versionheader.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. svnrev=0
  3. if [ -f revision ]; then
  4. svnrev=$(cat revision)
  5. fi
  6. dot_version=`cat version`
  7. major_version=$(sed <version -e 's;^\([^.]*\).*;\1;')
  8. minor_version=$(sed <version -e 's;^[^.]*\.\([^.]*\).*;\1;')
  9. micro_version=$(sed <version -e 's;^[^.]*\.[^.]*\.\([^.]*\).*;\1;')
  10. comma_version="$major_version,$minor_version,$micro_version,$svnrev"
  11. cat << EOF
  12. #define PROJECT_VERSION_SERVER $comma_version
  13. #define PROJECT_VERSION_SERVER_STR "$comma_version"
  14. #define PROJECT_VERSION_CLIENT $comma_version
  15. #define PROJECT_VERSION_CLIENT_STR "$comma_version"
  16. #define PROJECT_VERSION_EXT_STR "$comma_version"
  17. #define PROJECT_VERSION_SPOOLER_STR "$comma_version"
  18. #define PROJECT_VERSION_GATEWAY_STR "$comma_version"
  19. #define PROJECT_VERSION_CALDAV_STR "$comma_version"
  20. #define PROJECT_VERSION_DAGENT_STR "$comma_version"
  21. #define PROJECT_VERSION_PROFADMIN_STR "$comma_version"
  22. #define PROJECT_VERSION_MONITOR_STR "$comma_version"
  23. #define PROJECT_VERSION_PASSWD_STR "$comma_version"
  24. #define PROJECT_VERSION_FBSYNCER_STR "$comma_version"
  25. #define PROJECT_VERSION_SEARCH_STR "$comma_version"
  26. #define PROJECT_VERSION_ARCHIVER_STR "$comma_version"
  27. #define PROJECT_VERSION_DOT_STR "$dot_version"
  28. #define PROJECT_SVN_REV_STR "$svnrev"
  29. #define PROJECT_VERSION_MAJOR $major_version
  30. #define PROJECT_VERSION_MINOR $minor_version
  31. #define PROJECT_VERSION_MICRO $micro_version
  32. #define PROJECT_VERSION_REVISION $svnrev
  33. EOF