]> arthur.barton.de Git - netatalk.git/blob - distrib/rpm/buildrpm
Revert change from 3194183
[netatalk.git] / distrib / rpm / buildrpm
1 #!/bin/sh
2 #
3 # buildrpm
4 # $Id: buildrpm,v 1.3 2003-01-11 17:26:06 jmarcus Exp $
5 #
6 # automates the process of building the netatalk rpm
7 #
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.
16 #
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."
22     exit 1
23 fi
24
25 CVSNAME=$1
26
27 REDHAT_DIR=../
28
29 VERSION=`cat $CVSNAME/VERSION`
30
31 sed -e "s/__VERSION__/$VERSION/" \
32     $CVSNAME/distrib/rpm/netatalk-redhat.spec \
33     > ${REDHAT_DIR}/SPECS/netatalk.spec
34
35 cp -f $CVSNAME/distrib/rpm/netatalk-rpmbuild.patch \
36     ${REDHAT_DIR}/SOURCES
37
38 # Newer distros use rpmbuild
39 if `rpmbuild --version > /dev/null`; then
40     RPM="rpmbuild"
41 else
42     RPM="rpm"
43 fi
44
45 # clean out objects and Makefiles
46 (cd $CVSNAME && make distclean)
47
48 # tar up the archive
49 tar -c -v -z -f ${REDHAT_DIR}/SOURCES/$CVSNAME.tar.gz \
50         --exclude="*/CVS" --exclude="*~" $CVSNAME
51
52 # build the SRPM and binary and devel RPMs.
53 ${RPM} -ba ${REDHAT_DIR}/SPECS/netatalk.spec