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