]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsprogs-lts-make_rpms.patch
authorAndreas Dilger <adilger@sun.com>
Sat, 2 Feb 2008 08:57:34 +0000 (01:57 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Feb 2008 03:50:38 +0000 (22:50 -0500)
Allow "make rpm" to take some extra configure options from the build
environment without having to patch the code.

Build the tarball in a temporary directory instead of the e2fsprogs
source directory.

Signed-off-by: Michael MacDonald <Michael.Macdonald@Sun.COM>
Signed-off-by: Andreas Dilger <adilger@sun.com>
contrib/build-rpm
e2fsprogs.spec.in

index c635097ff87d6ab63ee6874462dbe2b2f7de1f90..0b06071517b8e1ee0d4734eae9f4dbb2f32741f7 100644 (file)
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+# enable xtrace output if requested
+if [ -n ${ENABLE_XTRACE:-''} ]; then
+    set -x
+fi
+
 # Build an e2fsprogs RPM from cvs
 
 pwd=`pwd`
@@ -8,8 +13,11 @@ pkgname=`grep Name: e2fsprogs.spec | awk '{print $2;}'`
 pkgvers=`grep Version: e2fsprogs.spec | awk '{print $2;}'`
 builddir=${pkgname}-${pkgvers}
 
+# ensure that $TMP is set to something
+TMP=${TMP:-'/tmp'}
+
 cd ..
-tmpdir=`mktemp -d rpmtmp.XXXXXX`
+tmpdir=`mktemp -d ${RPM_TMPDIR:-$TMP}/rpmtmp.XXXXXX`
 
 # We need to build a tarball for the SRPM using $builddir as the 
 # directory name (since that's what RPM will expect it to unpack
@@ -25,10 +33,13 @@ EXCLUDE="--exclude .hg* --exclude .pc*"
 (cd $tmpdir && tar czfh ${builddir}.tar.gz $EXCLUDE $builddir)
 
 [ "`rpmbuild --version 2> /dev/null`" ] && RPM=rpmbuild || RPM=rpm
-$RPM --define "_sourcedir `pwd`/$tmpdir" -ba $currdir/e2fsprogs.spec
-
-ret=$?
-rm -rf $tmpdir
-exit $?
 
+$RPM --define "_sourcedir $tmpdir" \
+     --define "_topdir ${RPM_TOPDIR:-$(rpm -E %_topdir)}" \
+     --define "_tmpdir ${RPM_TMPDIR:-$TMP}" \
+     --define "extra_config_flags ${EXTRA_CONFIG_FLAGS:-''}" \
+     -ba $currdir/e2fsprogs.spec
 
+rpm_exit=$?
+rm -rf $tmpdir
+exit $rpm_exit
index 415c9b634171d48df1c97bbcc064ee336e6aa008..908a510e624ff3d3c7d7c7c97c92fd6f3445aa07 100644 (file)
@@ -71,7 +71,8 @@ SMP systems.
 %setup
 
 %build
-%configure --enable-elf-shlibs --enable-nls
+%configure --enable-elf-shlibs --enable-nls \
+       %{?extra_config_flags:%extra_config_flags}
 make
 make check