summaryrefslogtreecommitdiff
path: root/packaging/RHEL/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/RHEL/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/RHEL/makerpms.sh.tmpl')
-rw-r--r--packaging/RHEL/makerpms.sh.tmpl68
1 files changed, 68 insertions, 0 deletions
diff --git a/packaging/RHEL/makerpms.sh.tmpl b/packaging/RHEL/makerpms.sh.tmpl
new file mode 100644
index 0000000000..361d841876
--- /dev/null
+++ b/packaging/RHEL/makerpms.sh.tmpl
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Copyright (C) John H Terpstra 1998-2002
+# Gerald (Jerry) Carter 2003
+
+# 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="samba.spec"
+RPMVER=`rpm --version | awk '{print $3}'`
+RPM="rpmbuild"
+
+##
+## Check the RPM version (paranoid)
+##
+case $RPMVER in
+ 4*)
+ echo "Supported RPM version [$RPMVER]"
+ ;;
+ *)
+ echo "Unknown RPM version: `rpm --version`"
+ exit 1
+ ;;
+esac
+
+( 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 )
+
+##
+## copy additional source files
+##
+for file in samba.pamd samba.sysconfig samba.spec \
+ smb.init swat.desktop filter-requires-samba.sh \
+ samba.log samba.xinetd smbprint winbind.init \
+ smb.conf smbusers
+do
+ cp -p $file ${SRCDIR}
+
+done
+
+chmod 755 ${SRCDIR}/filter-requires-samba.sh
+
+cp -p ${SPECFILE} ${SPECDIR}
+
+##
+## Build
+##
+echo Getting Ready to build release package
+cd ${SPECDIR}
+${RPM} -ba --clean --rmsource $SPECFILE
+
+echo Done.
+