I think this will gracefully get around issues between different rpm
authorGerald Carter <jerry@samba.org>
Tue, 2 Sep 2003 03:34:44 +0000 (03:34 +0000)
committerGerald Carter <jerry@samba.org>
Tue, 2 Sep 2003 03:34:44 +0000 (03:34 +0000)
versions.  Particularly the long standing problem with Net::LDAP
dependencies in examples/LDAP.  I'll build new packages tomorrow
as the final test.
(This used to be commit cca0f603506b2e3c20eff5e1dd235354363d7a86)

packaging/RedHat/filter-requires-samba_rh8.sh [new file with mode: 0755]
packaging/RedHat/filter-requires-samba_rh9.sh [new file with mode: 0755]
packaging/RedHat/makerpms.sh.tmpl
packaging/RedHat/samba.spec.tmpl

diff --git a/packaging/RedHat/filter-requires-samba_rh8.sh b/packaging/RedHat/filter-requires-samba_rh8.sh
new file mode 100755 (executable)
index 0000000..1c40a33
--- /dev/null
@@ -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 (executable)
index 0000000..3f2433c
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/lib/rpm/perl.req  | grep -v "Net::LDAP"
index 56e9fade7b605d950a1f98f41653f314757005a2..339c9718549c0dd9351871545966861fd877b402 100644 (file)
@@ -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.
 
index 9b071d5914a0c6adef09d8bb3b9d63ba04713d72..234ae809fe00b3c54a2110128307538a53dff788 100644 (file)
@@ -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