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@lists.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/')
49 %define with_vfs_gpfs PGPFS_DEFAULT
50 %define with_vfs_tsmsm PGPFS_DEFAULT
53 %define vfs_tsmsm ,vfs_tsmsm
57 %define vfs_gpfs ,vfs_gpfs
60 %define vfs_modules %{?vfs_gpfs}%{?vfs_tsmsm}
62 %define shared_modules idmap_rid,idmap_ad,idmap_tdb2%{vfs_modules}
65 Samba is the protocol by which a lot of PC-related machines share
66 files, printers, and other information (such as lists of available
67 files and printers). The Windows NT, OS/2, and Linux operating systems
68 support this natively, and add-on packages can enable the same thing
69 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
70 provides an SMB server that can be used to provide network services to
71 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
72 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
73 NetBIOS frame) protocol.
76 ######################################################################
78 Summary: Samba (SMB) client programs.
79 Group: Applications/System
80 Requires: samba-common = %{version}-%{release}
82 Provides: samba-client = %{version}-%{release}
85 The samba-client package provides some SMB clients to compliment the
86 built-in SMB filesystem in Linux. These clients allow access of SMB
87 shares and printing to SMB printers.
90 #######################################################################
92 Summary: Files used by both Samba servers and clients.
93 Group: Applications/System
94 Provides: samba-common = %{version}-%{release}
97 Samba-common provides files necessary for both the server and client
102 #######################################################################
104 Summary: The Samba SMB server configuration program.
105 Group: Applications/System
106 Requires: samba = %{version} xinetd
107 Provides: samba-swat = %{version}-%{release}
110 The samba-swat package includes the new SWAT (Samba Web Administration
111 Tool), for remotely managing Samba's smb.conf file using your favorite
115 #######################################################################
117 Summary: Samba Documentation
118 Group: Documentation/Other
119 Provides: samba-doc = %{version}-%{release}
120 Requires: /usr/bin/find /bin/rm /usr/bin/xargs
123 The samba-doc package includes the HTML versions of the Samba manpages
124 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
125 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
128 #######################################################################
133 # setup the vendor files (init scripts, etc...)
134 %setup -T -D -a 999 -n samba-%{version} -q
138 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
141 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
144 if ccache -h >/dev/null 2>&1 ; then
152 ## always run autogen.sh
155 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
156 --prefix=%{_prefix} \
157 --localstatedir=/var \
158 --with-configdir=%{_sysconfdir}/samba \
159 --libdir=%{_libarchdir} \
160 --with-modulesdir=%{_libarchdir}/samba \
161 --with-pammodulesdir=/%{_libarch}/security \
162 --with-lockdir=/var/lib/samba \
163 --with-logfilebase=/var/log/samba \
164 --mandir=%{_mandir} \
165 --with-piddir=/var/run \
166 --with-privatedir=%{_sysconfdir}/samba \
172 --with-libsmbclient \
173 --without-smbwrapper \
176 --with-shared-modules=%{shared_modules} \
179 --with-cluster-support \
180 --with-ctdb=/usr/include \
182 --without-dnsupdate \
184 --disable-external-libtalloc \
185 --disable-external-libtdb
189 ## check for gcc 3.4 or later
190 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
191 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
192 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
193 if [ ${CC_MAJOR} -ge 3 ]; then
194 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
200 make -j %{numcpu} %{?_smp_mflags} \
203 # check that desired suppor has been compiled into smbd:
204 export LD_LIBRARY_PATH=./bin
206 HAVE_VARS="HAVE_POSIX_ACLS HAVE_LDAP HAVE_KRB5 CLUSTER_SUPPORT"
208 HAVE_VARS="${HAVE_VARS} HAVE_GPFS"
210 for test in ${HAVE_VARS}
212 if ! $(./bin/smbd -b | grep -q $test ) ; then
213 echo "ERROR: '$test' is not in smbd. Build stopped."
218 # try and build the manpages
220 ./release-scripts/build-manpages-nogit
222 # Remove some permission bits to avoid to many dependencies
223 find examples docs -type f | xargs -r chmod -x
226 # Clean up in case there is trash left from a previous build
227 rm -rf $RPM_BUILD_ROOT
229 # Create the target build directory hierarchy
230 mkdir -p $RPM_BUILD_ROOT%{_datadir}/samba/swat/{help,include,using_samba/{figs,gifsa}}
231 mkdir -p $RPM_BUILD_ROOT%{_includedir}
232 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
233 mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
234 mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
235 mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
236 mkdir -p $RPM_BUILD_ROOT/lib/security
237 mkdir -p $RPM_BUILD_ROOT%{_mandir}
238 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
239 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
240 mkdir -p $RPM_BUILD_ROOT/sbin
241 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,samba}
242 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d}
243 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
244 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
245 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
246 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
247 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
248 mkdir -p $RPM_BUILD_ROOT/%{_libarchdir}/krb5/plugins/libkrb5
251 make DESTDIR=$RPM_BUILD_ROOT \
254 make DESTDIR=$RPM_BUILD_ROOT \
255 install-dbwrap_tool install-dbwrap_torture
258 # NSS winbind support
259 install -m 755 nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
260 ( cd $RPM_BUILD_ROOT/%{_libarch};
261 ln -sf libnss_winbind.so.2 libnss_winbind.so )
263 # do not install libnss_wins.so in order to reduce dependencies
264 # (we do not need it for the samba-ctdb scenario)
266 #install -m 755 nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so
267 # ( cd $RPM_BUILD_ROOT/%{_libarch}; ln -sf libnss_wins.so libnss_wins.so.2 )
269 cp -p source3/bin/winbind_krb5_locator.so ${RPM_BUILD_ROOT}/%{_libarchdir}/krb5/plugins/libkrb5
273 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
275 # remove installed but unpackaged files:
276 /bin/rm -f $RPM_BUILD_ROOT/usr/lib*/libtalloc.so
277 /bin/rm -f $RPM_BUILD_ROOT/usr/lib*/libtdb.so
278 /bin/rm -f $RPM_BUILD_ROOT/usr/lib*/samba/perfcount/pc_test.so
281 # Install the miscellany
282 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
284 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
285 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
286 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
287 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
288 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
289 install -m755 packaging/printing/smbprint $RPM_BUILD_ROOT%{_bindir}
290 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
291 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
292 install -m755 source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
294 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
295 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
297 # Remove "*.old" files
298 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
302 ## Clean out man pages for tools not installed here
304 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
305 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
306 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
307 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/samba-tool.8*
308 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/samba.8*
312 rm -rf $RPM_BUILD_ROOT
315 ## deal with an upgrade from a broken 3.0.21b RPM
316 if [ "$1" -eq "2" ]; then
317 if [ -d /var/cache/samba ]; then
318 for file in `ls /var/cache/samba/*tdb`; do
319 /bin/cp -up $file /var/lib/samba/`basename $file`
321 mkdir -p /var/lib/samba/eventlog
322 for file in `ls /var/cache/samba/eventlog/*tdb`; do
323 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
325 /bin/mv /var/cache/samba /var/cache/samba.moved
329 if [ "$1" -ge "1" ]; then
330 /sbin/service smb condrestart >/dev/null 2>&1 || :
335 /sbin/service smb stop >/dev/null 2>&1 || :
336 /sbin/chkconfig --del smb
337 # rm -rf /var/log/samba/* /var/lib/samba/*
344 # Add swat entry to /etc/services if not already there.
345 if [ ! "`grep ^\s**swat /etc/services`" ]; then
346 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
352 if [ "$1" -ge "1" ]; then
353 /sbin/service winbind condrestart >/dev/null 2>&1 || :
358 /sbin/service winbind stop >/dev/null 2>&1 || :
359 /sbin/chkconfig --del winbind
366 #######################################################################
368 #######################################################################
371 %defattr(-,root,root)
373 %config(noreplace) %{_sysconfdir}/sysconfig/samba
374 %config(noreplace) %{_sysconfdir}/samba/smbusers
375 %attr(755,root,root) %config %{initdir}/smb
376 %config(noreplace) %{_sysconfdir}/pam.d/samba
378 %attr(0755,root,root) %dir /var/log/samba
379 %attr(0755,root,root) %dir /var/lib/samba
380 %attr(1777,root,root) %dir /var/spool/samba
387 %{_bindir}/mksmbpasswd.sh
388 %{_bindir}/smbcontrol
393 %{_bindir}/tdbrestore
394 %{_bindir}/eventlogadm
396 %{_libarchdir}/samba/auth/script.so
397 %{_libarchdir}/samba/vfs/acl_tdb.so
398 %{_libarchdir}/samba/vfs/acl_xattr.so
399 %{_libarchdir}/samba/vfs/aio_fork.so
400 %{_libarchdir}/samba/vfs/audit.so
401 %{_libarchdir}/samba/vfs/cap.so
402 %{_libarchdir}/samba/vfs/catia.so
403 %{_libarchdir}/samba/vfs/crossrename.so
404 %{_libarchdir}/samba/vfs/default_quota.so
405 %{_libarchdir}/samba/vfs/dirsort.so
406 %{_libarchdir}/samba/vfs/expand_msdfs.so
407 %{_libarchdir}/samba/vfs/extd_audit.so
408 %{_libarchdir}/samba/vfs/fake_acls.so
409 %{_libarchdir}/samba/vfs/fake_perms.so
410 %{_libarchdir}/samba/vfs/fileid.so
411 %{_libarchdir}/samba/vfs/full_audit.so
413 %{_libarchdir}/samba/vfs/gpfs.so
415 %{_libarchdir}/samba/vfs/linux_xfs_sgid.so
416 %{_libarchdir}/samba/vfs/netatalk.so
417 %{_libarchdir}/samba/vfs/preopen.so
418 %{_libarchdir}/samba/vfs/readahead.so
419 %{_libarchdir}/samba/vfs/readonly.so
420 %{_libarchdir}/samba/vfs/recycle.so
421 %{_libarchdir}/samba/vfs/shadow_copy.so
422 %{_libarchdir}/samba/vfs/shadow_copy2.so
423 %{_libarchdir}/samba/vfs/streams_depot.so
424 %{_libarchdir}/samba/vfs/streams_xattr.so
425 %{_libarchdir}/samba/vfs/syncops.so
426 %{_libarchdir}/samba/vfs/time_audit.so
427 %if %{with_vfs_tsmsm}
428 %{_libarchdir}/samba/vfs/tsmsm.so
430 %{_libarchdir}/samba/vfs/xattr_tdb.so
431 %{_libarchdir}/samba/vfs/aio_posix.so
432 %{_libarchdir}/samba/vfs/aio_pthread.so
433 %{_libarchdir}/samba/vfs/media_harmony.so
435 %{_mandir}/man1/smbcontrol.1*
436 %{_mandir}/man1/smbstatus.1*
437 %{_mandir}/man1/vfstest.1*
438 %{_mandir}/man5/smbpasswd.5*
439 %{_mandir}/man5/pam_winbind.conf.5*
440 %{_mandir}/man7/samba.7*
441 %{_mandir}/man8/nmbd.8*
442 %{_mandir}/man8/pdbedit.8*
443 %{_mandir}/man8/smbd.8*
444 %{_mandir}/man8/eventlogadm.8*
445 %{_mandir}/man8/vfs_*.8*
451 %defattr(-,root,root)
456 %doc docs-xml/archives/THANKS
457 %doc docs-xml/archives/history
458 %doc docs-xml/registry
461 %doc examples/libsmbclient
463 %doc examples/printer-accounting
464 %doc examples/printing
469 %defattr(-,root,root)
470 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
471 %dir %{_datadir}/samba/swat
472 %{_datadir}/samba/swat/*
474 %{_mandir}/man8/swat.8*
475 %attr(755,root,root) %{_datadir}/samba/codepages/*.msg
480 %defattr(-,root,root)
494 %{_mandir}/man8/smbspool.8*
495 %{_mandir}/man1/smbget.1*
496 %{_mandir}/man5/smbgetrc.5*
497 %{_mandir}/man1/findsmb.1*
498 %{_mandir}/man1/nmblookup.1*
499 %{_mandir}/man1/rpcclient.1*
500 %{_mandir}/man1/smbcacls.1*
501 %{_mandir}/man1/smbclient.1*
502 %{_mandir}/man1/smbtar.1*
503 %{_mandir}/man1/smbtree.1*
504 %{_mandir}/man1/sharesec.1*
510 %defattr(-,root,root)
511 %dir %{_sysconfdir}/samba
512 %dir %{_libarchdir}/samba
513 %dir %{_libarchdir}/samba/charset
514 %config(noreplace) %{_sysconfdir}/samba/smb.conf
515 %config(noreplace) %{_sysconfdir}/samba/lmhosts
516 %attr(755,root,root) %config %{initdir}/winbind
518 %attr(755,root,root) /%{_libarch}/libnss_winbind.so
519 %attr(755,root,root) /%{_libarch}/libnss_winbind.so.2
520 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so
521 /usr/share/locale/*/LC_MESSAGES/pam_winbind.mo
522 /usr/share/locale/*/LC_MESSAGES/net.mo
524 %{_libarchdir}/samba/idmap/ad.so
525 %{_libarchdir}/samba/idmap/rid.so
526 %{_libarchdir}/samba/idmap/tdb2.so
527 %{_libarchdir}/samba/idmap/autorid.so
528 %{_libarchdir}/samba/idmap/hash.so
529 %{_libarchdir}/samba/nss_info/hash.so
530 %{_libarchdir}/samba/nss_info/rfc2307.so
531 %{_libarchdir}/samba/nss_info/sfu.so
532 %{_libarchdir}/samba/nss_info/sfu20.so
534 %{_includedir}/libsmbclient.h
535 %{_libarchdir}/libsmbclient.*
536 %{_includedir}/smb_share_modes.h
538 %{_includedir}/netapi.h
539 %{_includedir}/wbclient.h
540 %{_libarchdir}/libnetapi.so
541 %{_libarchdir}/libnetapi.so.0
542 %{_libarchdir}/libwbclient.so
543 %{_libarchdir}/libwbclient.so.0
545 %{_libarchdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
557 %{_bindir}/smbcquotas
558 %{_bindir}/dbwrap_tool
559 %{_bindir}/dbwrap_torture
561 %{_mandir}/man1/ntlm_auth.1*
562 %{_mandir}/man1/profiles.1*
563 %{_mandir}/man1/smbcquotas.1*
564 %{_mandir}/man1/testparm.1*
565 %{_mandir}/man5/smb.conf.5*
566 %{_mandir}/man5/lmhosts.5*
567 %{_mandir}/man8/smbpasswd.8*
568 %{_mandir}/man1/wbinfo.1*
569 %{_mandir}/man8/winbindd.8*
570 %{_mandir}/man8/net.8*
571 %{_mandir}/man8/pam_winbind.8*
572 %{_mandir}/man7/libsmbclient.7*
573 %{_mandir}/man7/winbind_krb5_locator.7*
574 %{_mandir}/man8/idmap_*.8*
579 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
580 - Removed ChangeLog entries since they are kept in CVS