#!/bin/sh
-/usr/lib/rpm/find-requires | grep -v "Net::LDAP"
+/usr/lib/rpm/find-requires $* | egrep -v '(Net::LDAP|CGI)'
#!/bin/sh
-/usr/lib/rpm/perl.req | grep -v "Net::LDAP"
+/usr/lib/rpm/perl.req $* | egrep -v '(Net::LDAP|CGI)'
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
;;
*)
;;
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} )
/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.
+## 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
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
%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