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}
82 Samba-common provides files necessary for both the server and client
86 #######################################################################
88 Summary: The Samba SMB server configuration program.
89 Group: Applications/System
90 Requires: samba = %{version} xinetd
91 Provides: samba-swat = %{version}-%{release}
94 The samba-swat package includes the new SWAT (Samba Web Administration
95 Tool), for remotely managing Samba's smb.conf file using your favorite
99 #######################################################################
101 Summary: Samba Documentation
102 Group: Documentation/Other
103 Provides: samba-doc = %{version}-%{release}
104 Requires: /usr/bin/find /bin/rm /usr/bin/xargs
107 The samba-doc package includes the HTML versions of the Samba manpages
108 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
109 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
112 #######################################################################
117 # setup the vendor files (init scripts, etc...)
118 %setup -T -D -a 999 -n samba-%{version} -q
122 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
125 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
128 if ccache -h >/dev/null 2>&1 ; then
136 ## always run autogen.sh
140 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
141 --prefix=%{_prefix} \
142 --localstatedir=/var \
143 --with-configdir=%{_sysconfdir}/samba \
144 --libdir=%{_libarchdir} \
145 --with-modulesdir=%{_libarchdir}/samba \
146 --with-pammodulesdir=%{_libarch}/security \
147 --with-lockdir=/var/lib/samba \
148 --with-logfilebase=/var/log/samba \
149 --with-mandir=%{_mandir} \
150 --with-piddir=/var/run \
151 --with-privatedir=%{_sysconfdir}/samba \
152 --with-sambabook=%{_datadir}/swat/using_samba \
153 --with-swatdir=%{_datadir}/swat \
160 --with-libsmbclient \
161 --with-libsmbsharemodes \
162 --without-smbwrapper \
165 --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs,vfs_tsmsm,vfs_gpfs_hsm_notify \
168 --with-cluster-support \
169 --with-ctdb=/usr/include \
171 --without-dnsupdate \
173 --disable-merged-build
177 ## check for gcc 3.4 or later
178 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
179 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
180 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
181 if [ ${CC_MAJOR} -ge 3 ]; then
182 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
188 make -j %{numcpu} %{?_smp_mflags} \
189 everything modules pam_smbpass
191 # check that desired suppor has been compiled into smbd:
192 export LD_LIBRARY_PATH=./bin
193 for test in HAVE_POSIX_ACLS HAVE_LDAP HAVE_KRB5 HAVE_GPFS CLUSTER_SUPPORT
195 if ! $(./bin/smbd -b | grep -q $test ) ; then
196 echo "ERROR: '$test' is not in smbd. Build stopped."
201 # try and build the manpages
203 ./release-scripts/build-manpages-nogit
205 # Remove some permission bits to avoid to many dependencies
206 find examples docs -type f | xargs -r chmod -x
209 # Clean up in case there is trash left from a previous build
210 rm -rf $RPM_BUILD_ROOT
212 # Create the target build directory hierarchy
213 mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
214 mkdir -p $RPM_BUILD_ROOT%{_includedir}
215 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
216 mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
217 mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
218 mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
219 mkdir -p $RPM_BUILD_ROOT/lib/security
220 mkdir -p $RPM_BUILD_ROOT%{_mandir}
221 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
222 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
223 mkdir -p $RPM_BUILD_ROOT/sbin
224 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,samba}
225 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d}
226 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
227 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
228 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
229 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
230 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
231 mkdir -p $RPM_BUILD_ROOT/%{_libarchdir}/krb5/plugins/libkrb5
234 make DESTDIR=$RPM_BUILD_ROOT \
237 make DESTDIR=$RPM_BUILD_ROOT \
238 install-dbwrap_tool install-dbwrap_torture
241 # NSS winbind support
242 install -m 755 nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
243 ( cd $RPM_BUILD_ROOT/%{_libarch};
244 ln -sf libnss_winbind.so.2 libnss_winbind.so )
246 # do not install libnss_wins.so in order to reduce dependencies
247 # (we do not need it for the samba-ctdb scenario)
249 #install -m 755 nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so
250 # ( cd $RPM_BUILD_ROOT/%{_libarch}; ln -sf libnss_wins.so libnss_wins.so.2 )
252 cp -p source3/bin/winbind_krb5_locator.so ${RPM_BUILD_ROOT}/%{_libarchdir}/krb5/plugins/libkrb5
256 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
258 # Install the miscellany
259 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
261 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
262 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
263 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
264 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
265 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
266 install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
267 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
268 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
269 install -m755 source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
271 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
272 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
274 # Remove "*.old" files
275 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
279 ## Clean out man pages for tools not installed here
281 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
282 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
283 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
287 rm -rf $RPM_BUILD_ROOT
290 ## deal with an upgrade from a broken 3.0.21b RPM
291 if [ "$1" -eq "2" ]; then
292 if [ -d /var/cache/samba ]; then
293 for file in `ls /var/cache/samba/*tdb`; do
294 /bin/cp -up $file /var/lib/samba/`basename $file`
296 mkdir -p /var/lib/samba/eventlog
297 for file in `ls /var/cache/samba/eventlog/*tdb`; do
298 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
300 /bin/mv /var/cache/samba /var/cache/samba.moved
304 if [ "$1" -ge "1" ]; then
305 /sbin/service smb condrestart >/dev/null 2>&1 || :
310 /sbin/service smb stop >/dev/null 2>&1 || :
311 /sbin/chkconfig --del smb
312 # rm -rf /var/log/samba/* /var/lib/samba/*
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
327 if [ "$1" -ge "1" ]; then
328 /sbin/service winbind condrestart >/dev/null 2>&1 || :
333 /sbin/service winbind stop >/dev/null 2>&1 || :
334 /sbin/chkconfig --del winbind
341 #######################################################################
343 #######################################################################
346 %defattr(-,root,root)
348 %config(noreplace) %{_sysconfdir}/sysconfig/samba
349 %config(noreplace) %{_sysconfdir}/samba/smbusers
350 %attr(755,root,root) %config %{initdir}/smb
351 %config(noreplace) %{_sysconfdir}/pam.d/samba
353 %attr(0755,root,root) %dir /var/log/samba
354 %attr(0755,root,root) %dir /var/lib/samba
355 %attr(1777,root,root) %dir /var/spool/samba
362 %{_bindir}/mksmbpasswd.sh
363 %{_bindir}/smbcontrol
368 %{_bindir}/tdbrestore
369 %{_bindir}/eventlogadm
371 %{_libarchdir}/samba/auth/script.so
372 %{_libarchdir}/samba/vfs/acl_tdb.so
373 %{_libarchdir}/samba/vfs/acl_xattr.so
374 %{_libarchdir}/samba/vfs/aio_fork.so
375 %{_libarchdir}/samba/vfs/audit.so
376 %{_libarchdir}/samba/vfs/cap.so
377 %{_libarchdir}/samba/vfs/catia.so
378 %{_libarchdir}/samba/vfs/crossrename.so
379 %{_libarchdir}/samba/vfs/default_quota.so
380 %{_libarchdir}/samba/vfs/dirsort.so
381 %{_libarchdir}/samba/vfs/expand_msdfs.so
382 %{_libarchdir}/samba/vfs/extd_audit.so
383 %{_libarchdir}/samba/vfs/fake_perms.so
384 %{_libarchdir}/samba/vfs/fileid.so
385 %{_libarchdir}/samba/vfs/full_audit.so
386 %{_libarchdir}/samba/vfs/gpfs.so
387 %{_libarchdir}/samba/vfs/gpfs_hsm_notify.so
388 %{_libarchdir}/samba/vfs/linux_xfs_sgid.so
389 %{_libarchdir}/samba/vfs/netatalk.so
390 %{_libarchdir}/samba/vfs/preopen.so
391 %{_libarchdir}/samba/vfs/readahead.so
392 %{_libarchdir}/samba/vfs/readonly.so
393 %{_libarchdir}/samba/vfs/recycle.so
394 %{_libarchdir}/samba/vfs/scannedonly.so
395 %{_libarchdir}/samba/vfs/shadow_copy.so
396 %{_libarchdir}/samba/vfs/shadow_copy2.so
397 %{_libarchdir}/samba/vfs/smb_traffic_analyzer.so
398 %{_libarchdir}/samba/vfs/streams_depot.so
399 %{_libarchdir}/samba/vfs/streams_xattr.so
400 %{_libarchdir}/samba/vfs/syncops.so
401 %{_libarchdir}/samba/vfs/time_audit.so
402 %{_libarchdir}/samba/vfs/tsmsm.so
403 %{_libarchdir}/samba/vfs/xattr_tdb.so
406 %{_mandir}/man1/smbcontrol.1*
407 %{_mandir}/man1/smbstatus.1*
408 %{_mandir}/man1/vfstest.1*
409 %{_mandir}/man5/smbpasswd.5*
410 %{_mandir}/man5/pam_winbind.conf.5*
411 %{_mandir}/man7/samba.7*
412 %{_mandir}/man8/nmbd.8*
413 %{_mandir}/man8/pdbedit.8*
414 %{_mandir}/man8/smbd.8*
415 %{_mandir}/man8/tdbbackup.8*
416 %{_mandir}/man8/tdbdump.8*
417 %{_mandir}/man8/tdbtool.8*
418 %{_mandir}/man8/eventlogadm.8*
419 %{_mandir}/man8/vfs_*.8*
420 %{_mandir}/man8/smbta-util.8*
426 %defattr(-,root,root)
432 %doc docs-xml/archives/THANKS
433 %doc docs-xml/archives/history
434 %doc docs-xml/registry
437 %doc examples/libsmbclient
439 %doc examples/printer-accounting
440 %doc examples/printing
445 %defattr(-,root,root)
446 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
447 %dir %{_datadir}/swat
450 %{_mandir}/man8/swat.8*
451 %attr(755,root,root) %{_libarchdir}/samba/*.msg
456 %defattr(-,root,root)
469 %{_bindir}/smbta-util
471 %{_mandir}/man8/smbspool.8*
472 %{_mandir}/man1/smbget.1*
473 %{_mandir}/man5/smbgetrc.5*
474 %{_mandir}/man1/findsmb.1*
475 %{_mandir}/man1/nmblookup.1*
476 %{_mandir}/man1/rpcclient.1*
477 %{_mandir}/man1/smbcacls.1*
478 %{_mandir}/man1/smbclient.1*
479 %{_mandir}/man1/smbtar.1*
480 %{_mandir}/man1/smbtree.1*
481 %{_mandir}/man1/sharesec.1*
486 %defattr(-,root,root)
487 %dir %{_sysconfdir}/samba
488 %dir %{_libarchdir}/samba
489 %dir %{_libarchdir}/samba/charset
490 %config(noreplace) %{_sysconfdir}/samba/smb.conf
491 %config(noreplace) %{_sysconfdir}/samba/lmhosts
492 %attr(755,root,root) %config %{initdir}/winbind
494 %attr(755,root,root) /%{_libarch}/libnss_winbind.so
495 %attr(755,root,root) /%{_libarch}/libnss_winbind.so.2
496 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so
497 %attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
498 /usr/share/locale/*/LC_MESSAGES/pam_winbind.mo
499 /usr/share/locale/*/LC_MESSAGES/net.mo
501 %{_libarchdir}/samba/charset/CP437.so
502 %{_libarchdir}/samba/charset/CP850.so
503 %{_libarchdir}/samba/idmap/ad.so
504 %{_libarchdir}/samba/idmap/rid.so
505 %{_libarchdir}/samba/idmap/tdb2.so
506 %{_libarchdir}/samba/idmap/autorid.so
507 %{_libarchdir}/samba/lowcase.dat
508 %{_libarchdir}/samba/nss_info/rfc2307.so
509 %{_libarchdir}/samba/nss_info/sfu.so
510 %{_libarchdir}/samba/nss_info/sfu20.so
511 %{_libarchdir}/samba/upcase.dat
512 %{_libarchdir}/samba/valid.dat
514 %{_includedir}/libsmbclient.h
515 %{_libarchdir}/libsmbclient.*
516 %{_includedir}/smb_share_modes.h
517 %{_libarchdir}/libsmbsharemodes.so
518 %{_libarchdir}/libsmbsharemodes.so.0
520 %{_includedir}/netapi.h
521 %{_includedir}/wbclient.h
522 %{_includedir}/talloc.h
524 %{_libarchdir}/libnetapi.so
525 %{_libarchdir}/libnetapi.so.0
526 %{_libarchdir}/libtalloc.so
527 %{_libarchdir}/libtalloc.so.2
528 %{_libarchdir}/libtdb.so
529 %{_libarchdir}/libtdb.so.1
530 %{_libarchdir}/libwbclient.so
531 %{_libarchdir}/libwbclient.so.0
533 %{_libarchdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
545 %{_bindir}/smbcquotas
546 %{_bindir}/dbwrap_tool
547 %{_bindir}/dbwrap_torture
549 %{_mandir}/man1/ntlm_auth.1*
550 %{_mandir}/man1/profiles.1*
551 %{_mandir}/man1/smbcquotas.1*
552 %{_mandir}/man1/testparm.1*
553 %{_mandir}/man5/smb.conf.5*
554 %{_mandir}/man5/lmhosts.5*
555 %{_mandir}/man8/smbpasswd.8*
556 %{_mandir}/man1/wbinfo.1*
557 %{_mandir}/man8/winbindd.8*
558 %{_mandir}/man8/net.8*
559 %{_mandir}/man8/pam_winbind.8*
560 %{_mandir}/man7/libsmbclient.7*
561 %{_mandir}/man1/ldbadd.1*
562 %{_mandir}/man1/ldbdel.1*
563 %{_mandir}/man1/ldbedit.1*
564 %{_mandir}/man1/ldbmodify.1*
565 %{_mandir}/man1/ldbsearch.1*
566 %{_mandir}/man1/ldbrename.1*
567 %{_mandir}/man7/winbind_krb5_locator.7*
568 %{_mandir}/man8/idmap_*.8*
573 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
574 - Removed ChangeLog entries since they are kept in CVS