summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpackaging/RedHat/filter-requires-samba_rh8.sh2
-rwxr-xr-xpackaging/RedHat/filter-requires-samba_rh9.sh2
-rw-r--r--packaging/RedHat/makerpms.sh.tmpl29
-rw-r--r--packaging/RedHat/samba.spec.tmpl11
4 files changed, 20 insertions, 24 deletions
diff --git a/packaging/RedHat/filter-requires-samba_rh8.sh b/packaging/RedHat/filter-requires-samba_rh8.sh
new file mode 100755
index 0000000000..1c40a335a6
--- /dev/null
+++ b/packaging/RedHat/filter-requires-samba_rh8.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/lib/rpm/find-requires | grep -v "Net::LDAP"
diff --git a/packaging/RedHat/filter-requires-samba_rh9.sh b/packaging/RedHat/filter-requires-samba_rh9.sh
new file mode 100755
index 0000000000..3f2433c712
--- /dev/null
+++ b/packaging/RedHat/filter-requires-samba_rh9.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/lib/rpm/perl.req | grep -v "Net::LDAP"
diff --git a/packaging/RedHat/makerpms.sh.tmpl b/packaging/RedHat/makerpms.sh.tmpl
index 56e9fade7b..339c971854 100644
--- a/packaging/RedHat/makerpms.sh.tmpl
+++ b/packaging/RedHat/makerpms.sh.tmpl
@@ -22,8 +22,6 @@ USERID=`id -u`
GRPID=`id -g`
VERSION='PVERSION'
SPECFILE="samba3.spec"
-REQUIRESCMD="find-requires"
-
RPMVER=`rpm --version | awk '{print $3}'`
RPM="rpm"
echo The RPM Version on this machine is: $RPMVER
@@ -31,27 +29,22 @@ echo The RPM Version on this machine is: $RPMVER
case $RPMVER in
2*)
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
+ sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba.spec > $SPECFILE
;;
4.0*)
## catch rpm v4.0.x first
echo Building for RPM v4.0
- sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec |\
- sed -e "s/REQUIRES_MACRO/__find_requires/g" > $SPECFILE
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $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
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
;;
4.2*)
echo Building for RPM v4.2
RPM="rpmbuild"
- REQUIRESCMD="perl.req"
- sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec |\
- sed -e "s/REQUIRES_MACRO/__find_requires/g" > $SPECFILE
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
;;
*)
echo "Unknown RPM version: `rpm --version`"
@@ -64,21 +57,13 @@ esac
( 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 -p filter-requires-samba_rh8.sh ${SRCDIR}
+/bin/cp -p filter-requires-samba_rh9.sh ${SRCDIR}
/bin/cp -av $SPECFILE ${SPECDIR}
echo Getting Ready to build release package
cd ${SPECDIR}
-${RPM} -ba -v --clean --rmsource $SPECFILE
+${RPM} --define="rpm_version $RPMVER" -ba -v --clean --rmsource $SPECFILE
echo Done.
diff --git a/packaging/RedHat/samba.spec.tmpl b/packaging/RedHat/samba.spec.tmpl
index 9b071d5914..234ae809fe 100644
--- a/packaging/RedHat/samba.spec.tmpl
+++ b/packaging/RedHat/samba.spec.tmpl
@@ -7,7 +7,9 @@ Group: Networking
Source: http://download.samba.org/samba/ftp/samba-%{version}.tar.bz2
# Don't depend on Net::LDAP
-Source999: filter-requires-samba.sh
+# one filter for RH 8 and one for 9
+Source998: filter-requires-samba_rh8.sh
+Source999: filter-requires-samba_rh9.sh
Packager: Gerald Carter [Samba-Team] <jerry@samba.org>
Requires: pam >= 0.72 kernel >= 2.2.1 glibc >= 2.1.2
@@ -18,7 +20,12 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prefix: /usr
# Working around perl dependency problem from docs
-%define REQUIRES_MACRO %{SOURCE999}
+# Only > RH 8.0 seems to care here
+%if "%{rpm_version}" == "4.2"
+ %define __perl_requires %{SOURCE998}
+%else if "%{rpm_version}" == "4.1"
+ %define __find_requires %{SOURCE999}
+%endif
%description
Samba provides an SMB/CIFS server which can be used to provide