Updated paths.
[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 smbsh smbwrapper.so
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 level 1 man pages
119 for i in smbclient.1 smbrun.1 smbstatus.1 smbtar.1 testparm.1 testprns.1 make_smbcodepage.1
120 do
121 install -m644 docs/$i $RPM_BUILD_ROOT/usr/man/man1
122 done
123
124 # Install codepage source files
125 for i in 437 737 850 852 861 866 932 936 949 950
126 do
127 install -m644 source/codepages/codepage_def.$i $RPM_BUILD_ROOT/etc/codepages/src
128 done
129
130 # Install SWAT helper files
131 for i in swat/help/*.html
132 do
133 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/help
134 done
135 for i in swat/images/*.{jpg,gif}
136 do
137 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/images
138 done
139 for i in swat/include/*.html
140 do
141 install -m644 $i $RPM_BUILD_ROOT/usr/share/swat/include
142 done
143
144 # Install the miscellany
145 install -m644 swat/README $RPM_BUILD_ROOT/usr/share/swat
146 install -m644 docs/smb.conf.5 $RPM_BUILD_ROOT/usr/man/man5
147 install -m644 docs/samba.7 $RPM_BUILD_ROOT/usr/man/man7
148 install -m644 docs/smbd.8 $RPM_BUILD_ROOT/usr/man/man8
149 install -m644 docs/nmbd.8 $RPM_BUILD_ROOT/usr/man/man8
150 install -m644 docs/smbpasswd.8 $RPM_BUILD_ROOT/usr/man/man8
151 install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/smb.conf
152 install -m644 packaging/RedHat/smbusers $RPM_BUILD_ROOT/etc/smbusers
153 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT/usr/bin
154 install -m755 packaging/RedHat/findsmb $RPM_BUILD_ROOT/usr/bin
155 install -m755 packaging/RedHat/smbadduser $RPM_BUILD_ROOT/usr/bin
156 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
157 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/usr/sbin/samba
158 install -m644 packaging/RedHat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
159 install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
160 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/lmhosts
161
162 %clean
163 rm -rf $RPM_BUILD_ROOT
164
165 %post
166 /sbin/chkconfig --add smb
167
168 # Build codepage load files
169 for i in 437 737 850 852 861 866 932 936 949 950
170 do
171 /usr/bin/make_smbcodepage c $i /etc/codepages/src/codepage_def.$i /etc/codepages/codepage.$i
172 done
173
174 # Add swat entry to /etc/services if not already there
175 if !( grep ^[:space:]*swat /etc/services > /dev/null ) then
176         echo 'swat              901/tcp                         # Add swat service used via inetd' >> /etc/services
177 fi
178
179 # Add swat entry to /etc/inetd.conf if needed
180 if !( grep ^[:space:]*swat /etc/inetd.conf > /dev/null ) then
181         echo 'swat      stream  tcp     nowait.400      root    /usr/sbin/swat swat' >> /etc/inetd.conf
182 killall -1 inetd
183 fi
184
185
186 %preun
187 /sbin/chkconfig --del smb
188
189 %postun
190 if [ -x /etc/pam.d/samba ]; then
191   rm -f /etc/pam.d/samba
192 fi
193 if [ -e /etc/codepages ]; then
194   rm -rf /etc/codepages
195 fi
196 if [ -e /var/log/samba ]; then
197   rm -rf /var/log/samba
198 fi
199 if [ -e /var/lock/samba ]; then
200   rm -rf /var/lock/samba
201 fi
202 # Remove swat entries from /etc/inetd.conf and /etc/services
203 cd /etc
204 tmpfile=/etc/tmp.$$
205 sed -e '/^[:space:]*swat.*$/d' /etc/inetd.conf > $tmpfile
206 mv $tmpfile inetd.conf
207 sed -e '/^[:space:]*swat.*$/d' /etc/services > $tmpfile
208 mv $tmpfile services
209
210 %files
211 %doc README COPYING Manifest Read-Manifest-Now
212 %doc WHATSNEW.txt Roadmap smbwrapper/README.smbsh
213 %doc docs
214 %doc swat/README
215 %doc examples
216 %attr(-,root,root) /usr/sbin/smbd
217 %attr(-,root,root) /usr/sbin/nmbd
218 %attr(-,root,root) /usr/sbin/swat
219 %attr(0755,root,root) /usr/sbin/samba
220 %attr(-,root,root) /usr/bin/addtosmbpass
221 %attr(-,root,root) /usr/bin/mksmbpasswd.sh
222 %attr(-,root,root) /usr/bin/smbclient
223 %attr(-,root,root) /usr/bin/rpcclient
224 %attr(-,root,root) /usr/bin/testparm
225 %attr(-,root,root) /usr/bin/testprns
226 %attr(-,root,root) /usr/bin/smbrun
227 %attr(-,root,root) /usr/bin/findsmb
228 %attr(-,root,root) /usr/bin/smbstatus
229 %attr(-,root,root) /usr/bin/nmblookup
230 %attr(-,root,root) /usr/bin/make_smbcodepage
231 %attr(-,root,root) /usr/bin/make_printerdef
232 %attr(-,root,root) /usr/bin/smbpasswd
233 %attr(-,root,root) /usr/bin/smbtar
234 %attr(-,root,root) /usr/bin/smbprint
235 %attr(-,root,root) /usr/bin/smbadduser
236 %attr(0755,root,root) /usr/bin/smbsh
237 %attr(0755,root,root) /usr/bin/smbwrapper.so
238 %attr(-,root,root) /usr/share/swat/help/parameters.html
239 %attr(-,root,root) /usr/share/swat/help/welcome.html
240 %attr(-,root,root) /usr/share/swat/images/background.jpg
241 %attr(-,root,root) /usr/share/swat/images/background.gif
242 %attr(-,root,root) /usr/share/swat/images/globals.gif
243 %attr(-,root,root) /usr/share/swat/images/home.gif
244 %attr(-,root,root) /usr/share/swat/images/printers.gif
245 %attr(-,root,root) /usr/share/swat/images/shares.gif
246 %attr(-,root,root) /usr/share/swat/images/samba.gif
247 %attr(-,root,root) /usr/share/swat/images/status.gif
248 %attr(-,root,root) /usr/share/swat/images/viewconfig.gif
249 %attr(-,root,root) /usr/share/swat/include/header.html
250 %attr(-,root,root) /usr/share/swat/include/footer.html
251 %attr(-,root,root) %config /etc/lmhosts
252 %attr(-,root,root) %config /etc/smb.conf
253 %attr(-,root,root) %config /etc/smbusers
254 %attr(-,root,root) /etc/rc.d/init.d/smb
255 %attr(-,root,root) /etc/logrotate.d/samba
256 %attr(-,root,root) /etc/pam.d/samba
257 %attr(-,root,root) /etc/codepages/src/codepage_def.437
258 %attr(-,root,root) /etc/codepages/src/codepage_def.737
259 %attr(-,root,root) /etc/codepages/src/codepage_def.850
260 %attr(-,root,root) /etc/codepages/src/codepage_def.852
261 %attr(-,root,root) /etc/codepages/src/codepage_def.861
262 %attr(-,root,root) /etc/codepages/src/codepage_def.866
263 %attr(-,root,root) /etc/codepages/src/codepage_def.932
264 %attr(-,root,root) /etc/codepages/src/codepage_def.936
265 %attr(-,root,root) /etc/codepages/src/codepage_def.949
266 %attr(-,root,root) /etc/codepages/src/codepage_def.950
267 %attr(-,root,root) /usr/man/man1/smbstatus.1
268 %attr(-,root,root) /usr/man/man1/smbclient.1
269 %attr(-,root,root) /usr/man/man1/make_smbcodepage.1
270 %attr(-,root,root) /usr/man/man1/smbrun.1
271 %attr(-,root,root) /usr/man/man1/smbtar.1
272 %attr(-,root,root) /usr/man/man1/testparm.1
273 %attr(-,root,root) /usr/man/man1/testprns.1
274 %attr(-,root,root) /usr/man/man5/smb.conf.5
275 %attr(-,root,root) /usr/man/man7/samba.7
276 %attr(-,root,root) /usr/man/man8/smbd.8
277 %attr(-,root,root) /usr/man/man8/nmbd.8
278 %attr(-,root,root) /usr/man/man8/smbpasswd.8
279 %attr(-,root,nobody) %dir /home/samba
280 %attr(-,root,root) %dir /etc/codepages
281 %attr(-,root,root) %dir /etc/codepages/src
282 %attr(-,root,root) %dir /var/lock/samba
283 %attr(-,root,root) %dir /var/log/samba
284 %attr(777,root,root) %dir /var/spool/samba