4 # $Id: buildrpm,v 1.3 2003-01-11 17:26:06 jmarcus Exp $
6 # automates the process of building the netatalk rpm
8 # To properly bootstrap the RPM from a raw CVS pull,
9 # place the CVS sandbox under, e.g. /usr/src/redhat/BUILD
10 # and name this new directory 'netatalk-$version' (where
11 # $version is the contents of the 'VERSION' file under the source
12 # root). Then, cd into the source root and run 'autogen.sh'
13 # (with no arguments). Finally, copy this file to the BUILD
14 # directory and run it from there, passing the full name of the
15 # source directory as the sole argument.
17 if [ "x$1" = "x" ]; then
18 echo "To avoid problems with builds on remote filesystems"
19 echo "please copy this file to your redhat/BUILD directory"
20 echo "and execute as 'buildrpm netatalk-xxy', using the actual"
21 echo "full name (i.e. with version) of the source tree."
29 VERSION=`cat $CVSNAME/VERSION`
31 sed -e "s/__VERSION__/$VERSION/" \
32 $CVSNAME/distrib/rpm/netatalk-redhat.spec \
33 > ${REDHAT_DIR}/SPECS/netatalk.spec
35 cp -f $CVSNAME/distrib/rpm/netatalk-rpmbuild.patch \
38 # Newer distros use rpmbuild
39 if `rpmbuild --version > /dev/null`; then
45 # clean out objects and Makefiles
46 (cd $CVSNAME && make distclean)
49 tar -c -v -z -f ${REDHAT_DIR}/SOURCES/$CVSNAME.tar.gz \
50 --exclude="*/CVS" --exclude="*~" $CVSNAME
52 # build the SRPM and binary and devel RPMs.
53 ${RPM} -ba ${REDHAT_DIR}/SPECS/netatalk.spec