diff options
author | Rob Funk <rfunk@funknet.net> | 2004-06-18 04:17:07 +0000 |
---|---|---|
committer | Rob Funk <rfunk@funknet.net> | 2004-06-18 04:17:07 +0000 |
commit | 4f40dc60c125ad1e14071c234b67315fab6c6fc3 (patch) | |
tree | c98e66addc90bb61fb448e9dbc458cc3ec7915e4 /dist-tools/shipper/buildrpms | |
parent | e2fbba91f98b2270da86d6cde1d680ff57aca077 (diff) | |
download | fetchmail-4f40dc60c125ad1e14071c234b67315fab6c6fc3.tar.gz fetchmail-4f40dc60c125ad1e14071c234b67315fab6c6fc3.tar.bz2 fetchmail-4f40dc60c125ad1e14071c234b67315fab6c6fc3.zip |
Move shipper to dist-tools directory
svn path=/trunk/; revision=3889
Diffstat (limited to 'dist-tools/shipper/buildrpms')
-rwxr-xr-x | dist-tools/shipper/buildrpms | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dist-tools/shipper/buildrpms b/dist-tools/shipper/buildrpms new file mode 100755 index 00000000..22086d01 --- /dev/null +++ b/dist-tools/shipper/buildrpms @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Build RPMs from the source in the current directory. This script sets +# up an RPM "_topdir" and builds the RPMs under there, then copies the +# binary and source RPMs to the current directory. +# +# Written by Sean Reifschneider <jafo-rpms@tummy.com>, 2003 + +TARBALL=$1 # tarball to build from + +# set up temporary directory +TMPDIR=`pwd`/rpm-build.$$ +[ ! -z "$TMPDIR" -a "$TMPDIR" != / ] && rm -rf "$TMPDIR" +mkdir -p "$TMPDIR"/BUILD +mkdir -p "$TMPDIR"/RPMS +mkdir -p "$TMPDIR"/SOURCES +mkdir -p "$TMPDIR"/SPECS +mkdir -p "$TMPDIR"/SRPMS + +# set up rpmmacros file +MACROFILE="$TMPDIR"/rpmmacros +RCFILE="$TMPDIR"/rpmrc +sed "s|~/.rpmmacros|$MACROFILE|" /usr/lib/rpm/rpmrc >"$RCFILE" +echo "%_topdir $TMPDIR" >"$MACROFILE" +echo "%_topdir $TMPDIR" >"$MACROFILE" + +# build RPMs +rpmbuild --rcfile "$RCFILE" $ARCH -ta $TARBALL +status=$? + +if [ $status = '0' ] +then + # copy RPMs to this directory + cp "$TMPDIR"/RPMS/*/*.rpm . + cp "$TMPDIR"/SRPMS/*.rpm . +fi + +# clean up build directory +[ ! -z "$TMPDIR" -a "$TMPDIR" != / ] && rm -rf "$TMPDIR" + +exit $status |