ab4e48649b93c3412661ab111a724920a0d6af88
[kai/samba.git] / packaging / Caldera / OpenLinux / samba3.spec.tmpl
1 %define Version         PVERSION
2 %define date            PRELEASE
3 %define Vendor          Caldera
4 %define Dist            OpenLinux
5 %define EtcSamba        /etc/samba.d
6
7 Name            : samba
8 Version         : %{Version}
9 Release         : %{date}
10 Group           : Server/Network
11
12 Summary      : Samba SMB client and server.
13
14 Copyright      : Andrew Tridgell, John H Terpstra; GPL Version 2
15 Packager      : Klaus Singvogel <klaus@caldera.de>
16 Icon              : Caldera-daemon.gif
17 URL              : http://samba.org/samba
18
19 Requires        : libpam >= 0.66, SysVinit-scripts >= 1.04-6
20
21
22 BuildRoot       : /tmp/%{Name}-%{Version}
23
24 Source: ftp://ftp.samba.org/pub/samba/%{Name}-%{Version}%{date}.tar.gz
25 #Patch0: %{Name}-%{Version}-smbmount.patch
26 Patch1: %{Name}-%{Version}-install.patch
27 #Patch2: %{Name}-%{Version}-smbconf.patch
28
29
30 %Package doc
31 Group           : Server/Network
32
33 Summary      : Documentation on SAMBA.
34
35
36 %Package -n smbfs
37 Group           : System/Network
38
39 Summary         : Mount and unmount commands for SMB filesystems (smbfs).
40
41
42 %Package -n swat
43 Group           : Administration/Network
44 Requires       : setup >= 2.0-2, tcp_wrappers
45
46 Summary      : Samba Web Administration Tool.
47 Samba provides an SMB server which can be used to provide
48 network services to SMB (sometimes called "Lan Manager")
49 clients, including various versions of MS Windows, OS/2,
50 and other Linux machines. Samba also provides some SMB
51 clients, which complement the built-in SMB filesystem
52 in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
53 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
54 protocol.
55
56 Samba-2.2 features working NT Domain Control capability and 
57 includes the SWAT (Samba Web Administration Tool) that 
58 allows samba's smb.conf file to be remotely managed using your 
59 favourite web browser. For the time being this is being
60 enabled on TCP port 901 via inetd.
61
62 Users are advised to use Samba-2.2 as a Windows NT4
63 Domain Controller only on networks that do NOT have a Windows
64 NT Domain Controller. This release does NOT as yet have
65 Backup Domain control ability.
66
67 Please refer to the WHATSNEW.txt document for fixup information.
68 This binary release includes encrypted password support.
69
70 Please read the smb.conf file and ENCRYPTION.txt in the
71 docs directory for implementation details.
72
73 %Description
74
75 NOTE: Caldera OpenLinux uses PAM which has integrated support
76 for Shadow passwordsand for quotas. Do NOT recompile with the 
77 SHADOW_PWD option enabled.
78
79 %Description doc
80 Documentation on SAMBA.
81
82
83 %Description -n smbfs
84 This package includes the tools necessary to mount filesystems from
85 SMB servers.
86
87 Smbmount and smbumount are an interface to the SMB filesystem. Smbfs is
88 a filesystem which understands the SMB protocol. This is the protocol
89 Windows for Workgroups, Windows NT or Lan Manager use to talk to each
90 other. It was inspired by samba, the program by Andrew Tridgell that
91 turns any unix site into a file server for DOS or Windows clients. See
92 http://samba.org/samba for this interesting program suite and lots of
93 more information on SMB and NetBIOS over TCP/IP. There you also find
94 explanation for conceps like NetBIOS name or share.
95
96
97 %Description -n swat
98 swat allows a Samba administrator to configure the complex smb.conf
99 file via a Web browser. In addition, a swat configuration page has
100 help links to all the configurable options in the smb.conf file
101 allowing an administrator to easily look up the effects of any change.
102
103
104 %Prep
105 %setup -n samba
106 #%%patch0 -p1
107 %patch1 -p1
108 #%patch2 -p1
109
110 # instead of patch (to help configuration) ...   ;^)
111 %{fixUP} -vbT source/Makefile.in -e '
112   s:we don.t use sbindir because we want:if you want : +
113   s:(the previous releases of Samba):$1, please use: +
114   s:(SBINDIR\s*=\s*\@)b:# ./configure --sbindir=\\\$(BINDIR)\n${1}sb: +
115   s:/log\.(\S+):/log/samba.d/${1}d: +
116   s:(PASSWD_PROGRAM\s*=\s*)(/bin):$1/usr$2: +
117   s:^(LIBS\s*=):AUTH_$1: +
118   s:((SMBD|SWAT|RPCCLIENT|SMBPASSWD)_OBJ\) )(\$\(LDF):$1\$(AUTH_LIBS) $3:
119 '
120
121 for i in {cvs.,change-}log; do [ ! -f ../$i ] || mv ../$i source; done
122
123 mv swat/help/welcome.html docs
124 %{fixUP} -vT docs -e '
125   s:/usr/local/samba/bin/(smb(client|run)):/usr/bin/$1:g +
126   s:/usr/local/samba/bin/((s|n)mbd|swat):/usr/sbin/$1:g +
127   s:/usr/local/samba/var/locks:/var/lock/samba.d: +
128   s:/usr/local/samba/(var|lib)/log:/var/log/samba.d/smb: +
129   s:/usr/local/samba/swat:/usr/share/samba/swat:g +
130   s:/usr/local/samba/lib:%{EtcSamba}:g;
131 '
132 mv docs/welcome.html swat/help
133 for i in docs/*/smb.conf.5*; do
134   %{fixUP} -vT $i -e '
135     s:users\.map:smbusers:g +
136     s:SAMBA_INSTALL_DIRECTORY/lib:%{EtcSamba}: +
137     s:None \(set in compile\)\.:(see above).: +
138     s:/usr/local/:/usr/:g;
139   '
140 done
141 %{fixUP} -vT docs/textdocs/Faxing.txt -e '
142   s:/usr/local/etc/:/etc/: +
143   s:/usr/local/:/usr/:;
144 '
145 %{fixUP} -vT docs/textdocs/ENCRYPTION.txt -e '
146   s:/usr/local/samba/private:%{EtcSamba}:g +
147   s:mksmbpasswd.sh:mksmbpasswd:g +
148   s:the Samba source directory:/usr/bin:;
149 '
150 # End of DirtyHack(TM)
151
152
153 %Build
154 cd source
155 autoreconf
156
157 CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-s" ./configure \
158         --prefix='$(DESTDIR)/usr' \
159         --localstatedir='$(DESTDIR)/var' \
160         --libdir='$(DESTDIR)%{EtcSamba}' \
161         --with-privatedir='$(LIBDIR)' \
162         --with-lockdir='$(DESTDIR)/var/lock/samba.d' \
163         --with-swatdir='$(DESTDIR)/usr/share/swat' \
164         --with-smbmount --with-pam --without-smbwrapper \
165         --with-utmp --with-quotas --with-vfs --with-msdfs \
166         --with-profile --with-syslog --with-utmp --with-netatalk \
167         --with-sambabook=$(DESTDIR)/usr/share/swat/using_samba
168
169 make all nsswitch/libnss_wins.so
170
171
172 %Install
173 %{mkDESTDIR}
174 VVS=packaging/%{Vendor}/%{Dist}
175
176 mkdir -p $DESTDIR/etc/{{rc.d/init,logrotate,pam}.d,sysconfig/daemons}
177 mkdir -p $DESTDIR/var/{lo{ck,g}/samba.d,spool/samba}
178 mkdir -p $DESTDIR/usr/{share,swat/using_samba}
179 mkdir -p $DESTDIR/home/samba $DESTDIR%{EtcSamba}/codepages/src $DESTDIR/sbin
180
181 make -C source  install
182
183 strip $DESTDIR/usr/bin/smb{mount,mnt,umount}
184 mv $DESTDIR/usr/bin/{make,add,conv}* $DESTDIR/usr/sbin
185
186 #cp -p source/codepages/codepage_def.??? $DESTDIR%{EtcSamba}/codepages/src
187
188 # Install the nsswitch library extension file
189 cp -p source/nsswitch/libnss_wins.so $DESTDIR/lib
190 # Make link for wins resolver
191 cd $DESTDIR/lib
192 ln -s libnss_wins.so libnss_wins.so.2
193 cd $RPM_BUILD_DIR
194
195 cp -p $VVS/samba.init $DESTDIR/etc/rc.d/init.d/samba
196 ln -s /etc/rc.d/init.d/samba $DESTDIR/usr/sbin
197
198 cp -p $VVS/smb.conf.sample $DESTDIR%{EtcSamba}/smb.conf.sample
199 #cp -p $VVS/smb.conf.sample $DESTDIR%{EtcSamba}/smb.conf
200 cp -p $VVS/smbusers $DESTDIR%{EtcSamba}
201 cp -p $VVS/smbprint $DESTDIR/usr/bin
202 cp -p $VVS/smbadduser.perl $DESTDIR/usr/sbin/smbadduser
203 cp -p $VVS/make_smbpasswd.perl $DESTDIR/usr/sbin/make_smbpasswd
204 cp -p $VVS/convertsmbpasswd.perl $DESTDIR/usr/sbin/convertsmbpasswd
205 cp -p $VVS/updatesmbpasswd.perl $DESTDIR/usr/sbin/updatesmbpasswd
206 cp -p $VVS/findsmb $DESTDIR/usr/sbin
207 cp -p $VVS/samba.daemon $DESTDIR/etc/sysconfig/daemons/samba
208 cp -p $VVS/samba.pam $DESTDIR/etc/pam.d/samba
209 cp -p $VVS/samba.logrotate $DESTDIR/etc/logrotate.d/samba
210
211 for f in testparm testprns; do
212   ln -s $f $DESTDIR/usr/bin/smb$f
213   ln -s $f.1 $DESTDIR/usr/man/man1/smb$f.1
214 done
215 ln -s make_smbcodepage  $DESTDIR/usr/sbin/mksmbcodepage
216 ln -s make_smbpasswd $DESTDIR/usr/sbin/mksmbpasswd
217 ln -sf convert_smbpasswd $DESTDIR/usr/sbin/convertsmbpasswd
218
219 cat <<-'EoH' > $DESTDIR%{EtcSamba}/lmhosts
220         127.0.0.1 localhost
221 EoH
222
223
224 DOCD="$DESTDIR/%{_defaultdocdir}/samba-%{Version}"; mkdir -p $DOCD
225 ln -sf ../Copyrights/GPL-2.0  $DOCD/COPYING
226 cp -p README Manifest Read-Manifest-Now WHATSNEW.txt Roadmap $DOCD
227 cp -a docs examples $DOCD
228
229 mv $DOCD/docs/htmldocs/wfw_slip.htm $DOCD/docs/wfw_slip.html
230
231 rm -rf $DOCD/docs/{htmldocs,manpages,yodldocs}
232 rm -rf $DOCD/examples/{svr4-startup,printing}
233
234 cp -p swat/README $DOCD/README.swat
235
236 %{fixUP} -vT $DOCD/examples -e 's:/usr/local/bin/:/usr/bin/:g;'
237
238 %{fixManPages}
239
240 %{mkLists} -c samba
241 cat << 'EOF' | %{mkLists} -d samba
242 ^/(etc|var|home)                        config-IGNORED
243 swat                                    swat
244 /usr/doc/samba-[^/]+/$                  base
245 /doc/samba-                             doc
246 @default@
247 EOF
248 cat << 'EOF' | %{mkLists} -f -a samba
249 ^/etc                                   config-IGNORED
250 /doc/samba-[^/]+/(COPYING|README$)      base
251 /doc/samba-                             doc
252 smb(mount|mnt|umount)                   smbfs
253 mount.smbfs                             smbfs
254 swat                                    swat
255 @default@
256 EOF
257
258
259 %Clean
260 %{rmDESTDIR}
261
262
263 %Post
264 lisa --SysV-init install samba S91 3:4:5 K09 0:1:2:6
265
266
267 %Post -n swat
268 lisa --inetd install swat stream tcp nowait.400 root /usr/sbin/tcpd swat
269 perl -pi -e '$s=1 if /^swat/;
270   print "swat:ALL EXCEPT 127.0.0.1\n" if eof && ! $s' /etc/hosts.deny
271
272
273 %PostUn
274 lisa --SysV-init remove samba $1
275 # We want to remove the browse.dat and wins.dat files so they can not
276 # interfer with a new version of samba!
277 rm -f /var/lock/samba/{browse,wins}.dat 
278
279
280 %PostUn -n swat
281 lisa --inetd disable swat $1
282 [ -x /usr/sbin/swat ]||perl -ni -e '/^swat\s*\:/||print' /etc/hosts.deny
283
284
285 %Files -f files-samba-base
286 %defattr(-,root,root)
287 %config %attr(755,root,root) /etc/rc.d/init.d/samba
288 %config %attr(644,root,root) /etc/sysconfig/daemons/samba
289 %config %attr(644,root,root) /etc/pam.d/samba
290 %config %attr(644,root,root) /etc/logrotate.d/samba
291 %config %attr(-,root,root) %{EtcSamba}
292 %config %attr(755,root,root) /home/samba
293
294 %dir %attr(755,root,root) /var/lock/samba.d
295 %dir %attr(755,root,root) /var/log/samba.d
296 %dir %attr(1777,root,root) /var/spool/samba
297 #%dir %attr(775,root,nobody) /home/samba
298
299
300 %Files doc -f files-samba-doc
301 %defattr(-,root,root)
302
303
304 %Files -n smbfs -f files-samba-smbfs
305 %defattr(-,root,root)
306
307
308 %Files -n swat  -f files-samba-swat
309 %defattr(-,root,root)
310
311
312 %ChangeLog
313 * Mon Jan 01 1997 ...
314