summaryrefslogtreecommitdiff
path: root/packaging/Caldera/OpenLinux/samba3.spec.tmpl
blob: ab4e48649b93c3412661ab111a724920a0d6af88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
%define Version 	PVERSION
%define date            PRELEASE
%define Vendor  	Caldera
%define Dist		OpenLinux
%define EtcSamba 	/etc/samba.d

Name        	: samba
Version     	: %{Version}
Release     	: %{date}
Group       	: Server/Network

Summary      : Samba SMB client and server.

Copyright      : Andrew Tridgell, John H Terpstra; GPL Version 2
Packager      : Klaus Singvogel <klaus@caldera.de>
Icon              : Caldera-daemon.gif
URL              : http://samba.org/samba

Requires    	: libpam >= 0.66, SysVinit-scripts >= 1.04-6


BuildRoot   	: /tmp/%{Name}-%{Version}

Source: ftp://ftp.samba.org/pub/samba/%{Name}-%{Version}%{date}.tar.gz
#Patch0: %{Name}-%{Version}-smbmount.patch
Patch1: %{Name}-%{Version}-install.patch
#Patch2: %{Name}-%{Version}-smbconf.patch


%Package doc
Group       	: Server/Network

Summary      : Documentation on SAMBA.


%Package -n smbfs
Group       	: System/Network

Summary     	: Mount and unmount commands for SMB filesystems (smbfs).


%Package -n swat
Group       	: Administration/Network
Requires       : setup >= 2.0-2, tcp_wrappers

Summary      : Samba Web Administration Tool.
Samba provides an SMB server which can be used to provide
network services to SMB (sometimes called "Lan Manager")
clients, including various versions of MS Windows, OS/2,
and other Linux machines. Samba also provides some SMB
clients, which complement the built-in SMB filesystem
in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
protocol.

Samba-2.2 features working NT Domain Control capability and 
includes the SWAT (Samba Web Administration Tool) that 
allows samba's smb.conf file to be remotely managed using your 
favourite web browser. For the time being this is being
enabled on TCP port 901 via inetd.

Users are advised to use Samba-2.2 as a Windows NT4
Domain Controller only on networks that do NOT have a Windows
NT Domain Controller. This release does NOT as yet have
Backup Domain control ability.

Please refer to the WHATSNEW.txt document for fixup information.
This binary release includes encrypted password support.

Please read the smb.conf file and ENCRYPTION.txt in the
docs directory for implementation details.

%Description

NOTE: Caldera OpenLinux uses PAM which has integrated support
for Shadow passwordsand for quotas. Do NOT recompile with the 
SHADOW_PWD option enabled.

%Description doc
Documentation on SAMBA.


%Description -n smbfs
This package includes the tools necessary to mount filesystems from
SMB servers.

Smbmount and smbumount are an interface to the SMB filesystem. Smbfs is
a filesystem which understands the SMB protocol. This is the protocol
Windows for Workgroups, Windows NT or Lan Manager use to talk to each
other. It was inspired by samba, the program by Andrew Tridgell that
turns any unix site into a file server for DOS or Windows clients. See
http://samba.org/samba for this interesting program suite and lots of
more information on SMB and NetBIOS over TCP/IP. There you also find
explanation for conceps like NetBIOS name or share.


%Description -n swat
swat allows a Samba administrator to configure the complex smb.conf
file via a Web browser. In addition, a swat configuration page has
help links to all the configurable options in the smb.conf file
allowing an administrator to easily look up the effects of any change.


%Prep
%setup -n samba
#%%patch0 -p1
%patch1 -p1
#%patch2 -p1

