3 # Build an e2fsprogs RPM from cvs
6 currdir=`basename $pwd`
7 pkgname=`grep Name: e2fsprogs.spec | awk '{print $2;}'`
8 pkgvers=`grep Version: e2fsprogs.spec | awk '{print $2;}'`
9 builddir=${pkgname}-${pkgvers}
12 tmpdir=`mktemp -d rpmtmp.XXXXXX`
14 # We need to build a tarball for the SRPM using $builddir as the
15 # directory name (since that's what RPM will expect it to unpack
16 # into). That may require a symlink.
18 # Make a recursive-symlink copy of the source dir
19 cp -sR `pwd`/$currdir $tmpdir/$builddir || exit 1
21 # Remove any build files from the temporary tarball directory
22 [ -f $tmpdir/$builddir/Makefile ] && make -C $tmpdir/$builddir distclean
24 (cd $tmpdir && tar czfh ${builddir}.tar.gz $builddir)
26 [ "`rpmbuild --version 2> /dev/null`" ] && RPM=rpmbuild || RPM=rpm
27 $RPM --define "_sourcedir `pwd`/$tmpdir" -ba $currdir/e2fsprogs.spec || exit $?