diff options
author | Gerald Carter <jerry@samba.org> | 2003-08-30 15:49:17 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-08-30 15:49:17 +0000 |
commit | 3aedaf6819ffef671d94656506a330d141610dac (patch) | |
tree | 63257a89148ccdb22783e32f2cdeb0b5ff928aad /packaging | |
parent | e1231a249380d35833c3181fcd19e302df89d0f7 (diff) | |
download | samba-3aedaf6819ffef671d94656506a330d141610dac.tar.gz samba-3aedaf6819ffef671d94656506a330d141610dac.tar.bz2 samba-3aedaf6819ffef671d94656506a330d141610dac.zip |
i know there is an specfile macro for determing the RPM version
but I can't seem to find it right now. This should get us around
all problems with RPM adding Net::LDAP to the list of requirements.
(This used to be commit 3c2bcc5804f3809221219b24be53a19e03b58535)
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/RedHat/filter-requires-samba.sh | 5 | ||||
-rw-r--r-- | packaging/RedHat/makerpms.sh.tmpl | 52 | ||||
-rw-r--r-- | packaging/RedHat/samba.spec.tmpl | 2 |
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 |