first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[kai/samba.git] / packaging / Caldera / 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.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 BuildRoot: /var/tmp/samba
12
13 %description
14 Samba provides an SMB server which can be used to provide
15 network services to SMB (sometimes called "Lan Manager")
16 clients, including various versions of MS Windows, OS/2,
17 and other Linux machines. Samba also provides some SMB
18 clients, which complement the built-in SMB filesystem
19 in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
20 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
21 protocol.
22
23 Samba-2 features an almost working NT Domain Control
24 capability and includes the new SWAT (Samba Web Administration
25 Tool) that allows samba's smb.conf file to be remotely managed
26 using your favourite web browser. For the time being this is
27 being enabled on TCP port 901 via inetd.
28
29 Please refer to the WHATSNEW.txt document for fixup information.
30 This binary release includes encrypted password support.
31 Please read the smb.conf file and ENCRYPTION.txt in the
32 docs directory for implementation details.
33
34 %changelog
35 * Mon Nov 16 1998 John H Terpstra <jht@samba.org>
36  - Ported to Cadera OpenLinux
37
38 %prep
39 %setup
40 %patch -p1
41 %patch1 -p1
42
43 %build
44 cd source
45 ./configure --prefix=/usr --libdir=/etc
46 make all
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 mkdir -p $RPM_BUILD_ROOT
51 mkdir -p $RPM_BUILD_ROOT/etc/codepages/src
52 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d}
53 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/{init.d,rc0.d,rc1.d,rc2.d,rc3.d,rc5.d,rc6.d}
54 mkdir -p $RPM_BUILD_ROOT/home/samba
55 mkdir -p $RPM_BUILD_ROOT/usr/{bin,sbin}
56 mkdir -p $RPM_BUILD_ROOT/usr/share/swat/{images,help,include}
57 mkdir -p $RPM_BUILD_ROOT/usr/man/{man1,man5,man7,man8}
58 mkdir -p $RPM_BUILD_ROOT/var/lock/samba
59 mkdir -p $RPM_BUILD_ROOT/var/log/samba
60 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
61
62 # Install standard binary files
63 for i in nmblookup smbclient smbpasswd smbrun smbstatus testparm testprns \
64       make_smbcodepage make_printerdef rpcclient
65 do
66 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/bin
67 done
68 for i in addtosmbpass mksmbpasswd.sh smbtar 
69 do
70 install -m755 source/script/$i $RPM_BUILD_ROOT/usr/bin
71 done
72
73 # Install secure binary files
74 for i in smbd nmbd swat
75 do
76 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/sbin
77 done
78
79 # Install level 1 man pages
80 for i in smbclient.1 smbrun.1 smbstatus.1 smbtar.1 testparm.1 testprns.1 make_smbcodepage.1 nmblookup.1
81 do
82 install -m644 docs/manpages/$i $RPM_BUILD_ROOT/usr/man/man1
83 done
84
85 # Install codepage source files
86 for i in 437 737 850 852 861 866 932 936 949 950
87 do
88 install -m644 source/codepages/codepage_def.$i $RPM_BUILD_ROOT/etc/codepages/src
89 done
90
91 # Install SWAT helper files
92 for i in swat/help/*.html docs/htmldocs/*.html
93 do
94 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/help
95 done
96 for i in swat/images/*.gif
97 do
98 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/images
99 done
100 for i in swat/include/*.html
101 do
102 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/include
103 done
104
105 # Install the miscellany
106 install -m644 swat/README $RPM_BUILD_ROOT/usr/share/swat
107 install -m644 docs/manpages/smb.conf.5 $RPM_BUILD_ROOT/usr/man/man5
108 install -m644 docs/manpages/lmhosts.5 $RPM_BUILD_ROOT/usr/man/man5
109 install -m644 docs/manpages/smbpasswd.5 $RPM_BUILD_ROOT/usr/man/man5
110 install -m644 docs/manpages/samba.7 $RPM_BUILD_ROOT/usr/man/man7
111 install -m644 docs/manpages/smbd.8 $RPM_BUILD_ROOT/usr/man/man8
112 install -m644 docs/manpages/nmbd.8 $RPM_BUILD_ROOT/usr/man/man8
113 install -m644 docs/manpages/swat.8 $RPM_BUILD_ROOT/usr/man/man8
114 install -m644 docs/manpages/smbpasswd.8 $RPM_BUILD_ROOT/usr/man/man8
115 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/smb.conf
116 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/smbusers
117 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT/usr/bin
118 install -m755 packaging/RedHat/findsmb $RPM_BUILD_ROOT/usr/bin
119 install -m755 packaging/RedHat/smbadduser $RPM_BUILD_ROOT/usr/bin
120 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
121 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/usr/sbin/samba
122 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
123 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
124 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/lmhosts
125
126 %clean
127 rm -rf $RPM_BUILD_ROOT
128
129 %post
130 /sbin/chkconfig --add smb
131
132 # Build codepage load files
133 for i in 437 737 850 852 861 866 932 936 949 950
134 do
135 /usr/bin/make_smbcodepage c $i /etc/codepages/src/codepage_def.$i /etc/codepages/codepage.$i
136 done
137
138 # Add swat entry to /etc/services if not already there
139 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
140         echo 'swat              901/tcp                         # Add swat service used via inetd' >> /etc/services
141 fi
142
143 # Add swat entry to /etc/inetd.conf if needed
144 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
145         echo 'swat      stream  tcp     nowait.400      root    /usr/sbin/swat swat' >> /etc/inetd.conf
146 killall -1 inetd || :
147 fi
148
149 %preun
150 if [ $1 = 0 ] ; then
151     /sbin/chkconfig --del smb
152
153     for n in /etc/codepages/*; do
154         if [ $n != /etc/codepages/src ]; then
155             rm -rf $n
156         fi
157     done
158     # We want to remove the browse.dat and wins.dat files so they can not interfer with a new version of samba!
159     if [ -e /var/lock/samba/browse.dat ]; then
160             rm -f /var/lock/samba/browse.dat
161     fi
162     if [ -e /var/lock/samba/wins.dat ]; then
163             rm -f /var/lock/samba/wins.dat
164     fi
165 fi
166
167 %postun
168 # Only delete remnants of samba if this is the final deletion.
169 if [ $1 != 0 ] ; then
170     exit 0
171
172     if [ -x /etc/pam.d/samba ]; then
173       rm -f /etc/pam.d/samba
174     fi
175     if [ -e /var/log/samba ]; then
176       rm -rf /var/log/samba
177     fi
178     if [ -e /var/lock/samba ]; then
179       rm -rf /var/lock/samba
180     fi
181
182     # Remove swat entries from /etc/inetd.conf and /etc/services
183     cd /etc
184     tmpfile=/etc/tmp.$$
185     sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
186     mv $tmpfile inetd.conf
187     sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
188     mv $tmpfile services
189 fi
190
191 %files
192 %doc README COPYING Manifest Read-Manifest-Now
193 %doc WHATSNEW.txt Roadmap
194 %doc docs
195 %doc swat/README
196 %doc examples
197 %attr(-,root,root) /usr/sbin/smbd
198 %attr(-,root,root) /usr/sbin/nmbd
199 %attr(-,root,root) /usr/sbin/swat
200 %attr(0750,root,root) /usr/sbin/samba
201 %attr(-,root,root) /usr/bin/addtosmbpass
202 %attr(-,root,root) /usr/bin/mksmbpasswd.sh
203 %attr(-,root,root) /usr/bin/smbclient
204 %attr(-,root,root) /usr/bin/rpcclient
205 %attr(-,root,root) /usr/bin/testparm
206 %attr(-,root,root) /usr/bin/testprns
207 %attr(-,root,root) /usr/bin/smbrun
208 %attr(-,root,root) /usr/bin/findsmb
209 %attr(-,root,root) /usr/bin/smbstatus
210 %attr(-,root,root) /usr/bin/nmblookup
211 %attr(-,root,root) /usr/bin/make_smbcodepage
212 %attr(-,root,root) /usr/bin/make_printerdef
213 %attr(-,root,root) /usr/bin/smbpasswd
214 %attr(-,root,root) /usr/bin/smbtar
215 %attr(-,root,root) /usr/bin/smbprint
216 %attr(-,root,root) /usr/bin/smbadduser
217 %attr(-,root,root) /usr/share/swat/help/welcome.html
218 %attr(-,root,root) /usr/share/swat/help/DOMAIN_MEMBER.html
219 %attr(-,root,root) /usr/share/swat/help/lmhosts.5.html
220 %attr(-,root,root) /usr/share/swat/help/make_smbcodepage.1.html
221 %attr(-,root,root) /usr/share/swat/help/nmbd.8.html
222 %attr(-,root,root) /usr/share/swat/help/nmblookup.1.html
223 %attr(-,root,root) /usr/share/swat/help/samba.7.html
224 %attr(-,root,root) /usr/share/swat/help/smb.conf.5.html
225 %attr(-,root,root) /usr/share/swat/help/smbclient.1.html
226 %attr(-,root,root) /usr/share/swat/help/smbd.8.html
227 %attr(-,root,root) /usr/share/swat/help/smbpasswd.5.html
228 %attr(-,root,root) /usr/share/swat/help/smbpasswd.8.html
229 %attr(-,root,root) /usr/share/swat/help/smbrun.1.html
230 %attr(-,root,root) /usr/share/swat/help/smbstatus.1.html
231 %attr(-,root,root) /usr/share/swat/help/smbtar.1.html
232 %attr(-,root,root) /usr/share/swat/help/swat.8.html
233 %attr(-,root,root) /usr/share/swat/help/testparm.1.html
234 %attr(-,root,root) /usr/share/swat/help/testprns.1.html
235 %attr(-,root,root) /usr/share/swat/images/globals.gif
236 %attr(-,root,root) /usr/share/swat/images/home.gif
237 %attr(-,root,root) /usr/share/swat/images/passwd.gif
238 %attr(-,root,root) /usr/share/swat/images/printers.gif
239 %attr(-,root,root) /usr/share/swat/images/shares.gif
240 %attr(-,root,root) /usr/share/swat/images/samba.gif
241 %attr(-,root,root) /usr/share/swat/images/status.gif
242 %attr(-,root,root) /usr/share/swat/images/viewconfig.gif
243 %attr(-,root,root) /usr/share/swat/include/header.html
244 %attr(-,root,root) /usr/share/swat/include/footer.html
245 %attr(-,root,root) %config(noreplace) /etc/lmhosts
246 %attr(-,root,root) %config(noreplace) /etc/smb.conf
247 %attr(-,root,root) %config(noreplace) /etc/smbusers
248 %attr(-,root,root) /etc/rc.d/init.d/smb
249 %attr(-,root,root) /etc/logrotate.d/samba
250 %attr(-,root,root) /etc/pam.d/samba
251 %attr(-,root,root) /etc/codepages/src/codepage_def.437
252 %attr(-,root,root) /etc/codepages/src/codepage_def.737
253 %attr(-,root,root) /etc/codepages/src/codepage_def.850
254 %attr(-,root,root) /etc/codepages/src/codepage_def.852
255 %attr(-,root,root) /etc/codepages/src/codepage_def.861
256 %attr(-,root,root) /etc/codepages/src/codepage_def.866
257 %attr(-,root,root) /etc/codepages/src/codepage_def.932
258 %attr(-,root,root) /etc/codepages/src/codepage_def.936
259 %attr(-,root,root) /etc/codepages/src/codepage_def.949
260 %attr(-,root,root) /etc/codepages/src/codepage_def.950
261 %attr(-,root,root) /usr/man/man1/smbstatus.1
262 %attr(-,root,root) /usr/man/man1/smbclient.1
263 %attr(-,root,root) /usr/man/man1/make_smbcodepage.1
264 %attr(-,root,root) /usr/man/man1/smbrun.1
265 %attr(-,root,root) /usr/man/man1/smbtar.1
266 %attr(-,root,root) /usr/man/man1/testparm.1
267 %attr(-,root,root) /usr/man/man1/testprns.1
268 %attr(-,root,root) /usr/man/man1/nmblookup.1
269 %attr(-,root,root) /usr/man/man5/smb.conf.5
270 %attr(-,root,root) /usr/man/man5/lmhosts.5
271 %attr(-,root,root) /usr/man/man5/smbpasswd.5
272 %attr(-,root,root) /usr/man/man7/samba.7
273 %attr(-,root,root) /usr/man/man8/smbd.8
274 %attr(-,root,root) /usr/man/man8/nmbd.8
275 %attr(-,root,root) /usr/man/man8/smbpasswd.8
276 %attr(-,root,root) /usr/man/man8/swat.8
277 %attr(-,root,nobody) %dir /home/samba
278 %attr(-,root,root) %dir /etc/codepages
279 %attr(-,root,root) %dir /etc/codepages/src
280 %attr(-,root,root) %dir /var/lock/samba
281 %attr(-,root,root) %dir /var/log/samba
282 %attr(1777,root,root) %dir /var/spool/samba