Theodore Ts'o | 26d4042 | 2001-01-02 23:44:00 +0000 | [diff] [blame] | 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 | |
| 13 | # We need to build a tarball for the SRPM using $builddir as the |
| 14 | # directory name (since that's what RPM will expect it to unpack |
| 15 | # into). That may require a symlink. |
| 16 | |
| 17 | if [ -L $builddir ] ; then |
| 18 | rm -f $builddir || exit 1 |
| 19 | elif [ -d $builddir ] ; then |
| 20 | rm -rf $builddir || exit 1 |
| 21 | fi |
| 22 | |
| 23 | # Make a recursive-symlink copy of the source dir |
| 24 | cp -sR `pwd`/$currdir $builddir || exit 1 |
| 25 | |
| 26 | # Remove any build files from the temporary tarball directory |
| 27 | [ -f $builddir/Makefile ] && make -C $builddir distclean |
| 28 | |
| 29 | tar czfh ${builddir}.tar.gz $builddir |
| 30 | |
| 31 | rpm --define "_sourcedir `pwd`" -ba $currdir/e2fsprogs.spec |