merge from 2.2 DeletePrinterDriver() server side stud coming
[Samba/gbeck.git] / packaging / RedHat / samba2.spec.tmpl
blob73ca9513366c0c592d3e9343ee44991f66c9d3d1
1 Summary: Samba SMB client and server
2 Name: samba
3 Version: PVERSION
4 Release: PRELEASE
5 Copyright: GNU GPL version 2
6 Group: Networking
7 Source: ftp://samba.org/pub/samba/samba-PVERSION.tar.gz
8 Patch: makefile-path.patch
9 Patch1: smbw.patch
10 Packager: John H Terpstra [Samba-Team] <jht@samba.org>
11 Requires: pam >= 0.64 kernel >= 2.2.1 glibc >= 2.1.2
12 Prereq: chkconfig fileutils
13 BuildRoot: /var/tmp/samba
14 Prefix: /usr
16 %description
17 Samba provides an SMB server which can be used to provide
18 network services to SMB (sometimes called "Lan Manager")
19 clients, including various versions of MS Windows, OS/2,
20 and other Linux machines. Samba also provides some SMB
21 clients, which complement the built-in SMB filesystem
22 in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
23 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
24 protocol.
26 Samba-2.2 features working NT Domain Control capability and 
27 includes the SWAT (Samba Web Administration Tool) that 
28 allows samba's smb.conf file to be remotely managed using your 
29 favourite web browser. For the time being this is being
30 enabled on TCP port 901 via inetd.
32 Users are advised to use Samba-2.2 as a Windows NT4
33 Domain Controller only on networks that do NOT have a Windows
34 NT Domain Controller. This release does NOT as yet have
35 Backup Domain control ability.
37 Please refer to the WHATSNEW.txt document for fixup information.
38 This binary release includes encrypted password support.
40 Please read the smb.conf file and ENCRYPTION.txt in the
41 docs directory for implementation details.
43 NOTE: Red Hat Linux uses PAM which has integrated support
44 for Shadow passwords and quotas. Do NOT recompile with the
45 SHADOW_PWD option enabled
47 %changelog
48 * Sun Nov 12 2000 John H Terpstra <jht@samba.org>
49  - Updated for Samba-2.2 releases
50  - Added libnss_wins.so stuff
51  - Added compile-time options
53 * Sat Nov 29 1999 Matthew Vanecek <mev0003@unt.edu>
54  - Added a Prefix and changed "/usr" to "%{prefix}"
56 * Sat Nov 11 1999 Tridge <tridge@linuxcare.com>
57  - changed from mount.smb to mount.smbfs
59 * Sat Oct 9 1999 Tridge <tridge@linuxcare.com>
60  - removed smbwrapper
61  - added smbmnt and smbmount
63 * Sun Apr 25 1999 John H Terpstra <jht@samba.org>
64  - added smbsh.1 man page
66 * Fri Mar 26 1999 Andrew Tridgell <tridge@samba.org>
67  - added --with-pam as pam is no longer used by default
69 * Sat Jan 27 1999 Jeremy Allison <jra@samba.org>
70  - Removed smbrun binary and tidied up some loose ends
72 * Sun Oct 25 1998 John H Terpstra <jht@samba.org>
73  - Added parameters to /config to ensure smb.conf, lmhosts, 
74         and smbusers never gets over-written.
76 * Sat Oct 24 1998 John H Terpstra <jht@samba.org>
77  - removed README.smbsh file from docs area
79 * Mon Oct 05 1998 John H Terpstra <jht@samba.org>
80  - Added rpcclient to binaries list
81  - Added smbwrapper stuff
83 * Fri Aug 21 1998 John H Terpstra <jht@samba.org>
84  - Updated for Samba version 2.0 building
86 * Tue Jul 07 1998 Erik Troan <ewt@redhat.com>
87   - updated postun triggerscript to check $0
88   - clear /etc/codepages from %preun instead of %postun
90 * Sat Jul 04 1998 John H Terpstra <jht@samba.org>
91  - fixed codepage preservation during update via -Uvh
93 * Mon Jun 08 1998 Erik Troan <ewt@redhat.com>
94   - made the %postun script a tad less agressive; no reason to remove
95     the logs or lock file 
96   - the %postun and %preun should only exectute if this is the final
97     removal
98   - migrated %triggerpostun from Red Hat's samba package to work around
99     packaging problems in some Red Hat samba releases
101 * Sun Apr 26 1998 John H Terpstra <jht@samba.org>
102  - Tidy up for early alpha releases
103  - added findsmb from SGI packaging
105 * Thu Apr 09 1998 John H Terpstra <jht@samba.org>
106  - Updated spec file
107  - Included new codepage.936
109 * Sat Mar 20 1998 John H Terpstra <jht@samba.org>
110  - Added swat facility
112 * Sat Jan 24 1998 John H Terpstra <jht@samba.org>
113  - Many optimisations (some suggested by Manoj Kasichainula <manojk@io.com>
114   - Use of chkconfig in place of individual symlinks to /etc/rc.d/init/smb
115   - Compounded make line
116   - Updated smb.init restart mechanism
117   - Use compound mkdir -p line instead of individual calls to mkdir
118   - Fixed smb.conf file path for log files
119   - Fixed smb.conf file path for incoming smb print spool directory
120   - Added a number of options to smb.conf file
121   - Added smbadduser command (missed from all previous RPMs) - Doooh!
122   - Added smbuser file and smb.conf file updates for username map
124 %prep
125 %setup
126 %patch -p1
127 %patch1 -p1
129 %build
130 cd source
132 %ifarch ia64
133 libtoolize --copy --force     # get it to recognize IA-64
134 autoconf
135 autoheader
136 EXTRA="-D_LARGEFILE64_SOURCE"
137 %endif
138 NUMCPU=`grep processor /proc/cpuinfo | wc -l`
139 CFLAGS="$RPM_OPT_FLAGS $EXTRA" ./configure \
140         --prefix=%{prefix}\
141         --libdir=/etc \
142         --with-lockdir=/var/lock/samba \
143         --with-privatedir=/etc \
144         --with-swatdir=%{prefix}/share/swat \
145         --with-quotas \
146         --with-smbmount \
147         --with-pam \
148         --with-profile \
149         --with-syslog \
150         --with-utmp \
151         --with-vfs \
152         --with-msdfs \
153         --with-netatalk \
154         --with-sambabook=%{prefix}/share/swat/using_samba
155 make -j${NUMCPU} all smbfilter nsswitch/libnss_wins.so
156 make -j${NUMCPU} smbtorture debug2html locktest2
157 make -j${NUMCPU} masktest bin/smbspool
158 #make -j${NUMCPU} rpctorture locktest smbwrapper bin/wbinfo
161 %install
162 rm -rf $RPM_BUILD_ROOT
163 mkdir -p $RPM_BUILD_ROOT
164 mkdir -p $RPM_BUILD_ROOT/etc/codepages/src
165 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d}
166 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/{init.d,rc0.d,rc1.d,rc2.d,rc3.d,rc5.d,rc6.d}
167 mkdir -p $RPM_BUILD_ROOT/home/samba
168 mkdir -p $RPM_BUILD_ROOT%{prefix}/{bin,sbin}
169 mkdir -p $RPM_BUILD_ROOT/sbin
170 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/{images,help,include}
171 mkdir -p $RPM_BUILD_ROOT%{prefix}/man/{man1,man5,man7,man8}
172 mkdir -p $RPM_BUILD_ROOT/var/lock/samba
173 mkdir -p $RPM_BUILD_ROOT/var/log/samba
174 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
176 # Install standard binary files
177 for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \
178       make_smbcodepage make_unicodemap make_printerdef rpcclient smbspool
179 #      smbsh smbwrapper.so 
181 install -m755 -s source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin
182 done
183 for i in addtosmbpass mksmbpasswd.sh smbtar 
185 install -m755 source/script/$i $RPM_BUILD_ROOT%{prefix}/bin
186 done
188 # Install secure binary files
189 for i in smbd nmbd swat smbmount smbumount smbmnt debug2html \
190       smbtorture smbfilter locktest2 masktest
191 #     wbinfo
193 install -m755 -s source/bin/$i $RPM_BUILD_ROOT%{prefix}/sbin
194 done
196 # we need a symlink for mount to recognise the smb and smbfs filesystem types
197 ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smbfs
198 ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
200 # Install level 1 man pages
201 for i in smbclient.1 smbrun.1 smbstatus.1 smbtar.1 testparm.1 testprns.1 make_smbcodepage.1 nmblookup.1
203 install -m644 docs/manpages/$i $RPM_BUILD_ROOT%{prefix}/man/man1
204 done
206 # Install codepage source files
207 for i in 437 737 775 850 852 861 866 932 936 949 950 1251
209 install -m644 source/codepages/codepage_def.$i $RPM_BUILD_ROOT/etc/codepages/src
210 done
211 for i in 437 737 850 852 861 866 932 936 949 950 ISO8859-1 ISO8859-2 ISO8859-5 ISO8859-7 KOI8-R
213 install -m644 source/codepages/CP$i.TXT $RPM_BUILD_ROOT/etc/codepages/src
214 done
216 # Install the nsswitch library extension file
217 install -m755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/lib
218 # Make link for wins resolver
219 ( cd $RPM_BUILD_ROOT/lib; ln -s libnss_wins.so libnss_wins.so.2; )
221 # Install SWAT helper files
222 for i in swat/help/*.html docs/htmldocs/*.html
224 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/help
225 done
226 for i in swat/images/*.gif
228 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/images
229 done
230 for i in swat/include/*.html
232 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/include
233 done# This is the O'Reily Samba Book - on-line
234 for i in docs/htmldocs/using_samba/*.html
236 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/using_samba
237 done
238 for i in docs/htmldocs/using_samba/figs/*.gif
240 install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/using_samba/figs
241 done
242 for i in docs/htmldocs/using_samba/gifs/*.gif
244 install -m644 $i $RPM_BUILD_ROOT%{prefix/share/swat/using_samba/gifs
245 done
247 # Install the miscellany
248 install -m644 swat/README $RPM_BUILD_ROOT%{prefix}/share/swat
249 install -m644 docs/manpages/smb.conf.5 $RPM_BUILD_ROOT%{prefix}/man/man5
250 install -m644 docs/manpages/lmhosts.5 $RPM_BUILD_ROOT%{prefix}/man/man5
251 install -m644 docs/manpages/smbpasswd.5 $RPM_BUILD_ROOT%{prefix}/man/man5
252 install -m644 docs/manpages/samba.7 $RPM_BUILD_ROOT%{prefix}/man/man7
253 install -m644 docs/manpages/smbd.8 $RPM_BUILD_ROOT%{prefix}/man/man8
254 install -m644 docs/manpages/nmbd.8 $RPM_BUILD_ROOT%{prefix}/man/man8
255 install -m644 docs/manpages/swat.8 $RPM_BUILD_ROOT%{prefix}/man/man8
256 install -m644 docs/manpages/smbmnt.8 $RPM_BUILD_ROOT%{prefix}/man/man8
257 install -m644 docs/manpages/smbmount.8 $RPM_BUILD_ROOT%{prefix}/man/man8
258 install -m644 docs/manpages/smbpasswd.8 $RPM_BUILD_ROOT%{prefix}/man/man8
259 install -m644 docs/manpages/smbspool.8 $RPM_BUILD_ROOT%{prefix}/man/man8
260 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/smb.conf
261 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/smbusers
262 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT%{prefix}/bin
263 install -m755 packaging/RedHat/findsmb $RPM_BUILD_ROOT%{prefix}/bin
264 install -m755 packaging/RedHat/smbadduser $RPM_BUILD_ROOT%{prefix}/bin
265 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
266 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT%{prefix}/sbin/samba
267 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
268 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
269 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/lmhosts
271 %clean
272 rm -rf $RPM_BUILD_ROOT
274 %post
275 /sbin/chkconfig --add smb
277 # Build codepage load files
278 for i in 437 737 850 852 861 866 932 936 949 950 1251
280 %{prefix}/bin/make_smbcodepage c $i /etc/codepages/src/codepage_def.$i /etc/codepages/codepage.$i
281 done
282 for i in 437 737 850 852 861 866 932 936 949 950 ISO8859-1 ISO8859-2 ISO8859-5 ISO8859-7 KOI8-R
284 %{prefix/bin/make_unicodemap $i /etc/codepages/src/CP$i.TXT /etc/codepages/unicode_map.$i
285 done
287 # Add swat entry to /etc/services if not already there
288 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
289         echo 'swat              901/tcp                         # Add swat service used via inetd' >> /etc/services
292 # Add swat entry to /etc/inetd.conf if needed
293 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
294         echo 'swat      stream  tcp     nowait.400      root    %{prefix}/sbin/swat swat' >> /etc/inetd.conf
295 killall -1 inetd || :
298 %preun
299 if [ $1 = 0 ] ; then
300     /sbin/chkconfig --del smb
302     for n in /etc/codepages/*; do
303         if [ $n != /etc/codepages/src ]; then
304             rm -rf $n
305         fi
306     done
307     # We want to remove the browse.dat and wins.dat files so they can not interfer with a new version of samba!
308     if [ -e /var/lock/samba/browse.dat ]; then
309             rm -f /var/lock/samba/browse.dat
310     fi
311     if [ -e /var/lock/samba/wins.dat ]; then
312             rm -f /var/lock/samba/wins.dat
313     fi
316 %postun
317 # Only delete remnants of samba if this is the final deletion.
318 if [ $1 = 0 ] ; then
319     if [ -x /etc/pam.d/samba ]; then
320       rm -f /etc/pam.d/samba
321     fi
322     if [ -e /var/log/samba ]; then
323       rm -rf /var/log/samba
324     fi
325     if [ -e /var/lock/samba ]; then
326       rm -rf /var/lock/samba
327     fi
329     # Remove swat entries from /etc/inetd.conf and /etc/services
330     cd /etc
331     tmpfile=/etc/tmp.$$
332     sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
333     mv $tmpfile inetd.conf
334     sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
335     mv $tmpfile services
338 if [ -f /sbin/mount.smb ]; then
339         rm -f /sbin/mount.smb
341 if [ -f /sbin/mount.smbfs ]; then
342         rm -f /sbin/mount.smbfs
345 %triggerpostun -- samba < samba-2.0.0
346 if [ $0 != 0 ]; then
347     /sbin/chkconfig --add smb
351 %files
352 %doc README COPYING Manifest Read-Manifest-Now
353 %doc WHATSNEW.txt Roadmap
354 %doc docs
355 %doc swat/README
356 %doc examples
357 %attr(-,root,root) %{prefix}/sbin/smbd
358 %attr(-,root,root) %{prefix}/sbin/nmbd
359 %attr(-,root,root) %{prefix}/sbin/swat
360 %attr(-,root,root) %{prefix}/sbin/smbmnt
361 %attr(-,root,root) %{prefix}/sbin/smbmount
362 %attr(-,root,root) %{prefix}/sbin/smbumount
363 %attr(-,root,root) /sbin/mount.smbfs
364 %attr(-,root,root) /sbin/mount.smb
365 %attr(0750,root,root) %{prefix}/sbin/samba
366 %attr(-,root,root) %{prefix}/bin/addtosmbpass
367 %attr(-,root,root) %{prefix}/bin/mksmbpasswd.sh
368 %attr(-,root,root) %{prefix}/bin/smbclient
369 %attr(-,root,root) %{prefix}/bin/smbspool
370 %attr(-,root,root) %{prefix}/bin/rpcclient
371 %attr(-,root,root) %{prefix}/bin/testparm
372 %attr(-,root,root) %{prefix}/bin/testprns
373 %attr(-,root,root) %{prefix}/bin/findsmb
374 %attr(-,root,root) %{prefix}/bin/smbstatus
375 %attr(-,root,root) %{prefix}/bin/nmblookup
376 %attr(-,root,root) %{prefix}/bin/make_smbcodepage
377 %attr(-,root,root) %{prefix}/bin/make_unicodemap
378 %attr(-,root,root) %{prefix}/bin/make_printerdef
379 %attr(-,root,root) %{prefix}/bin/smbpasswd
380 %attr(-,root,root) %{prefix}/bin/smbtar
381 %attr(-,root,root) %{prefix}/bin/smbprint
382 %attr(-,root,root) %{prefix}/bin/smbadduser
383 %attr(755,root,root) /lib/libnss_wins.s*
384 %attr(-,root,root) %{prefix}/share/swat/help/*
385 %attr(-,root,root) %{prefix}/share/swat/images/*
386 %attr(-,root,root) %{prefix}/share/swat/include/header.html
387 %attr(-,root,root) %{prefix}/share/swat/include/footer.html
388 %attr(-,root,root) %{prefix}/share/swat/using_samba/*
389 %attr(-,root,root) %config(noreplace) /etc/lmhosts
390 %attr(-,root,root) %config(noreplace) /etc/smb.conf
391 %attr(-,root,root) %config(noreplace) /etc/smbusers
392 %attr(-,root,root) /etc/rc.d/init.d/smb
393 %attr(-,root,root) /etc/logrotate.d/samba
394 %attr(-,root,root) /etc/pam.d/samba
395 %attr(-,root,root) /etc/codepages/src/codepage_def.*
396 %attr(-,root,root) %{prefix}/man/man1/make_smbcodepage.1
397 %attr(-,root,root) %{prefix}/man/man1/make_unicodemap.1
398 %attr(-,root,root) %{prefix}/man/man1/nmblookup.1
399 %attr(-,root,root) %{prefix}/man/man1/smbclient.1
400 %attr(-,root,root) %{prefix}/man/man1/smbrun.1
401 %attr(-,root,root) %{prefix}/man/man1/smbstatus.1
402 %attr(-,root,root) %{prefix}/man/man1/smbtar.1
403 %attr(-,root,root) %{prefix}/man/man1/testparm.1
404 %attr(-,root,root) %{prefix}/man/man1/testprns.1
405 %attr(-,root,root) %{prefix}/man/man5/lmhosts.5
406 %attr(-,root,root) %{prefix}/man/man5/smb.conf.5
407 %attr(-,root,root) %{prefix}/man/man5/smbpasswd.5
408 %attr(-,root,root) %{prefix}/man/man7/samba.7
409 %attr(-,root,root) %{prefix}/man/man8/nmbd.8
410 %attr(-,root,root) %{prefix}/man/man8/smbd.8
411 %attr(-,root,root) %{prefix}/man/man8/smbmnt.8
412 %attr(-,root,root) %{prefix}/man/man8/smbmount.8
413 %attr(-,root,root) %{prefix}/man/man8/smbpasswd.8
414 %attr(-,root,root) %{prefix}/man/man8/smbspool.8
415 %attr(-,root,root) %{prefix}/man/man8/swat.8
416 %attr(-,root,nobody) %dir /home/samba
417 %attr(-,root,root) %dir /etc/codepages
418 %attr(-,root,root) %dir /etc/codepages/src
419 %attr(-,root,root) %dir /var/lock/samba
420 %attr(-,root,root) %dir /var/log/samba
421 %attr(1777,root,root) %dir /var/spool/samba