blob: fcafce3162aa5dac6f3ea5d11bdfc0344899bb54 [file] [log] [blame]
Theodore Ts'o26d40422001-01-02 23:44:00 +00001#!/bin/sh
2
3# Build an e2fsprogs RPM from cvs
4
5pwd=`pwd`
6currdir=`basename $pwd`
7pkgname=`grep Name: e2fsprogs.spec | awk '{print $2;}'`
8pkgvers=`grep Version: e2fsprogs.spec | awk '{print $2;}'`
9builddir=${pkgname}-${pkgvers}
10
11cd ..
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
17if [ -L $builddir ] ; then
18 rm -f $builddir || exit 1
19elif [ -d $builddir ] ; then
20 rm -rf $builddir || exit 1
21fi
22
23# Make a recursive-symlink copy of the source dir
24cp -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
29tar czfh ${builddir}.tar.gz $builddir
30
31rpm --define "_sourcedir `pwd`" -ba $currdir/e2fsprogs.spec