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: Samba SMB client and server
6 Packager: Samba Team <samba@samba.org>
9 Release: PRELEASEPRPMREV
11 License: GNU GPL version 2
12 Group: System Environment/Daemons
13 URL: http://www.samba.org/
15 Source: samba-%{version}.tar.bz2
17 # Don't depend on Net::LDAP
18 Source998: filter-requires-samba.sh
19 Source999: setup.tar.bz2
21 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
22 Prereq: fileutils sed /etc/init.d
24 Requires: pam >= 0.64 %{auth}
25 Requires: samba-common = %{version}-%{release}
26 Requires: logrotate >= 3.4 initscripts >= 5.54-1
27 Provides: samba = %{version}
30 BuildRoot: %{_tmppath}/%{name}-%{version}-root
31 BuildRequires: pam-devel, readline-devel, fileutils, libacl-devel, openldap-devel, krb5-devel, cups-devel
33 # Working around perl dependency problem from docs
34 %define __perl_requires %{SOURCE998}
38 Samba is the protocol by which a lot of PC-related machines share
39 files, printers, and other information (such as lists of available
40 files and printers). The Windows NT, OS/2, and Linux operating systems
41 support this natively, and add-on packages can enable the same thing
42 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
43 provides an SMB server that can be used to provide network services to
44 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
45 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
46 NetBIOS frame) protocol.
49 #######################################################################
51 Summary: Samba (SMB) client programs.
52 Group: Applications/System
53 Requires: samba-common = %{version}-%{release}
55 Provides: samba-client = %{version}-%{release}
58 The samba-client package provides some SMB clients to compliment the
59 built-in SMB filesystem in Linux. These clients allow access of SMB
60 shares and printing to SMB printers.
63 #######################################################################
65 Summary: Files used by both Samba servers and clients.
66 Group: Applications/System
67 Provides: samba-common = %{version}-%{release}
70 Samba-common provides files necessary for both the server and client
74 #######################################################################
76 Summary: The Samba SMB server configuration program.
77 Group: Applications/System
78 Requires: samba = %{version} xinetd
79 Provides: samba-swat = %{version}-%{release}
82 The samba-swat package includes the new SWAT (Samba Web Administration
83 Tool), for remotely managing Samba's smb.conf file using your favorite
87 #######################################################################
89 Summary: Samba Documentation
90 Group: Documentation/Other
91 Provides: samba-doc = %{version}-%{release}
92 Prereq: /usr/bin/find /bin/rm /usr/bin/xargs
95 The samba-doc package includes the HTML versions of the Samba manpages
96 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
97 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
100 #######################################################################
105 # setup the vendor files (init scripts, etc...)
106 %setup -T -D -a 999 -n samba-%{version} -q
110 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
113 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
116 # ccache -h 2>&1 > /dev/null
117 #if [ $? -eq 0 ]; then
123 ## always run autogen.sh
126 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
127 --prefix=%{_prefix} \
128 --localstatedir=/var \
129 --with-configdir=%{_sysconfdir}/samba \
130 --with-libdir=%{_libdir}/samba \
131 --with-lockdir=/var/lib/samba \
132 --with-logfilebase=/var/log/samba \
133 --with-mandir=%{_mandir} \
134 --with-piddir=/var/run \
135 --with-privatedir=%{_sysconfdir}/samba \
136 --with-sambabook=%{_datadir}/swat/using_samba \
137 --with-swatdir=%{_datadir}/swat \
144 --with-libsmbclient \
145 --with-libsmbsharemodes \
146 --without-smbwrapper \
149 --with-shared-modules=idmap_rid,idmap_ad \
157 make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" proto
159 ## check for gcc 3.4 or later
160 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
161 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
162 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
163 if [ ${CC_MAJOR} -ge 3 ]; then
164 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
170 make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" %{?_smp_mflags} \
171 all modules pam_smbpass
173 ## build the cifs fs mount helper
175 gcc -o mount.cifs $RPM_OPT_FLAGS -D_GNU_SOURCE -Wall -D_GNU_SOURCE -D_LARGEFILE64_SOURCE mount.cifs.c
176 gcc -o umount.cifs $RPM_OPT_FLAGS -D_GNU_SOURCE -Wall -D_GNU_SOURCE -D_LARGEFILE64_SOURCE umount.cifs.c
179 # Remove some permission bits to avoid to many dependencies
181 find examples docs -type f | xargs -r chmod -x
184 # Clean up in case there is trash left from a previous build
185 rm -rf $RPM_BUILD_ROOT
187 # Create the target build directory hierarchy
188 mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
189 mkdir -p $RPM_BUILD_ROOT%{_includedir}
190 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
191 mkdir -p $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
192 mkdir -p $RPM_BUILD_ROOT%{_libdir}/samba/{auth,charset,idmap,vfs,pdb}
193 mkdir -p $RPM_BUILD_ROOT/%{_lib}/security
194 mkdir -p $RPM_BUILD_ROOT%{_mandir}
195 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
196 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
197 mkdir -p $RPM_BUILD_ROOT/sbin
198 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{logrotate.d,pam.d,samba}
199 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,logrotate.d}
200 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
201 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
202 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
203 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
204 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
207 make DESTDIR=$RPM_BUILD_ROOT \
212 cp source/bin/pam_smbpass.so $RPM_BUILD_ROOT/%{_lib}/security/pam_smbpass.so
214 # NSS & PAM winbind support
215 install -m 755 source/bin/pam_winbind.so $RPM_BUILD_ROOT/%{_lib}/security/pam_winbind.so
216 install -m 755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so
217 install -m 755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_lib}/libnss_wins.so
218 ( cd $RPM_BUILD_ROOT/%{_lib};
219 ln -sf libnss_winbind.so libnss_winbind.so.2;
220 ln -sf libnss_wins.so libnss_wins.so.2 )
222 # make install puts libsmbclient.so in the wrong place on x86_64
223 rm -f $RPM_BUILD_ROOT/usr/lib*/samba/libsmbclient.so $RPM_BUILD_ROOT/usr/lib*/samba/libsmbclient.a || true
224 install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{_libdir}/libsmbclient.so
225 install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{_libdir}/libsmbclient.a
226 install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{_includedir}
227 ln -s %{_libdir}/libsmbclient.so $RPM_BUILD_ROOT%{_libdir}/libsmbclient.so.0
229 # make install puts libsmbsharemodes.so in the wrong place on x86_64
230 rm -f $RPM_BUILD_ROOT/usr/lib*/samba/libsmbsharemodes.so $RPM_BUILD_ROOT/usr/lib*/samba/libsmbsharemodes.a || true
231 install -m 755 source/bin/libsmbsharemodes.so $RPM_BUILD_ROOT%{_libdir}/libsmbsharemodes.so
232 install -m 755 source/bin/libsmbsharemodes.a $RPM_BUILD_ROOT%{_libdir}/libsmbsharemodes.a
233 install -m 644 source/include/smb_share_modes.h $RPM_BUILD_ROOT%{_includedir}
234 rm -f $RPM_BUILD_ROOT%{_libdir}/samba/libsmbsharemodes.*
235 ln -s /%{_libdir}/libsmbsharemodes.so $RPM_BUILD_ROOT%{_libdir}/libsmbsharemodes.so.0
237 # Install pam_smbpass.so
238 install -m755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/%{_lib}/security/pam_smbpass.so
241 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
243 # we need a symlink for mount to recognise the smb and smbfs filesystem types
244 ln -sf %{_prefix}/bin/smbmount $RPM_BUILD_ROOT/sbin/mount.smbfs
245 ln -sf %{_prefix}/bin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
246 /bin/rm -f $RPM_BUILD_ROOT/mount.smbfs
248 # Install the miscellany
249 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
251 install -m644 setup/samba.log $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/samba
252 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
253 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
254 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
255 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
256 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
257 install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
258 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
259 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
260 install -m755 source/client/mount.cifs $RPM_BUILD_ROOT/sbin/mount.cifs
261 install -m755 source/client/umount.cifs $RPM_BUILD_ROOT/sbin/umount.cifs
262 install -m755 source/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
264 /bin/rm $RPM_BUILD_ROOT%{_sbindir}/*mount.cifs
266 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
267 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
269 # Remove "*.old" files
270 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
272 ## don't duplicate the docs. These are installed by/with SWAT
275 ( cd docs; ln -s %{_prefix}/share/swat/help htmldocs )
278 ## Clean out man pages for tools not installed here
280 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
281 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
282 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
286 rm -rf $RPM_BUILD_ROOT
289 ## deal with an upgrade from a broken 3.0.21b RPM
290 if [ "$1" -eq "2" ]; then
291 if [ -d /var/cache/samba ]; then
292 for file in `ls /var/cache/samba/*tdb`; do
293 /bin/cp -up $file /var/lib/samba/`basename $file`
295 mkdir -p /var/lib/samba/eventlog
296 for file in `ls /var/cache/samba/eventlog/*tdb`; do
297 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
299 /bin/mv /var/cache/samba /var/cache/samba.moved
305 /sbin/chkconfig --del smb
306 /sbin/chkconfig --del winbind
307 # rm -rf /var/log/samba/* /var/lib/samba/*
308 /sbin/service smb stop >/dev/null 2>&1
313 if [ "$1" -ge "1" ]; then
314 %{initdir}/smb restart >/dev/null 2>&1
319 # Add swat entry to /etc/services if not already there.
320 if [ ! "`grep ^\s**swat /etc/services`" ]; then
321 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
330 #######################################################################
332 #######################################################################
335 %defattr(-,root,root)
337 %config(noreplace) %{_sysconfdir}/sysconfig/samba
338 %config(noreplace) %{_sysconfdir}/samba/smbusers
339 %attr(755,root,root) %config %{initdir}/smb
340 %attr(755,root,root) %config %{initdir}/winbind
341 %config(noreplace) %{_sysconfdir}/logrotate.d/samba
342 %config(noreplace) %{_sysconfdir}/pam.d/samba
344 %attr(0755,root,root) %dir /var/log/samba
345 %attr(0755,root,root) %dir /var/lib/samba
346 %attr(1777,root,root) %dir /var/spool/samba
355 %{_bindir}/mksmbpasswd.sh
356 %{_bindir}/smbcontrol
364 %{_bindir}/eventlogadm
366 %{_libdir}/samba/idmap/*.so
367 %{_libdir}/samba/nss_info/*.so
368 %{_libdir}/samba/vfs/*.so
369 %{_libdir}/samba/auth/*.so
371 %{_mandir}/man1/smbcontrol.1*
372 %{_mandir}/man1/smbstatus.1*
373 %{_mandir}/man1/vfstest.1*
374 %{_mandir}/man5/smbpasswd.5*
375 %{_mandir}/man7/samba.7*
376 %{_mandir}/man8/nmbd.8*
377 %{_mandir}/man8/pdbedit.8*
378 %{_mandir}/man8/smbd.8*
379 %{_mandir}/man8/tdbbackup.8*
380 %{_mandir}/man8/tdbdump.8*
381 %{_mandir}/man8/tdbtool.8*
382 %{_mandir}/man8/eventlogadm.8*
383 %{_mandir}/man8/winbindd.8*
384 %{_mandir}/man1/ntlm_auth.1*
385 %{_mandir}/man1/wbinfo.1*
386 %{_mandir}/man8/vfs_*.8*
387 %{_mandir}/man8/idmap_*.8*
393 %defattr(-,root,root)
394 %doc README COPYING Manifest
395 %doc WHATSNEW.txt Roadmap
397 %doc examples/autofs examples/LDAP examples/libsmbclient examples/misc examples/printer-accounting
398 %doc examples/printing
399 %doc %{_datadir}/swat/help
400 %doc %{_datadir}/swat/using_samba
405 %defattr(-,root,root)
406 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
407 %dir %{_datadir}/swat
408 %{_datadir}/swat/include
409 %{_datadir}/swat/images
410 %{_datadir}/swat/lang
412 %{_mandir}/man8/swat.8*
417 %defattr(-,root,root)
429 %{_bindir}/smbcquotas
439 %{_mandir}/man8/smbmnt.8*
440 %{_mandir}/man8/smbmount.8*
441 %{_mandir}/man8/smbumount.8*
442 %{_mandir}/man8/mount.cifs.8.*
443 %{_mandir}/man8/umount.cifs.8.*
444 %{_mandir}/man8/smbspool.8*
445 %{_mandir}/man1/smbget.1*
446 %{_mandir}/man5/smbgetrc.5*
447 %{_mandir}/man1/findsmb.1*
448 %{_mandir}/man1/nmblookup.1*
449 %{_mandir}/man1/rpcclient.1*
450 %{_mandir}/man1/smbcacls.1*
451 %{_mandir}/man1/smbclient.1*
452 %{_mandir}/man1/smbtar.1*
453 %{_mandir}/man1/smbtree.1*
454 %{_mandir}/man8/net.8*
455 %{_mandir}/man1/smbcquotas.1*
460 %defattr(-,root,root)
461 %dir %{_sysconfdir}/samba
462 %config(noreplace) %{_sysconfdir}/samba/smb.conf
463 %config(noreplace) %{_sysconfdir}/samba/lmhosts
465 %attr(755,root,root) /%{_lib}/libnss_wins.so*
466 %attr(755,root,root) /%{_lib}/libnss_winbind.so*
467 %attr(755,root,root) /%{_lib}/security/pam_winbind.so
468 %attr(755,root,root) /%{_lib}/security/pam_smbpass.so
470 %{_includedir}/libsmbclient.h
471 %{_libdir}/libsmbclient.*
472 %{_includedir}/smb_share_modes.h
473 %{_libdir}/libsmbsharemodes.*
475 %{_libdir}/samba/*.dat
476 %{_libdir}/samba/*.msg
477 %{_libdir}/samba/charset/*.so
483 %{_mandir}/man1/profiles.1*
484 %{_mandir}/man1/testparm.1*
485 %{_mandir}/man5/smb.conf.5*
486 %{_mandir}/man5/lmhosts.5*
487 %{_mandir}/man8/smbpasswd.8*
488 %{_mandir}/man7/libsmbclient.7*
489 %{_mandir}/man7/pam_winbind.7*
492 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
493 - Removed ChangeLog entries since they are kept in CVS