aboutsummaryrefslogtreecommitdiffstats
path: root/shipper/buildrpms
diff options
context:
space:
mode:
authorRob Funk <rfunk@funknet.net>2004-06-18 01:32:22 +0000
committerRob Funk <rfunk@funknet.net>2004-06-18 01:32:22 +0000
commitc0573a237af3dc90386646efea80f65b688ed23c (patch)
treef9d5834525352834c462c0a567bf8ad1d30336a6 /shipper/buildrpms
parentc227c01f855cd1c67bcc002fe1594a3f3ca7d1c8 (diff)
downloadfetchmail-c0573a237af3dc90386646efea80f65b688ed23c.tar.gz
fetchmail-c0573a237af3dc90386646efea80f65b688ed23c.tar.bz2
fetchmail-c0573a237af3dc90386646efea80f65b688ed23c.zip
Add ESR's shipper utility (version 0.5) in a subdir,
for easily making releases (since the makerelease script depends on it) svn path=/trunk/; revision=3886
Diffstat (limited to 'shipper/buildrpms')
-rwxr-xr-xshipper/buildrpms41
1 files changed, 41 insertions, 0 deletions
diff --git a/shipper/buildrpms b/shipper/buildrpms
new file mode 100755
index 00000000..22086d01
--- /dev/null
+++ b/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