summaryrefslogtreecommitdiffstats
path: root/ctdb/packaging/RPM
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-10-22 15:12:50 +1100
committerAmitay Isaacs <amitay@gmail.com>2012-10-22 18:15:17 +1100
commit231898db1fc1a40552ff94095ba78cf8f8847535 (patch)
tree7ee0e847ba7df5b2303daafcef8c2e9006434b05 /ctdb/packaging/RPM
parent5ea3a56b6247829f8419d2629afea10996bf075a (diff)
downloadsamba-231898db1fc1a40552ff94095ba78cf8f8847535.tar.gz
samba-231898db1fc1a40552ff94095ba78cf8f8847535.tar.xz
samba-231898db1fc1a40552ff94095ba78cf8f8847535.zip
packaging: Use common code to generate VERSION string
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 0019291371af1e63ee132ed173ba7f52a0291a44)
Diffstat (limited to 'ctdb/packaging/RPM')
-rwxr-xr-xctdb/packaging/RPM/makerpms.sh30
1 files changed, 4 insertions, 26 deletions
diff --git a/ctdb/packaging/RPM/makerpms.sh b/ctdb/packaging/RPM/makerpms.sh
index e2f60512be..254abde848 100755
--- a/ctdb/packaging/RPM/makerpms.sh
+++ b/ctdb/packaging/RPM/makerpms.sh
@@ -52,32 +52,10 @@ mkdir -p `rpm --eval %_rpmdir`/noarch
mkdir -p `rpm --eval %_rpmdir`/i386
mkdir -p `rpm --eval %_rpmdir`/x86_64
-# We use tags and determine the version, as follows:
-# ctdb-0.9.1 (First release of 0.9).
-# ctdb-0.9.23 (23rd minor release of the 112 version)
-#
-# If we're not directly on a tag, this is a devel release; we append
-# .0.<patchnum>.<checksum>.devel to the release.
-TAG=`git describe`
-case "$TAG" in
- ctdb-*)
- TAG=${TAG##ctdb-}
- case "$TAG" in
- *-*-g*) # 0.9-168-ge6cf0e8
- # Not exactly on tag: devel version.
- VERSION=`echo "$TAG" | sed 's/\([^-]\+\)-\([0-9]\+\)-\(g[0-9a-f]\+\)/\1.0.\2.\3.devel/'`
- ;;
- *)
- # An actual release version
- VERSION=$TAG
- ;;
- esac
- ;;
- *)
- echo Invalid tag "$TAG" >&2
- exit 1
- ;;
-esac
+VERSION=$(${TOPDIR}/packaging/mkversion.sh)
+if [ -z "$VERSION" ]; then
+ exit 1
+fi
sed -e s/@VERSION@/$VERSION/g \
< ${DIRNAME}/${SPECFILE_IN} \