summaryrefslogtreecommitdiffstats
path: root/builddsrpm.sh
diff options
context:
space:
mode:
Diffstat (limited to 'builddsrpm.sh')
-rwxr-xr-xbuilddsrpm.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/builddsrpm.sh b/builddsrpm.sh
new file mode 100755
index 00000000..6ce63bc6
--- /dev/null
+++ b/builddsrpm.sh
@@ -0,0 +1,40 @@
+#!/bin/sh -v
+
+mkdirs() {
+ for d in "$@" ; do
+ if [ -d $d ]; then
+ mv $d $d.deleted
+ rm -rf $d.deleted &
+ fi
+ mkdir -p $d
+ done
+}
+
+if [ ! -f $HOME/.rpmmacros ]; then
+ echo "This script assumes you want to build as a non-root"
+ echo "user and in a non-default place (e.g. your home dir)"
+ echo "You must have a $HOME/.rpmmacros file that redefines"
+ echo "_topdir e.g."
+ echo "%_topdir /home/rmeggins/ds71"
+ echo "Please create that file with the above contents and"
+ echo "rerun this script."
+ exit 1
+fi
+
+NAME=ldapserver
+VERSION=7.1
+# change HEAD to a real static tag when available
+CVSTAG=HEAD
+
+mkdirs SOURCES BUILD SRPMS RPMS
+cd SOURCES
+rm -rf $NAME-$VERSION $NAME-$VERSION.tar.gz
+echo "Checking out source code . . ."
+cvs export -r $CVSTAG -d $NAME-$VERSION $NAME > /dev/null 2>&1
+echo "Building tarball . . ."
+tar cf - $NAME-$VERSION | gzip > $NAME-$VERSION.tar.gz
+rm -rf $NAME-$VERSION
+cd ..
+echo "Executing rpmbuild . . ."
+rpmbuild -ba $NAME.spec
+echo "Finished doing rpmbuild $NAME.spec"