makerpms: fix creation of tarball when gzip does not know "--rsynceable"
authorMichael Adam <obnox@samba.org>
Wed, 17 Dec 2008 15:01:49 +0000 (16:01 +0100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 16 Jan 2009 09:49:52 +0000 (20:49 +1100)
--rsynceable is a patch to gzip that not all distributors / packagers
add to gzip. (It has just bitten me on openSUSE.) This path first detects
whether gzip knows about --rsynceable and then calls gzip accordingly.

Michael

packaging/RPM/makerpms.sh

index f513da4ce47fc73146a92848184011ab92eab96f..3735b394d80ff944d2b149dce281a8b15db81993 100755 (executable)
@@ -28,9 +28,15 @@ RPMBUILD="rpmbuild"
 VERSION=$(grep ^Version ${DIRNAME}/${SPECFILE} | sed -e 's/^Version:\ \+//')
 RELEASE=$(grep ^Release ${DIRNAME}/${SPECFILE} | sed -e 's/^Release:\ \+//')
 
+if gzip --rsyncable 2>&1 ; then
+       GZIP="gzip -9 --rsyncable"
+else
+       GZIP="gzip -9"
+fi
+
 pushd ${TOPDIR}
 echo -n "Creating ctdb-${VERSION}.tar.gz ... "
-git archive --prefix=ctdb-${VERSION}/ HEAD | gzip -9 --rsyncable > ${SRCDIR}/ctdb-${VERSION}.tar.gz
+git archive --prefix=ctdb-${VERSION}/ HEAD | ${GZIP} > ${SRCDIR}/ctdb-${VERSION}.tar.gz
 RC=$?
 popd
 echo "Done."