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
31 # requirements for building the man pages:
32 BuildRequires: libxslt, docbook-utils, docbook-style-xsl
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,vfs_gpfs_hsm_notify \
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/gpfs_hsm_notify.so
420 %{_libarchdir}/samba/vfs/linux_xfs_sgid.so
421 %{_libarchdir}/samba/vfs/netatalk.so
422 %{_libarchdir}/samba/vfs/preopen.so
423 %{_libarchdir}/samba/vfs/readahead.so
424 %{_libarchdir}/samba/vfs/readonly.so
425 %{_libarchdir}/samba/vfs/recycle.so
426 %{_libarchdir}/samba/vfs/scannedonly.so
427 %{_libarchdir}/samba/vfs/shadow_copy.so
428 %{_libarchdir}/samba/vfs/shadow_copy2.so
429 %{_libarchdir}/samba/vfs/smb_traffic_analyzer.so
430 %{_libarchdir}/samba/vfs/streams_depot.so
431 %{_libarchdir}/samba/vfs/streams_xattr.so
432 %{_libarchdir}/samba/vfs/syncops.so
433 %{_libarchdir}/samba/vfs/time_audit.so
434 %{_libarchdir}/samba/vfs/tsmsm.so
435 %{_libarchdir}/samba/vfs/xattr_tdb.so
438 %{_mandir}/man1/smbcontrol.1*
439 %{_mandir}/man1/smbstatus.1*
440 %{_mandir}/man1/vfstest.1*
441 %{_mandir}/man5/smbpasswd.5*
442 %{_mandir}/man5/pam_winbind.conf.5*
443 %{_mandir}/man7/samba.7*
444 %{_mandir}/man8/nmbd.8*
445 %{_mandir}/man8/pdbedit.8*
446 %{_mandir}/man8/smbd.8*
447 %{_mandir}/man8/tdbbackup.8*
448 %{_mandir}/man8/tdbdump.8*
449 %{_mandir}/man8/tdbtool.8*
450 %{_mandir}/man8/eventlogadm.8*
451 %{_mandir}/man8/vfs_*.8*
452 %{_mandir}/man8/smbta-util.8*
458 %defattr(-,root,root)
464 %doc docs-xml/archives/THANKS
465 %doc docs-xml/archives/history
466 %doc docs-xml/registry
469 %doc examples/libsmbclient
471 %doc examples/printer-accounting
472 %doc examples/printing
477 %defattr(-,root,root)
478 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
479 %dir %{_datadir}/swat
482 %{_mandir}/man8/swat.8*
483 %attr(755,root,root) /usr/share/codepages/*.msg
488 %defattr(-,root,root)
501 %{_bindir}/smbta-util
503 %{_mandir}/man8/smbspool.8*
504 %{_mandir}/man1/smbget.1*
505 %{_mandir}/man5/smbgetrc.5*
506 %{_mandir}/man1/findsmb.1*
507 %{_mandir}/man1/nmblookup.1*
508 %{_mandir}/man1/rpcclient.1*
509 %{_mandir}/man1/smbcacls.1*
510 %{_mandir}/man1/smbclient.1*
511 %{_mandir}/man1/smbtar.1*
512 %{_mandir}/man1/smbtree.1*
513 %{_mandir}/man1/sharesec.1*
518 %{_libarchdir}/libtalloc.so.LIBTALLOCVERSION
519 %{_libarchdir}/libtalloc.so.2
522 %{_libarchdir}/libtdb.so.LIBTDBVERSION
523 %{_libarchdir}/libtdb.so.1
526 %defattr(-,root,root)
527 %dir %{_sysconfdir}/samba
528 %dir %{_libarchdir}/samba
529 %dir %{_libarchdir}/samba/charset
530 %config(noreplace) %{_sysconfdir}/samba/smb.conf
531 %config(noreplace) %{_sysconfdir}/samba/lmhosts
532 %attr(755,root,root) %config %{initdir}/winbind
534 %attr(755,root,root) /%{_libarch}/libnss_winbind.so
535 %attr(755,root,root) /%{_libarch}/libnss_winbind.so.2
536 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so
537 %attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
538 /usr/share/locale/*/LC_MESSAGES/pam_winbind.mo
539 /usr/share/locale/*/LC_MESSAGES/net.mo
541 %{_libarchdir}/samba/idmap/ad.so
542 %{_libarchdir}/samba/idmap/rid.so
543 %{_libarchdir}/samba/idmap/tdb2.so
544 %{_libarchdir}/samba/idmap/autorid.so
545 %{_libarchdir}/samba/nss_info/rfc2307.so
546 %{_libarchdir}/samba/nss_info/sfu.so
547 %{_libarchdir}/samba/nss_info/sfu20.so
548 /usr/share/codepages/lowcase.dat
549 /usr/share/codepages/upcase.dat
550 /usr/share/codepages/valid.dat
552 %{_includedir}/libsmbclient.h
553 %{_libarchdir}/libsmbclient.*
554 %{_includedir}/smb_share_modes.h
555 %{_libarchdir}/libsmbsharemodes.so
556 %{_libarchdir}/libsmbsharemodes.so.0
558 %{_includedir}/netapi.h
559 %{_includedir}/wbclient.h
560 %{_includedir}/talloc.h
562 %{_libarchdir}/libnetapi.so
563 %{_libarchdir}/libnetapi.so.0
564 %{_libarchdir}/libwbclient.so
565 %{_libarchdir}/libwbclient.so.0
567 %{_libarchdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
579 %{_bindir}/smbcquotas
580 %{_bindir}/dbwrap_tool
581 %{_bindir}/dbwrap_torture
583 %{_mandir}/man1/ntlm_auth.1*
584 %{_mandir}/man1/profiles.1*
585 %{_mandir}/man1/smbcquotas.1*
586 %{_mandir}/man1/testparm.1*
587 %{_mandir}/man5/smb.conf.5*
588 %{_mandir}/man5/lmhosts.5*
589 %{_mandir}/man8/smbpasswd.8*
590 %{_mandir}/man1/wbinfo.1*
591 %{_mandir}/man8/winbindd.8*
592 %{_mandir}/man8/net.8*
593 %{_mandir}/man8/pam_winbind.8*
594 %{_mandir}/man7/libsmbclient.7*
595 %{_mandir}/man1/ldbadd.1*
596 %{_mandir}/man1/ldbdel.1*
597 %{_mandir}/man1/ldbedit.1*
598 %{_mandir}/man1/ldbmodify.1*
599 %{_mandir}/man1/ldbsearch.1*
600 %{_mandir}/man1/ldbrename.1*
601 %{_mandir}/man7/winbind_krb5_locator.7*
602 %{_mandir}/man8/idmap_*.8*
607 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
608 - Removed ChangeLog entries since they are kept in CVS