summaryrefslogtreecommitdiff
path: root/packaging/RedHat-9/makerpms.sh.tmpl
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-01-20 01:11:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:12 -0500
commit4183c1824cf1dd2813766a469929f82972635b7c (patch)
treef8c1109f403ed7a42f7dc6a7ae07f4728b704e8c /packaging/RedHat-9/makerpms.sh.tmpl
parenta9016186adeb3fbd702726212ca5ddf0f200f8eb (diff)
downloadsamba-4183c1824cf1dd2813766a469929f82972635b7c.tar.gz
samba-4183c1824cf1dd2813766a469929f82972635b7c.tar.bz2
samba-4183c1824cf1dd2813766a469929f82972635b7c.zip
r13048: trying to fix the confusion over packaging platforms
(This used to be commit b99ef469d1057a8e856f3818f5fd0f25db70d4ee)
Diffstat (limited to 'packaging/RedHat-9/makerpms.sh.tmpl')
-rw-r--r--packaging/RedHat-9/makerpms.sh.tmpl71
1 files changed, 71 insertions, 0 deletions
diff --git a/packaging/RedHat-9/makerpms.sh.tmpl b/packaging/RedHat-9/makerpms.sh.tmpl
new file mode 100644
index 0000000000..8da4a5d520
--- /dev/null
+++ b/packaging/RedHat-9/makerpms.sh.tmpl
@@ -0,0 +1,71 @@
+#!/bin/sh
+# Copyright (C) John H Terpstra 1998-2002
+# Updated for RPM 3 by Jochen Wiedmann, joe@ispsoft.de
+# Changed for a generic tar file rebuild by abartlet@pcug.org.au
+# Changed by John H Terpstra to build on RH7.2 - should also work for earlier versions jht@samba.org
+
+# The following allows environment variables to override the target directories
+# the alternative is to have a file in your home directory calles .rpmmacros
+# containing the following:
+# %_topdir /home/mylogin/redhat
+#
+# Note: Under this directory rpm expects to find the same directories that are under the
+# /usr/src/redhat directory
+#
+
+SPECDIR=`rpm --eval %_specdir`
+SRCDIR=`rpm --eval %_sourcedir`
+
+# At this point the SPECDIR and SRCDIR vaiables must have a value!
+
+USERID=`id -u`
+GRPID=`id -g`
+VERSION='PVERSION'
+SPECFILE="samba3.spec"
+RPMVER=`rpm --version | awk '{print $3}'`
+RPM="rpm"
+echo The RPM Version on this machine is: $RPMVER
+
+##
+## fix the mandir macro
+##
+case $RPMVER in
+ [23]*)
+ sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba.spec > $SPECFILE
+ ;;
+ 4*)
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
+ ;;
+ *)
+ echo "Unknown RPM version: `rpm --version`"
+ exit 1
+ ;;
+esac
+
+##
+## now catch the right command to build an RPM (defaults ro 'rpm'
+##
+case $RPMVER in
+ 4.[123]*)
+ RPM="rpmbuild"
+ ;;
+esac
+
+echo "RPM build command is \"$RPM\""
+
+( cd ../../source; if [ -f Makefile ]; then make distclean; fi )
+( cd ../../.. ; chown -R ${USERID}.${GRPID} samba-${VERSION} )
+
+( cd ../../.. ; tar --exclude=CVS -cf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2 )
+
+/bin/cp -p filter-requires-samba_rh8.sh ${SRCDIR}
+/bin/cp -p filter-requires-samba_rh9.sh ${SRCDIR}
+chmod 755 ${SRCDIR}/filter-requires-samba_rh?.sh
+/bin/cp -av $SPECFILE ${SPECDIR}
+
+echo Getting Ready to build release package
+cd ${SPECDIR}
+${RPM} -ba --clean --rmsource $SPECFILE
+
+echo Done.
+