From 86cd0cd081a6893f663c30d5a1bedb10e9f24f77 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 2 Sep 2003 03:34:44 +0000 Subject: I think this will gracefully get around issues between different rpm 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 | 2 ++ packaging/RedHat/filter-requires-samba_rh9.sh | 2 ++ packaging/RedHat/makerpms.sh.tmpl | 29 +++++++-------------------- packaging/RedHat/samba.spec.tmpl | 11 ++++++++-- 4 files changed, 20 insertions(+), 24 deletions(-) create mode 100755 packaging/RedHat/filter-requires-samba_rh8.sh create mode 100755 packaging/RedHat/filter-requires-samba_rh9.sh (limited to 'packaging/RedHat') 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] 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 -- cgit