another round of changes for build on RedHat
authorGerald Carter <jerry@samba.org>
Tue, 2 Sep 2003 20:02:45 +0000 (20:02 +0000)
committerGerald Carter <jerry@samba.org>
Tue, 2 Sep 2003 20:02:45 +0000 (20:02 +0000)
packaging/RedHat/filter-requires-samba_rh8.sh
packaging/RedHat/filter-requires-samba_rh9.sh
packaging/RedHat/makerpms.sh.tmpl
packaging/RedHat/samba.spec.tmpl

index 1c40a335a68484b6f6ddfa289103aac92df15142..8428a6ad0132bb197ced22885447a2af1c38724f 100755 (executable)
@@ -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)'
index 3f2433c71222bcebd62d3bbba394bee02a685a96..8378523bceb2fb852cf1953294e5924e3ea1b4d0 100755 (executable)
@@ -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)'
index 339c9718549c0dd9351871545966861fd877b402..1371b55fd3c4c7ccb5d87968ae0ff09cd93a6ee6 100644 (file)
@@ -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.
 
index 234ae809fe00b3c54a2110128307538a53dff788..26e86aa61ddd57ee594b96cdbd7467a43de22c39 100644 (file)
@@ -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