From 3cf6eaebd6c57974d33934bf9647b0ab9f50f88e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 9 Sep 2003 03:18:20 +0000 Subject: syncing packaging files from 3.0 (This used to be commit ccc2a0d3840f88625cf89d6739320728e830ef87) --- packaging/RedHat/filter-requires-samba_rh8.sh | 2 + packaging/RedHat/filter-requires-samba_rh9.sh | 2 + packaging/RedHat/makerpms.sh.tmpl | 49 +++++++++++----------- packaging/RedHat/samba.spec.tmpl | 58 +++++++++++++++------------ packaging/RedHat/smb.conf | 2 +- packaging/RedHat/smb.init | 2 +- packaging/RedHat/winbind.init | 11 ++--- 7 files changed, 65 insertions(+), 61 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..8428a6ad01 --- /dev/null +++ b/packaging/RedHat/filter-requires-samba_rh8.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/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 new file mode 100755 index 0000000000..8378523bce --- /dev/null +++ b/packaging/RedHat/filter-requires-samba_rh9.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/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 dc82033b06..a37e03a144 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,28 +22,18 @@ USERID=`id -u` GRPID=`id -g` VERSION='PVERSION' SPECFILE="samba3.spec" - 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 - sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba.spec > $SPECFILE - ;; - 3*) - echo Building for RPM 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.*) - echo Building for RPM v4.1 or later - RPM="rpmbuild" + 4*) sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba.spec > $SPECFILE ;; *) @@ -59,16 +42,30 @@ 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} ) ( cd ../../.. ; tar --exclude=CVS -cf - samba-${VERSION}/. | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2 ) -cp -av $SPECFILE ${SPECDIR} +/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} -ba -v --clean --rmsource $SPECFILE +${RPM} -ba --clean --rmsource $SPECFILE echo Done. diff --git a/packaging/RedHat/samba.spec.tmpl b/packaging/RedHat/samba.spec.tmpl index 4c5a480a27..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 @@ -5,9 +8,15 @@ Release: PRELEASE License: GNU GPL version 2 Group: Networking Source: http://download.samba.org/samba/ftp/samba-%{version}.tar.bz2 + +# Don't depend on Net::LDAP +# 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 -Prereq: chkconfig fileutils +Prereq: chkconfig fileutils /sbin/ldconfig Provides: samba = %{version} Obsoletes: samba-common, samba-client, samba-swat BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -37,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 @@ -94,7 +116,7 @@ mkdir -p $RPM_BUILD_ROOT%{prefix}/{lib,include} # Install standard binary files for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \ rpcclient smbspool smbcacls smbcontrol wbinfo smbmnt net \ - smbcacls pdbedit tdbbackup smbtree + smbcacls pdbedit tdbbackup smbtree ntlm_auth smbcquotas do install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin done @@ -123,7 +145,7 @@ make DESTDIR=$RPM_BUILD_ROOT \ LIBDIR=%{prefix}/lib/samba \ VARDIR=/var \ SBINDIR=%{prefix}/sbin \ - BINDIR=$%{prefix}/bin \ + BINDIR=%{prefix}/bin \ MANDIR=MANDIR_MACRO \ SWATDIR=%{prefix}/share/swat \ SAMBABOOK=%{prefix}/share/swat/using_samba \ @@ -147,22 +169,7 @@ install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{prefix}/lib/ install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{prefix}/lib/ install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{prefix}/include/ -# Install SWAT helper files -#for i in swat/help/*.html docs/htmldocs/*.html -#do -# install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/help -#done -#for i in swat/images/*.gif -#do -# install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/images -#done -#for i in swat/include/*.html -#do -# install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/include -#done - # Install the miscellany -install -m755 swat/README $RPM_BUILD_ROOT%{prefix}/share/swat/README install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT%{prefix}/bin install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb install -m755 packaging/RedHat/winbind.init $RPM_BUILD_ROOT/etc/rc.d/init.d/winbind @@ -287,15 +294,13 @@ else rm -f /etc/samba/samba.stack fi -# Create winbind nss client symlink - -if [ -e /lib/libnss_winbind.so ]; then - ln -sf /lib/libnss_winbind.so /lib/libnss_winbind.so.2 -fi +## call ldconfig to create the version symlink for libsmbclient.so +/sbin/ldconfig %preun if [ $1 = 0 ] ; then /sbin/chkconfig --del smb + /sbin/chkconfig --del winbind # We want to remove the browse.dat and wins.dat files so they can not interfer with a new version of samba! if [ -e /var/cache/samba/browse.dat ]; then @@ -366,12 +371,13 @@ if [ $1 = 0 ] ; then fi fi +/sbin/ldconfig + %files %defattr(-,root,root) %doc README COPYING Manifest Read-Manifest-Now %doc WHATSNEW.txt Roadmap %doc docs -%doc swat/README %doc examples %{prefix}/sbin/smbd %{prefix}/sbin/nmbd @@ -399,12 +405,15 @@ fi %{prefix}/bin/smbcontrol %{prefix}/bin/wbinfo %{prefix}/bin/net +%{prefix}/bin/ntlm_auth +%{prefix}/bin/smbcquotas %{prefix}/bin/smbcacls %{prefix}/bin/pdbedit %{prefix}/bin/tdbbackup %{prefix}/bin/smbtree %attr(755,root,root) /lib/libnss_wins.s* %attr(755,root,root) %{prefix}/lib/samba/vfs/*.so +%attr(755,root,root) %{prefix}/lib/samba/charset/*.so #%attr(755,root,root) %{prefix}/lib/samba/pdb/*.so %attr(755,root,root) %{prefix}/lib/samba/*.dat %{prefix}/include/libsmbclient.h @@ -417,7 +426,6 @@ fi %{prefix}/share/swat/lang/*/images/* %{prefix}/share/swat/lang/*/include/*.html %{prefix}/share/swat/using_samba/* -%{prefix}/share/swat/README %config(noreplace) /etc/samba/lmhosts %config(noreplace) /etc/samba/smb.conf %config(noreplace) /etc/samba/smbusers diff --git a/packaging/RedHat/smb.conf b/packaging/RedHat/smb.conf index 71ff946388..5786ec5d04 100644 --- a/packaging/RedHat/smb.conf +++ b/packaging/RedHat/smb.conf @@ -66,7 +66,7 @@ ; smb passwd file = /etc/samba/smbpasswd # The following are needed to allow password changing from Windows to -# update the Linux sytsem password also. +# update the Linux system password also. # NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above. # NOTE2: You do NOT need these to allow workstations to change only # the encrypted SMB passwords. They allow the Unix password diff --git a/packaging/RedHat/smb.init b/packaging/RedHat/smb.init index f50da2c6b2..79f4f322d0 100755 --- a/packaging/RedHat/smb.init +++ b/packaging/RedHat/smb.init @@ -1,6 +1,6 @@ #!/bin/sh # -# chkconfig: 345 91 35 +# chkconfig: 345 81 35 # description: Starts and stops the Samba smbd and nmbd daemons \ # used to provide SMB network services. diff --git a/packaging/RedHat/winbind.init b/packaging/RedHat/winbind.init index 17ddbd502b..1635dca93b 100644 --- a/packaging/RedHat/winbind.init +++ b/packaging/RedHat/winbind.init @@ -1,6 +1,6 @@ #!/bin/sh # -# chkconfig: 345 81 45 +# chkconfig: 345 91 45 # description: Starts and stops the Samba winbind daemon to provide \ # user and group information from a domain controller to linux. @@ -19,16 +19,11 @@ fi # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 +CONFIG=/etc/samba/smb.conf + # Check that smb.conf exists. [ -f $CONFIG ] || exit 0 -RETVAL=0 - -CONFIG=/usr/local/samba/lib/smb.conf -PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/samba/sbin:/usr/local/samba/bin -export PATH - - start() { echo -n "Starting Winbind services: " RETVAL=1 -- cgit