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