VERSION.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # brand is lower case - used for names that don't appear to end users
  2. # brand is used for file naming - should contain no spaces
  3. brand=389
  4. # capbrand is the properly capitalized brand name that appears to end users
  5. # may contain spaces
  6. capbrand=389
  7. # vendor is the properly formatted vendor/manufacturer name that appears to end users
  8. vendor="389 Project"
  9. # PACKAGE_VERSION is constructed from these
  10. VERSION_MAJOR=1
  11. VERSION_MINOR=3
  12. VERSION_MAINT=5
  13. # NOTE: VERSION_PREREL is automatically set for builds made out of a git tree
  14. VERSION_PREREL=
  15. VERSION_DATE=`date -u +%Y%m%d%H%M%S`
  16. GIT_CHECKOUT=`git log -1 >/dev/null 2>&1`
  17. # Set the version and release numbers for local developer RPM builds. We
  18. # set these here because we do not want the git commit hash in the RPM
  19. # version since it can make RPM upgrades difficult. If we have a git
  20. # commit hash, we add it into the release number below.
  21. RPM_RELEASE=${VERSION_DATE}
  22. RPM_VERSION=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINT}
  23. if test -n "$GIT_CHECKOUT"; then
  24. # if the source is from a git repo, put the last commit
  25. # in the version
  26. # if this is not a git repo, git log will say
  27. # fatal: Not a git repository
  28. # to stderr and stdout will be empty
  29. # this tells git to print the short commit hash from the last commit
  30. COMMIT=`cd $srcdir ; git log -1 --pretty=format:%h 2> /dev/null`
  31. if test -n "$COMMIT" ; then
  32. VERSION_PREREL=.${VERSION_DATE}-git$COMMIT
  33. RPM_RELEASE=$RPM_RELEASE-git$COMMIT
  34. fi
  35. fi
  36. # the real version used throughout configure and make
  37. # NOTE: because of autoconf/automake harshness, we cannot override the settings
  38. # below in C code - there is no way to override the default #defines
  39. # for these set with AC_INIT - so configure.ac should AC_DEFINE
  40. # DS_PACKAGE_VERSION DS_PACKAGE_TARNAME DS_PACKAGE_BUGREPORT
  41. # for use in C code - other code (perl scripts, shell scripts, Makefiles)
  42. # can use PACKAGE_VERSION et. al.
  43. PACKAGE_VERSION=$VERSION_MAJOR.$VERSION_MINOR.${VERSION_MAINT}${VERSION_PREREL}
  44. # the name of the source tarball - see make dist
  45. PACKAGE_TARNAME=${brand}-ds-base
  46. # url for bug reports
  47. PACKAGE_BUGREPORT="${PACKAGE_BUGREPORT}enter_bug.cgi?product=$brand"
  48. PACKAGE_STRING="$PACKAGE_TARNAME $PACKAGE_VERSION"
  49. # the version of the ds console package that this directory server
  50. # is compatible with
  51. # console .2 is still compatible with 389 .3 for now
  52. CONSOLE_VERSION=$VERSION_MAJOR.2