# instead of patch (to help configuration) ...   ;^)
%{fixUP} -vbT source/Makefile.in -e '
  s:we don.t use sbindir because we want:if you want : +
  s:(the previous releases of Samba):$1, please use: +
  s:(SBINDIR\s*=\s*\@)b:# ./configure --sbindir=\\\$(BINDIR)\n${1}sb: +
  s:/log\.(\S+):/log/samba.d/${1}d: +
  s:(PASSWD_PROGRAM\s*=\s*)(/bin):$1/usr$2: +
  s:^(LIBS\s*=):AUTH_$1: +
  s:((SMBD|SWAT|RPCCLIENT|SMBPASSWD)_OBJ\) )(\$\(LDF):$1\$(AUTH_LIBS) $3:
'

for i in {cvs.,change-}log; do [ ! -f ../$i ] || mv ../$i source; done

mv swat/help/welcome.html docs
%{fixUP} -vT docs -e '
  s:/usr/local/samba/bin/(smb(client|run)):/usr/bin/$1:g +
  s:/usr/local/samba/bin/((s|n)mbd|swat):/usr/sbin/$1:g +
  s:/usr/local/samba/var/locks:/var/lock/samba.d: +
  s:/usr/local/samba/(var|lib)/log:/var/log/samba.d/smb: +
  s:/usr/local/samba/swat:/usr/share/samba/swat:g +
  s:/usr/local/samba/lib:%{EtcSamba}:g;
'
mv docs/welcome.html swat/help
for i in docs/*/smb.conf.5*; do
  %{fixUP} -vT $i -e '
    s:users\.map:smbusers:g +
    s:SAMBA_INSTALL_DIRECTORY/lib:%{EtcSamba}: +
    s:None \(set in compile\)\.:(see above).: +
    s:/usr/local/:/usr/:g;
  '
done
%{fixUP} -vT docs/textdocs/Faxing.txt -e '
  s:/usr/local/etc/:/etc/: +
  s:/usr/local/:/usr/:;
'
%{fixUP} -vT docs/textdocs/ENCRYPTION.txt -e '
  s:/usr/local/samba/private:%{EtcSamba}:g +
  s:mksmbpasswd.sh:mksmbpasswd:g +
  s:the Samba source directory:/usr/bin:;
'
# End of DirtyHack(TM)


%Build
cd source
autoreconf

CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-s" ./configure \
	--prefix='$(DESTDIR)/usr' \
	--localstatedir='$(DESTDIR)/var' \
	--libdir='$(DESTDIR)%{EtcSamba}' \
	--with-privatedir='$(LIBDIR)' \
	--with-lockdir='$(DESTDIR)/var/lock/samba.d' \
	--with-swatdir='$(DESTDIR)/usr/share/swat' \
	--with-smbmount --with-pam --without-smbwrapper \
	--with-utmp --with-quotas --with-vfs --with-msdfs \
	--with-profile --with-syslog --with-utmp --with-netatalk \
	--with-sambabook=$(DESTDIR)/usr/share/swat/using_samba

make all nsswitch/libnss_wins.so


%Install
%{mkDESTDIR}
VVS=packaging/%{Vendor}/%{Dist}

mkdir -p $DESTDIR/etc/{{rc.d/init,logrotate,pam}.d,sysconfig/daemons}
mkdir -p $DESTDIR/var/{lo{ck,g}/samba.d,spool/samba}
mkdir -p $DESTDIR/usr/{share,swat/using_samba}
mkdir -p $DESTDIR/home/samba $DESTDIR%{EtcSamba}/codepages/src $DESTDIR/sbin

make -C source  install

strip $DESTDIR/usr/bin/smb{mount,mnt,umount}
mv $DESTDIR/usr/bin/{make,add,conv}* $DESTDIR/usr/sbin

#cp -p source/codepages/codepage_def.??? $DESTDIR%{EtcSamba}/codepages/src

# Install the nsswitch library extension file
cp -p source/nsswitch/libnss_wins.so $DESTDIR/lib
# Make link for wins resolver
cd $DESTDIR/lib
ln -s libnss_wins.so libnss_wins.so.2
cd $RPM_BUILD_DIR

cp -p $VVS/samba.init $DESTDIR/etc/rc.d/init.d/samba
ln -s /etc/rc.d/init.d/samba $DESTDIR/usr/sbin

cp -p $VVS/smb.conf.sample $DESTDIR%{EtcSamba}/smb.conf.sample
#cp -p $VVS/smb.conf.sample $DESTDIR%{EtcSamba}/smb.conf
cp -p $VVS/smbusers $DESTDIR%{EtcSamba}
cp -p $VVS/smbprint $DESTDIR/usr/bin
cp -p $VVS/smbadduser.perl $DESTDIR/usr/sbin/smbadduser
cp -p $VVS/make_smbpasswd.perl $DESTDIR/usr/sbin/make_smbpasswd
cp -p $VVS/convertsmbpasswd.perl $DESTDIR/usr/sbin/convertsmbpasswd
cp -p $VVS/updatesmbpasswd.perl $DESTDIR/usr/sbin/updatesmbpasswd
cp -p $VVS/findsmb $DESTDIR/usr/sbin
cp -p $VVS/samba.daemon $DESTDIR/etc/sysconfig/daemons/samba
cp -p $VVS/samba.pam $DESTDIR/etc/pam.d/samba
cp -p $VVS/samba.logrotate $DESTDIR/etc/logrotate.d/samba

for f in testparm testprns; do
  ln -s $f $DESTDIR/usr/bin/smb$f
  ln -s $f.1 $DESTDIR/usr/man/man1/smb$f.1
done
ln -s make_smbcodepage  $DESTDIR/usr/sbin/mksmbcodepage
ln -s make_smbpasswd $DESTDIR/usr/sbin/mksmbpasswd
ln -sf convert_smbpasswd $DESTDIR/usr/sbin/convertsmbpasswd

cat <<-'EoH' > $DESTDIR%{EtcSamba}/lmhosts
	127.0.0.1 localhost
EoH


DOCD="$DESTDIR/%{_defaultdocdir}/samba-%{Version}"; mkdir -p $DOCD
ln -sf ../Copyrights/GPL-2.0  $DOCD/COPYING
cp -p README Manifest Read-Manifest-Now WHATSNEW.txt Roadmap $DOCD
cp -a docs examples $DOCD

mv $DOCD/docs/htmldocs/wfw_slip.htm $DOCD/docs/wfw_slip.html

rm -rf $DOCD/docs/{htmldocs,manpages,yodldocs}
rm -rf $DOCD/examples/{svr4-startup,printing}

cp -p swat/README $DOCD/README.swat

%{fixUP} -vT $DOCD/examples -e 's:/usr/local/bin/:/usr/bin/:g;'

%{fixManPages}

%{mkLists} -c samba
cat << 'EOF' | %{mkLists} -d samba
^/(etc|var|home)			config-IGNORED
swat					swat
/usr/doc/samba-[^/]+/$			base
/doc/samba- 				doc
@default@
EOF
cat << 'EOF' | %{mkLists} -f -a samba
^/etc					config-IGNORED
/doc/samba-[^/]+/(COPYING|README$)	base
/doc/samba- 				doc
smb(mount|mnt|umount)			smbfs
mount.smbfs				smbfs
swat					swat
@default@
EOF


%Clean
%{rmDESTDIR}


%Post
lisa --SysV-init install samba S91 3:4:5 K09 0:1:2:6


%Post -n swat
lisa --inetd install swat stream tcp nowait.400 root /usr/sbin/tcpd swat
perl -pi -e '$s=1 if /^swat/;
  print "swat:ALL EXCEPT 127.0.0.1\n" if eof && ! $s' /etc/hosts.deny


%PostUn
lisa --SysV-init remove samba $1
# We want to remove the browse.dat and wins.dat files so they can not
# interfer with a new version of samba!
rm -f /var/lock/samba/{browse,wins}.dat 


%PostUn -n swat
lisa --inetd disable swat $1
[ -x /usr/sbin/swat ]||perl -ni -e '/^swat\s*\:/||print' /etc/hosts.deny


%Files -f files-samba-base
%defattr(-,root,root)
%config %attr(755,root,root) /etc/rc.d/init.d/samba
%config %attr(644,root,root) /etc/sysconfig/daemons/samba
%config %attr(644,root,root) /etc/pam.d/samba
%config %attr(644,root,root) /etc/logrotate.d/samba
%config %attr(-,root,root) %{EtcSamba}
%config %attr(755,root,root) /home/samba

%dir %attr(755,root,root) /var/lock/samba.d
%dir %attr(755,root,root) /var/log/samba.d
%dir %attr(1777,root,root) /var/spool/samba
#%dir %attr(775,root,nobody) /home/samba


%Files doc -f files-samba-doc
%defattr(-,root,root)


%Files -n smbfs -f files-samba-smbfs
%defattr(-,root,root)


%Files -n swat  -f files-samba-swat
%defattr(-,root,root)


%ChangeLog
* Mon Jan 01 1997 ...