Added the NT_Security file to the packaging for RedHat.
[Samba/gbeck.git] / packaging / RedHat / samba2.spec.tmpl
blob05998ad6746f6f559260e56d99f25f095f4016c9
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
12 Prereq: chkconfig fileutils
13 BuildRoot: /var/tmp/samba
15 %description
16 Samba provides an SMB server which can be used to provide
17 network services to SMB (sometimes called "Lan Manager")
18 clients, including various versions of MS Windows, OS/2,
19 and other Linux machines. Samba also provides some SMB
20 clients, which complement the built-in SMB filesystem
21 in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
22 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
23 protocol.
25 Samba-2 features an almost working NT Domain Control
26 capability and includes the new SWAT (Samba Web Administration
27 Tool) that allows samba's smb.conf file to be remotely managed
28 using your favourite web browser. For the time being this is
29 being enabled on TCP port 901 via inetd.
31 Please refer to the WHATSNEW.txt document for fixup information.
32 This binary release includes encrypted password support.
33 Please read the smb.conf file and ENCRYPTION.txt in the
34 docs directory for implementation details.
36 NOTE: Red Hat Linux 5.X Uses PAM which has integrated support
37 for Shadow passwords. Do NOT recompile with the SHADOW_PWD option
38 enabled. Red Hat Linux has built in support for quotas in PAM.
40 %changelog
41 * Sun Apr 25 1999 John H Terpstra <jht@samba.org>
42  - added smbsh.1 man page
44 * Fri Mar 26 1999 Andrew Tridgell <tridge@samba.org>
45  - added --with-pam as pam is no longer used by default
47 * Sat Jan 27 1999 Jeremy Allison <jra@samba.org>
48  - Removed smbrun binary and tidied up some loose ends
50 * Sun Oct 25 1998 John H Terpstra <jht@samba.org>
51  - Added parameters to /config to ensure smb.conf, lmhosts, 
52         and smbusers never gets over-written.
54 * Sat Oct 24 1998 John H Terpstra <jht@samba.org>
55  - removed README.smbsh file from docs area
57 * Mon Oct 05 1998 John H Terpstra <jht@samba.org>
58  - Added rpcclient to binaries list
59  - Added smbwrapper stuff
61 * Fri Aug 21 1998 John H Terpstra <jht@samba.org>
62  - Updated for Samba version 2.0 building
64 * Tue Jul 07 1998 Erik Troan <ewt@redhat.com>
65   - updated postun triggerscript to check $0
66   - clear /etc/codepages from %preun instead of %postun
68 * Sat Jul 04 1998 John H Terpstra <jht@samba.org>
69  - fixed codepage preservation during update via -Uvh
71 * Mon Jun 08 1998 Erik Troan <ewt@redhat.com>
72   - made the %postun script a tad less agressive; no reason to remove
73     the logs or lock file 
74   - the %postun and %preun should only exectute if this is the final
75     removal
76   - migrated %triggerpostun from Red Hat's samba package to work around
77     packaging problems in some Red Hat samba releases
79 * Sun Apr 26 1998 John H Terpstra <jht@samba.org>
80  - Tidy up for early alpha releases
81  - added findsmb from SGI packaging
83 * Thu Apr 09 1998 John H Terpstra <jht@samba.org>
84  - Updated spec file
85  - Included new codepage.936
87 * Sat Mar 20 1998 John H Terpstra <jht@samba.org>
88  - Added swat facility
90 * Sat Jan 24 1998 John H Terpstra <jht@samba.org>
91  - Many optimisations (some suggested by Manoj Kasichainula <manojk@io.com>
92   - Use of chkconfig in place of individual symlinks to /etc/rc.d/init/smb
93   - Compounded make line
94   - Updated smb.init restart mechanism
95   - Use compound mkdir -p line instead of individual calls to mkdir
96   - Fixed smb.conf file path for log files
97   - Fixed smb.conf file path for incoming smb print spool directory
98   - Added a number of options to smb.conf file
99   - Added smbadduser command (missed from all previous RPMs) - Doooh!
100   - Added smbuser file and smb.conf file updates for username map
102 %prep
103 %setup
104 %patch -p1
105 %patch1 -p1
107 %build
108 cd source
109 ./configure --prefix=/usr --libdir=/etc --with-lockdir=/var/lock/samba --with-privatedir=/etc --with-swatdir=/usr/share/swat --with-smbwrapper --with-automount --with-quotas --with-pam
110 make all smbwrapper
112 %install
113 rm -rf $RPM_BUILD_ROOT
114 mkdir -p $RPM_BUILD_ROOT
115 mkdir -p $RPM_BUILD_ROOT/etc/codepages/src
116 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d}
117 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/{init.d,rc0.d,rc1.d,rc2.d,rc3.d,rc5.d,rc6.d}
118 mkdir -p $RPM_BUILD_ROOT/home/samba
119 mkdir -p $RPM_BUILD_ROOT/usr/{bin,sbin}
120 mkdir -p $RPM_BUILD_ROOT/usr/share/swat/{images,help,include}
121 mkdir -p $RPM_BUILD_ROOT/usr/man/{man1,man5,man7,man8}
122 mkdir -p $RPM_BUILD_ROOT/var/lock/samba
123 mkdir -p $RPM_BUILD_ROOT/var/log/samba
124 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
126 # Install standard binary files
127 for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \
128       make_smbcodepage make_printerdef rpcclient smbsh smbwrapper.so
130 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/bin
131 done
132 for i in addtosmbpass mksmbpasswd.sh smbtar 
134 install -m755 source/script/$i $RPM_BUILD_ROOT/usr/bin
135 done
137 # Install secure binary files
138 for i in smbd nmbd swat
140 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/sbin
141 done
143 # Install level 1 man pages
144 for i in smbclient.1 smbrun.1 smbstatus.1 smbtar.1 testparm.1 testprns.1 make_smbcodepage.1 nmblookup.1 smbsh.1
146 install -m644 docs/manpages/$i $RPM_BUILD_ROOT/usr/man/man1
147 done
149 # Install codepage source files
150 for i in 437 737 850 852 861 866 932 936 949 950
152 install -m644 source/codepages/codepage_def.$i $RPM_BUILD_ROOT/etc/codepages/src
153 done
155 # Install SWAT helper files
156 for i in swat/help/*.html docs/htmldocs/*.html
158 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/help
159 done
160 for i in swat/images/*.gif
162 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/images
163 done
164 for i in swat/include/*.html
166 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/include
167 done
169 # Install the miscellany
170 install -m644 swat/README $RPM_BUILD_ROOT/usr/share/swat
171 install -m644 docs/manpages/smb.conf.5 $RPM_BUILD_ROOT/usr/man/man5
172 install -m644 docs/manpages/lmhosts.5 $RPM_BUILD_ROOT/usr/man/man5
173 install -m644 docs/manpages/smbpasswd.5 $RPM_BUILD_ROOT/usr/man/man5
174 install -m644 docs/manpages/samba.7 $RPM_BUILD_ROOT/usr/man/man7
175 install -m644 docs/manpages/smbd.8 $RPM_BUILD_ROOT/usr/man/man8
176 install -m644 docs/manpages/nmbd.8 $RPM_BUILD_ROOT/usr/man/man8
177 install -m644 docs/manpages/swat.8 $RPM_BUILD_ROOT/usr/man/man8
178 install -m644 docs/manpages/smbpasswd.8 $RPM_BUILD_ROOT/usr/man/man8
179 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/smb.conf
180 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/smbusers
181 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT/usr/bin
182 install -m755 packaging/RedHat/findsmb $RPM_BUILD_ROOT/usr/bin
183 install -m755 packaging/RedHat/smbadduser $RPM_BUILD_ROOT/usr/bin
184 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
185 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/usr/sbin/samba
186 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
187 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
188 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/lmhosts
190 %clean
191 rm -rf $RPM_BUILD_ROOT
193 %post
194 /sbin/chkconfig --add smb
196 # Build codepage load files
197 for i in 437 737 850 852 861 866 932 936 949 950
199 /usr/bin/make_smbcodepage c $i /etc/codepages/src/codepage_def.$i /etc/codepages/codepage.$i
200 done
202 # Add swat entry to /etc/services if not already there
203 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
204         echo 'swat              901/tcp                         # Add swat service used via inetd' >> /etc/services
207 # Add swat entry to /etc/inetd.conf if needed
208 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
209         echo 'swat      stream  tcp     nowait.400      root    /usr/sbin/swat swat' >> /etc/inetd.conf
210 killall -1 inetd || :
213 %preun
214 if [ $1 = 0 ] ; then
215     /sbin/chkconfig --del smb
217     for n in /etc/codepages/*; do
218         if [ $n != /etc/codepages/src ]; then
219             rm -rf $n
220         fi
221     done
222     # We want to remove the browse.dat and wins.dat files so they can not interfer with a new version of samba!
223     if [ -e /var/lock/samba/browse.dat ]; then
224             rm -f /var/lock/samba/browse.dat
225     fi
226     if [ -e /var/lock/samba/wins.dat ]; then
227             rm -f /var/lock/samba/wins.dat
228     fi
231 %postun
232 # Only delete remnants of samba if this is the final deletion.
233 if [ $1 = 0 ] ; then
234     if [ -x /etc/pam.d/samba ]; then
235       rm -f /etc/pam.d/samba
236     fi
237     if [ -e /var/log/samba ]; then
238       rm -rf /var/log/samba
239     fi
240     if [ -e /var/lock/samba ]; then
241       rm -rf /var/lock/samba
242     fi
244     # Remove swat entries from /etc/inetd.conf and /etc/services
245     cd /etc
246     tmpfile=/etc/tmp.$$
247     sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
248     mv $tmpfile inetd.conf
249     sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
250     mv $tmpfile services
253 %triggerpostun -- samba < samba-2.0.0
254 if [ $0 != 0 ]; then
255     /sbin/chkconfig --add smb
259 %files
260 %doc README COPYING Manifest Read-Manifest-Now
261 %doc WHATSNEW.txt Roadmap
262 %doc docs
263 %doc swat/README
264 %doc examples
265 %attr(-,root,root) /usr/sbin/smbd
266 %attr(-,root,root) /usr/sbin/nmbd
267 %attr(-,root,root) /usr/sbin/swat
268 %attr(0750,root,root) /usr/sbin/samba
269 %attr(-,root,root) /usr/bin/addtosmbpass
270 %attr(-,root,root) /usr/bin/mksmbpasswd.sh
271 %attr(-,root,root) /usr/bin/smbclient
272 %attr(-,root,root) /usr/bin/rpcclient
273 %attr(-,root,root) /usr/bin/testparm
274 %attr(-,root,root) /usr/bin/testprns
275 %attr(-,root,root) /usr/bin/findsmb
276 %attr(-,root,root) /usr/bin/smbstatus
277 %attr(-,root,root) /usr/bin/nmblookup
278 %attr(-,root,root) /usr/bin/make_smbcodepage
279 %attr(-,root,root) /usr/bin/make_printerdef
280 %attr(-,root,root) /usr/bin/smbpasswd
281 %attr(-,root,root) /usr/bin/smbtar
282 %attr(-,root,root) /usr/bin/smbprint
283 %attr(-,root,root) /usr/bin/smbadduser
284 %attr(0755,root,root) /usr/bin/smbsh
285 %attr(0755,root,root) /usr/bin/smbwrapper.so
286 %attr(-,root,root) /usr/share/swat/help/welcome.html
287 %attr(-,root,root) /usr/share/swat/help/DOMAIN_MEMBER.html
288 %attr(-,root,root) /usr/share/swat/help/NT_Security.html
289 %attr(-,root,root) /usr/share/swat/help/lmhosts.5.html
290 %attr(-,root,root) /usr/share/swat/help/make_smbcodepage.1.html
291 %attr(-,root,root) /usr/share/swat/help/nmbd.8.html
292 %attr(-,root,root) /usr/share/swat/help/nmblookup.1.html
293 %attr(-,root,root) /usr/share/swat/help/samba.7.html
294 %attr(-,root,root) /usr/share/swat/help/smb.conf.5.html
295 %attr(-,root,root) /usr/share/swat/help/smbclient.1.html
296 %attr(-,root,root) /usr/share/swat/help/smbsh.1.html
297 %attr(-,root,root) /usr/share/swat/help/smbd.8.html
298 %attr(-,root,root) /usr/share/swat/help/smbpasswd.5.html
299 %attr(-,root,root) /usr/share/swat/help/smbpasswd.8.html
300 %attr(-,root,root) /usr/share/swat/help/smbrun.1.html
301 %attr(-,root,root) /usr/share/swat/help/smbstatus.1.html
302 %attr(-,root,root) /usr/share/swat/help/smbtar.1.html
303 %attr(-,root,root) /usr/share/swat/help/swat.8.html
304 %attr(-,root,root) /usr/share/swat/help/testparm.1.html
305 %attr(-,root,root) /usr/share/swat/help/testprns.1.html
306 %attr(-,root,root) /usr/share/swat/images/globals.gif
307 %attr(-,root,root) /usr/share/swat/images/home.gif
308 %attr(-,root,root) /usr/share/swat/images/passwd.gif
309 %attr(-,root,root) /usr/share/swat/images/printers.gif
310 %attr(-,root,root) /usr/share/swat/images/shares.gif
311 %attr(-,root,root) /usr/share/swat/images/samba.gif
312 %attr(-,root,root) /usr/share/swat/images/status.gif
313 %attr(-,root,root) /usr/share/swat/images/viewconfig.gif
314 %attr(-,root,root) /usr/share/swat/include/header.html
315 %attr(-,root,root) /usr/share/swat/include/footer.html
316 %attr(-,root,root) %config(noreplace) /etc/lmhosts
317 %attr(-,root,root) %config(noreplace) /etc/smb.conf
318 %attr(-,root,root) %config(noreplace) /etc/smbusers
319 %attr(-,root,root) /etc/rc.d/init.d/smb
320 %attr(-,root,root) /etc/logrotate.d/samba
321 %attr(-,root,root) /etc/pam.d/samba
322 %attr(-,root,root) /etc/codepages/src/codepage_def.437
323 %attr(-,root,root) /etc/codepages/src/codepage_def.737
324 %attr(-,root,root) /etc/codepages/src/codepage_def.850
325 %attr(-,root,root) /etc/codepages/src/codepage_def.852
326 %attr(-,root,root) /etc/codepages/src/codepage_def.861
327 %attr(-,root,root) /etc/codepages/src/codepage_def.866
328 %attr(-,root,root) /etc/codepages/src/codepage_def.932
329 %attr(-,root,root) /etc/codepages/src/codepage_def.936
330 %attr(-,root,root) /etc/codepages/src/codepage_def.949
331 %attr(-,root,root) /etc/codepages/src/codepage_def.950
332 %attr(-,root,root) /usr/man/man1/smbstatus.1
333 %attr(-,root,root) /usr/man/man1/smbclient.1
334 %attr(-,root,root) /usr/man/man1/make_smbcodepage.1
335 %attr(-,root,root) /usr/man/man1/smbrun.1
336 %attr(-,root,root) /usr/man/man1/smbtar.1
337 %attr(-,root,root) /usr/man/man1/smbsh.1
338 %attr(-,root,root) /usr/man/man1/testparm.1
339 %attr(-,root,root) /usr/man/man1/testprns.1
340 %attr(-,root,root) /usr/man/man1/nmblookup.1
341 %attr(-,root,root) /usr/man/man5/smb.conf.5
342 %attr(-,root,root) /usr/man/man5/lmhosts.5
343 %attr(-,root,root) /usr/man/man5/smbpasswd.5
344 %attr(-,root,root) /usr/man/man7/samba.7
345 %attr(-,root,root) /usr/man/man8/smbd.8
346 %attr(-,root,root) /usr/man/man8/nmbd.8
347 %attr(-,root,root) /usr/man/man8/smbpasswd.8
348 %attr(-,root,root) /usr/man/man8/swat.8
349 %attr(-,root,nobody) %dir /home/samba
350 %attr(-,root,root) %dir /etc/codepages
351 %attr(-,root,root) %dir /etc/codepages/src
352 %attr(-,root,root) %dir /var/lock/samba
353 %attr(-,root,root) %dir /var/log/samba
354 %attr(1777,root,root) %dir /var/spool/samba