1 Summary: Samba SMB client and server
5 Copyright: GNU GPL version 2
7 Source: http://download.samba.org/samba/ftp/samba-%{version}.tar.bz2
8 Packager: John H Terpstra [Samba-Team] <jht@samba.org>
9 Requires: pam >= 0.72 kernel >= 2.2.1 glibc >= 2.1.2
10 Prereq: chkconfig fileutils
11 Provides: samba = %{version}
13 Obsoletes: samba-common, samba-client, samba-swat
14 BuildRoot: /var/tmp/samba
18 Samba provides an SMB server which can be used to provide
19 network services to SMB (sometimes called "Lan Manager")
20 clients, including various versions of MS Windows, OS/2,
21 and other Linux machines. Samba also provides some SMB
22 clients, which complement the built-in SMB filesystem
23 in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
24 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
27 Samba-2.2 features working NT Domain Control capability and
28 includes the SWAT (Samba Web Administration Tool) that
29 allows samba's smb.conf file to be remotely managed using your
30 favourite web browser. For the time being this is being
31 enabled on TCP port 901 via inetd.
33 Users are advised to use Samba-2.2 as a Windows NT4
34 Domain Controller only on networks that do NOT have a Windows
35 NT Domain Controller. This release does NOT as yet have
36 Backup Domain control ability.
38 Please refer to the WHATSNEW.txt document for fixup information.
39 This binary release includes encrypted password support.
41 Please read the smb.conf file and ENCRYPTION.txt in the
42 docs directory for implementation details.
44 NOTE: Red Hat Linux uses PAM which has integrated support
45 for Shadow passwords and quotas. Do NOT recompile with the
46 SHADOW_PWD option enabled
49 * Thu Jun 6 2002 Gerald Carter <jerry@samba.org>
50 - add separate winbindd init script
51 - build and install libsmbclient
53 * Sun Jun 2 2002 Gerald Carter <jerry@samba.org>
54 - include audit and recycle VFS modules in /usr/lib/samba
56 * Mon May 6 2002 Gerald Carter <jerry@samba.org>
57 - moved findsmb to a standard component in samba's
58 "make install". Removed from specfile.
60 * Sun Oct 14 2001 Andrew Bartlett <abartlet@samba.org>
61 - Set SBINDIR for codepage/manpage install, cope with
64 * Mon Aug 1 2001 Tim Potter <tpot@samba.org>
65 - Install winbind daemon, client programs, nss and pam libraries
67 * Sat Mar 31 2001 Andrew Bartlett <abartlet@pcug.org.au>
68 - Changed prefix/share/man for _mandir/share/man
69 - Changed this for a sed macro MANDIR_MACRO
70 - This allows us to build both RH7 (RPM4)
71 and older versions from same specfile.
72 - Made makerpms.sh use the rpm -ta command rather
73 than attempting to devine the correct location to
74 put the file. Also removes some /tmp symlink games.
75 - Allows build on RPM4
76 - Increased PAM requirements to allow us to use
77 system-auth (this pam is in 6.x errata at least)
79 * Tue Mar 27 2001 John H Terpstra <jht@samba.org>
80 - Fixed typos introduced by Sum Wun.
81 - Build for Red Hat 7.x
83 * Sun Nov 12 2000 John H Terpstra <jht@samba.org>
84 - Updated for Samba-2.2 releases
85 - Added libnss_wins.so stuff
86 - Added compile-time options
88 * Sat Nov 29 1999 Matthew Vanecek <mev0003@unt.edu>
89 - Added a Prefix and changed "/usr" to "%{prefix}"
91 * Sat Nov 11 1999 Tridge <tridge@linuxcare.com>
92 - changed from mount.smb to mount.smbfs
94 * Sat Oct 9 1999 Tridge <tridge@linuxcare.com>
96 - added smbmnt and smbmount
98 * Sun Apr 25 1999 John H Terpstra <jht@samba.org>
99 - added smbsh.1 man page
101 * Fri Mar 26 1999 Andrew Tridgell <tridge@samba.org>
102 - added --with-pam as pam is no longer used by default
104 * Sat Jan 27 1999 Jeremy Allison <jra@samba.org>
105 - Removed smbrun binary and tidied up some loose ends
107 * Sun Oct 25 1998 John H Terpstra <jht@samba.org>
108 - Added parameters to /config to ensure smb.conf, lmhosts,
109 and smbusers never gets over-written.
111 * Sat Oct 24 1998 John H Terpstra <jht@samba.org>
112 - removed README.smbsh file from docs area
114 * Mon Oct 05 1998 John H Terpstra <jht@samba.org>
115 - Added rpcclient to binaries list
116 - Added smbwrapper stuff
118 * Fri Aug 21 1998 John H Terpstra <jht@samba.org>
119 - Updated for Samba version 2.0 building
121 * Tue Jul 07 1998 Erik Troan <ewt@redhat.com>
122 - updated postun triggerscript to check $0
123 - clear /etc/codepages from %preun instead of %postun
125 * Sat Jul 04 1998 John H Terpstra <jht@samba.org>
126 - fixed codepage preservation during update via -Uvh
128 * Mon Jun 08 1998 Erik Troan <ewt@redhat.com>
129 - made the %postun script a tad less agressive; no reason to remove
130 the logs or lock file
131 - the %postun and %preun should only exectute if this is the final
133 - migrated %triggerpostun from Red Hat's samba package to work around
134 packaging problems in some Red Hat samba releases
136 * Sun Apr 26 1998 John H Terpstra <jht@samba.org>
137 - Tidy up for early alpha releases
138 - added findsmb from SGI packaging
140 * Thu Apr 09 1998 John H Terpstra <jht@samba.org>
142 - Included new codepage.936
144 * Sat Mar 20 1998 John H Terpstra <jht@samba.org>
145 - Added swat facility
147 * Sat Jan 24 1998 John H Terpstra <jht@samba.org>
148 - Many optimisations (some suggested by Manoj Kasichainula <manojk@io.com>
149 - Use of chkconfig in place of individual symlinks to /etc/rc.d/init/smb
150 - Compounded make line
151 - Updated smb.init restart mechanism
152 - Use compound mkdir -p line instead of individual calls to mkdir
153 - Fixed smb.conf file path for log files
154 - Fixed smb.conf file path for incoming smb print spool directory
155 - Added a number of options to smb.conf file
156 - Added smbuser file and smb.conf file updates for username map
162 ## Build main Samba source
166 libtoolize --copy --force # get it to recognize IA-64
169 EXTRA="-D_LARGEFILE64_SOURCE"
171 NUMCPU=`grep processor /proc/cpuinfo | wc -l`
172 CFLAGS="$RPM_OPT_FLAGS $EXTRA" ./configure \
174 --localstatedir=/var \
175 --with-configdir=/etc/samba \
176 --with-privatedir=/etc/samba \
177 --with-codepagedir=/etc/codepages \
186 --with-sambabook=%{prefix}/share/swat/using_samba \
187 --with-swatdir=%{prefix}/share/swat \
189 make -j${NUMCPU} proto
190 make -j${NUMCPU} all nsswitch/libnss_wins.so
191 make -j${NUMCPU} debug2html
192 make -j${NUMCPU} bin/smbspool
196 CFLAGS="$RPM_OPT_FLAGS $EXTRA" ./configure \
202 # Remove some permission bits to avoid to many dependencies
203 find examples docs -type f | xargs -r chmod -x
206 rm -rf $RPM_BUILD_ROOT
207 mkdir -p $RPM_BUILD_ROOT
208 mkdir -p $RPM_BUILD_ROOT/sbin
209 mkdir -p $RPM_BUILD_ROOT/etc/samba
210 mkdir -p $RPM_BUILD_ROOT/etc/codepages/src
211 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,samba}
212 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
213 mkdir -p $RPM_BUILD_ROOT%{prefix}/{bin,sbin}
214 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/{images,help,include,using_samba}
215 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/using_samba/{figs,gifs}
216 mkdir -p $RPM_BUILD_ROOTMANDIR_MACRO
217 mkdir -p $RPM_BUILD_ROOT/var/cache/samba
218 mkdir -p $RPM_BUILD_ROOT/var/{log,run}/samba
219 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
220 mkdir -p $RPM_BUILD_ROOT/lib/security
221 mkdir -p $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
222 mkdir -p $RPM_BUILD_ROOT%{prefix}/{lib,include}
224 # Install standard binary files
225 for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \
226 make_smbcodepage make_unicodemap make_printerdef rpcclient smbspool \
227 smbcacls smbcontrol wbinfo smbmnt
229 install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin
231 for i in mksmbpasswd.sh smbtar findsmb
233 install -m755 source/script/$i $RPM_BUILD_ROOT%{prefix}/bin
236 # Install secure binary files
237 for i in smbd nmbd swat smbmount smbumount debug2html winbindd
239 install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/sbin
242 # we need a symlink for mount to recognise the smb and smbfs filesystem types
243 ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smbfs
244 ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
246 # This allows us to get away without duplicating code that
247 # sombody else can maintain for us.
249 make BASEDIR=$RPM_BUILD_ROOT/usr \
250 LIBDIR=$RPM_BUILD_ROOT/etc/samba \
251 VARDIR=$RPM_BUILD_ROOT/var \
252 SBINDIR=$RPM_BUILD_ROOT%{prefix}/sbin \
253 BINDIR=$RPM_BUILD_ROOT%{prefix}/bin \
254 MANDIR=$RPM_BUILD_ROOTMANDIR_MACRO \
255 CODEPAGEDIR=$RPM_BUILD_ROOT/etc/codepages \
256 SWATDIR=$RPM_BUILD_ROOT/usr/share/swat \
257 SAMBABOOK=$RPM_BUILD_ROOT/usr/share/swat/using_samba \
258 installman installcp installswat
261 # Install codepage source files
262 for i in source/codepages/codepage_def.* source/codepages/*.TXT
264 install -m644 $i $RPM_BUILD_ROOT/etc/codepages/src
267 # Install the nsswitch wins library
268 install -m755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/lib
269 ( cd $RPM_BUILD_ROOT/lib; ln -sf libnss_wins.so libnss_wins.so.2; )
271 # Install winbind shared libraries
272 install -m755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/lib
273 ( cd $RPM_BUILD_ROOT/lib; ln -sf libnss_winbind.so libnss_winbind.so.2; )
274 install -m755 source/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/lib/security
276 # Install pam_smbpass.so
277 install -m755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/lib/security
279 # Install the VFS modules
280 install -m755 examples/VFS/recycle/recycle.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
281 install -m644 examples/VFS/recycle/recycle.conf $RPM_BUILD_ROOT/etc/samba/
282 install -m755 examples/VFS/block/block.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
283 install -m644 examples/VFS/block/samba-block.conf $RPM_BUILD_ROOT/etc/samba/
284 install -m755 examples/VFS/audit.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
286 # clean out VFS directory since it will get installed as documentation later
287 (cd examples/VFS; make clean)
290 install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{prefix}/lib/
291 install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{prefix}/lib/
292 install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{prefix}/include/
294 # Install SWAT helper files
295 for i in swat/help/*.html docs/htmldocs/*.html
297 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/help
299 for i in swat/images/*.gif
301 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/images
303 for i in swat/include/*.html
305 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/include
308 # Install the miscellany
309 install -m644 swat/README $RPM_BUILD_ROOT%{prefix}/share/swat
310 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT%{prefix}/bin
311 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
312 install -m755 packaging/RedHat/winbind.init $RPM_BUILD_ROOT/etc/rc.d/init.d/winbind
313 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT%{prefix}/sbin/samba
314 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
315 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/samba/smb.conf
316 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/samba/smbusers
317 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
318 install -m644 packaging/RedHat/samba.pamd.stack $RPM_BUILD_ROOT/etc/samba/samba.stack
319 install -m644 packaging/RedHat/samba.xinetd $RPM_BUILD_ROOT/etc/samba/samba.xinetd
320 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/samba/lmhosts
323 rm -rf $RPM_BUILD_ROOT
326 /sbin/chkconfig --add smb
327 /sbin/chkconfig --add winbind
328 /sbin/chkconfig smb off
329 /sbin/chkconfig winbind off
331 echo "Looking for old /etc/smb.conf..."
332 if [ -f /etc/smb.conf -a ! -f /etc/samba/smb.conf ]; then
333 echo "Moving old /etc/smb.conf to /etc/samba/smb.conf"
334 mv /etc/smb.conf /etc/samba/smb.conf
337 echo "Looking for old /etc/smbusers..."
338 if [ -f /etc/smbusers -a ! -f /etc/samba/smbusers ]; then
339 echo "Moving old /etc/smbusers to /etc/samba/smbusers"
340 mv /etc/smbusers /etc/samba/smbusers
343 echo "Looking for old /etc/lmhosts..."
344 if [ -f /etc/lmhosts -a ! -f /etc/samba/lmhosts ]; then
345 echo "Moving old /etc/lmhosts to /etc/samba/lmhosts"
346 mv /etc/lmhosts /etc/samba/lmhosts
349 echo "Looking for old /etc/MACHINE.SID..."
350 if [ -f /etc/MACHINE.SID -a ! -f /etc/samba/MACHINE.SID ]; then
351 echo "Moving old /etc/MACHINE.SID to /etc/samba/MACHINE.SID"
352 mv /etc/MACHINE.SID /etc/samba/MACHINE.SID
355 echo "Looking for old /etc/smbpasswd..."
356 if [ -f /etc/smbpasswd -a ! -f /etc/samba/smbpasswd ]; then
357 echo "Moving old /etc/smbpasswd to /etc/samba/smbpasswd"
358 mv /etc/smbpasswd /etc/samba/smbpasswd
362 # For 2.2.1 we move the tdb files from /var/lock/samba to /var/cache/samba
363 # to preserve across reboots.
365 echo "Moving tdb files in /var/lock/samba/*.tdb to /var/cache/samba/*.tdb"
366 for i in /var/lock/samba/*.tdb
369 newname=`echo $i | sed -e's|var\/lock\/samba|var\/cache\/samba|'`
370 echo "Moving $i to $newname"
375 # Remove the transient tdb files.
376 if [ -e /var/cache/samba/brlock.tdb ]; then
377 rm -f /var/cache/samba/brlock.tdb
380 if [ -e /var/cache/samba/unexpected.tdb ]; then
381 rm -f /var/cache/samba/unexpected.tdb
384 if [ -e /var/cache/samba/connections.tdb ]; then
385 rm -f /var/cache/samba/connections.tdb
388 if [ -e /var/cache/samba/locking.tdb ]; then
389 rm -f /var/cache/samba/locking.tdb
392 if [ -e /var/cache/samba/messages.tdb ]; then
393 rm -f /var/cache/samba/messages.tdb
396 if [ -d /var/lock/samba ]; then
397 rm -rf /var/lock/samba
400 # Add swat entry to /etc/services if not already there.
401 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
402 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
405 # Add swat entry to /etc/inetd.conf if needed.
406 if [ -f /etc/inetd.conf ]; then
407 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
408 echo 'swat stream tcp nowait.400 root %{prefix}/sbin/swat swat' >> /etc/inetd.conf
409 killall -1 inetd || :
413 # Add swat entry to xinetd.d if needed.
414 if [ -d $RPM_BUILD_ROOT/etc/xinetd.d -a ! -f /etc/xinetd.d/swat ]; then
415 mv /etc/samba/samba.xinetd /etc/xinetd.d/swat
417 rm -f /etc/samba/samba.xinetd
420 # Install the correct version of the samba pam file, depending on pam version.
421 if [ -f /lib/security/pam_stack.so ]; then
422 echo "Installing stack version of /etc/pam.d/samba..."
423 mv /etc/samba/samba.stack /etc/pam.d/samba
425 echo "Installing non-stack version of /etc/pam.d/samba..."
426 rm -f /etc/samba/samba.stack
429 # Create winbind nss client symlink
431 if [ -e /lib/libnss_winbind.so ]; then
432 ln -sf /lib/libnss_winbind.so /lib/libnss_winbind.so.2
437 /sbin/chkconfig --del smb
439 # We want to remove the browse.dat and wins.dat files so they can not interfer with a new version of samba!
440 if [ -e /var/cache/samba/browse.dat ]; then
441 rm -f /var/cache/samba/browse.dat
443 if [ -e /var/cache/samba/wins.dat ]; then
444 rm -f /var/cache/samba/wins.dat
447 # Remove the transient tdb files.
448 if [ -e /var/cache/samba/brlock.tdb ]; then
449 rm -f /var/cache/samba/brlock.tdb
452 if [ -e /var/cache/samba/unexpected.tdb ]; then
453 rm -f /var/cache/samba/unexpected.tdb
456 if [ -e /var/cache/samba/connections.tdb ]; then
457 rm -f /var/cache/samba/connections.tdb
460 if [ -e /var/cache/samba/locking.tdb ]; then
461 rm -f /var/cache/samba/locking.tdb
464 if [ -e /var/cache/samba/messages.tdb ]; then
465 rm -f /var/cache/samba/messages.tdb
468 # Remove winbind nss client symlink
470 if [ -L /lib/libnss_winbind.so.2 ]; then
471 rm -f /lib/libnss_winbind.so.2
476 # Only delete remnants of samba if this is the final deletion.
478 if [ -x /etc/pam.d/samba ]; then
479 rm -f /etc/pam.d/samba
481 if [ -e /var/log/samba ]; then
482 rm -rf /var/log/samba
484 if [ -e /var/cache/samba ]; then
485 rm -rf /var/cache/samba
488 # Remove swat entries from /etc/inetd.conf and /etc/services
491 if [ -f /etc/inetd.conf ]; then
492 # preserve inetd.conf permissions.
493 cp -p /etc/inetd.conf $tmpfile
494 sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
495 mv $tmpfile inetd.conf
497 # preserve services permissions.
498 cp -p /etc/services $tmpfile
499 sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
500 mv $tmpfile /etc/services
502 # Remove swat entry from /etc/xinetd.d
503 if [ -f /etc/xinetd.d/swat ]; then
504 rm -r /etc/xinetd.d/swat
508 #%triggerpostun -- samba < samba-2.0.0
509 #if [ $0 != 0 ]; then
510 # /sbin/chkconfig --add smb
514 %defattr(-,root,root)
515 %doc README COPYING Manifest Read-Manifest-Now
516 %doc WHATSNEW.txt Roadmap
524 %{prefix}/sbin/smbmount
525 %{prefix}/sbin/smbumount
526 %{prefix}/sbin/winbindd
529 %{prefix}/bin/mksmbpasswd.sh
530 %{prefix}/bin/smbclient
531 %{prefix}/bin/smbspool
532 %{prefix}/bin/rpcclient
533 %{prefix}/bin/testparm
534 %{prefix}/bin/testprns
535 %{prefix}/bin/findsmb
536 %{prefix}/bin/smbstatus
537 %{prefix}/bin/nmblookup
538 %{prefix}/bin/make_smbcodepage
539 %{prefix}/bin/make_unicodemap
540 %{prefix}/bin/make_printerdef
541 %{prefix}/bin/smbpasswd
543 %{prefix}/bin/smbprint
544 %{prefix}/bin/smbcontrol
545 %{prefix}/bin/smbcacls
547 %attr(755,root,root) /lib/libnss_wins.s*
548 %attr(755,root,root) %{prefix}/lib/samba/vfs/*.so
549 %{prefix}/include/libsmbclient.h
550 %{prefix}/lib/libsmbclient.a
551 %{prefix}/lib/libsmbclient.so
552 %{prefix}/share/swat/help/*
553 %{prefix}/share/swat/images/*
554 %{prefix}/share/swat/include/header.html
555 %{prefix}/share/swat/include/footer.html
556 %{prefix}/share/swat/using_samba/*
557 %config(noreplace) /etc/samba/lmhosts
558 %config(noreplace) /etc/samba/smb.conf
559 %config(noreplace) /etc/samba/recycle.conf
560 %config(noreplace) /etc/samba/samba-block.conf
561 %config(noreplace) /etc/samba/smbusers
562 /etc/samba/samba.stack
563 /etc/samba/samba.xinetd
565 /etc/rc.d/init.d/winbind
566 /etc/logrotate.d/samba
567 %config(noreplace) /etc/pam.d/samba
572 %dir /etc/codepages/*
573 %attr(755,root,root) %dir /var/cache/samba
576 %attr(1777,root,root) %dir /var/spool/samba
577 %attr(-,root,root) /lib/libnss_winbind.so
578 %attr(-,root,root) /lib/security/pam_winbind.so
579 %attr(-,root,root) /lib/security/pam_smbpass.so