1 %define initdir %{_sysconfdir}/rc.d/init.d
2 %define auth %(test -f /etc/pam.d/system-auth && echo /etc/pam.d/system-auth || echo)
4 Summary: The Samba SMB server.
8 License: GNU GPL Version 2
9 Group: System Environment/Daemons
10 URL: http://www.samba.org/
12 Source: ftp://www.samba.org/pub/samba/%{name}-%{version}.tar.bz2
14 # Red Hat specific replacement-files
17 Source4: samba.sysconfig
25 # Don't depend on Net::LDAP
26 Source999: filter-requires-samba.sh
30 Requires: pam >= 0.64 %{auth} samba-common = %{version}
31 Requires: logrotate >= 3.4 initscripts >= 5.54-1
32 BuildRoot: %{_tmppath}/%{name}-%{version}-root
33 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
34 Prereq: fileutils sed /etc/init.d
35 BuildRequires: pam-devel, readline-devel, ncurses-devel, fileutils, libacl-devel, openldap-devel, krb5-devel
38 # Working around perl dependency problem from docs
39 %define __perl_requires %{SOURCE999}
42 Samba is the protocol by which a lot of PC-related machines share
43 files, printers, and other information (such as lists of available
44 files and printers). The Windows NT, OS/2, and Linux operating systems
45 support this natively, and add-on packages can enable the same thing
46 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
47 provides an SMB server that can be used to provide network services to
48 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
49 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
50 NetBIOS frame) protocol.
53 Summary: Samba (SMB) client programs.
54 Group: Applications/System
55 Requires: samba-common = %{version}
59 The samba-client package provides some SMB clients to compliment the
60 built-in SMB filesystem in Linux. These clients allow access of SMB
61 shares and printing to SMB printers.
64 Summary: Files used by both Samba servers and clients.
65 Group: Applications/System
68 Samba-common provides files necessary for both the server and client
72 Summary: The Samba SMB server configuration program.
73 Group: Applications/System
74 Requires: samba = %{version} xinetd
77 The samba-swat package includes the new SWAT (Samba Web Administration
78 Tool), for remotely managing Samba's smb.conf file using your favorite
84 # copy Red Hat specific scripts
85 cp %{SOURCE5} packaging/Fedora/
86 cp %{SOURCE6} packaging/Fedora/
87 cp %{SOURCE7} packaging/Fedora/
88 cp %{SOURCE8} packaging/Fedora/winbind.init
94 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
97 libtoolize --copy --force # get it to recognize IA-64
100 EXTRA="-D_LARGEFILE64_SOURCE"
103 ## run autogen if missing the configure script
104 if [ ! -f "configure" ]; then
108 CFLAGS="$RPM_OPT_FLAGS" ./configure \
109 --prefix=%{_prefix} \
110 --localstatedir=/var \
112 --with-privatedir=%{_sysconfdir}/samba \
120 --with-sambabook=%{_datadir}/swat/using_samba \
121 --with-swatdir=%{_datadir}/swat \
122 --with-libsmbclient \
126 make %{?_smp_mflags} all nsswitch/libnss_wins.so debug2html
130 rm -rf $RPM_BUILD_ROOT
132 mkdir -p $RPM_BUILD_ROOT/sbin
133 mkdir -p $RPM_BUILD_ROOT/usr/{sbin,bin}
134 mkdir -p $RPM_BUILD_ROOT/%{initdir}
135 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/{pam.d,logrotate.d}
136 mkdir -p $RPM_BUILD_ROOT/var/{log,spool,lib}/samba
137 mkdir -p $RPM_BUILD_ROOT/%{_datadir}/swat/using_samba
138 mkdir -p $RPM_BUILD_ROOT/%{_datadir}/samba/codepages
142 make DESTDIR=$RPM_BUILD_ROOT \
147 # Install other stuff
148 install -m644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
149 install -m644 %{SOURCE9} $RPM_BUILD_ROOT/etc/samba/smbusers
150 install -m755 %{SOURCE8} $RPM_BUILD_ROOT%{_bindir}
151 install -m644 %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/samba
152 install -m644 %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/samba
153 install -m755 source/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
155 install -m755 %{SOURCE5} $RPM_BUILD_ROOT%{initdir}/smb
156 install -m755 %{SOURCE6} $RPM_BUILD_ROOT%{initdir}/winbind
157 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
158 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
160 ln -s ../usr/bin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
161 ## Samba's Makefile is breaking this currently. Remove it and set our own
162 /bin/rm -f $RPM_BUILD_ROOT/sbin/mount.smbfs
163 ln -s ../usr/bin/smbmount $RPM_BUILD_ROOT/sbin/mount.smbfs
165 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
169 mkdir -p $RPM_BUILD_ROOT/%{_lib}/security
170 mv source/bin/pam_smbpass.so $RPM_BUILD_ROOT/%{_lib}/security/pam_smbpass.so
173 mkdir -p $RPM_BUILD_ROOT/%{_lib}/security
174 install -m 755 source/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/%{_lib}/security/pam_winbind.so
175 install -m 755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so
176 install -m 755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_lib}/libnss_wins.so
177 ( cd $RPM_BUILD_ROOT/%{_lib};
178 ln -sf libnss_winbind.so libnss_winbind.so.2;
179 ln -sf libnss_wins.so libnss_wins.so.2 )
183 # make install puts libsmbclient.so in the wrong place on x86_64
184 rm -f $RPM_BUILD_ROOT/usr/lib || true
185 mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}
186 install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{_libdir}/libsmbclient.so
187 install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{_libdir}/libsmbclient.a
188 install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{_includedir}
190 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
191 install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
193 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
194 install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
197 ## Clean out man pages for tools not installed here
199 rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/editreg.1*
200 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
201 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
202 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbget.1*
203 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/smbget.5*
204 rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/mount.cifs.8*
207 rm -rf $RPM_BUILD_ROOT
210 /sbin/chkconfig --add smb
214 /sbin/chkconfig --del smb
215 rm -rf /var/log/samba/* /var/cache/samba/*
216 /sbin/service smb stop >/dev/null 2>&1
221 if [ "$1" -ge "1" ]; then
222 %{initdir}/smb condrestart >/dev/null 2>&1
227 # Add swat entry to /etc/services if not already there.
228 if [ ! "`grep ^\s**swat /etc/services`" ]; then
229 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
233 /sbin/chkconfig --add winbind
238 /sbin/chkconfig --del winbind
239 /sbin/service winbind stop >/dev/null 2>&1
243 %postun common -p /sbin/ldconfig
245 %triggerpostun -- samba < 1.9.18p7
247 /sbin/chkconfig --add smb
250 %triggerpostun -- samba < 2.0.5a-3
252 [ ! -d /var/lock/samba ] && mkdir -m 0755 /var/lock/samba
253 [ ! -d /var/spool/samba ] && mkdir -m 1777 /var/spool/samba
254 chmod 644 /etc/services
255 [ -f /etc/inetd.conf ] && chmod 644 /etc/inetd.conf
259 %defattr(-,root,root)
260 %doc README COPYING Manifest
261 %doc WHATSNEW.txt Roadmap
263 %doc examples/autofs examples/LDAP examples/libsmbclient examples/misc examples/printer-accounting
264 %doc examples/printing
266 %attr(755,root,root) /%{_lib}/security/pam_smbpass.so
269 # %{_bindir}/make_unicodemap
270 %{_bindir}/mksmbpasswd.sh
271 %{_bindir}/smbcontrol
273 # %{_bindir}/smbadduser
275 %config(noreplace) %{_sysconfdir}/sysconfig/samba
276 %config(noreplace) %{_sysconfdir}/samba/smbusers
277 %attr(755,root,root) %config %{initdir}/smb
278 %config(noreplace) %{_sysconfdir}/logrotate.d/samba
279 %config(noreplace) %{_sysconfdir}/pam.d/samba
280 # %{_mandir}/man1/make_unicodemap.1*
281 %{_mandir}/man1/smbcontrol.1*
282 %{_mandir}/man1/smbstatus.1*
283 %{_mandir}/man5/smbpasswd.5*
284 %{_mandir}/man7/samba.7*
285 %{_mandir}/man8/nmbd.8*
286 %{_mandir}/man8/pdbedit.8*
287 %{_mandir}/man8/smbd.8*
288 %{_mandir}/man8/tdbbackup.8*
289 #%{_mandir}/ja/man1/smbstatus.1*
290 #%{_mandir}/ja/man5/smbpasswd.5*
291 #%{_mandir}/ja/man7/samba.7*
292 #%{_mandir}/ja/man8/smbd.8*
293 #%{_mandir}/ja/man8/nmbd.8*
296 %attr(0700,root,root) %dir /var/log/samba
297 %attr(1777,root,root) %dir /var/spool/samba
300 %defattr(-,root,root)
301 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
304 %{_mandir}/man8/swat.8*
305 #%{_mandir}/ja/man8/swat.8*
306 %attr(755,root,root) %{_libdir}/samba/*.msg
309 %defattr(-,root,root)
312 %{_libdir}/samba/lowcase.dat
313 %{_libdir}/samba/upcase.dat
314 %{_libdir}/samba/valid.dat
322 %{_mandir}/man8/tdbdump.8*
323 %{_mandir}/man8/smbmnt.8*
324 %{_mandir}/man8/smbmount.8*
325 %{_mandir}/man8/smbumount.8*
326 %{_mandir}/man8/smbspool.8*
334 %{_mandir}/man1/findsmb.1*
335 %{_mandir}/man1/nmblookup.1*
336 %{_mandir}/man1/rpcclient.1*
337 %{_mandir}/man1/smbcacls.1*
338 %{_mandir}/man1/smbclient.1*
339 %{_mandir}/man1/smbtar.1*
340 %{_mandir}/man1/smbtree.1*
341 %{_mandir}/man8/net.8*
342 #%{_mandir}/ja/man1/smbtar.1*
343 #%{_mandir}/ja/man1/smbclient.1*
344 #%{_mandir}/ja/man1/nmblookup.1*
347 %defattr(-,root,root)
348 /%{_lib}/libnss_wins.so*
349 /%{_lib}/libnss_winbind.so*
350 /%{_lib}/security/pam_winbind.so
351 %{_libdir}/libsmbclient.a
352 %{_libdir}/libsmbclient.so
353 %{_libdir}/samba/charset/CP*.so
354 %{_includedir}/libsmbclient.h
358 # %{_bindir}/make_printerdef
364 %{_bindir}/smbcquotas
367 %config(noreplace) %{_sysconfdir}/samba/smb.conf
368 %config(noreplace) %{_sysconfdir}/samba/lmhosts
369 %dir %{_datadir}/samba
370 %dir %{_datadir}/samba/codepages
371 %dir %{_sysconfdir}/samba
373 # %{_datadir}/samba/codepages/*
374 # %{_mandir}/man1/make_smbcodepage.1*
375 %{_mandir}/man1/ntlm_auth.1*
376 %{_mandir}/man1/profiles.1*
377 %{_mandir}/man1/smbcquotas.1*
378 %{_mandir}/man1/testparm.1*
379 %{_mandir}/man1/testprns.1*
380 %{_mandir}/man5/smb.conf.5*
381 %{_mandir}/man5/lmhosts.5*
382 %{_mandir}/man8/smbpasswd.8*
383 %{_mandir}/man1/wbinfo.1*
384 %{_mandir}/man8/winbindd.8*
385 %{_mandir}/man1/vfstest.1*
387 # #%lang(ja) %{_mandir}/ja/man1/make_smbcodepage.1*
388 #%lang(ja) %{_mandir}/ja/man1/testparm.1*
389 #%lang(ja) %{_mandir}/ja/man1/testprns.1*
390 #%lang(ja) %{_mandir}/ja/man5/smb.conf.5*
391 #%lang(ja) %{_mandir}/ja/man5/lmhosts.5*
392 #%lang(ja) %{_mandir}/ja/man8/smbpasswd.8*
395 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
396 - Removed ChangeLog entries since they are kept in CVS