2 # Buildpkg script for producing RPM packages. Does not require root access.
4 # This is useful for debugging
6 # Buildbot exports some useful env variables.
7 # Check for $AMVER. I couldn't come up with a good way to detect it.
11 # Check for AMTARBALL variable.
12 if [ -z $AMTARBALL ]; then
13 AMTARBALL=$AMVER.tar.gz
16 # Check for AMTARBALL file, if it's not there, create it.
17 if [ ! -f ${AMTARBALL} ]; then
20 tar -cf ${AMTARBALL} -z ${AMVER}
24 # Check for the packaging dirs.
25 if [ -z $AMPKGDIR ]; then
28 if [ ! -d ${AMPKGDIR} ]; then
43 # Make a copy of the tarball with the name that rpmbuild expects
44 cp ${AMTARBALL} rpm/SOURCES/${AMVER}.tar.gz
45 cp packaging/rpm/amanda.spec rpm/SPECS/amanda.spec
46 # Rpmbuild requires absolute paths. annoying. If you need to change the
47 # default value of some rpm.spec variable, just pass extra --define options.
48 # this is useful for changing %amanda_release or %amanda_version
49 rpmbuild -ba --define "_topdir ${AMPKGDIR}/rpm" \
50 ${AMPKGDIR}/rpm/SPECS/amanda.spec