Make the new code conditional on lp_share_modes() just like the code in open_file_sha...
[samba.git] / packaging / RedHat / 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 BuildRoot: /tmp/samba
13
14 %description
15 Samba provides an SMB server which can be used to provide
16 network services to SMB (sometimes called "Lan Manager")
17 clients, including various versions of MS Windows, OS/2,
18 and other Linux machines. Samba also provides some SMB
19 clients, which complement the built-in SMB filesystem
20 in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
21 and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
22 protocol.
23
24 This a work in progress release only. This is NOT a production
25 stable release and it is VERY VERY pre-alpha.
26
27 Samba-2 features an almost working NT Domain Control
28 capability and includes the new SWAT (Samba Web Administration
29 Tool) that allows samba's smb.conf file to be remotely managed
30 using your favourite web browser. For the time being this is
31 being enabled on TCP port 901 via inetd.
32
33 Please refer to the WHATSNEW.txt document for fixup information.
34 This binary release includes encrypted password support.
35 Please read the smb.conf file and ENCRYPTION.txt in the
36 docs directory for implementation details.
37
38 NOTE: Red Hat Linux 5.X Uses PAM which has integrated support
39 for Shadow passwords. Do NOT recompile with the SHADOW_PWD option
40 enabled. Red Hat Linux has built in support for quotas in PAM.
41
42 %changelog
43 * Mon Oct 05 1998 John H Terpstra <jht@samba.anu.edu.au>
44  - Added rpcclient to binaries list
45  - Added smbwrapper stuff
46
47 * Fri Aug 21 1998 John H Terpstra <jht@samba.anu.edu.au>
48  - Updated for Samba version 2.0 building
49
50 * Sat Jul 4 1998 John H Terpstra <jht@samba.anu.edu.au>
51  - fixed codepage preservation during update via -Uvh
52
53 * Sun Apr 26 1998 John H Terpstra <jht@samba.anu.edu.au>
54  - Tidy up for early alpha releases
55  - added findsmb from SGI packaging
56
57 * Thu Apr 9 1998 John H Terpstra <jht@samba.anu.edu.au>
58  - Updated spec file
59  - Included new codepage.936
60
61 * Sat Mar 20 1998 John H Terpstra <jht@samba.anu.edu/au>
62  - Added swat facility
63
64 * Sat Jan 24 1998 John H Terpstra <jht@samba.anu.edu.au>
65  - Many optimisations (some suggested by Manoj Kasichainula <manojk@io.com>
66   - Use of chkconfig in place of individual symlinks to /etc/rc.d/init/smb
67   - Compounded make line
68   - Updated smb.init restart mechanism
69   - Use compound mkdir -p line instead of individual calls to mkdir
70   - Fixed smb.conf file path for log files
71   - Fixed smb.conf file path for incoming smb print spool directory
72   - Added a number of options to smb.conf file
73   - Added smbadduser command (missed from all previous RPMs) - Doooh!
74   - Added smbuser file and smb.conf file updates for username map
75
76 %prep
77 %setup
78 %patch -p1
79 %patch1 -p1
80 mv source/smbwrapper/README source/smbwrapper/README.smbsh
81
82 %build
83 cd source
84 ./configure
85 make all smbwrapper
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89 mkdir -p $RPM_BUILD_ROOT
90 mkdir -p $RPM_BUILD_ROOT/etc/codepages/src
91 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d}
92 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/{init.d,rc0.d,rc1.d,rc2.d,rc3.d,rc5.d,rc6.d}
93 mkdir -p $RPM_BUILD_ROOT/home/samba
94 mkdir -p $RPM_BUILD_ROOT/usr/{bin,sbin}
95 mkdir -p $RPM_BUILD_ROOT/usr/share/swat/{images,help,include}
96 mkdir -p $RPM_BUILD_ROOT/usr/man/{man1,man5,man7,man8}
97 mkdir -p $RPM_BUILD_ROOT/var/lock/samba
98 mkdir -p $RPM_BUILD_ROOT/var/log/samba
99 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
100
101 # Install standard binary files
102 for i in nmblookup smbclient smbpasswd smbrun smbstatus testparm testprns \
103       make_smbcodepage make_printerdef rpcclient
104 do
105 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/bin
106 done
107 for i in addtosmbpass mksmbpasswd.sh smbtar 
108 do
109 install -m755 source/script/$i $RPM_BUILD_ROOT/usr/bin
110 done
111
112 # Install secure binary files
113 for i in smbd nmbd swat
114 do
115 install -m755 -s source/bin/$i $RPM_BUILD_ROOT/usr/sbin
116 done
117
118 # Install smbwrapper stuff
119 install -m755 -s source/smbwrapper/smbsh $RPM_BUILD_ROOT/usr/bin
120 install -m755 -s source/smbwrapper/smbwrapper.so $RPM_BUILD_ROOT/usr/bin
121
122 # Install level 1 man pages
123 for i in smbclient.1 smbrun.1 smbstatus.1 smbtar.1 testparm.1 testprns.1 make_smbcodepage.1
124 do
125 install -m644 docs/$i $RPM_BUILD_ROOT/usr/man/man1
126 done
127
128 # Install codepage source files
129 for i in 437 737 850 852 861 866 932 936 949 950
130 do
131 install -m644 source/codepages/codepage_def.$i $RPM_BUILD_ROOT/etc/codepages/src
132 done
133
134 # Install SWAT helper files
135 for i in swat/help/*.html
136 do
137 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/help
138 done
139 for i in swat/images/*.{jpg,gif}
140 do
141 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/images
142 done
143 for i in swat/include/*.html
144 do
145 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/include
146 done
147
148 # Install the miscellany
149 install -m644 swat/README $RPM_BUILD_ROOT/usr/share/swat
150 install -m644 docs/smb.conf.5 $RPM_BUILD_ROOT/usr/man/man5
151 install -m644 docs/samba.7 $RPM_BUILD_ROOT/usr/man/man7
152 install -m644 docs/smbd.8 $RPM_BUILD_ROOT/usr/man/man8
153 install -m644 docs/nmbd.8 $RPM_BUILD_ROOT/usr/man/man8
154 install -m644 docs/smbpasswd.8 $RPM_BUILD_ROOT/usr/man/man8
155 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/smb.conf
156 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/smbusers
157 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT/usr/bin
158 install -m755 packaging/RedHat/findsmb $RPM_BUILD_ROOT/usr/bin
159 install -m755 packaging/RedHat/smbadduser $RPM_BUILD_ROOT/usr/bin
160 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
161 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/usr/sbin/samba
162 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
163 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
164 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/lmhosts
165
166 %clean
167 rm -rf $RPM_BUILD_ROOT
168
169 %post
170 /sbin/chkconfig --add smb
171
172 # Build codepage load files
173 for i in 437 737 850 852 861 866 932 936 949 950
174 do
175 /usr/bin/make_smbcodepage c $i /etc/codepages/src/codepage_def.$i /etc/codepages/codepage.$i
176 done
177
178 # Add swat entry to /etc/services if not already there
179 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
180         echo 'swat              901/tcp                         # Add swat service used via inetd' >> /etc/services
181 fi
182
183 # Add swat entry to /etc/inetd.conf if needed
184 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
185         echo 'swat      stream  tcp     nowait.400      root    /usr/sbin/swat swat' >> /etc/inetd.conf
186 killall -1 inetd
187 fi
188
189
190 %preun
191 /sbin/chkconfig --del smb
192
193 %postun
194 if [ -x /etc/pam.d/samba ]; then
195   rm -f /etc/pam.d/samba
196 fi
197 if [ -e /etc/codepages ]; then
198   rm -rf /etc/codepages
199 fi
200 if [ -e /var/log/samba ]; then
201   rm -rf /var/log/samba
202 fi
203 if [ -e /var/lock/samba ]; then
204   rm -rf /var/lock/samba
205 fi
206 # Remove swat entries from /etc/inetd.conf and /etc/services
207 cd /etc
208 tmpfile=/etc/tmp.$$
209 sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
210 mv $tmpfile inetd.conf
211 sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
212 mv $tmpfile services
213
214 %files
215 %doc README COPYING Manifest Read-Manifest-Now
216 %doc WHATSNEW.txt Roadmap smbwrapper/README.smbsh
217 %doc docs
218 %doc swat/README
219 %doc examples
220 %attr(-,root,root) /usr/sbin/smbd
221 %attr(-,root,root) /usr/sbin/nmbd
222 %attr(-,root,root) /usr/sbin/swat
223 %attr(0755,root,root) /usr/sbin/samba
224 %attr(-,root,root) /usr/bin/addtosmbpass
225 %attr(-,root,root) /usr/bin/mksmbpasswd.sh
226 %attr(-,root,root) /usr/bin/smbclient
227 %attr(-,root,root) /usr/bin/rpcclient
228 %attr(-,root,root) /usr/bin/testparm
229 %attr(-,root,root) /usr/bin/testprns
230 %attr(-,root,root) /usr/bin/smbrun
231 %attr(-,root,root) /usr/bin/findsmb
232 %attr(-,root,root) /usr/bin/smbstatus
233 %attr(-,root,root) /usr/bin/nmblookup
234 %attr(-,root,root) /usr/bin/make_smbcodepage
235 %attr(-,root,root) /usr/bin/make_printerdef
236 %attr(-,root,root) /usr/bin/smbpasswd
237 %attr(-,root,root) /usr/bin/smbtar
238 %attr(-,root,root) /usr/bin/smbprint
239 %attr(-,root,root) /usr/bin/smbadduser
240 %attr(0755,root,root) /usr/bin/smbsh
241 %attr(0755,root,root) /usr/bin/smbwrapper.so
242 %attr(-,root,root) /usr/share/swat/help/parameters.html
243 %attr(-,root,root) /usr/share/swat/help/welcome.html
244 %attr(-,root,root) /usr/share/swat/images/background.jpg
245 %attr(-,root,root) /usr/share/swat/images/background.gif
246 %attr(-,root,root) /usr/share/swat/images/globals.gif
247 %attr(-,root,root) /usr/share/swat/images/home.gif
248 %attr(-,root,root) /usr/share/swat/images/printers.gif
249 %attr(-,root,root) /usr/share/swat/images/shares.gif
250 %attr(-,root,root) /usr/share/swat/images/samba.gif
251 %attr(-,root,root) /usr/share/swat/images/status.gif
252 %attr(-,root,root) /usr/share/swat/images/viewconfig.gif
253 %attr(-,root,root) /usr/share/swat/include/header.html
254 %attr(-,root,root) /usr/share/swat/include/footer.html
255 %attr(-,root,root) %config /etc/lmhosts
256 %attr(-,root,root) %config /etc/smb.conf
257 %attr(-,root,root) %config /etc/smbusers
258 %attr(-,root,root) /etc/rc.d/init.d/smb
259 %attr(-,root,root) /etc/logrotate.d/samba
260 %attr(-,root,root) /etc/pam.d/samba
261 %attr(-,root,root) /etc/codepages/src/codepage_def.437
262 %attr(-,root,root) /etc/codepages/src/codepage_def.737
263 %attr(-,root,root) /etc/codepages/src/codepage_def.850
264 %attr(-,root,root) /etc/codepages/src/codepage_def.852
265 %attr(-,root,root) /etc/codepages/src/codepage_def.861
266 %attr(-,root,root) /etc/codepages/src/codepage_def.866
267 %attr(-,root,root) /etc/codepages/src/codepage_def.932
268 %attr(-,root,root) /etc/codepages/src/codepage_def.936
269 %attr(-,root,root) /etc/codepages/src/codepage_def.949
270 %attr(-,root,root) /etc/codepages/src/codepage_def.950
271 %attr(-,root,root) /usr/man/man1/smbstatus.1
272 %attr(-,root,root) /usr/man/man1/smbclient.1
273 %attr(-,root,root) /usr/man/man1/make_smbcodepage.1
274 %attr(-,root,root) /usr/man/man1/smbrun.1
275 %attr(-,root,root) /usr/man/man1/smbtar.1
276 %attr(-,root,root) /usr/man/man1/testparm.1
277 %attr(-,root,root) /usr/man/man1/testprns.1
278 %attr(-,root,root) /usr/man/man5/smb.conf.5
279 %attr(-,root,root) /usr/man/man7/samba.7
280 %attr(-,root,root) /usr/man/man8/smbd.8
281 %attr(-,root,root) /usr/man/man8/nmbd.8
282 %attr(-,root,root) /usr/man/man8/smbpasswd.8
283 %attr(-,root,nobody) %dir /home/samba
284 %attr(-,root,root) %dir /etc/codepages
285 %attr(-,root,root) %dir /etc/codepages/src
286 %attr(-,root,root) %dir /var/lock/samba
287 %attr(-,root,root) %dir /var/log/samba
288 %attr(777,root,root) %dir /var/spool/samba