Revert "version: generate RPM version from git"
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 20 Aug 2010 02:51:30 +0000 (12:51 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 20 Aug 2010 02:51:30 +0000 (12:51 +1000)
This reverts commit 44009e02a661d4a1e14246f650974fc4ed7a07c9.

packaging/RPM/ctdb.spec.in
packaging/RPM/makerpms.sh

index 833dae8095484e635130776e2f1f57afd035c74b..6706672cc0a4073d15412d7ba8b719117181eb0b 100644 (file)
@@ -3,8 +3,8 @@ Name: ctdb
 Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <samba@samba.org>
-Version: @VERSION@
-Release: 1
+Version: 1.9
+Release: 1GITHASH
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
index 266fcfb4cae0225cf9fe15f59ccbbb6ab685b9ba..a51099c543e9ab58e4b58cb717d149e55c9f70dd 100755 (executable)
@@ -44,38 +44,18 @@ SPECFILE="ctdb.spec"
 SPECFILE_IN="ctdb.spec.in"
 RPMBUILD="rpmbuild"
 
-# 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
-
-sed -e s/@VERSION@/$VERSION/g \
+GITHASH=".$(git log --pretty=format:%h -1)"
+
+if test "x$USE_GITHASH" = "xno" ; then
+       GITHASH=""
+fi
+
+sed -e s/GITHASH/${GITHASH}/g \
        < ${DIRNAME}/${SPECFILE_IN} \
        > ${DIRNAME}/${SPECFILE}
 
 VERSION=$(grep ^Version ${DIRNAME}/${SPECFILE} | sed -e 's/^Version:\ \+//')
+RELEASE=$(grep ^Release ${DIRNAME}/${SPECFILE} | sed -e 's/^Release:\ \+//')
 
 if echo | gzip -c --rsyncable - > /dev/null 2>&1 ; then
        GZIP="gzip -9 --rsyncable"