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: Gerald Carter [Samba-Team] <jerry@samba.org>
9 Requires: pam >= 0.72 kernel >= 2.2.1 glibc >= 2.1.2
10 Prereq: chkconfig fileutils
11 Provides: samba = %{version}
12 Obsoletes: samba-common, samba-client, samba-swat
13 BuildRoot: /var/tmp/samba
17 Users are advised to use Samba-2.2 as a Windows NT4
18 Samba provides an SMB/CIFS server which can be used to provide
19 network file and print services to SMB/CIFS clients, including
20 various versions of MS Windows, OS/2, and other Linux machines.
21 Samba also provides some SMB clients, which complement the
22 built-in SMB filesystem in Linux. Samba uses NetBIOS over TCP/IP
23 (NetBT) protocols and does NOT need NetBEUI (Microsoft Raw NetBIOS
26 Please refer to the WHATSNEW.txt document for fixup information.
29 * Mon Nov 18 2002 Gerald Carter <jerry@samba.org>
30 - removed change log entries since history
31 is being maintained in CVS
37 ## Build main Samba source
41 libtoolize --copy --force # get it to recognize IA-64
44 EXTRA="-D_LARGEFILE64_SOURCE"
46 NUMCPU=`grep processor /proc/cpuinfo | wc -l`
47 CFLAGS="$RPM_OPT_FLAGS $EXTRA" ./configure \
49 --localstatedir=/var \
50 --with-configdir=/etc/samba \
51 --with-privatedir=/etc/samba \
60 --with-sambabook=%{prefix}/share/swat/using_samba \
61 --with-swatdir=%{prefix}/share/swat \
63 make -j${NUMCPU} proto
64 make -j${NUMCPU} all nsswitch/libnss_wins.so
65 make -j${NUMCPU} debug2html
66 make -j${NUMCPU} bin/smbspool
75 rm -rf $RPM_BUILD_ROOT
76 mkdir -p $RPM_BUILD_ROOT
77 mkdir -p $RPM_BUILD_ROOT/sbin
78 mkdir -p $RPM_BUILD_ROOT/etc/samba
79 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,samba}
80 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
81 mkdir -p $RPM_BUILD_ROOT%{prefix}/{bin,sbin}
82 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/{images,help,include,using_samba}
83 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/using_samba/{figs,gifs}
84 mkdir -p $RPM_BUILD_ROOTMANDIR_MACRO
85 mkdir -p $RPM_BUILD_ROOT/var/cache/samba
86 mkdir -p $RPM_BUILD_ROOT/var/{log,run}/samba
87 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
88 mkdir -p $RPM_BUILD_ROOT/lib/security
89 mkdir -p $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
90 mkdir -p $RPM_BUILD_ROOT%{prefix}/{lib,include}
92 # Install standard binary files
93 for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \
94 rpcclient smbspool smbcacls smbcontrol wbinfo smbmnt
96 install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin
99 for i in mksmbpasswd.sh smbtar findsmb
101 install -m755 source/script/$i $RPM_BUILD_ROOT%{prefix}/bin
104 # Install secure binary files
105 for i in smbd nmbd swat smbmount smbumount debug2html winbindd
107 install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/sbin
110 # we need a symlink for mount to recognise the smb and smbfs filesystem types
111 ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smbfs
112 ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
114 # This allows us to get away without duplicating code that
115 # sombody else can maintain for us.
117 make BASEDIR=$RPM_BUILD_ROOT/usr \
118 LIBDIR=$RPM_BUILD_ROOT/etc/samba \
119 VARDIR=$RPM_BUILD_ROOT/var \
120 SBINDIR=$RPM_BUILD_ROOT%{prefix}/sbin \
121 BINDIR=$RPM_BUILD_ROOT%{prefix}/bin \
122 MANDIR=$RPM_BUILD_ROOTMANDIR_MACRO \
123 SWATDIR=$RPM_BUILD_ROOT/usr/share/swat \
124 SAMBABOOK=$RPM_BUILD_ROOT/usr/share/swat/using_samba \
125 installman installswat
128 # Install the nsswitch wins library
129 install -m755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/lib
131 # Make link for wins resolver
132 ( cd $RPM_BUILD_ROOT/lib; ln -sf libnss_wins.so libnss_wins.so.2; )
134 # Install winbind shared libraries
135 install -m755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/lib
136 install -m755 source/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/lib/security
138 # Install pam_smbpass.so
139 install -m755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/lib/security
141 # Install the VFS modules
142 #install -m755 examples/VFS/recycle.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
143 #install -m755 examples/VFS/audit.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
144 #install -m755 examples/VFS/netatalk.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
146 # clean out VFS directory since it will get installed as documentation later
147 #(cd examples/VFS; make clean)
150 install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{prefix}/lib/
151 install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{prefix}/lib/
152 install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{prefix}/include/
154 # Install SWAT helper files
155 for i in swat/help/*.html docs/htmldocs/*.html
157 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/help
159 for i in swat/images/*.gif
161 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/images
163 for i in swat/include/*.html
165 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/include
168 # Install the miscellany
169 install -m644 swat/README $RPM_BUILD_ROOT%{prefix}/share/swat
170 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT%{prefix}/bin
171 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
172 install -m755 packaging/RedHat/winbind.init $RPM_BUILD_ROOT/etc/rc.d/init.d/winbind
173 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT%{prefix}/sbin/samba
174 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
175 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/samba/smb.conf
176 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/samba/smbusers
177 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
178 install -m644 packaging/RedHat/samba.pamd.stack $RPM_BUILD_ROOT/etc/samba/samba.stack
179 install -m644 packaging/RedHat/samba.xinetd $RPM_BUILD_ROOT/etc/samba/samba.xinetd
180 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/samba/lmhosts
183 rm -rf $RPM_BUILD_ROOT
186 /sbin/chkconfig --add smb
187 /sbin/chkconfig --add winbind
188 /sbin/chkconfig smb off
189 /sbin/chkconfig winbind off
191 echo "Looking for old /etc/smb.conf..."
192 if [ -f /etc/smb.conf -a ! -f /etc/samba/smb.conf ]; then
193 echo "Moving old /etc/smb.conf to /etc/samba/smb.conf"
194 mv /etc/smb.conf /etc/samba/smb.conf
197 echo "Looking for old /etc/smbusers..."
198 if [ -f /etc/smbusers -a ! -f /etc/samba/smbusers ]; then
199 echo "Moving old /etc/smbusers to /etc/samba/smbusers"
200 mv /etc/smbusers /etc/samba/smbusers
203 echo "Looking for old /etc/lmhosts..."
204 if [ -f /etc/lmhosts -a ! -f /etc/samba/lmhosts ]; then
205 echo "Moving old /etc/lmhosts to /etc/samba/lmhosts"
206 mv /etc/lmhosts /etc/samba/lmhosts
209 echo "Looking for old /etc/MACHINE.SID..."
210 if [ -f /etc/MACHINE.SID -a ! -f /etc/samba/MACHINE.SID ]; then
211 echo "Moving old /etc/MACHINE.SID to /etc/samba/MACHINE.SID"
212 mv /etc/MACHINE.SID /etc/samba/MACHINE.SID
215 echo "Looking for old /etc/smbpasswd..."
216 if [ -f /etc/smbpasswd -a ! -f /etc/samba/smbpasswd ]; then
217 echo "Moving old /etc/smbpasswd to /etc/samba/smbpasswd"
218 mv /etc/smbpasswd /etc/samba/smbpasswd
222 # For 2.2.1 we move the tdb files from /var/lock/samba to /var/cache/samba
223 # to preserve across reboots.
225 echo "Moving tdb files in /var/lock/samba/*.tdb to /var/cache/samba/*.tdb"
226 for i in /var/lock/samba/*.tdb
229 newname=`echo $i | sed -e's|var\/lock\/samba|var\/cache\/samba|'`
230 echo "Moving $i to $newname"
235 # Remove the transient tdb files.
236 if [ -e /var/cache/samba/brlock.tdb ]; then
237 rm -f /var/cache/samba/brlock.tdb
240 if [ -e /var/cache/samba/unexpected.tdb ]; then
241 rm -f /var/cache/samba/unexpected.tdb
244 if [ -e /var/cache/samba/connections.tdb ]; then
245 rm -f /var/cache/samba/connections.tdb
248 if [ -e /var/cache/samba/locking.tdb ]; then
249 rm -f /var/cache/samba/locking.tdb
252 if [ -e /var/cache/samba/messages.tdb ]; then
253 rm -f /var/cache/samba/messages.tdb
256 if [ -d /var/lock/samba ]; then
257 rm -rf /var/lock/samba
260 # Add swat entry to /etc/services if not already there.
261 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
262 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
265 # Add swat entry to /etc/inetd.conf if needed.
266 if [ -f /etc/inetd.conf ]; then
267 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
268 echo 'swat stream tcp nowait.400 root %{prefix}/sbin/swat swat' >> /etc/inetd.conf
269 killall -1 inetd || :
273 # Add swat entry to xinetd.d if needed.
274 if [ -d $RPM_BUILD_ROOT/etc/xinetd.d -a ! -f /etc/xinetd.d/swat ]; then
275 mv /etc/samba/samba.xinetd /etc/xinetd.d/swat
277 rm -f /etc/samba/samba.xinetd
280 # Install the correct version of the samba pam file, depending on pam version.
281 if [ -f /lib/security/pam_stack.so ]; then
282 echo "Installing stack version of /etc/pam.d/samba..."
283 mv /etc/samba/samba.stack /etc/pam.d/samba
285 echo "Installing non-stack version of /etc/pam.d/samba..."
286 rm -f /etc/samba/samba.stack
289 # Create winbind nss client symlink
291 if [ -e /lib/libnss_winbind.so ]; then
292 ln -sf /lib/libnss_winbind.so /lib/libnss_winbind.so.2
297 /sbin/chkconfig --del smb
299 # We want to remove the browse.dat and wins.dat files so they can not interfer with a new version of samba!
300 if [ -e /var/cache/samba/browse.dat ]; then
301 rm -f /var/cache/samba/browse.dat
303 if [ -e /var/cache/samba/wins.dat ]; then
304 rm -f /var/cache/samba/wins.dat
307 # Remove the transient tdb files.
308 if [ -e /var/cache/samba/brlock.tdb ]; then
309 rm -f /var/cache/samba/brlock.tdb
312 if [ -e /var/cache/samba/unexpected.tdb ]; then
313 rm -f /var/cache/samba/unexpected.tdb
316 if [ -e /var/cache/samba/connections.tdb ]; then
317 rm -f /var/cache/samba/connections.tdb
320 if [ -e /var/cache/samba/locking.tdb ]; then
321 rm -f /var/cache/samba/locking.tdb
324 if [ -e /var/cache/samba/messages.tdb ]; then
325 rm -f /var/cache/samba/messages.tdb
328 # Remove winbind nss client symlink
330 if [ -L /lib/libnss_winbind.so.2 ]; then
331 rm -f /lib/libnss_winbind.so.2
336 # Only delete remnants of samba if this is the final deletion.
338 if [ -x /etc/pam.d/samba ]; then
339 rm -f /etc/pam.d/samba
341 if [ -e /var/log/samba ]; then
342 rm -rf /var/log/samba
344 if [ -e /var/cache/samba ]; then
345 rm -rf /var/cache/samba
348 # Remove swat entries from /etc/inetd.conf and /etc/services
351 if [ -f /etc/inetd.conf ]; then
352 # preserve inetd.conf permissions.
353 cp -p /etc/inetd.conf $tmpfile
354 sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
355 mv $tmpfile inetd.conf
357 # preserve services permissions.
358 cp -p /etc/services $tmpfile
359 sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
360 mv $tmpfile /etc/services
362 # Remove swat entry from /etc/xinetd.d
363 if [ -f /etc/xinetd.d/swat ]; then
364 rm -r /etc/xinetd.d/swat
368 %triggerpostun -- samba < samba-2.0.0
370 /sbin/chkconfig --add smb
374 %defattr(-,root,root)
375 %doc README COPYING Manifest Read-Manifest-Now
376 %doc WHATSNEW.txt Roadmap
384 %{prefix}/sbin/smbmount
385 %{prefix}/sbin/smbumount
386 %{prefix}/sbin/winbindd
389 %{prefix}/bin/mksmbpasswd.sh
390 %{prefix}/bin/smbclient
391 %{prefix}/bin/smbspool
392 %{prefix}/bin/rpcclient
393 %{prefix}/bin/testparm
394 %{prefix}/bin/testprns
395 %{prefix}/bin/findsmb
396 %{prefix}/bin/smbstatus
397 %{prefix}/bin/nmblookup
398 %{prefix}/bin/smbpasswd
400 %{prefix}/bin/smbprint
401 %{prefix}/bin/smbcontrol
402 %{prefix}/bin/smbcacls
404 %attr(755,root,root) /lib/libnss_wins.s*
405 %attr(755,root,root) %{prefix}/lib/samba/vfs/*.so
406 %{prefix}/include/libsmbclient.h
407 %{prefix}/lib/libsmbclient.a
408 %{prefix}/lib/libsmbclient.so
409 %{prefix}/share/swat/help/*
410 %{prefix}/share/swat/images/*
411 %{prefix}/share/swat/include/header.html
412 %{prefix}/share/swat/include/footer.html
413 %{prefix}/share/swat/using_samba/*
414 %config(noreplace) /etc/samba/lmhosts
415 %config(noreplace) /etc/samba/smb.conf
416 %config(noreplace) /etc/samba/smbusers
417 /etc/samba/samba.stack
418 /etc/samba/samba.xinetd
420 /etc/rc.d/init.d/winbind
421 /etc/logrotate.d/samba
422 %config(noreplace) /etc/pam.d/samba
427 %attr(755,root,root) %dir /var/cache/samba
430 %attr(1777,root,root) %dir /var/spool/samba
431 %attr(-,root,root) /lib/libnss_winbind.so
432 %attr(-,root,root) /lib/security/pam_winbind.so
433 %attr(-,root,root) /lib/security/pam_smbpass.so