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, ctdb, e2fsprogs-devel
31 # requirements for building the man pages:
32 BuildRequires: libxslt, docbook-utils, docbook-style-xsl
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}
46 %define numcpu %(grep "^processor" /proc/cpuinfo |wc -l | sed -e 's/^0$/1/')
49 Samba is the protocol by which a lot of PC-related machines share
50 files, printers, and other information (such as lists of available
51 files and printers). The Windows NT, OS/2, and Linux operating systems
52 support this natively, and add-on packages can enable the same thing
53 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
54 provides an SMB server that can be used to provide network services to
55 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
56 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
57 NetBIOS frame) protocol.
60 ######################################################################
62 Summary: Samba (SMB) client programs.
63 Group: Applications/System
64 Requires: samba-common = %{version}-%{release}
66 Provides: samba-client = %{version}-%{release}
69 The samba-client package provides some SMB clients to compliment the
70 built-in SMB filesystem in Linux. These clients allow access of SMB
71 shares and printing to SMB printers.
74 #######################################################################
76 Summary: Files used by both Samba servers and clients.
77 Group: Applications/System
78 Provides: samba-common = %{version}-%{release}
79 Requires: libtalloc >= 2.0.1
80 Requires: libtdb >= 1.2.6
83 Samba-common provides files necessary for both the server and client
87 #######################################################################
89 Summary: the tdb library
90 Group: Applications/System
91 Provides: libtdb = LIBTDBVERSION-%{release}
93 #Conflicts: libtdb < LIBTALLOCVERSION
98 #######################################################################
100 Summary: the talloc library
101 Group: Applications/System
102 Provides: libtalloc = LIBTALLOCVERSION-%{release}
104 #Conflicts: libtalloc < LIBTALLOCVERSION
106 %description libtalloc
107 Samba's talloc library
109 #######################################################################
111 Summary: The Samba SMB server configuration program.
112 Group: Applications/System
113 Requires: samba = %{version} xinetd
114 Provides: samba-swat = %{version}-%{release}
117 The samba-swat package includes the new SWAT (Samba Web Administration
118 Tool), for remotely managing Samba's smb.conf file using your favorite
122 #######################################################################
124 Summary: Samba Documentation
125 Group: Documentation/Other
126 Provides: samba-doc = %{version}-%{release}
127 Requires: /usr/bin/find /bin/rm /usr/bin/xargs
130 The samba-doc package includes the HTML versions of the Samba manpages
131 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
132 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
135 #######################################################################
140 # setup the vendor files (init scripts, etc...)
141 %setup -T -D -a 999 -n samba-%{version} -q
145 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
148 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
151 if ccache -h >/dev/null 2>&1 ; then
159 ## always run autogen.sh
163 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
164 --prefix=%{_prefix} \
165 --localstatedir=/var \
166 --with-configdir=%{_sysconfdir}/samba \
167 --libdir=%{_libarchdir} \
168 --with-modulesdir=%{_libarchdir}/samba \
169 --with-pammodulesdir=%{_libarch}/security \
170 --with-lockdir=/var/lib/samba \
171 --with-logfilebase=/var/log/samba \
172 --with-mandir=%{_mandir} \
173 --with-piddir=/var/run \
174 --with-privatedir=%{_sysconfdir}/samba \
175 --with-sambabook=%{_datadir}/swat/using_samba \
176 --with-swatdir=%{_datadir}/swat \
183 --with-libsmbclient \
184 --with-libsmbsharemodes \
185 --without-smbwrapper \
188 --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs,vfs_tsmsm,vfs_gpfs_hsm_notify \
191 --with-cluster-support \
192 --with-ctdb=/usr/include \
194 --without-dnsupdate \
196 --disable-merged-build \
197 --disable-smbtorture4 \
198 --disable-external-libtalloc \
199 --disable-external-libtdb
203 ## check for gcc 3.4 or later
204 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
205 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
206 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
207 if [ ${CC_MAJOR} -ge 3 ]; then
208 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
214 make -j %{numcpu} %{?_smp_mflags} \
215 everything modules pam_smbpass
217 # check that desired suppor has been compiled into smbd:
218 export LD_LIBRARY_PATH=./bin
219 for test in HAVE_POSIX_ACLS HAVE_LDAP HAVE_KRB5 HAVE_GPFS CLUSTER_SUPPORT
221 if ! $(./bin/smbd -b | grep -q $test ) ; then
222 echo "ERROR: '$test' is not in smbd. Build stopped."
227 # try and build the manpages
229 ./release-scripts/build-manpages-nogit
231 # Remove some permission bits to avoid to many dependencies
232 find examples docs -type f | xargs -r chmod -x
235 # Clean up in case there is trash left from a previous build
236 rm -rf $RPM_BUILD_ROOT
238 # Create the target build directory hierarchy
239 mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
240 mkdir -p $RPM_BUILD_ROOT%{_includedir}
241 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
242 mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
243 mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
244 mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
245 mkdir -p $RPM_BUILD_ROOT/lib/security
246 mkdir -p $RPM_BUILD_ROOT%{_mandir}
247 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
248 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
249 mkdir -p $RPM_BUILD_ROOT/sbin
250 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,samba}
251 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d}
252 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
253 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
254 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
255 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
256 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
257 mkdir -p $RPM_BUILD_ROOT/%{_libarchdir}/krb5/plugins/libkrb5
260 make DESTDIR=$RPM_BUILD_ROOT \
263 make DESTDIR=$RPM_BUILD_ROOT \
264 install-dbwrap_tool install-dbwrap_torture
267 # NSS winbind support
268 install -m 755 nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
269 ( cd $RPM_BUILD_ROOT/%{_libarch};
270 ln -sf libnss_winbind.so.2 libnss_winbind.so )
272 # do not install libnss_wins.so in order to reduce dependencies
273 # (we do not need it for the samba-ctdb scenario)
275 #install -m 755 nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so
276 # ( cd $RPM_BUILD_ROOT/%{_libarch}; ln -sf libnss_wins.so libnss_wins.so.2 )
278 cp -p source3/bin/winbind_krb5_locator.so ${RPM_BUILD_ROOT}/%{_libarchdir}/krb5/plugins/libkrb5
282 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
284 # remove installed but unpackaged files:
285 /bin/rm -f $RPM_BUILD_ROOT/usr/lib*/libtalloc.so
286 /bin/rm -f $RPM_BUILD_ROOT/usr/lib*/libtdb.so
289 # Install the miscellany
290 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
292 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
293 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
294 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
295 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
296 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
297 install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
298 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
299 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
300 install -m755 source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
302 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
303 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
305 # Remove "*.old" files
306 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
310 ## Clean out man pages for tools not installed here
312 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
313 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
314 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
318 rm -rf $RPM_BUILD_ROOT
321 ## deal with an upgrade from a broken 3.0.21b RPM
322 if [ "$1" -eq "2" ]; then
323 if [ -d /var/cache/samba ]; then
324 for file in `ls /var/cache/samba/*tdb`; do
325 /bin/cp -up $file /var/lib/samba/`basename $file`
327 mkdir -p /var/lib/samba/eventlog
328 for file in `ls /var/cache/samba/eventlog/*tdb`; do
329 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
331 /bin/mv /var/cache/samba /var/cache/samba.moved
335 if [ "$1" -ge "1" ]; then
336 /sbin/service smb condrestart >/dev/null 2>&1 || :
341 /sbin/service smb stop >/dev/null 2>&1 || :
342 /sbin/chkconfig --del smb
343 # rm -rf /var/log/samba/* /var/lib/samba/*
350 # Add swat entry to /etc/services if not already there.
351 if [ ! "`grep ^\s**swat /etc/services`" ]; then
352 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
358 if [ "$1" -ge "1" ]; then
359 /sbin/service winbind condrestart >/dev/null 2>&1 || :
364 /sbin/service winbind stop >/dev/null 2>&1 || :
365 /sbin/chkconfig --del winbind
372 #######################################################################
374 #######################################################################
377 %defattr(-,root,root)
379 %config(noreplace) %{_sysconfdir}/sysconfig/samba
380 %config(noreplace) %{_sysconfdir}/samba/smbusers
381 %attr(755,root,root) %config %{initdir}/smb
382 %config(noreplace) %{_sysconfdir}/pam.d/samba
384 %attr(0755,root,root) %dir /var/log/samba
385 %attr(0755,root,root) %dir /var/lib/samba
386 %attr(1777,root,root) %dir /var/spool/samba
393 %{_bindir}/mksmbpasswd.sh
394 %{_bindir}/smbcontrol
399 %{_bindir}/tdbrestore
400 %{_bindir}/eventlogadm
402 %{_libarchdir}/samba/auth/script.so
403 %{_libarchdir}/samba/vfs/acl_tdb.so
404 %{_libarchdir}/samba/vfs/acl_xattr.so
405 %{_libarchdir}/samba/vfs/aio_fork.so
406 %{_libarchdir}/samba/vfs/audit.so
407 %{_libarchdir}/samba/vfs/cap.so
408 %{_libarchdir}/samba/vfs/catia.so
409 %{_libarchdir}/samba/vfs/crossrename.so
410 %{_libarchdir}/samba/vfs/default_quota.so
411 %{_libarchdir}/samba/vfs/dirsort.so
412 %{_libarchdir}/samba/vfs/expand_msdfs.so
413 %{_libarchdir}/samba/vfs/extd_audit.so
414 %{_libarchdir}/samba/vfs/fake_perms.so
415 %{_libarchdir}/samba/vfs/fileid.so
416 %{_libarchdir}/samba/vfs/full_audit.so
417 %{_libarchdir}/samba/vfs/gpfs.so
418 %{_libarchdir}/samba/vfs/gpfs_hsm_notify.so
419 %{_libarchdir}/samba/vfs/gpfs_prefetch.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/shadow_copy3.so
430 %{_libarchdir}/samba/vfs/smb_traffic_analyzer.so
431 %{_libarchdir}/samba/vfs/streams_depot.so
432 %{_libarchdir}/samba/vfs/streams_xattr.so
433 %{_libarchdir}/samba/vfs/syncops.so
434 %{_libarchdir}/samba/vfs/time_audit.so
435 %{_libarchdir}/samba/vfs/tsmsm.so
436 %{_libarchdir}/samba/vfs/xattr_tdb.so
439 %{_mandir}/man1/smbcontrol.1*
440 %{_mandir}/man1/smbstatus.1*
441 %{_mandir}/man1/vfstest.1*
442 %{_mandir}/man5/smbpasswd.5*
443 %{_mandir}/man5/pam_winbind.conf.5*
444 %{_mandir}/man7/samba.7*
445 %{_mandir}/man8/nmbd.8*
446 %{_mandir}/man8/pdbedit.8*
447 %{_mandir}/man8/smbd.8*
448 %{_mandir}/man8/tdbbackup.8*
449 %{_mandir}/man8/tdbdump.8*
450 %{_mandir}/man8/tdbtool.8*
451 %{_mandir}/man8/eventlogadm.8*
452 %{_mandir}/man8/vfs_*.8*
453 %{_mandir}/man8/smbta-util.8*
459 %defattr(-,root,root)
465 %doc docs-xml/archives/THANKS
466 %doc docs-xml/archives/history
467 %doc docs-xml/registry
470 %doc examples/libsmbclient
472 %doc examples/printer-accounting
473 %doc examples/printing
478 %defattr(-,root,root)
479 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
480 %dir %{_datadir}/swat
483 %{_mandir}/man8/swat.8*
484 %attr(755,root,root) %{_libarchdir}/samba/*.msg
489 %defattr(-,root,root)
502 %{_bindir}/smbta-util
504 %{_mandir}/man8/smbspool.8*
505 %{_mandir}/man1/smbget.1*
506 %{_mandir}/man5/smbgetrc.5*
507 %{_mandir}/man1/findsmb.1*
508 %{_mandir}/man1/nmblookup.1*
509 %{_mandir}/man1/rpcclient.1*
510 %{_mandir}/man1/smbcacls.1*
511 %{_mandir}/man1/smbclient.1*
512 %{_mandir}/man1/smbtar.1*
513 %{_mandir}/man1/smbtree.1*
514 %{_mandir}/man1/sharesec.1*
519 %{_libarchdir}/libtalloc.so.LIBTALLOCVERSION
520 %{_libarchdir}/libtalloc.so.2
523 %{_libarchdir}/libtdb.so.LIBTDBVERSION
524 %{_libarchdir}/libtdb.so.1
527 %defattr(-,root,root)
528 %dir %{_sysconfdir}/samba
529 %dir %{_libarchdir}/samba
530 %dir %{_libarchdir}/samba/charset
531 %config(noreplace) %{_sysconfdir}/samba/smb.conf
532 %config(noreplace) %{_sysconfdir}/samba/lmhosts
533 %attr(755,root,root) %config %{initdir}/winbind
535 %attr(755,root,root) /%{_libarch}/libnss_winbind.so
536 %attr(755,root,root) /%{_libarch}/libnss_winbind.so.2
537 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so
538 %attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
539 /usr/share/locale/*/LC_MESSAGES/pam_winbind.mo
540 /usr/share/locale/*/LC_MESSAGES/net.mo
542 %{_libarchdir}/samba/charset/CP437.so
543 %{_libarchdir}/samba/charset/CP850.so
544 %{_libarchdir}/samba/idmap/ad.so
545 %{_libarchdir}/samba/idmap/rid.so
546 %{_libarchdir}/samba/idmap/tdb2.so
547 %{_libarchdir}/samba/idmap/autorid.so
548 %{_libarchdir}/samba/lowcase.dat
549 %{_libarchdir}/samba/nss_info/rfc2307.so
550 %{_libarchdir}/samba/nss_info/sfu.so
551 %{_libarchdir}/samba/nss_info/sfu20.so
552 %{_libarchdir}/samba/upcase.dat
553 %{_libarchdir}/samba/valid.dat
555 %{_includedir}/libsmbclient.h
556 %{_libarchdir}/libsmbclient.*
557 %{_includedir}/smb_share_modes.h
558 %{_libarchdir}/libsmbsharemodes.so
559 %{_libarchdir}/libsmbsharemodes.so.0
561 %{_includedir}/netapi.h
562 %{_includedir}/wbclient.h
563 %{_includedir}/talloc.h
565 %{_libarchdir}/libnetapi.so
566 %{_libarchdir}/libnetapi.so.0
567 %{_libarchdir}/libwbclient.so
568 %{_libarchdir}/libwbclient.so.0
570 %{_libarchdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
582 %{_bindir}/smbcquotas
583 %{_bindir}/dbwrap_tool
584 %{_bindir}/dbwrap_torture
586 %{_mandir}/man1/ntlm_auth.1*
587 %{_mandir}/man1/profiles.1*
588 %{_mandir}/man1/smbcquotas.1*
589 %{_mandir}/man1/testparm.1*
590 %{_mandir}/man5/smb.conf.5*
591 %{_mandir}/man5/lmhosts.5*
592 %{_mandir}/man8/smbpasswd.8*
593 %{_mandir}/man1/wbinfo.1*
594 %{_mandir}/man8/winbindd.8*
595 %{_mandir}/man8/net.8*
596 %{_mandir}/man8/pam_winbind.8*
597 %{_mandir}/man7/libsmbclient.7*
598 %{_mandir}/man1/ldbadd.1*
599 %{_mandir}/man1/ldbdel.1*
600 %{_mandir}/man1/ldbedit.1*
601 %{_mandir}/man1/ldbmodify.1*
602 %{_mandir}/man1/ldbsearch.1*
603 %{_mandir}/man1/ldbrename.1*
604 %{_mandir}/man7/winbind_krb5_locator.7*
605 %{_mandir}/man8/idmap_*.8*
610 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
611 - Removed ChangeLog entries since they are kept in CVS