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 Source998: filter-requires-samba.sh
19 Source999: setup.tar.bz2
21 Requires: /sbin/chkconfig /bin/mktemp /usr/bin/killall
22 Requires: fileutils sed /etc/init.d
24 Requires: pam >= 0.64 %{auth}
25 Requires: samba-common = %{version}-%{release}
26 Provides: samba = %{version}
29 BuildRoot: %{_tmppath}/%{name}-%{version}-root
30 BuildRequires: pam-devel, readline-devel, fileutils, libacl-devel, openldap-devel, krb5-devel, cups-devel, e2fsprogs-devel, gettext
31 # requirements for building the man pages:
32 BuildRequires: libxslt, docbook-utils, docbook-style-xsl, rsync
33 BuildRequires: ctdb-devel >= 1.2.25
35 # Working around perl dependency problem from docs
36 %define __perl_requires %{SOURCE998}
38 # rpm screws up the arch lib dir when using --target on RHEL5
39 %ifarch i386 i486 i586 i686 ppc s390
42 %define _libarch %_lib
45 %define _libarchdir /usr/%{_libarch}
47 %define numcpu %(grep "^processor" /proc/cpuinfo |wc -l | sed -e 's/^0$/1/')
50 Samba is the protocol by which a lot of PC-related machines share
51 files, printers, and other information (such as lists of available
52 files and printers). The Windows NT, OS/2, and Linux operating systems
53 support this natively, and add-on packages can enable the same thing
54 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
55 provides an SMB server that can be used to provide network services to
56 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
57 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
58 NetBIOS frame) protocol.
61 ######################################################################
63 Summary: Samba (SMB) client programs.
64 Group: Applications/System
65 Requires: samba-common = %{version}-%{release}
67 Provides: samba-client = %{version}-%{release}
70 The samba-client package provides some SMB clients to compliment the
71 built-in SMB filesystem in Linux. These clients allow access of SMB
72 shares and printing to SMB printers.
75 #######################################################################
77 Summary: Files used by both Samba servers and clients.
78 Group: Applications/System
79 Provides: samba-common = %{version}-%{release}
80 Requires: libtalloc >= 2.0.1
81 Requires: libtdb >= 1.2.6
84 Samba-common provides files necessary for both the server and client
88 #######################################################################
90 Summary: the tdb library
91 Group: Applications/System
92 Provides: libtdb = LIBTDBVERSION-%{release}
94 #Conflicts: libtdb < LIBTALLOCVERSION
99 #######################################################################
101 Summary: the talloc library
102 Group: Applications/System
103 Provides: libtalloc = LIBTALLOCVERSION-%{release}
105 #Conflicts: libtalloc < LIBTALLOCVERSION
107 %description libtalloc
108 Samba's talloc library
110 #######################################################################
112 Summary: The Samba SMB server configuration program.
113 Group: Applications/System
114 Requires: samba = %{version} xinetd
115 Provides: samba-swat = %{version}-%{release}
118 The samba-swat package includes the new SWAT (Samba Web Administration
119 Tool), for remotely managing Samba's smb.conf file using your favorite
123 #######################################################################
125 Summary: Samba Documentation
126 Group: Documentation/Other
127 Provides: samba-doc = %{version}-%{release}
128 Requires: /usr/bin/find /bin/rm /usr/bin/xargs
131 The samba-doc package includes the HTML versions of the Samba manpages
132 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
133 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
136 #######################################################################
141 # setup the vendor files (init scripts, etc...)
142 %setup -T -D -a 999 -n samba-%{version} -q
146 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
149 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
152 if ccache -h >/dev/null 2>&1 ; then
160 ## always run autogen.sh
164 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
165 --prefix=%{_prefix} \
166 --localstatedir=/var \
167 --with-configdir=%{_sysconfdir}/samba \
168 --libdir=%{_libarchdir} \
169 --with-modulesdir=%{_libarchdir}/samba \
170 --with-pammodulesdir=%{_libarch}/security \
171 --with-lockdir=/var/lib/samba \
172 --with-logfilebase=/var/log/samba \
173 --mandir=%{_mandir} \
174 --with-piddir=/var/run \
175 --with-privatedir=%{_sysconfdir}/samba \
176 --with-sambabook=%{_datadir}/swat/using_samba \
177 --with-swatdir=%{_datadir}/swat \
184 --with-libsmbclient \
185 --with-libsmbsharemodes \
186 --without-smbwrapper \
189 --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs,vfs_tsmsm \
192 --with-cluster-support \
193 --with-ctdb=/usr/include \
195 --without-dnsupdate \
197 --disable-merged-build \
198 --disable-smbtorture4 \
199 --disable-external-libtalloc \
200 --disable-external-libtdb
204 ## check for gcc 3.4 or later
205 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
206 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
207 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
208 if [ ${CC_MAJOR} -ge 3 ]; then
209 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
215 make -j %{numcpu} %{?_smp_mflags} \
216 everything modules pam_smbpass
218 # check that desired suppor has been compiled into smbd:
219 export LD_LIBRARY_PATH=./bin
220 for test in HAVE_POSIX_ACLS HAVE_LDAP HAVE_KRB5 HAVE_GPFS CLUSTER_SUPPORT
222 if ! $(./bin/smbd -b | grep -q $test ) ; then
223 echo "ERROR: '$test' is not in smbd. Build stopped."
228 # try and build the manpages
230 ./release-scripts/build-manpages-nogit
232 # Remove some permission bits to avoid to many dependencies
233 find examples docs -type f | xargs -r chmod -x
236 # Clean up in case there is trash left from a previous build
237 rm -rf $RPM_BUILD_ROOT
239 # Create the target build directory hierarchy
240 mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
241 mkdir -p $RPM_BUILD_ROOT%{_includedir}
242 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
243 mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
244 mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
245 mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
246 mkdir -p $RPM_BUILD_ROOT/lib/security
247 mkdir -p $RPM_BUILD_ROOT%{_mandir}
248 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
249 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
250 mkdir -p $RPM_BUILD_ROOT/sbin
251 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,samba}
252 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d}
253 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
254 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
255 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
256 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
257 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
258 mkdir -p $RPM_BUILD_ROOT/%{_libarchdir}/krb5/plugins/libkrb5
261 make DESTDIR=$RPM_BUILD_ROOT \
264 make DESTDIR=$RPM_BUILD_ROOT \
265 install-dbwrap_tool install-dbwrap_torture
268 # NSS winbind support
269 install -m 755 nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
270 ( cd $RPM_BUILD_ROOT/%{_libarch};
271 ln -sf libnss_winbind.so.2 libnss_winbind.so )
273 # do not install libnss_wins.so in order to reduce dependencies
274 # (we do not need it for the samba-ctdb scenario)
276 #install -m 755 nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so
277 # ( cd $RPM_BUILD_ROOT/%{_libarch}; ln -sf libnss_wins.so libnss_wins.so.2 )
279 cp -p source3/bin/winbind_krb5_locator.so ${RPM_BUILD_ROOT}/%{_libarchdir}/krb5/plugins/libkrb5
283 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
285 # remove installed but unpackaged files:
286 /bin/rm -f $RPM_BUILD_ROOT/usr/lib*/libtalloc.so
287 /bin/rm -f $RPM_BUILD_ROOT/usr/lib*/libtdb.so
290 # Install the miscellany
291 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
293 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
294 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
295 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
296 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
297 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
298 install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
299 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
300 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
301 install -m755 source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
303 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
304 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
306 # Remove "*.old" files
307 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
311 ## Clean out man pages for tools not installed here
313 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
314 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
315 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
319 rm -rf $RPM_BUILD_ROOT
322 ## deal with an upgrade from a broken 3.0.21b RPM
323 if [ "$1" -eq "2" ]; then
324 if [ -d /var/cache/samba ]; then
325 for file in `ls /var/cache/samba/*tdb`; do
326 /bin/cp -up $file /var/lib/samba/`basename $file`
328 mkdir -p /var/lib/samba/eventlog
329 for file in `ls /var/cache/samba/eventlog/*tdb`; do
330 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
332 /bin/mv /var/cache/samba /var/cache/samba.moved
336 if [ "$1" -ge "1" ]; then
337 /sbin/service smb condrestart >/dev/null 2>&1 || :
342 /sbin/service smb stop >/dev/null 2>&1 || :
343 /sbin/chkconfig --del smb
344 # rm -rf /var/log/samba/* /var/lib/samba/*
351 # Add swat entry to /etc/services if not already there.
352 if [ ! "`grep ^\s**swat /etc/services`" ]; then
353 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
359 if [ "$1" -ge "1" ]; then
360 /sbin/service winbind condrestart >/dev/null 2>&1 || :
365 /sbin/service winbind stop >/dev/null 2>&1 || :
366 /sbin/chkconfig --del winbind
373 #######################################################################
375 #######################################################################
378 %defattr(-,root,root)
380 %config(noreplace) %{_sysconfdir}/sysconfig/samba
381 %config(noreplace) %{_sysconfdir}/samba/smbusers
382 %attr(755,root,root) %config %{initdir}/smb
383 %config(noreplace) %{_sysconfdir}/pam.d/samba
385 %attr(0755,root,root) %dir /var/log/samba
386 %attr(0755,root,root) %dir /var/lib/samba
387 %attr(1777,root,root) %dir /var/spool/samba
394 %{_bindir}/mksmbpasswd.sh
395 %{_bindir}/smbcontrol
400 %{_bindir}/tdbrestore
401 %{_bindir}/eventlogadm
403 %{_libarchdir}/samba/auth/script.so
404 %{_libarchdir}/samba/vfs/acl_tdb.so
405 %{_libarchdir}/samba/vfs/acl_xattr.so
406 %{_libarchdir}/samba/vfs/aio_fork.so
407 %{_libarchdir}/samba/vfs/audit.so
408 %{_libarchdir}/samba/vfs/cap.so
409 %{_libarchdir}/samba/vfs/catia.so
410 %{_libarchdir}/samba/vfs/crossrename.so
411 %{_libarchdir}/samba/vfs/default_quota.so
412 %{_libarchdir}/samba/vfs/dirsort.so
413 %{_libarchdir}/samba/vfs/expand_msdfs.so
414 %{_libarchdir}/samba/vfs/extd_audit.so
415 %{_libarchdir}/samba/vfs/fake_perms.so
416 %{_libarchdir}/samba/vfs/fileid.so
417 %{_libarchdir}/samba/vfs/full_audit.so
418 %{_libarchdir}/samba/vfs/gpfs.so
419 %{_libarchdir}/samba/vfs/linux_xfs_sgid.so
420 %{_libarchdir}/samba/vfs/netatalk.so
421 %{_libarchdir}/samba/vfs/preopen.so
422 %{_libarchdir}/samba/vfs/readahead.so
423 %{_libarchdir}/samba/vfs/readonly.so
424 %{_libarchdir}/samba/vfs/recycle.so
425 %{_libarchdir}/samba/vfs/scannedonly.so
426 %{_libarchdir}/samba/vfs/shadow_copy.so
427 %{_libarchdir}/samba/vfs/shadow_copy2.so
428 %{_libarchdir}/samba/vfs/smb_traffic_analyzer.so
429 %{_libarchdir}/samba/vfs/streams_depot.so
430 %{_libarchdir}/samba/vfs/streams_xattr.so
431 %{_libarchdir}/samba/vfs/syncops.so
432 %{_libarchdir}/samba/vfs/time_audit.so
433 %{_libarchdir}/samba/vfs/tsmsm.so
434 %{_libarchdir}/samba/vfs/xattr_tdb.so
437 %{_mandir}/man1/smbcontrol.1*
438 %{_mandir}/man1/smbstatus.1*
439 %{_mandir}/man1/vfstest.1*
440 %{_mandir}/man5/smbpasswd.5*
441 %{_mandir}/man5/pam_winbind.conf.5*
442 %{_mandir}/man7/samba.7*
443 %{_mandir}/man8/nmbd.8*
444 %{_mandir}/man8/pdbedit.8*
445 %{_mandir}/man8/smbd.8*
446 %{_mandir}/man8/tdbbackup.8*
447 %{_mandir}/man8/tdbdump.8*
448 %{_mandir}/man8/tdbtool.8*
449 %{_mandir}/man8/eventlogadm.8*
450 %{_mandir}/man8/vfs_*.8*
451 %{_mandir}/man8/smbta-util.8*
457 %defattr(-,root,root)
463 %doc docs-xml/archives/THANKS
464 %doc docs-xml/archives/history
465 %doc docs-xml/registry
468 %doc examples/libsmbclient
470 %doc examples/printer-accounting
471 %doc examples/printing
476 %defattr(-,root,root)
477 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
478 %dir %{_datadir}/swat
481 %{_mandir}/man8/swat.8*
482 %attr(755,root,root) /usr/share/codepages/*.msg
487 %defattr(-,root,root)
500 %{_bindir}/smbta-util
502 %{_mandir}/man8/smbspool.8*
503 %{_mandir}/man1/smbget.1*
504 %{_mandir}/man5/smbgetrc.5*
505 %{_mandir}/man1/findsmb.1*
506 %{_mandir}/man1/nmblookup.1*
507 %{_mandir}/man1/rpcclient.1*
508 %{_mandir}/man1/smbcacls.1*
509 %{_mandir}/man1/smbclient.1*
510 %{_mandir}/man1/smbtar.1*
511 %{_mandir}/man1/smbtree.1*
512 %{_mandir}/man1/sharesec.1*
517 %{_libarchdir}/libtalloc.so.LIBTALLOCVERSION
518 %{_libarchdir}/libtalloc.so.2
521 %{_libarchdir}/libtdb.so.LIBTDBVERSION
522 %{_libarchdir}/libtdb.so.1
525 %defattr(-,root,root)
526 %dir %{_sysconfdir}/samba
527 %dir %{_libarchdir}/samba
528 %dir %{_libarchdir}/samba/charset
529 %config(noreplace) %{_sysconfdir}/samba/smb.conf
530 %config(noreplace) %{_sysconfdir}/samba/lmhosts
531 %attr(755,root,root) %config %{initdir}/winbind
533 %attr(755,root,root) /%{_libarch}/libnss_winbind.so
534 %attr(755,root,root) /%{_libarch}/libnss_winbind.so.2
535 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so
536 %attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
537 /usr/share/locale/*/LC_MESSAGES/pam_winbind.mo
538 /usr/share/locale/*/LC_MESSAGES/net.mo
540 %{_libarchdir}/samba/idmap/ad.so
541 %{_libarchdir}/samba/idmap/rid.so
542 %{_libarchdir}/samba/idmap/tdb2.so
543 %{_libarchdir}/samba/idmap/autorid.so
544 %{_libarchdir}/samba/nss_info/rfc2307.so
545 %{_libarchdir}/samba/nss_info/sfu.so
546 %{_libarchdir}/samba/nss_info/sfu20.so
547 /usr/share/codepages/lowcase.dat
548 /usr/share/codepages/upcase.dat
549 /usr/share/codepages/valid.dat
551 %{_includedir}/libsmbclient.h
552 %{_libarchdir}/libsmbclient.*
553 %{_includedir}/smb_share_modes.h
554 %{_libarchdir}/libsmbsharemodes.so
555 %{_libarchdir}/libsmbsharemodes.so.0
557 %{_includedir}/netapi.h
558 %{_includedir}/wbclient.h
559 %{_includedir}/talloc.h
561 %{_libarchdir}/libnetapi.so
562 %{_libarchdir}/libnetapi.so.0
563 %{_libarchdir}/libwbclient.so
564 %{_libarchdir}/libwbclient.so.0
566 %{_libarchdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
578 %{_bindir}/smbcquotas
579 %{_bindir}/dbwrap_tool
580 %{_bindir}/dbwrap_torture
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}/man8/pam_winbind.8*
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*
599 %{_mandir}/man1/ldbrename.1*
600 %{_mandir}/man7/winbind_krb5_locator.7*
601 %{_mandir}/man8/idmap_*.8*
606 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
607 - Removed ChangeLog entries since they are kept in CVS