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>
9 Release: PRELEASEPRPMREV
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 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
22 Prereq: fileutils sed /etc/init.d
24 Requires: pam >= 0.64 %{auth}
25 Requires: samba-common = %{version}-%{release}
26 Requires: logrotate >= 3.4 initscripts >= 5.54-1
27 Provides: samba = %{version}
30 BuildRoot: %{_tmppath}/%{name}-%{version}-root
31 BuildRequires: pam-devel, readline-devel, fileutils, libacl-devel, openldap-devel, krb5-devel, cups-devel
33 # Working around perl dependency problem from docs
34 %define __perl_requires %{SOURCE998}
36 # rpm screws up the arch lib dir when using --target on RHEL5
37 %ifarch i386 i486 i586 i686 ppc s390
40 %define _libarch %_lib
43 %define _libarchdir /usr/%{_libarch}
47 Samba is the protocol by which a lot of PC-related machines share
48 files, printers, and other information (such as lists of available
49 files and printers). The Windows NT, OS/2, and Linux operating systems
50 support this natively, and add-on packages can enable the same thing
51 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
52 provides an SMB server that can be used to provide network services to
53 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
54 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
55 NetBIOS frame) protocol.
58 #######################################################################
60 Summary: Samba (SMB) client programs.
61 Group: Applications/System
62 Requires: samba-common = %{version}-%{release}
64 Provides: samba-client = %{version}-%{release}
67 The samba-client package provides some SMB clients to compliment the
68 built-in SMB filesystem in Linux. These clients allow access of SMB
69 shares and printing to SMB printers.
72 #######################################################################
74 Summary: Files used by both Samba servers and clients.
75 Group: Applications/System
76 Provides: samba-common = %{version}-%{release}
79 Samba-common provides files necessary for both the server and client
83 #######################################################################
85 Summary: The Samba SMB server configuration program.
86 Group: Applications/System
87 Requires: samba = %{version} xinetd
88 Provides: samba-swat = %{version}-%{release}
91 The samba-swat package includes the new SWAT (Samba Web Administration
92 Tool), for remotely managing Samba's smb.conf file using your favorite
96 #######################################################################
98 Summary: Samba Documentation
99 Group: Documentation/Other
100 Provides: samba-doc = %{version}-%{release}
101 Prereq: /usr/bin/find /bin/rm /usr/bin/xargs
104 The samba-doc package includes the HTML versions of the Samba manpages
105 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
106 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
109 #######################################################################
114 # setup the vendor files (init scripts, etc...)
115 %setup -T -D -a 999 -n samba-%{version} -q
119 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
122 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
125 if [ "$(which ccache 2> /dev/null)" != "" ]; then
131 ## always run autogen.sh
134 CC="$CC" CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
135 --prefix=%{_prefix} \
136 --localstatedir=/var \
137 --with-configdir=%{_sysconfdir}/samba \
138 --libdir=%{_libarchdir} \
139 --with-modulesdir=%{_libarchdir}/samba \
140 --with-pammodulesdir=%{_libarch}/security \
141 --with-lockdir=/var/lib/samba \
142 --with-logfilebase=/var/log/samba \
143 --with-mandir=%{_mandir} \
144 --with-piddir=/var/run \
145 --with-privatedir=%{_sysconfdir}/samba \
146 --with-sambabook=%{_datadir}/swat/using_samba \
147 --with-swatdir=%{_datadir}/swat \
154 --with-libsmbclient \
155 --with-libsmbsharemodes \
156 --without-smbwrapper \
159 --with-shared-modules=idmap_rid,idmap_ad,idmap_hash,idmap_adex \
166 ## check for gcc 3.4 or later
167 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
168 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
169 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
170 if [ ${CC_MAJOR} -ge 3 ]; then
171 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
177 make all modules pam_smbpass
179 # Remove some permission bits to avoid to many dependencies
181 find examples docs -type f | xargs -r chmod -x
184 # Clean up in case there is trash left from a previous build
185 rm -rf $RPM_BUILD_ROOT
187 # Create the target build directory hierarchy
188 mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
189 mkdir -p $RPM_BUILD_ROOT%{_includedir}
190 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
191 mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
192 mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
193 mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
194 mkdir -p $RPM_BUILD_ROOT%{_mandir}
195 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
196 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
197 mkdir -p $RPM_BUILD_ROOT/sbin
198 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{logrotate.d,pam.d,samba}
199 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,logrotate.d}
200 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
201 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
202 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
203 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
204 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
207 make DESTDIR=$RPM_BUILD_ROOT \
211 # NSS winbind support
212 install -m 755 nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
213 install -m 755 nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so.2
214 ( cd $RPM_BUILD_ROOT/%{_libarch};
215 ln -sf libnss_winbind.so.2 libnss_winbind.so;
216 ln -sf libnss_wins.so.2 libnss_wins.so )
219 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
221 # Install the miscellany
222 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
224 install -m644 setup/samba.log $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/samba
225 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
226 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
227 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
228 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
229 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
230 install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
231 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
232 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
233 install -m755 source3/bin/mount.cifs $RPM_BUILD_ROOT/sbin/mount.cifs
234 install -m755 source3/bin/umount.cifs $RPM_BUILD_ROOT/sbin/umount.cifs
235 install -m755 source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
237 /bin/rm $RPM_BUILD_ROOT%{_sbindir}/*mount.cifs
239 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
240 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
242 # Remove "*.old" files
243 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
245 ## don't duplicate the docs. These are installed by/with SWAT
248 ( cd docs; ln -s %{_prefix}/share/swat/help htmldocs )
251 ## Clean out man pages for tools not installed here
253 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
254 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
255 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
259 rm -rf $RPM_BUILD_ROOT
262 ## deal with an upgrade from a broken 3.0.21b RPM
263 if [ "$1" -eq "2" ]; then
264 if [ -d /var/cache/samba ]; then
265 for file in `ls /var/cache/samba/*tdb`; do
266 /bin/cp -up $file /var/lib/samba/`basename $file`
268 mkdir -p /var/lib/samba/eventlog
269 for file in `ls /var/cache/samba/eventlog/*tdb`; do
270 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
272 /bin/mv /var/cache/samba /var/cache/samba.moved
278 /sbin/chkconfig --del smb
279 /sbin/chkconfig --del winbind
280 # rm -rf /var/log/samba/* /var/lib/samba/*
281 /sbin/service smb stop >/dev/null 2>&1
286 if [ "$1" -ge "1" ]; then
287 %{initdir}/smb restart >/dev/null 2>&1
292 # Add swat entry to /etc/services if not already there.
293 if [ ! "`grep ^\s**swat /etc/services`" ]; then
294 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
303 #######################################################################
305 #######################################################################
308 %defattr(-,root,root)
310 %config(noreplace) %{_sysconfdir}/sysconfig/samba
311 %config(noreplace) %{_sysconfdir}/samba/smbusers
312 %attr(755,root,root) %config %{initdir}/smb
313 %attr(755,root,root) %config %{initdir}/winbind
314 %config(noreplace) %{_sysconfdir}/logrotate.d/samba
315 %config(noreplace) %{_sysconfdir}/pam.d/samba
317 %attr(0755,root,root) %dir /var/log/samba
318 %attr(0755,root,root) %dir /var/lib/samba
319 %attr(1777,root,root) %dir /var/spool/samba
328 %{_bindir}/mksmbpasswd.sh
329 %{_bindir}/smbcontrol
337 %{_bindir}/eventlogadm
339 %{_libarchdir}/samba/idmap/*.so
340 %{_libarchdir}/samba/nss_info/*.so
341 %{_libarchdir}/samba/vfs/*.so
342 %{_libarchdir}/samba/auth/*.so
344 %{_mandir}/man1/smbcontrol.1*
345 %{_mandir}/man1/smbstatus.1*
346 %{_mandir}/man1/vfstest.1*
347 %{_mandir}/man5/smbpasswd.5*
348 %{_mandir}/man7/samba.7*
349 %{_mandir}/man7/winbind_krb5_locator.7*
350 %{_mandir}/man8/nmbd.8*
351 %{_mandir}/man8/pdbedit.8*
352 %{_mandir}/man8/smbd.8*
353 %{_mandir}/man8/tdbbackup.8*
354 %{_mandir}/man8/tdbdump.8*
355 %{_mandir}/man8/tdbtool.8*
356 %{_mandir}/man8/eventlogadm.8*
357 %{_mandir}/man8/winbindd.8*
358 %{_mandir}/man1/ntlm_auth.1*
359 %{_mandir}/man1/wbinfo.1*
360 %{_mandir}/man8/vfs_*.8*
361 %{_mandir}/man8/idmap_*.8*
367 %defattr(-,root,root)
368 %doc README COPYING Manifest
369 %doc WHATSNEW.txt Roadmap
371 %doc examples/autofs examples/LDAP examples/libsmbclient examples/misc examples/printer-accounting
372 %doc examples/printing
373 %doc %{_datadir}/swat/help
374 %doc %{_datadir}/swat/using_samba
379 %defattr(-,root,root)
380 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
381 %dir %{_datadir}/swat
382 %{_datadir}/swat/include
383 %{_datadir}/swat/images
384 %{_datadir}/swat/lang
386 %{_mandir}/man8/swat.8*
391 %defattr(-,root,root)
394 %{_sbindir}/cifs.upcall
400 %{_bindir}/smbcquotas
410 %{_mandir}/man8/mount.cifs.8.*
411 %{_mandir}/man8/umount.cifs.8.*
412 %{_mandir}/man8/cifs.upcall.8.*
413 %{_mandir}/man8/smbspool.8*
414 %{_mandir}/man1/smbget.1*
415 %{_mandir}/man5/smbgetrc.5*
416 %{_mandir}/man1/findsmb.1*
417 %{_mandir}/man1/nmblookup.1*
418 %{_mandir}/man1/rpcclient.1*
419 %{_mandir}/man1/smbcacls.1*
420 %{_mandir}/man1/sharesec.1*
421 %{_mandir}/man1/smbclient.1*
422 %{_mandir}/man1/smbtar.1*
423 %{_mandir}/man1/smbtree.1*
424 %{_mandir}/man8/net.8*
425 %{_mandir}/man1/smbcquotas.1*
430 %defattr(-,root,root)
431 %dir %{_sysconfdir}/samba
432 %dir %{_libarchdir}/samba
433 %dir %{_libarchdir}/samba/charset
434 %config(noreplace) %{_sysconfdir}/samba/smb.conf
435 %config(noreplace) %{_sysconfdir}/samba/lmhosts
437 %attr(755,root,root) /%{_libarch}/libnss_wins.so*
438 %attr(755,root,root) /%{_libarch}/libnss_winbind.so*
439 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so
440 %attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
441 /usr/share/locale/de/LC_MESSAGES/pam_winbind.mo
442 /usr/share/locale/ar/LC_MESSAGES/pam_winbind.mo
443 /usr/share/locale/cs/LC_MESSAGES/pam_winbind.mo
444 /usr/share/locale/da/LC_MESSAGES/pam_winbind.mo
445 /usr/share/locale/es/LC_MESSAGES/pam_winbind.mo
446 /usr/share/locale/fi/LC_MESSAGES/pam_winbind.mo
447 /usr/share/locale/fr/LC_MESSAGES/pam_winbind.mo
448 /usr/share/locale/hu/LC_MESSAGES/pam_winbind.mo
449 /usr/share/locale/it/LC_MESSAGES/pam_winbind.mo
450 /usr/share/locale/ja/LC_MESSAGES/pam_winbind.mo
451 /usr/share/locale/ko/LC_MESSAGES/pam_winbind.mo
452 /usr/share/locale/nb/LC_MESSAGES/pam_winbind.mo
453 /usr/share/locale/nl/LC_MESSAGES/pam_winbind.mo
454 /usr/share/locale/pl/LC_MESSAGES/pam_winbind.mo
455 /usr/share/locale/pt_BR/LC_MESSAGES/pam_winbind.mo
456 /usr/share/locale/ru/LC_MESSAGES/pam_winbind.mo
457 /usr/share/locale/sv/LC_MESSAGES/pam_winbind.mo
458 /usr/share/locale/zh_CN/LC_MESSAGES/pam_winbind.mo
459 /usr/share/locale/zh_TW/LC_MESSAGES/pam_winbind.mo
461 %{_includedir}/libsmbclient.h
462 %{_libarchdir}/libsmbclient.*
463 %{_includedir}/smb_share_modes.h
464 %{_libarchdir}/libsmbsharemodes.*
466 %{_libarchdir}/samba/*.dat
467 %{_libarchdir}/samba/*.msg
468 %{_libarchdir}/samba/charset/*.so
470 %{_includedir}/netapi.h
471 %{_includedir}/wbclient.h
472 %{_includedir}/talloc.h
474 %{_libarchdir}/libnetapi.so*
475 %{_libarchdir}/libtalloc.so*
476 %{_libarchdir}/libtdb.so*
477 %{_libarchdir}/libwbclient.so*
490 %{_mandir}/man1/profiles.1*
491 %{_mandir}/man1/testparm.1*
492 %{_mandir}/man5/smb.conf.5*
493 %{_mandir}/man5/lmhosts.5*
494 %{_mandir}/man8/smbpasswd.8*
495 %{_mandir}/man7/libsmbclient.7*
496 %{_mandir}/man8/pam_winbind.8*
498 %{_mandir}/man1/ldbadd.1*
499 %{_mandir}/man1/ldbdel.1*
500 %{_mandir}/man1/ldbedit.1*
501 %{_mandir}/man1/ldbmodify.1*
502 %{_mandir}/man1/ldbrename.1*
503 %{_mandir}/man1/ldbsearch.1*
506 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
507 - Removed ChangeLog entries since they are kept in CVS