summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-09-02 20:02:45 +0000
committerGerald Carter <jerry@samba.org>2003-09-02 20:02:45 +0000
commit04c0d440ff5be404184003a01ae524d26d82b7ae (patch)
tree8ca12d2ca1c3855c6514a653bef23c9f128cd594
parent7d378e9a116e47facf1f5a7d696e680c458ae843 (diff)
downloadsamba-04c0d440ff5be404184003a01ae524d26d82b7ae.tar.gz
samba-04c0d440ff5be404184003a01ae524d26d82b7ae.tar.bz2
samba-04c0d440ff5be404184003a01ae524d26d82b7ae.zip
another round of changes for build on RedHat
(This used to be commit a8de1f41c9e8465a26d5ce19c5c08efda186e198)
-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.tmpl35
-rw-r--r--packaging/RedHat/samba.spec.tmpl24
4 files changed, 37 insertions, 26 deletions
diff --git a/packaging/RedHat/filter-requires-samba_rh8.sh b/packaging/RedHat/filter-requires-samba_rh8.sh
index 1c40a335a6..8428a6ad01 100755
--- a/packaging/RedHat/filter-requires-samba_rh8.sh
+++ b/packaging/RedHat/filter-requires-samba_rh8.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-/usr/lib/rpm/find-requires | grep -v "Net::LDAP"
+/usr/lib/rpm/find-requires $* | egrep -v '(Net::LDAP|CGI)'
diff --git a/packaging/RedHat/filter-requires-samba_rh9.sh b/packaging/RedHat/filter-requires-samba_rh9.sh
index 3f2433c712..8378523bce 100755
--- a/packaging/RedHat/filter-requires-samba_rh9.sh
+++ b/packaging/RedHat/filter-requires-samba_rh9.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-/usr/lib/rpm/perl.req | grep -v "Net::LDAP"
+/usr/lib/rpm/perl.req $* | egrep -v '(Net::LDAP|CGI)'
diff --git a/packaging/RedHat/makerpms.sh.tmpl b/packaging/RedHat/makerpms.sh.tmpl
index 339c971854..1371b55fd3 100644
--- a/packaging/RedHat/makerpms.sh.tmpl
+++ b/packaging/RedHat/makerpms.sh.tmpl
@@ -26,24 +26,14 @@ RPMVER=`rpm --version | awk '{print $3}'`
RPM="rpm"
echo The RPM Version on this machine is: $RPMVER
+##
+## fix the mandir macro
+##
case $RPMVER in
- 2*)
- echo Building for RPM v2.x or v3.x
+ [23]*)
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 > $SPECFILE
- ;;
- 4.1*)
- echo Building for RPM v4.1
- RPM="rpmbuild"
- sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
- ;;
- 4.2*)
- echo Building for RPM v4.2
- RPM="rpmbuild"
+ 4*)
sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE
;;
*)
@@ -52,6 +42,17 @@ case $RPMVER in
;;
esac
+##
+## now catch the right command to build an RPM (defaults ro 'rpm'
+##
+case $RPMVER in
+ 4.[12]*)
+ RPM="rpmbuild"
+ ;;
+esac
+
+echo "RPM build command is \"$RPM\""
+
( cd ../../source; if [ -f Makefile ]; then make distclean; fi )
( cd ../../.. ; chown -R ${USERID}.${GRPID} samba-${VERSION} )
@@ -59,11 +60,13 @@ esac
/bin/cp -p filter-requires-samba_rh8.sh ${SRCDIR}
/bin/cp -p filter-requires-samba_rh9.sh ${SRCDIR}
+chmod 755 ${SRCDIR}/filter-requires-samba_rh?.sh
/bin/cp -av $SPECFILE ${SPECDIR}
echo Getting Ready to build release package
cd ${SPECDIR}
-${RPM} --define="rpm_version $RPMVER" -ba -v --clean --rmsource $SPECFILE
+#${RPM} -ba --clean --rmsource $SPECFILE
+${RPM} -ba -vv $SPECFILE
echo Done.
diff --git a/packaging/RedHat/samba.spec.tmpl b/packaging/RedHat/samba.spec.tmpl
index 234ae809fe..26e86aa61d 100644
--- a/packaging/RedHat/samba.spec.tmpl
+++ b/packaging/RedHat/samba.spec.tmpl
@@ -1,3 +1,6 @@
+## grab the major and minor version of rpm
+%define rpm_version `rpm --version | awk '{print $3}' | awk -F. '{print $1$2}'`
+
Summary: Samba SMB client and server
Name: samba
Version: PVERSION
@@ -19,14 +22,6 @@ Obsoletes: samba-common, samba-client, samba-swat
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prefix: /usr
-# Working around perl dependency problem from docs
-# 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
network file and print services to SMB/CIFS clients, including
@@ -51,6 +46,19 @@ docs directory for implementation details.
%setup
%build
+
+# Working around perl dependency problem from docs
+# Only > RH 8.0 seems to care here
+
+echo "rpm_version == %{rpm_version}"
+if [ "%{rpm_version}" == "42" ]; then
+ %define __perl_requires %{SOURCE999}
+ echo "%{__perl_requires}"
+elif [ "%{rpm_version}" == "41" ]; then
+ %define __find_requires %{SOURCE998}
+ echo "%{__find_requires}"
+fi
+
## Build main Samba source
cd source