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}
38 Samba is the protocol by which a lot of PC-related machines share
39 files, printers, and other information (such as lists of available
40 files and printers). The Windows NT, OS/2, and Linux operating systems
41 support this natively, and add-on packages can enable the same thing
42 for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
43 provides an SMB server that can be used to provide network services to
44 SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
45 TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
46 NetBIOS frame) protocol.
49 #######################################################################
51 Summary: Samba (SMB) client programs.
52 Group: Applications/System
53 Requires: samba-common = %{version}-%{release}
55 Provides: samba-client = %{version}-%{release}
58 The samba-client package provides some SMB clients to compliment the
59 built-in SMB filesystem in Linux. These clients allow access of SMB
60 shares and printing to SMB printers.
63 #######################################################################
65 Summary: Files used by both Samba servers and clients.
66 Group: Applications/System
67 Provides: samba-common = %{version}-%{release}
70 Samba-common provides files necessary for both the server and client
74 #######################################################################
76 Summary: The Samba SMB server configuration program.
77 Group: Applications/System
78 Requires: samba = %{version} xinetd
79 Provides: samba-swat = %{version}-%{release}
82 The samba-swat package includes the new SWAT (Samba Web Administration
83 Tool), for remotely managing Samba's smb.conf file using your favorite
87 #######################################################################
89 Summary: Samba Documentation
90 Group: Documentation/Other
91 Provides: samba-doc = %{version}-%{release}
92 Prereq: /usr/bin/find /bin/rm /usr/bin/xargs
95 The samba-doc package includes the HTML versions of the Samba manpages
96 utilized by SWAT as well as the HTML and PDF version of "Using Samba",
97 "Samba By Example", and "The Official Samba HOWTO and Reference Guide".
100 #######################################################################
105 # setup the vendor files (init scripts, etc...)
106 %setup -T -D -a 999 -n samba-%{version} -q
110 /bin/cp setup/filter-requires-samba.sh %{SOURCE998}
113 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
116 # ccache -h 2>&1 > /dev/null
117 #if [ $? -eq 0 ]; then
123 ## always run autogen.sh
126 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
127 --prefix=%{_prefix} \
128 --localstatedir=/var \
129 --with-configdir=%{_sysconfdir}/samba \
130 --libdir=%{_libdir} \
131 --with-modulesdir=%{_libdir}/samba \
132 --with-lockdir=/var/lib/samba \
133 --with-logfilebase=/var/log/samba \
134 --with-mandir=%{_mandir} \
135 --with-piddir=/var/run \
136 --with-privatedir=%{_sysconfdir}/samba \
137 --with-sambabook=%{_datadir}/swat/using_samba \
138 --with-swatdir=%{_datadir}/swat \
145 --with-libsmbclient \
146 --with-libsmbsharemodes \
147 --without-smbwrapper \
150 --with-shared-modules=idmap_rid,idmap_ad \
157 ## check for gcc 3.4 or later
158 CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
159 CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
160 CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
161 if [ ${CC_MAJOR} -ge 3 ]; then
162 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
168 make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" %{?_smp_mflags} \
169 all modules pam_smbpass
171 ## build the cifs fs mount helper
173 gcc -o mount.cifs $RPM_OPT_FLAGS -D_GNU_SOURCE -Wall -D_GNU_SOURCE -D_LARGEFILE64_SOURCE mount.cifs.c
174 gcc -o umount.cifs $RPM_OPT_FLAGS -D_GNU_SOURCE -Wall -D_GNU_SOURCE -D_LARGEFILE64_SOURCE umount.cifs.c
177 # Remove some permission bits to avoid to many dependencies
179 find examples docs -type f | xargs -r chmod -x
182 # Clean up in case there is trash left from a previous build
183 rm -rf $RPM_BUILD_ROOT
185 # Create the target build directory hierarchy
186 mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
187 mkdir -p $RPM_BUILD_ROOT%{_includedir}
188 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
189 mkdir -p $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
190 mkdir -p $RPM_BUILD_ROOT%{_libdir}/samba/{auth,charset,idmap,vfs,pdb}
191 mkdir -p $RPM_BUILD_ROOT/%{_lib}/security
192 mkdir -p $RPM_BUILD_ROOT%{_mandir}
193 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
194 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
195 mkdir -p $RPM_BUILD_ROOT/sbin
196 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{logrotate.d,pam.d,samba}
197 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,logrotate.d}
198 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
199 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
200 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
201 mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
202 mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
205 make DESTDIR=$RPM_BUILD_ROOT \
210 cp source/bin/pam_smbpass.so $RPM_BUILD_ROOT/%{_lib}/security/pam_smbpass.so
212 # NSS & PAM winbind support
213 install -m 755 source/bin/pam_winbind.so $RPM_BUILD_ROOT/%{_lib}/security/pam_winbind.so
214 install -m 755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so
215 install -m 755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_lib}/libnss_wins.so
216 ( cd $RPM_BUILD_ROOT/%{_lib};
217 ln -sf libnss_winbind.so libnss_winbind.so.2;
218 ln -sf libnss_wins.so libnss_wins.so.2 )
220 # make install puts libsmbclient.so in the wrong place on x86_64
221 rm -f $RPM_BUILD_ROOT/usr/lib*/samba/libsmbclient.so $RPM_BUILD_ROOT/usr/lib*/samba/libsmbclient.a || true
222 install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{_libdir}/libsmbclient.so
223 install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{_libdir}/libsmbclient.a
224 install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{_includedir}
225 ln -s %{_libdir}/libsmbclient.so $RPM_BUILD_ROOT%{_libdir}/libsmbclient.so.0
227 # make install puts libsmbsharemodes.so in the wrong place on x86_64
228 rm -f $RPM_BUILD_ROOT/usr/lib*/samba/libsmbsharemodes.so $RPM_BUILD_ROOT/usr/lib*/samba/libsmbsharemodes.a || true
229 install -m 755 source/bin/libsmbsharemodes.so $RPM_BUILD_ROOT%{_libdir}/libsmbsharemodes.so
230 install -m 755 source/bin/libsmbsharemodes.a $RPM_BUILD_ROOT%{_libdir}/libsmbsharemodes.a
231 install -m 644 source/include/smb_share_modes.h $RPM_BUILD_ROOT%{_includedir}
232 rm -f $RPM_BUILD_ROOT%{_libdir}/samba/libsmbsharemodes.*
233 ln -s /%{_libdir}/libsmbsharemodes.so $RPM_BUILD_ROOT%{_libdir}/libsmbsharemodes.so.0
235 # Install pam_smbpass.so
236 install -m755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/%{_lib}/security/pam_smbpass.so
239 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
241 # Install the miscellany
242 echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
244 install -m644 setup/samba.log $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/samba
245 install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
246 install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
247 install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
248 install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
249 install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
250 install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
251 install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
252 install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
253 install -m755 source/client/mount.cifs $RPM_BUILD_ROOT/sbin/mount.cifs
254 install -m755 source/client/umount.cifs $RPM_BUILD_ROOT/sbin/umount.cifs
255 install -m755 source/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
257 /bin/rm $RPM_BUILD_ROOT%{_sbindir}/*mount.cifs
259 ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
260 ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
262 # Remove "*.old" files
263 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
265 ## don't duplicate the docs. These are installed by/with SWAT
268 ( cd docs; ln -s %{_prefix}/share/swat/help htmldocs )
271 ## Clean out man pages for tools not installed here
273 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
274 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
275 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
279 rm -rf $RPM_BUILD_ROOT
282 ## deal with an upgrade from a broken 3.0.21b RPM
283 if [ "$1" -eq "2" ]; then
284 if [ -d /var/cache/samba ]; then
285 for file in `ls /var/cache/samba/*tdb`; do
286 /bin/cp -up $file /var/lib/samba/`basename $file`
288 mkdir -p /var/lib/samba/eventlog
289 for file in `ls /var/cache/samba/eventlog/*tdb`; do
290 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
292 /bin/mv /var/cache/samba /var/cache/samba.moved
298 /sbin/chkconfig --del smb
299 /sbin/chkconfig --del winbind
300 # rm -rf /var/log/samba/* /var/lib/samba/*
301 /sbin/service smb stop >/dev/null 2>&1
306 if [ "$1" -ge "1" ]; then
307 %{initdir}/smb restart >/dev/null 2>&1
312 # Add swat entry to /etc/services if not already there.
313 if [ ! "`grep ^\s**swat /etc/services`" ]; then
314 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
323 #######################################################################
325 #######################################################################
328 %defattr(-,root,root)
330 %config(noreplace) %{_sysconfdir}/sysconfig/samba
331 %config(noreplace) %{_sysconfdir}/samba/smbusers
332 %attr(755,root,root) %config %{initdir}/smb
333 %attr(755,root,root) %config %{initdir}/winbind
334 %config(noreplace) %{_sysconfdir}/logrotate.d/samba
335 %config(noreplace) %{_sysconfdir}/pam.d/samba
337 %attr(0755,root,root) %dir /var/log/samba
338 %attr(0755,root,root) %dir /var/lib/samba
339 %attr(1777,root,root) %dir /var/spool/samba
348 %{_bindir}/mksmbpasswd.sh
349 %{_bindir}/smbcontrol
357 %{_bindir}/eventlogadm
359 %{_libdir}/samba/idmap/*.so
360 %{_libdir}/samba/nss_info/*.so
361 %{_libdir}/samba/vfs/*.so
362 %{_libdir}/samba/auth/*.so
364 %{_mandir}/man1/smbcontrol.1*
365 %{_mandir}/man1/smbstatus.1*
366 %{_mandir}/man1/vfstest.1*
367 %{_mandir}/man5/smbpasswd.5*
368 %{_mandir}/man7/samba.7*
369 %{_mandir}/man8/nmbd.8*
370 %{_mandir}/man8/pdbedit.8*
371 %{_mandir}/man8/smbd.8*
372 %{_mandir}/man8/tdbbackup.8*
373 %{_mandir}/man8/tdbdump.8*
374 %{_mandir}/man8/tdbtool.8*
375 %{_mandir}/man8/eventlogadm.8*
376 %{_mandir}/man8/winbindd.8*
377 %{_mandir}/man1/ntlm_auth.1*
378 %{_mandir}/man1/wbinfo.1*
379 %{_mandir}/man8/vfs_*.8*
380 %{_mandir}/man8/idmap_*.8*
386 %defattr(-,root,root)
387 %doc README COPYING Manifest
388 %doc WHATSNEW.txt Roadmap
390 %doc examples/autofs examples/LDAP examples/libsmbclient examples/misc examples/printer-accounting
391 %doc examples/printing
392 %doc %{_datadir}/swat/help
393 %doc %{_datadir}/swat/using_samba
398 %defattr(-,root,root)
399 %config(noreplace) %{_sysconfdir}/xinetd.d/swat
400 %dir %{_datadir}/swat
401 %{_datadir}/swat/include
402 %{_datadir}/swat/images
403 %{_datadir}/swat/lang
405 %{_mandir}/man8/swat.8*
410 %defattr(-,root,root)
421 %{_bindir}/smbcquotas
431 %{_mandir}/man8/mount.cifs.8.*
432 %{_mandir}/man8/umount.cifs.8.*
433 %{_mandir}/man8/smbspool.8*
434 %{_mandir}/man1/smbget.1*
435 %{_mandir}/man5/smbgetrc.5*
436 %{_mandir}/man1/findsmb.1*
437 %{_mandir}/man1/nmblookup.1*
438 %{_mandir}/man1/rpcclient.1*
439 %{_mandir}/man1/smbcacls.1*
440 %{_mandir}/man1/smbclient.1*
441 %{_mandir}/man1/smbtar.1*
442 %{_mandir}/man1/smbtree.1*
443 %{_mandir}/man8/net.8*
444 %{_mandir}/man1/smbcquotas.1*
449 %defattr(-,root,root)
450 %dir %{_sysconfdir}/samba
451 %config(noreplace) %{_sysconfdir}/samba/smb.conf
452 %config(noreplace) %{_sysconfdir}/samba/lmhosts
454 %attr(755,root,root) /%{_lib}/libnss_wins.so*
455 %attr(755,root,root) /%{_lib}/libnss_winbind.so*
456 %attr(755,root,root) /%{_lib}/security/pam_winbind.so
457 %attr(755,root,root) /%{_lib}/security/pam_smbpass.so
459 %{_includedir}/libsmbclient.h
460 %{_libdir}/libsmbclient.*
461 %{_includedir}/smb_share_modes.h
462 %{_libdir}/libsmbsharemodes.*
464 %{_libdir}/samba/*.dat
465 %{_libdir}/samba/*.msg
466 %{_libdir}/samba/charset/*.so
472 %{_mandir}/man1/profiles.1*
473 %{_mandir}/man1/testparm.1*
474 %{_mandir}/man5/smb.conf.5*
475 %{_mandir}/man5/lmhosts.5*
476 %{_mandir}/man8/smbpasswd.8*
477 %{_mandir}/man7/libsmbclient.7*
478 %{_mandir}/man7/pam_winbind.7*
481 * Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
482 - Removed ChangeLog entries since they are kept in CVS