diff options
author | Rich Megginson <rmeggins@redhat.com> | 2005-02-04 00:08:51 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2005-02-04 00:08:51 +0000 |
commit | 42b7146fa220f45b1ede6f8d4543344ca08ba74b (patch) | |
tree | f1311b75879570249b71c047d3130ce2a14cfc3b /builddsrpm.sh | |
parent | 269a85b79465f6b0a6d1231cbca335a8975e163b (diff) | |
download | ds-42b7146fa220f45b1ede6f8d4543344ca08ba74b.tar.gz ds-42b7146fa220f45b1ede6f8d4543344ca08ba74b.tar.xz ds-42b7146fa220f45b1ede6f8d4543344ca08ba74b.zip |
RPM packaging - the ldapserver.spec file and the builddsrpm.sh script to do the prep work
Diffstat (limited to 'builddsrpm.sh')
-rwxr-xr-x | builddsrpm.sh | 40 |
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" |