packaging(RHEL-CTDB): add the current githash to the rpm release number by default
authorMichael Adam <obnox@samba.org>
Wed, 4 Nov 2009 11:26:46 +0000 (12:26 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 5 Nov 2009 12:47:39 +0000 (13:47 +0100)
Disable this (to build a release-rpm) by calling

USE_GITHASH=no makerpms.sh

Michael

packaging/RHEL-CTDB/makespec.sh
packaging/RHEL-CTDB/samba.spec.tmpl

index 62f0969868c68092690b40cfae925b02391e5354..c0dc5faa7aff7ef9c2de536fc3a334d4b1487020 100755 (executable)
@@ -33,7 +33,20 @@ fi
 VERSION=`echo ${VERSION} | sed 's/-/_/g'`
 VERSION=`echo ${VERSION} | sed 's/\"//g'`
 echo "VERSION: ${VERSION}"
+
+# to build a release-rpm, set USE_GITHASH="no"
+# in the environmet
+#
+if test "x$USE_GITHASH" = "xno" ; then
+       GITHASH=""
+       echo "GITHASH: not used"
+else
+       GITHASH=".$(git log --pretty=format:%h -1)"
+       echo "GITHASH: ${GITHASH}"
+fi
+
 sed -e s/PVERSION/${VERSION}/g \
+       -e s/GITHASH/${GITHASH}/g \
        < ${SPECFILE}.tmpl \
        > ${SPECFILE}
 
index ded2c08ee957276c73fe646474bd5e2580d4e6d9..126a5e7f7fc30ceb5a78227ee05f6e489fdf1c4c 100644 (file)
@@ -6,7 +6,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba@samba.org>
 Name:         samba
 Version:      PVERSION
-Release:      1
+Release:      1GITHASH
 Epoch:        0
 License: GNU GPL version 3
 Group: System Environment/Daemons