summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpackaging/RedHat/filter-requires-samba.sh5
-rw-r--r--packaging/RedHat/makerpms.sh.tmpl52
-rw-r--r--packaging/RedHat/samba.spec.tmpl2
3 files changed, 30 insertions, 29 deletions
diff --git a/packaging/RedHat/filter-requires-samba.sh b/packaging/RedHat/filter-requires-samba.sh
deleted file mode 100755
index 8d4f7fbc60..0000000000
--- a/packaging/RedHat/filter-requires-samba.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-## snarfed from the RedHat Rawhide samba SRPM
-
-/usr/lib/rpm/perl.req $* | grep -v "Net::LDAP"
diff --git a/packaging/RedHat/makerpms.sh.tmpl b/packaging/RedHat/makerpms.sh.tmpl
index 7e927907ae..56e9fade7b 100644
--- a/packaging/RedHat/makerpms.sh.tmpl
+++ b/packaging/RedHat/makerpms.sh.tmpl
@@ -12,16 +12,9 @@
# Note: Under this directory rpm expects to find the same directories that are under the
# /usr/src/redhat directory
#
-if [ -r ~/.rpmmacros ]; then
- TOPDIR=`awk '/topdir/ {print $2}' < ~/.rpmmacros`
- if [ z$TOPDIR != "z" ]; then
- SPECDIR=${TOPDIR}/SPECS
- SRCDIR=${TOPDIR}/SOURCES
- fi
-fi
-SPECDIR=${SPECDIR:-/usr/src/redhat/SPECS}
-SRCDIR=${SRCDIR:-/usr/src/redhat/SOURCES}
+SPECDIR=`rpm --eval %_specdir`
+SRCDIR=`rpm --eval %_sourcedir`
# At this point the SPECDIR and SRCDIR vaiables must have a value!
@@ -29,6 +22,7 @@ USERID=`id -u`
GRPID=`id -g`
VERSION='PVERSION'
SPECFILE="samba3.spec"
+REQUIRESCMD="find-requires"
RPMVER=`rpm --version | awk '{print $3}'`
RPM="rpm"
@@ -36,26 +30,28 @@ echo The RPM Version on this machine is: $RPMVER
case $RPMVER in
2*)
- echo Building for RPM v2.x
- sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba.spec > $SPECFILE
- ;;
- 3*)
- echo Building for RPM v3.x
- sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba.spec > $SPECFILE
+ echo Building for RPM v2.x or v3.x
+ sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba.spec |\
+ sed -e "s/REQUIRES_MACRO/__find_requires/g" > $SPECFILE
;;
4.0*)
## catch rpm v4.0.x first
echo Building for RPM v4.0
- sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec |\
+ sed -e "s/REQUIRES_MACRO/__find_requires/g" > $SPECFILE
+ ;;
+ 4.1*)
+ echo Building for RPM v4.1
+ RPM="rpmbuild"
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec |\
+ sed -e "s/REQUIRES_MACRO/__find_requires/g" > $SPECFILE
;;
- 4.*)
- echo Building for RPM v4.1 or later
- ## we can do a little better here on the spec and
- ## source directories
- SPECDIR=`rpm -E %_specdir`
- SOURCEDIR=`rpm -E %_sourcedir`
+ 4.2*)
+ echo Building for RPM v4.2
RPM="rpmbuild"
- sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
+ REQUIRESCMD="perl.req"
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec |\
+ sed -e "s/REQUIRES_MACRO/__find_requires/g" > $SPECFILE
;;
*)
echo "Unknown RPM version: `rpm --version`"
@@ -67,6 +63,16 @@ esac
( cd ../../.. ; chown -R ${USERID}.${GRPID} samba-${VERSION} )
( cd ../../.. ; tar --exclude=CVS -cf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2 )
+
+## build the filter script
+
+cat << EOR > filter-requires-samba.sh
+#!/bin/sh
+/usr/lib/rpm/$REQUIRESCMD $* | grep -v "Net::LDAP"
+EOR
+
+chmod 755 filter-requires-samba.sh
+
/bin/cp -p filter-requires-samba.sh ${SRCDIR}
/bin/cp -av $SPECFILE ${SPECDIR}
diff --git a/packaging/RedHat/samba.spec.tmpl b/packaging/RedHat/samba.spec.tmpl
index 725809b075..9b071d5914 100644
--- a/packaging/RedHat/samba.spec.tmpl
+++ b/packaging/RedHat/samba.spec.tmpl
@@ -18,7 +18,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prefix: /usr
# Working around perl dependency problem from docs
-%define __perl_requires %{SOURCE999}
+%define REQUIRES_MACRO %{SOURCE999}
%description
Samba provides an SMB/CIFS server which can be used to provide