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>
11 License: GNU GPL version 3
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 Source997: docs.tar.bz2
19 Source998: filter-requires-samba.sh
20 Source999: setup.tar.bz2
22 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
23 Prereq: fileutils sed /etc/init.d
25 Requires: pam >= 0.64 %{auth}
26 Requires: samba-common = %{version}-%{release}
27 Requires: logrotate >= 3.4 initscripts >= 5.54-1
28 Provides: samba = %{version}
31 BuildRoot: %{_tmppath}/%{name}-%{version}-root
32 BuildRequires: pam-devel, readline-devel, fileutils, libacl-devel, openldap-devel, krb5-devel, cups-devel, ctdb
34 # Working around perl dependency problem from docs
35 %define __perl_requires %{SOURCE998}
37 # rpm screws up the arch lib dir when using --target on RHEL5
38 %ifarch i386 i486 i586 i686 ppc s390
41 %define _libarch %_lib
44 %define _libarchdir /usr/%{_libarch}
48 Samba is the protocol by which a lot of PC-related machines share
49 files, printers, and other information (such as lists of available
50 files and printers). The Windows NT, OS/2, and Linux operating systems
51 support this natively, and add-on packages can enable the same thing
52 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
53 provides an SMB server that can be used to provide network services to
54 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
55 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
56 NetBIOS frame) protocol.
59 ######################################################################
61 Summary: Samba (SMB) client programs.
62 Group: Applications/System
63 Requires: samba-common = %{version}-%{release}
65 Provides: samba-client = %{version}-%{release}
68 The samba-client package provides some SMB clients to compliment the
69 built-in SMB filesystem in Linux. These clients allow access of SMB
70 shares and printing to SMB printers.
73 #######################################################################
75 Summary: Files used by both Samba servers and clients.
76 Group: Applications/System
77 Provides: samba-common = %{version}-%{release}
80 Samba-common provides files necessary for both the server and client
84 #######################################################################
86 Summary: The Samba SMB server configuration program.
87 Group: Applications/System
88 Requires: samba = %{version} xinetd
89 Provides: samba-swat = %{version}-%{release}
92 The samba-swat package includes the new SWAT (Samba Web Administration
93 Tool), for remotely managing Samba's smb.conf file using your favorite
97 %package winbind-32bit
98 Summary: Samba winbind compatibility package for 32bit apps on 64bit archs
99 Group: Applications/System
101 %description winbind-32bit
102 Compatibility package for 32 bit apps on 64 bit architecures
106 #######################################################################
108 Summary: Samba Documentation
109 Group: Documentation/Other
110 Provides: samba-doc = %{version}-%{release}
111 Prereq: /usr/bin/find /bin/rm /usr/bin/xargs
114 The samba-doc package includes the HTML versions of the Samba manpages
115 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
116 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
119 #######################################################################
124 # setup the vendor files (init scripts, etc...)
125 %setup -T -D -a 999 -n samba-%{version} -q
126 %setup -T -D -a 997 -n samba-%{version} -q
130 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
133 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
136 if ccache -h >/dev/null 2>&1 ; then
144 ## always run autogen.sh
149 ## build the files for the winbind-32bit compat package
150 ## and copy them to a safe location
154 # a directory to store the 32bit compatibility modules for later install
155 %define _32bit_tmp_dir %{_tmppath}/%{name}-%{version}-32bit
160 CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -m32" ./configure \
161 --prefix=%{_prefix} \
162 --localstatedir=/var \
163 --with-configdir=%{_sysconfdir}/samba \
164 --with-libdir=/usr/lib/samba \
165 --with-pammodulesdir=/lib/security \
166 --with-lockdir=/var/lib/samba \
167 --with-logfilebase=/var/log/samba \
168 --with-mandir=%{_mandir} \
169 --with-piddir=/var/run \
170 --with-privatedir=%{_sysconfdir}/samba \
177 --with-libsmbclient \
178 --with-libsmbsharemodes \
179 --without-smbwrapper \
184 --with-cluster-support \
185 --with-ctdb=/usr/include \
187 --without-dnsupdate \
192 ## check for gcc 3.4 or later
193 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
194 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
195 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
196 if [ ${CC_MAJOR} -ge 3 ]; then
197 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
202 make %{?_smp_mflags} \
203 nss_modules pam_modules
205 rm -rf %{_32bit_tmp_dir}
206 mkdir %{_32bit_tmp_dir}
208 mv ../nsswitch/libnss_winbind.so %{_32bit_tmp_dir}/
209 mv bin/pam_winbind.so %{_32bit_tmp_dir}/
210 mv bin/libtalloc.so* %{_32bit_tmp_dir}/
211 mv bin/libtdb.so* %{_32bit_tmp_dir}/
219 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
220 --prefix=%{_prefix} \
221 --localstatedir=/var \
222 --with-configdir=%{_sysconfdir}/samba \
223 --libdir=%{_libarchdir} \
224 --with-modulesdir=%{_libarchdir}/samba \
225 --with-pammodulesdir=%{_libarch}/security \
226 --with-lockdir=/var/lib/samba \
227 --with-logfilebase=/var/log/samba \
228 --with-mandir=%{_mandir} \
229 --with-piddir=/var/run \
230 --with-privatedir=%{_sysconfdir}/samba \
231 --with-sambabook=%{_datadir}/swat/using_samba \
232 --with-swatdir=%{_datadir}/swat \
239 --with-libsmbclient \
240 --with-libsmbsharemodes \
241 --without-smbwrapper \
244 --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs \
247 --with-cluster-support \
248 --with-ctdb=/usr/include \
250 --without-dnsupdate \
255 ## check for gcc 3.4 or later
256 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
257 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
258 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
259 if [ ${CC_MAJOR} -ge 3 ]; then
260 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
266 make %{?_smp_mflags} \
267 all modules pam_smbpass
269 # Remove some permission bits to avoid to many dependencies
271 find examples docs -type f | xargs -r chmod -x
274 # Clean up in case there is trash left from a previous build
275 rm -rf $RPM_BUILD_ROOT
277 # Create the target build directory hierarchy
278 mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
279 mkdir -p $RPM_BUILD_ROOT%{_includedir}
280 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
281 mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
282 mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
283 mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
284 mkdir -p $RPM_BUILD_ROOT/lib/security
285 mkdir -p $RPM_BUILD_ROOT%{_mandir}
286 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
287 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
288 mkdir -p $RPM_BUILD_ROOT/sbin
289 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{logrotate.d,pam.d,samba}
290 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,logrotate.d}
291 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
292 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
293 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
294 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
295 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
298 make DESTDIR=$RPM_BUILD_ROOT \
302 # NSS winbind support
303 install -m 755 nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
304 ( cd $RPM_BUILD_ROOT/%{_libarch};
305 ln -sf libnss_winbind.so.2 libnss_winbind.so )
307 # do not install libnss_wins.so in order to reduce dependencies
308 # (we do not need it for the samba-ctdb scenario)
310 #install -m 755 nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so
311 # ( cd $RPM_BUILD_ROOT/%{_libarch}; ln -sf libnss_wins.so libnss_wins.so.2 )
314 # install files for winbind-32bit package
317 install -m 755 %{_32bit_tmp_dir}/libnss_winbind.so ${RPM_BUILD_ROOT}/lib/libnss_winbind.so.2
318 ( cd ${RPM_BUILD_ROOT}/lib; ln -sf libnss_winbind.so.2 libnss_winbind.so )
320 mv %{_32bit_tmp_dir}/libtalloc* ${RPM_BUILD_ROOT}/usr/lib
321 mv %{_32bit_tmp_dir}/libtdb* ${RPM_BUILD_ROOT}/usr/lib
322 mv %{_32bit_tmp_dir}/pam_winbind.so ${RPM_BUILD_ROOT}/lib/security
324 rm -rf %{_32bit_tmp_dir}
329 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
331 # Install the miscellany
332 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
334 install -m644 setup/samba.log $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/samba
335 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
336 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
337 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
338 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
339 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
340 install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
341 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
342 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
343 install -m755 source3/bin/mount.cifs $RPM_BUILD_ROOT/sbin/mount.cifs
344 install -m755 source3/bin/umount.cifs $RPM_BUILD_ROOT/sbin/umount.cifs
345 install -m755 source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
347 /bin/rm $RPM_BUILD_ROOT%{_sbindir}/*mount.cifs
349 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
350 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
352 # Remove "*.old" files
353 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
355 ## don't duplicate the docs. These are installed by/with SWAT
358 ( cd docs; ln -s %{_prefix}/share/swat/help htmldocs )
361 ## Clean out man pages for tools not installed here
363 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
364 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
365 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
369 rm -rf $RPM_BUILD_ROOT
372 ## deal with an upgrade from a broken 3.0.21b RPM
373 if [ "$1" -eq "2" ]; then
374 if [ -d /var/cache/samba ]; then
375 for file in `ls /var/cache/samba/*tdb`; do
376 /bin/cp -up $file /var/lib/samba/`basename $file`
378 mkdir -p /var/lib/samba/eventlog
379 for file in `ls /var/cache/samba/eventlog/*tdb`; do
380 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
382 /bin/mv /var/cache/samba /var/cache/samba.moved
386 if [ "$1" -ge "1" ]; then
387 /sbin/service smb condrestart >/dev/null 2>&1 || :
392 /sbin/service smb stop >/dev/null 2>&1 || :
393 /sbin/chkconfig --del smb
394 # rm -rf /var/log/samba/* /var/lib/samba/*
401 # Add swat entry to /etc/services if not already there.
402 if [ ! "`grep ^\s**swat /etc/services`" ]; then
403 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
409 if [ "$1" -ge "1" ]; then
410 /sbin/service winbind condrestart >/dev/null 2>&1 || :
415 /sbin/service winbind stop >/dev/null 2>&1 || :
416 /sbin/chkconfig --del winbind
423 #######################################################################
425 #######################################################################
428 %defattr(-,root,root)
430 %config(noreplace) %{_sysconfdir}/sysconfig/samba
431 %config(noreplace) %{_sysconfdir}/samba/smbusers
432 %attr(755,root,root) %config %{initdir}/smb
433 %config(noreplace) %{_sysconfdir}/logrotate.d/samba
434 %config(noreplace) %{_sysconfdir}/pam.d/samba
436 %attr(0755,root,root) %dir /var/log/samba
437 %attr(0755,root,root) %dir /var/lib/samba
438 %attr(1777,root,root) %dir /var/spool/samba
445 %{_bindir}/mksmbpasswd.sh
446 %{_bindir}/smbcontrol
451 %{_bindir}/eventlogadm
453 %{_libarchdir}/samba/idmap/*.so
454 %{_libarchdir}/samba/nss_info/*.so
455 %{_libarchdir}/samba/vfs/*.so
456 %{_libarchdir}/samba/auth/*.so
458 %{_mandir}/man1/smbcontrol.1*
459 %{_mandir}/man1/smbstatus.1*
460 %{_mandir}/man1/vfstest.1*
461 %{_mandir}/man5/smbpasswd.5*
462 %{_mandir}/man7/samba.7*
463 %{_mandir}/man8/nmbd.8*
464 %{_mandir}/man8/pdbedit.8*
465 %{_mandir}/man8/smbd.8*
466 %{_mandir}/man8/tdbbackup.8*
467 %{_mandir}/man8/tdbdump.8*
468 %{_mandir}/man8/tdbtool.8*
469 %{_mandir}/man8/eventlogadm.8*
470 %{_mandir}/man8/vfs_*.8*
471 %{_mandir}/man8/idmap_*.8*
477 %defattr(-,root,root)
478 %doc README COPYING Manifest
479 %doc WHATSNEW.txt Roadmap
481 %doc examples/autofs examples/LDAP examples/libsmbclient examples/misc examples/printer-accounting
482 %doc examples/printing
487 %defattr(-,root,root)
488 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
489 %dir %{_datadir}/swat
492 %{_mandir}/man8/swat.8*
493 %attr(755,root,root) %{_libarchdir}/samba/*.msg
498 %defattr(-,root,root)
502 %{_sbindir}/cifs.upcall
515 %{_mandir}/man8/mount.cifs.8.*
516 %{_mandir}/man8/umount.cifs.8.*
517 %{_mandir}/man8/cifs.upcall.8*
518 %{_mandir}/man8/smbspool.8*
519 %{_mandir}/man1/smbget.1*
520 %{_mandir}/man5/smbgetrc.5*
521 %{_mandir}/man1/findsmb.1*
522 %{_mandir}/man1/nmblookup.1*
523 %{_mandir}/man1/rpcclient.1*
524 %{_mandir}/man1/smbcacls.1*
525 %{_mandir}/man1/smbclient.1*
526 %{_mandir}/man1/smbtar.1*
527 %{_mandir}/man1/smbtree.1*
532 %defattr(-,root,root)
533 %dir %{_sysconfdir}/samba
534 %dir %{_libarchdir}/samba
535 %dir %{_libarchdir}/samba/charset
536 %config(noreplace) %{_sysconfdir}/samba/smb.conf
537 %config(noreplace) %{_sysconfdir}/samba/lmhosts
538 %attr(755,root,root) %config %{initdir}/winbind
540 #%attr(755,root,root) /%{_libarch}/libnss_wins.so*
541 %attr(755,root,root) /%{_libarch}/libnss_winbind.so*
542 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so
543 %attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
545 %{_includedir}/libsmbclient.h
546 %{_libarchdir}/libsmbclient.*
547 #%{_includedir}/libmsrpc.h
548 #%{_libarchdir}/libmsrpc.*
549 %{_includedir}/smb_share_modes.h
550 %{_libarchdir}/libsmbsharemodes.*
552 %{_libarchdir}/samba/*.dat
553 %{_libarchdir}/samba/charset/*.so
555 %{_includedir}/netapi.h
556 %{_includedir}/wbclient.h
557 %{_includedir}/talloc.h
559 %{_libarchdir}/libnetapi.so*
560 %{_libarchdir}/libtalloc.so*
561 %{_libarchdir}/libtdb.so*
562 %{_libarchdir}/libwbclient.so*
580 %{_bindir}/smbcquotas
582 %{_mandir}/man1/ntlm_auth.1*
583 %{_mandir}/man1/profiles.1*
584 %{_mandir}/man1/smbcquotas.1*
585 %{_mandir}/man1/testparm.1*
586 %{_mandir}/man5/smb.conf.5*
587 %{_mandir}/man5/lmhosts.5*
588 %{_mandir}/man8/smbpasswd.8*
589 %{_mandir}/man1/wbinfo.1*
590 %{_mandir}/man8/winbindd.8*
591 %{_mandir}/man8/net.8*
592 %{_mandir}/man7/pam_winbind.7*
593 %{_mandir}/man7/libsmbclient.7*
594 %{_mandir}/man1/ldbadd.1*
595 %{_mandir}/man1/ldbdel.1*
596 %{_mandir}/man1/ldbedit.1*
597 %{_mandir}/man1/ldbmodify.1*
598 %{_mandir}/man1/ldbsearch.1*
602 %attr(755,root,root) /lib/libnss_winbind.so*
603 #%attr(755,root,root) /lib/libnss_wins.so*
604 %attr(755,root,root) /usr/lib/libtalloc.so*
605 %attr(755,root,root) /usr/lib/libtdb.so*
606 %attr(755,root,root) /lib/security/pam_winbind.so
612 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
613 - Removed ChangeLog entries since they are kept in CVS