%define Version PVERSION %define date PRELEASE %define Vendor Caldera %define Dist OpenLinux %define EtcSamba /etc/samba.d Name : samba Version : %{Version} Release : %{date} Group : Server/Network Summary : Samba SMB client and server. Copyright : Andrew Tridgell, John H Terpstra; GPL Version 2 Packager : Klaus Singvogel Icon : Caldera-daemon.gif URL : http://samba.org/samba Requires : libpam >= 0.66, SysVinit-scripts >= 1.04-6 BuildRoot : /tmp/%{Name}-%{Version} Source: ftp://ftp.samba.org/pub/samba/%{Name}-%{Version}.tar.gz #Patch0: %{Name}-%{Version}-smbmount.patch Patch1: %{Name}-%{Version}-install.patch #Patch2: %{Name}-%{Version}-smbconf.patch %Package doc Group : Server/Network Summary : Documentation on SAMBA. %Package -n smbfs Group : System/Network Summary : Mount and unmount commands for SMB filesystems (smbfs). %Package -n swat Group : Administration/Network Requires : setup >= 2.0-2, tcp_wrappers Summary : Samba Web Administration Tool. Samba provides an SMB server which can be used to provide network services to SMB (sometimes called "Lan Manager") clients, including various versions of MS Windows, OS/2, and other Linux machines. Samba also provides some SMB clients, which complement the built-in SMB filesystem in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols and does NOT need NetBEUI (Microsoft Raw NetBIOS frame) protocol. Samba-2.2 features working NT Domain Control capability and includes the SWAT (Samba Web Administration Tool) that allows samba's smb.conf file to be remotely managed using your favourite web browser. For the time being this is being enabled on TCP port 901 via inetd. Users are advised to use Samba-2.2 as a Windows NT4 Domain Controller only on networks that do NOT have a Windows NT Domain Controller. This release does NOT as yet have Backup Domain control ability. Please refer to the WHATSNEW.txt document for fixup information. This binary release includes encrypted password support. Please read the smb.conf file and ENCRYPTION.txt in the docs directory for implementation details. %Description NOTE: Caldera OpenLinux uses PAM which has integrated support for Shadow passwordsand for quotas. Do NOT recompile with the SHADOW_PWD option enabled. %Description doc Documentation on SAMBA. %Description -n smbfs This package includes the tools necessary to mount filesystems from SMB servers. Smbmount and smbumount are an interface to the SMB filesystem. Smbfs is a filesystem which understands the SMB protocol. This is the protocol Windows for Workgroups, Windows NT or Lan Manager use to talk to each other. It was inspired by samba, the program by Andrew Tridgell that turns any unix site into a file server for DOS or Windows clients. See http://samba.org/samba for this interesting program suite and lots of more information on SMB and NetBIOS over TCP/IP. There you also find explanation for conceps like NetBIOS name or share. %Description -n swat swat allows a Samba administrator to configure the complex smb.conf file via a Web browser. In addition, a swat configuration page has help links to all the configurable options in the smb.conf file allowing an administrator to easily look up the effects of any change. %Prep %setup -n samba #%%patch0 -p1 %patch1 -p1 #%patch2 -p1 # instead of patch (to help configuration) ... ;^) %{fixUP} -vbT source/Makefile.in -e ' s:we don.t use sbindir because we want:if you want : + s:(the previous releases of Samba):$1, please use: + s:(SBINDIR\s*=\s*\@)b:# ./configure --sbindir=\\\$(BINDIR)\n${1}sb: + s:/log\.(\S+):/log/samba.d/${1}d: + s:(PASSWD_PROGRAM\s*=\s*)(/bin):$1/usr$2: + s:^(LIBS\s*=):AUTH_$1: + s:((SMBD|SWAT|RPCCLIENT|SMBPASSWD)_OBJ\) )(\$\(LDF):$1\$(AUTH_LIBS) $3: ' for i in {cvs.,change-}log; do [ ! -f ../$i ] || mv ../$i source; done mv swat/help/welcome.html docs %{fixUP} -vT docs -e ' s:/usr/local/samba/bin/(smb(client|run)):/usr/bin/$1:g + s:/usr/local/samba/bin/((s|n)mbd|swat):/usr/sbin/$1:g + s:/usr/local/samba/var/locks:/var/lock/samba.d: + s:/usr/local/samba/(var|lib)/log:/var/log/samba.d/smb: + s:/usr/local/samba/swat:/usr/share/samba/swat:g + s:/usr/local/samba/lib:%{EtcSamba}:g; ' mv docs/welcome.html swat/help for i in docs/*/smb.conf.5*; do %{fixUP} -vT $i -e ' s:users\.map:smbusers:g + s:SAMBA_INSTALL_DIRECTORY/lib:%{EtcSamba}: + s:None \(set in compile\)\.:(see above).: + s:/usr/local/:/usr/:g; ' done %{fixUP} -vT docs/textdocs/Faxing.txt -e ' s:/usr/local/etc/:/etc/: + s:/usr/local/:/usr/:; ' %{fixUP} -vT docs/textdocs/ENCRYPTION.txt -e ' s:/usr/local/samba/private:%{EtcSamba}:g + s:mksmbpasswd.sh:mksmbpasswd:g + s:the Samba source directory:/usr/bin:; ' # End of DirtyHack(TM) %Build cd source autoreconf CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-s" ./configure \ --prefix='$(DESTDIR)/usr' \ --localstatedir='$(DESTDIR)/var' \ --libdir='$(DESTDIR)%{EtcSamba}' \ --with-privatedir='$(LIBDIR)' \ --with-lockdir='$(DESTDIR)/var/lock/samba.d' \ --with-swatdir='$(DESTDIR)/usr/share/swat' \ --with-smbmount --with-pam --without-smbwrapper \ --with-utmp --with-quotas --with-vfs --with-msdfs \ --with-profile --with-syslog --with-utmp --with-netatalk \ --with-sambabook=$(DESTDIR)/usr/share/swat/using_samba make all nsswitch/libnss_wins.so %Install %{mkDESTDIR} VVS=packaging/%{Vendor}/%{Dist} mkdir -p $DESTDIR/etc/{{rc.d/init,logrotate,pam}.d,sysconfig/daemons} mkdir -p $DESTDIR/var/{lo{ck,g}/samba.d,spool/samba} mkdir -p $DESTDIR/usr/{share,swat/using_samba} mkdir -p $DESTDIR/home/samba $DESTDIR%{EtcSamba}/codepages/src $DESTDIR/sbin make -C source install strip $DESTDIR/usr/bin/smb{mount,mnt,umount} mv $DESTDIR/usr/bin/{make,add,conv}* $DESTDIR/usr/sbin #cp -p source/codepages/codepage_def.??? $DESTDIR%{EtcSamba}/codepages/src # Install the nsswitch library extension file cp -p source/nsswitch/libnss_wins.so $DESTDIR/lib # Make link for wins resolver cd $DESTDIR/lib ln -s libnss_wins.so libnss_wins.so.2 cd $RPM_BUILD_DIR cp -p $VVS/samba.init $DESTDIR/etc/rc.d/init.d/samba ln -s /etc/rc.d/init.d/samba $DESTDIR/usr/sbin cp -p $VVS/smb.conf.sample $DESTDIR%{EtcSamba}/smb.conf.sample #cp -p $VVS/smb.conf.sample $DESTDIR%{EtcSamba}/smb.conf cp -p $VVS/smbusers $DESTDIR%{EtcSamba} cp -p $VVS/smbprint $DESTDIR/usr/bin cp -p $VVS/smbadduser.perl $DESTDIR/usr/sbin/smbadduser cp -p $VVS/make_smbpasswd.perl $DESTDIR/usr/sbin/make_smbpasswd cp -p $VVS/convertsmbpasswd.perl $DESTDIR/usr/sbin/convertsmbpasswd cp -p $VVS/updatesmbpasswd.perl $DESTDIR/usr/sbin/updatesmbpasswd cp -p $VVS/findsmb $DESTDIR/usr/sbin cp -p $VVS/samba.daemon $DESTDIR/etc/sysconfig/daemons/samba cp -p $VVS/samba.pam $DESTDIR/etc/pam.d/samba cp -p $VVS/samba.logrotate $DESTDIR/etc/logrotate.d/samba for f in testparm testprns; do ln -s $f $DESTDIR/usr/bin/smb$f ln -s $f.1 $DESTDIR/usr/man/man1/smb$f.1 done ln -s make_smbcodepage $DESTDIR/usr/sbin/mksmbcodepage ln -s make_smbpasswd $DESTDIR/usr/sbin/mksmbpasswd ln -sf convert_smbpasswd $DESTDIR/usr/sbin/convertsmbpasswd cat <<-'EoH' > $DESTDIR%{EtcSamba}/lmhosts 127.0.0.1 localhost EoH DOCD="$DESTDIR/%{_defaultdocdir}/samba-%{Version}"; mkdir -p $DOCD ln -sf ../Copyrights/GPL-2.0 $DOCD/COPYING cp -p README Manifest Read-Manifest-Now WHATSNEW.txt Roadmap $DOCD cp -a docs examples $DOCD mv $DOCD/docs/htmldocs/wfw_slip.htm $DOCD/docs/wfw_slip.html rm -rf $DOCD/docs/{htmldocs,manpages,yodldocs} rm -rf $DOCD/examples/{svr4-startup,printing} cp -p swat/README $DOCD/README.swat %{fixUP} -vT $DOCD/examples -e 's:/usr/local/bin/:/usr/bin/:g;' %{fixManPages} %{mkLists} -c samba cat << 'EOF' | %{mkLists} -d samba ^/(etc|var|home) config-IGNORED swat swat /usr/doc/samba-[^/]+/$ base /doc/samba- doc @default@ EOF cat << 'EOF' | %{mkLists} -f -a samba ^/etc config-IGNORED /doc/samba-[^/]+/(COPYING|README$) base /doc/samba- doc smb(mount|mnt|umount) smbfs mount.smbfs smbfs swat swat @default@ EOF %Clean %{rmDESTDIR} %Post lisa --SysV-init install samba S91 3:4:5 K09 0:1:2:6 %Post -n swat lisa --inetd install swat stream tcp nowait.400 root /usr/sbin/tcpd swat perl -pi -e '$s=1 if /^swat/; print "swat:ALL EXCEPT 127.0.0.1\n" if eof && ! $s' /etc/hosts.deny %PostUn lisa --SysV-init remove samba $1 # We want to remove the browse.dat and wins.dat files so they can not # interfer with a new version of samba! rm -f /var/lock/samba/{browse,wins}.dat %PostUn -n swat lisa --inetd disable swat $1 [ -x /usr/sbin/swat ]||perl -ni -e '/^swat\s*\:/||print' /etc/hosts.deny %Files -f files-samba-base %defattr(-,root,root) %config %attr(755,root,root) /etc/rc.d/init.d/samba %config %attr(644,root,root) /etc/sysconfig/daemons/samba %config %attr(644,root,root) /etc/pam.d/samba %config %attr(644,root,root) /etc/logrotate.d/samba %config %attr(-,root,root) %{EtcSamba} %config %attr(755,root,root) /home/samba %dir %attr(755,root,root) /var/lock/samba.d %dir %attr(755,root,root) /var/log/samba.d %dir %attr(1777,root,root) /var/spool/samba #%dir %attr(775,root,nobody) /home/samba %Files doc -f files-samba-doc %defattr(-,root,root) %Files -n smbfs -f files-samba-smbfs %defattr(-,root,root) %Files -n swat -f files-samba-swat %defattr(-,root,root) %ChangeLog * Mon Jan 01 1997 ...