3b210c9d3210e52c1eb403dcd1fc0b11035b80bf
[kai/samba.git] / packaging / PHT / TurboLinux / samba2.spec.tmpl
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.anu.edu.au/pub/samba/samba-PVERSION.tar.gz
8 Patch: makefile-path.patch
9 Patch1: smbw.patch
10 Packager: John H Terpstra [Samba-Team] <jht@samba.anu.edu.au>
11 Requires: pam >= 0.64
12 Prereq: chkconfig fileutils
13 BuildRoot: /var/tmp/samba
14
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.
24
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.
30
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.
35
36 NOTE: TurboLinux 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.
39
40 %changelog
41 * Sun Oct 25 1998 John H Terpstra <jht@samba.anu.edu.au>
42  - Added modifier to /config specifier so that smb.conf,
43         lmhosts and smbusers never get lost
44
45 * Sat Oct 24 1998 John H Terpstra <jht@samba.anu.edu.au>
46  - removed README.smbsh file from docs area
47
48 * Mon Oct 05 1998 John H Terpstra <jht@samba.anu.edu.au>
49  - Added rpcclient to binaries list
50  - Added smbwrapper stuff
51
52 * Fri Aug 21 1998 John H Terpstra <jht@samba.anu.edu.au>
53  - Updated for Samba version 2.0 building
54
55 * Tue Jul 07 1998 Erik Troan <ewt@redhat.com>
56   - updated postun triggerscript to check $0
57   - clear /etc/codepages from %preun instead of %postun
58
59 * Sat Jul 04 1998 John H Terpstra <jht@samba.anu.edu.au>
60  - fixed codepage preservation during update via -Uvh
61
62 * Mon Jun 08 1998 Erik Troan <ewt@redhat.com>
63   - made the %postun script a tad less agressive; no reason to remove
64     the logs or lock file 
65   - the %postun and %preun should only exectute if this is the final
66     removal
67   - migrated %triggerpostun from Red Hat's samba package to work around
68     packaging problems in some Red Hat samba releases
69
70 * Sun Apr 26 1998 John H Terpstra <jht@samba.anu.edu.au>
71  - Tidy up for early alpha releases
72  - added findsmb from SGI packaging
73
74 * Thu Apr 09 1998 John H Terpstra <jht@samba.anu.edu.au>
75  - Updated spec file
76  - Included new codepage.936
77
78 * Sat Mar 20 1998 John H Terpstra <jht@samba.anu.edu/au>
79  - Added swat facility
80
81 * Sat Jan 24 1998 John H Terpstra <jht@samba.anu.edu.au>
82  - Many optimisations (some suggested by Manoj Kasichainula <manojk@io.com>
83   - Use of chkconfig in place of individual symlinks to /etc/rc.d/init/smb
84   - Compounded make line
85   - Updated smb.init restart mechanism
86   - Use compound mkdir -p line instead of individual calls to mkdir
87   - Fixed smb.conf file path for log files
88   - Fixed smb.conf file path for incoming smb print spool directory
89   - Added a number of options to smb.conf file
90   - Added smbadduser command (missed from all previous RPMs) - Doooh!
91   - Added smbuser file and smb.conf file updates for username map
92
93 %prep
94 %setup
95 %patch -p1
96 %patch1 -p1
97
98 %build
99 cd source
100 ./configure
101 make all smbwrapper
102
103 %install
104 rm -rf $RPM_BUILD_ROOT
105 mkdir -p $RPM_BUILD_ROOT
106 mkdir -p $RPM_BUILD_ROOT/etc/codepages/src
107 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d}
108 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/{init.d,rc0.d,rc1.d,rc2.d,rc3.d,rc5.d,rc6.d}
109 mkdir -p $RPM_BUILD_ROOT/home/samba
110 mkdir -p $RPM_BUILD_ROOT/usr/{bin,sbin}
111 mkdir -p $RPM_BUILD_ROOT/usr/share/swat/{images,help,include}
112 mkdir -p $RPM_BUILD_ROOT/usr/man/{man1,man5,man7,man8}
113 mkdir -p $RPM_BUILD_ROOT/var/lock/samba
114 mkdir -p $RPM_BUILD_ROOT/var/log/samba
115 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
116
117 # Install standard binary files
118 for i in nmblookup smbclient smbpasswd smbrun smbstatus testparm testprns \
119       make_smbcodepage make_printerdef rpcclient smbsh smbwrapper.so
120 do
121 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/bin
122 done
123 for i in addtosmbpass mksmbpasswd.sh smbtar 
124 do
125 install -m755 source/script/$i $RPM_BUILD_ROOT/usr/bin
126 done
127
128 # Install secure binary files
129 for i in smbd nmbd swat
130 do
131 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/sbin
132 done
133
134 # Install level 1 man pages
135 for i in smbclient.1 smbrun.1 smbstatus.1 smbtar.1 testparm.1 testprns.1 make_smbcodepage.1
136 do
137 install -m644 docs/$i $RPM_BUILD_ROOT/usr/man/man1
138 done
139
140 # Install codepage source files
141 for i in 437 737 850 852 861 866 932 936 949 950
142 do
143 install -m644 source/codepages/codepage_def.$i $RPM_BUILD_ROOT/etc/codepages/src
144 done
145
146 # Install SWAT helper files
147 for i in swat/help/*.html
148 do
149 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/help
150 done
151 for i in swat/images/*.{jpg,gif}
152 do
153 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/images
154 done
155 for i in swat/include/*.html
156 do
157 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/include
158 done
159
160 # Install the miscellany
161 install -m644 swat/README $RPM_BUILD_ROOT/usr/share/swat
162 install -m644 docs/smb.conf.5 $RPM_BUILD_ROOT/usr/man/man5
163 install -m644 docs/samba.7 $RPM_BUILD_ROOT/usr/man/man7
164 install -m644 docs/smbd.8 $RPM_BUILD_ROOT/usr/man/man8
165 install -m644 docs/nmbd.8 $RPM_BUILD_ROOT/usr/man/man8
166 install -m644 docs/smbpasswd.8 $RPM_BUILD_ROOT/usr/man/man8
167 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/smb.conf
168 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/smbusers
169 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT/usr/bin
170 install -m755 packaging/RedHat/findsmb $RPM_BUILD_ROOT/usr/bin
171 install -m755 packaging/RedHat/smbadduser $RPM_BUILD_ROOT/usr/bin
172 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
173 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/usr/sbin/samba
174 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
175 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
176 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/lmhosts
177
178 %clean
179 rm -rf $RPM_BUILD_ROOT
180
181 %post
182 /sbin/chkconfig --add smb
183
184 # Build codepage load files
185 for i in 437 737 850 852 861 866 932 936 949 950
186 do
187 /usr/bin/make_smbcodepage c $i /etc/codepages/src/codepage_def.$i /etc/codepages/codepage.$i
188 done
189
190 # Add swat entry to /etc/services if not already there
191 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
192         echo 'swat              901/tcp                         # Add swat service used via inetd' >> /etc/services
193 fi
194
195 # Add swat entry to /etc/inetd.conf if needed
196 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
197         echo 'swat      stream  tcp     nowait.400      root    /usr/sbin/swat swat' >> /etc/inetd.conf
198 killall -1 inetd || :
199 fi
200
201 %preun
202 if [ $1 = 0 ] ; then
203     /sbin/chkconfig --del smb
204
205     for n in /etc/codepages/*; do
206         if [ $n != /etc/codepages/src ]; then
207             rm -rf $n
208         fi
209     done
210     # We want to remove the browse.dat and wins.dat files so they can not interfer with a new version of samba!
211     if [ -e /var/lock/samba/browse.dat ]; then
212             rm -f /var/lock/samba/browse.dat
213     fi
214     if [ -e /var/lock/samba/wins.dat ]; then
215             rm -f /var/lock/samba/wins.dat
216     fi
217 fi
218
219 %postun
220 # Only delete remnants of samba if this is the final deletion.
221 if [ $1 != 0 ] ; then
222     exit 0
223
224     if [ -x /etc/pam.d/samba ]; then
225       rm -f /etc/pam.d/samba
226     fi
227     if [ -e /var/log/samba ]; then
228       rm -rf /var/log/samba
229     fi
230     if [ -e /var/lock/samba ]; then
231       rm -rf /var/lock/samba
232     fi
233
234     # Remove swat entries from /etc/inetd.conf and /etc/services
235     cd /etc
236     tmpfile=/etc/tmp.$$
237     sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
238     mv $tmpfile inetd.conf
239     sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
240     mv $tmpfile services
241 fi
242
243 %triggerpostun -- samba < samba-2.0.0
244 if [ $0 != 0 ]; then
245     /sbin/chkconfig --add smb
246 fi
247
248
249 %files
250 %doc README COPYING Manifest Read-Manifest-Now
251 %doc WHATSNEW.txt Roadmap
252 %doc docs
253 %doc swat/README
254 %doc examples
255 %attr(-,root,root) /usr/sbin/smbd
256 %attr(-,root,root) /usr/sbin/nmbd
257 %attr(-,root,root) /usr/sbin/swat
258 %attr(0755,root,root) /usr/sbin/samba
259 %attr(-,root,root) /usr/bin/addtosmbpass
260 %attr(-,root,root) /usr/bin/mksmbpasswd.sh
261 %attr(-,root,root) /usr/bin/smbclient
262 %attr(-,root,root) /usr/bin/rpcclient
263 %attr(-,root,root) /usr/bin/testparm
264 %attr(-,root,root) /usr/bin/testprns
265 %attr(-,root,root) /usr/bin/smbrun
266 %attr(-,root,root) /usr/bin/findsmb
267 %attr(-,root,root) /usr/bin/smbstatus
268 %attr(-,root,root) /usr/bin/nmblookup
269 %attr(-,root,root) /usr/bin/make_smbcodepage
270 %attr(-,root,root) /usr/bin/make_printerdef
271 %attr(-,root,root) /usr/bin/smbpasswd
272 %attr(-,root,root) /usr/bin/smbtar
273 %attr(-,root,root) /usr/bin/smbprint
274 %attr(-,root,root) /usr/bin/smbadduser
275 %attr(0755,root,root) /usr/bin/smbsh
276 %attr(0755,root,root) /usr/bin/smbwrapper.so
277 %attr(-,root,root) /usr/share/swat/help/parameters.html
278 %attr(-,root,root) /usr/share/swat/help/welcome.html
279 %attr(-,root,root) /usr/share/swat/images/background.jpg
280 %attr(-,root,root) /usr/share/swat/images/background.gif
281 %attr(-,root,root) /usr/share/swat/images/globals.gif
282 %attr(-,root,root) /usr/share/swat/images/home.gif
283 %attr(-,root,root) /usr/share/swat/images/printers.gif
284 %attr(-,root,root) /usr/share/swat/images/shares.gif
285 %attr(-,root,root) /usr/share/swat/images/samba.gif
286 %attr(-,root,root) /usr/share/swat/images/status.gif
287 %attr(-,root,root) /usr/share/swat/images/viewconfig.gif
288 %attr(-,root,root) /usr/share/swat/include/header.html
289 %attr(-,root,root) /usr/share/swat/include/footer.html
290 %attr(-,root,root) %config(noreplace) /etc/lmhosts
291 %attr(-,root,root) %config(noreplace) /etc/smb.conf
292 %attr(-,root,root) %config(noreplace) /etc/smbusers
293 %attr(-,root,root) /etc/rc.d/init.d/smb
294 %attr(-,root,root) /etc/logrotate.d/samba
295 %attr(-,root,root) /etc/pam.d/samba
296 %attr(-,root,root) /etc/codepages/src/codepage_def.437
297 %attr(-,root,root) /etc/codepages/src/codepage_def.737
298 %attr(-,root,root) /etc/codepages/src/codepage_def.850
299 %attr(-,root,root) /etc/codepages/src/codepage_def.852
300 %attr(-,root,root) /etc/codepages/src/codepage_def.861
301 %attr(-,root,root) /etc/codepages/src/codepage_def.866
302 %attr(-,root,root) /etc/codepages/src/codepage_def.932
303 %attr(-,root,root) /etc/codepages/src/codepage_def.936
304 %attr(-,root,root) /etc/codepages/src/codepage_def.949
305 %attr(-,root,root) /etc/codepages/src/codepage_def.950
306 %attr(-,root,root) /usr/man/man1/smbstatus.1
307 %attr(-,root,root) /usr/man/man1/smbclient.1
308 %attr(-,root,root) /usr/man/man1/make_smbcodepage.1
309 %attr(-,root,root) /usr/man/man1/smbrun.1
310 %attr(-,root,root) /usr/man/man1/smbtar.1
311 %attr(-,root,root) /usr/man/man1/testparm.1
312 %attr(-,root,root) /usr/man/man1/testprns.1
313 %attr(-,root,root) /usr/man/man5/smb.conf.5
314 %attr(-,root,root) /usr/man/man7/samba.7
315 %attr(-,root,root) /usr/man/man8/smbd.8
316 %attr(-,root,root) /usr/man/man8/nmbd.8
317 %attr(-,root,root) /usr/man/man8/smbpasswd.8
318 %attr(-,root,nobody) %dir /home/samba
319 %attr(-,root,root) %dir /etc/codepages
320 %attr(-,root,root) %dir /etc/codepages/src
321 %attr(-,root,root) %dir /var/lock/samba
322 %attr(-,root,root) %dir /var/log/samba
323 %attr(777,root,root) %dir /var/spool/samba