1 #!/bin/sh 2 3 # Build an e2fsprogs RPM from cvs 4 5 pwd=`pwd` 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} 10 11 cd .. 12 tmpdir=`mktemp -d rpmtmp.XXXXXX` 13 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. 17 18 # Make a recursive-symlink copy of the source dir 19 cp -sR `pwd`/$currdir $tmpdir/$builddir || exit 1 20 21 # Remove any build files from the temporary tarball directory 22 [ -f $tmpdir/$builddir/Makefile ] && make -C $tmpdir/$builddir distclean 23 24 EXCLUDE="--exclude .hg* --exclude .pc*" 25 (cd $tmpdir && tar czfh ${builddir}.tar.gz $EXCLUDE $builddir) 26 27 [ "`rpmbuild --version 2> /dev/null`" ] && RPM=rpmbuild || RPM=rpm 28 $RPM --define "_sourcedir `pwd`/$tmpdir" -ba $currdir/e2fsprogs.spec 29 30 ret=$? 31 rm -rf $tmpdir 32 exit $? 33 34 35