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 Source997
: docs.tar.bz2
19 Source998
: filter
-requires
-samba.sh
20 Source999
: setup.tar.bz2
22 Prereq
: /sbin
/chkconfig
/bin
/mktemp
/usr
/bin
/killall
23 Prereq
: fileutils sed
/etc
/init.d
25 Requires: pam
>= 0.64 %{auth}
26 Requires: samba
-common
= %{version}-%{release}
27 Requires: logrotate
>= 3.4 initscripts
>= 5.54-1
28 Provides: samba
= %{version}
31 BuildRoot: %{_tmppath}/%{name}-%{version}-root
32 BuildRequires
: pam
-devel
, readline
-devel
, fileutils
, libacl
-devel
, openldap
-devel
, krb5
-devel
, cups
-devel
, ctdb
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 # rpm screws up the arch lib dir when using --target on RHEL5
45 %ifarch i386 i486 i586 i686 ppc s390
48 %define _libarch
%_lib
53 Samba is the protocol by which a lot of PC
-related machines share
54 files
, printers
, and other information
(such as lists of available
55 files and printers
). The Windows NT
, OS
/2, and Linux operating systems
56 support this natively
, and add
-on packages can
enable the same thing
57 for DOS
, Windows
, VMS
, UNIX of all kinds
, MVS
, and more. This package
58 provides an SMB server that can be used to provide network services to
59 SMB
(sometimes called "Lan Manager"
) clients. Samba uses NetBIOS over
60 TCP
/IP
(NetBT
) protocols and does NOT need the NetBEUI
(Microsoft Raw
61 NetBIOS frame
) protocol.
64 ######################################################################
66 Summary: Samba
(SMB
) client programs.
67 Group: Applications
/System
68 Requires: samba
-common
= %{version}-%{release}
70 Provides: samba
-client
= %{version}-%{release}
73 The samba
-client package provides some SMB clients to compliment the
74 built
-in SMB filesystem
in Linux. These clients allow access of SMB
75 shares and printing to SMB printers.
78 #######################################################################
80 Summary: Files used by both Samba servers and clients.
81 Group: Applications
/System
82 Provides: samba
-common
= %{version}-%{release}
85 Samba
-common provides files necessary
for both the server and client
89 #######################################################################
91 Summary: The Samba SMB server configuration program.
92 Group: Applications
/System
93 Requires: samba
= %{version} xinetd
94 Provides: samba
-swat
= %{version}-%{release}
97 The samba
-swat package includes the new SWAT
(Samba Web Administration
98 Tool
), for remotely managing Samba's smb.conf file using your favorite
101 %ifarch i386 i486 i586 i686 ppc s390
102 %package winbind
-32bit
103 Summary: Samba winbind compatibility package
for 32bit apps on
64bit archs
104 Group: Applications
/System
106 %description winbind
-32bit
107 Compatibility package
for 32 bit apps on
64 bit architecures
111 #######################################################################
113 Summary: Samba Documentation
114 Group: Documentation
/Other
115 Provides: samba
-doc
= %{version}-%{release}
116 Prereq
: /usr
/bin
/find
/bin
/rm /usr
/bin
/xargs
119 The samba
-doc package includes the HTML versions of the Samba manpages
120 utilized by SWAT as well as the HTML and PDF version of "Using Samba"
,
121 "Samba By Example"
, and "The Official Samba HOWTO and Reference Guide".
124 #######################################################################
129 # setup the vendor files (init scripts, etc...)
130 %setup -T
-D
-a
999 -n samba
-%{version} -q
131 %setup -T
-D
-a
997 -n samba
-%{version} -q
135 /bin
/cp setup
/filter
-requires
-samba.sh
%{SOURCE998}
138 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
141 # ccache -h 2>&1 > /dev/null
142 #if [ $? -eq 0 ]; then
148 ## always run autogen.sh
151 CFLAGS
="$RPM_OPT_FLAGS $EXTRA
-D_GNU_SOURCE" .
/configure \
152 --prefix
=%{_prefix} \
153 --localstatedir
=/var \
154 --with
-configdir
=%{_sysconfdir}/samba \
155 --with
-libdir
=%{_libdir}/samba \
156 --with
-lockdir
=/var
/lib
/samba \
157 --with
-logfilebase
=/var
/log
/samba \
158 --with
-mandir
=%{_mandir} \
159 --with
-piddir
=/var
/run \
160 --with
-privatedir
=%{_sysconfdir}/samba \
161 --with
-sambabook
=%{_datadir}/swat
/using_samba \
162 --with
-swatdir
=%{_datadir}/swat \
169 --with
-libsmbclient \
170 --with
-libsmbsharemodes \
171 --without
-smbwrapper \
174 --with
-shared
-modules
=idmap_rid
,idmap_ad
,idmap_tdb2 \
177 --with
-cluster
-support \
178 --with
-ctdb
=/usr
/include \
185 make CFLAGS
="$RPM_OPT_FLAGS
-D_GNU_SOURCE" proto
187 ## check for gcc 3.4 or later
188 CC_VERSION
=`$
{CC
} --version | head
-1 | awk '
{print $
3}'`
189 CC_MAJOR
=`
echo $
{CC_VERSION
} | cut
-d.
-f
1`
190 CC_MINOR
=`
echo $
{CC_VERSION
} | cut
-d.
-f
2`
191 if [ $
{CC_MAJOR
} -ge
3 ]; then
192 if [ $
{CC_MAJOR
} -gt
3 -o $
{CC_MINOR
} -ge
4 ]; then
198 make CFLAGS
="$RPM_OPT_FLAGS
-D_GNU_SOURCE"
%{?_smp_mflags} \
199 all modules pam_smbpass
201 ## build the cifs fs mount helper
203 gcc
-o mount.cifs $RPM_OPT_FLAGS
-D_GNU_SOURCE
-Wall
-D_GNU_SOURCE
-D_LARGEFILE64_SOURCE mount.cifs.c
204 gcc
-o umount.cifs $RPM_OPT_FLAGS
-D_GNU_SOURCE
-Wall
-D_GNU_SOURCE
-D_LARGEFILE64_SOURCE umount.cifs.c
207 # Remove some permission bits to avoid to many dependencies
209 find examples docs
-type f | xargs
-r chmod
-x
212 # Clean up in case there is trash left from a previous build
213 rm -rf $RPM_BUILD_ROOT
215 # Create the target build directory hierarchy
216 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
217 mkdir -p $RPM_BUILD_ROOT
%{_includedir}
218 mkdir -p $RPM_BUILD_ROOT
%{_initrddir}
219 mkdir -p $RPM_BUILD_ROOT
{%{_libdir},%{_includedir}}
220 mkdir -p $RPM_BUILD_ROOT
%{_libdir}/samba/{auth,charset,idmap,vfs,pdb}
221 mkdir -p $RPM_BUILD_ROOT
/%{_libarch}/security
222 mkdir -p $RPM_BUILD_ROOT
%{_mandir}
223 mkdir -p $RPM_BUILD_ROOT
%{_prefix}/{bin,sbin}
224 mkdir -p $RPM_BUILD_ROOT
%{_prefix}/lib
225 mkdir -p $RPM_BUILD_ROOT
/sbin
226 mkdir -p $RPM_BUILD_ROOT
%{_sysconfdir}/{logrotate.d,pam.d,samba}
227 mkdir -p $RPM_BUILD_ROOT
%{_sysconfdir}/{pam.d,logrotate.d}
228 mkdir -p $RPM_BUILD_ROOT
%{_sysconfdir}/rc.d
/init.d
229 mkdir -p $RPM_BUILD_ROOT
%{_sysconfdir}/{samba,sysconfig}
230 mkdir -p $RPM_BUILD_ROOT
%{_sysconfdir}/xinetd.d
231 mkdir -p $RPM_BUILD_ROOT
/var
/lib
/samba
/winbindd_privileged
232 mkdir -p $RPM_BUILD_ROOT
/var
/{log
,run
/winbindd
,spool
}/samba
235 make DESTDIR
=$RPM_BUILD_ROOT \
240 cp
source/bin
/pam_smbpass.so $RPM_BUILD_ROOT
/%{_libarch}/security
/pam_smbpass.so
242 # NSS & PAM winbind support
243 install -m
755 source/bin
/pam_winbind.so $RPM_BUILD_ROOT
/%{_libarch}/security
/pam_winbind.so
244 install -m
755 source/nsswitch
/libnss_winbind.so $RPM_BUILD_ROOT
/%{_libarch}/libnss_winbind.so
245 install -m
755 source/nsswitch
/libnss_wins.so $RPM_BUILD_ROOT
/%{_libarch}/libnss_wins.so
246 ( cd $RPM_BUILD_ROOT
/%{_libarch};
247 ln
-sf libnss_winbind.so libnss_winbind.so
.2;
248 ln
-sf libnss_wins.so libnss_wins.so
.2 )
250 # make install puts libsmbclient.so in the wrong place on x86_64
251 rm -f $RPM_BUILD_ROOT
/usr
/lib
*/samba
/libsmbclient.so $RPM_BUILD_ROOT
/usr
/lib
*/samba
/libsmbclient.a || true
252 install -m
755 source/bin
/libsmbclient.so $RPM_BUILD_ROOT
%{_libdir}/libsmbclient.so
253 install -m
755 source/bin
/libsmbclient.a $RPM_BUILD_ROOT
%{_libdir}/libsmbclient.a
254 install -m
644 source/include
/libsmbclient.h $RPM_BUILD_ROOT
%{_includedir}
255 ln
-s
%{_libdir}/libsmbclient.so $RPM_BUILD_ROOT%{_libdir}/libsmbclient.so
.0
257 # make install puts libmsrpc.so in the wrong place on x86_64
258 #rm -f $RPM_BUILD_ROOT/usr/lib*/samba/libmsrpc.so $RPM_BUILD_ROOT/usr/lib*/samba/libmsrpc.a || true
259 #install -m 755 source/bin/libmsrpc.so $RPM_BUILD_ROOT%{_libdir}/libmsrpc.so
260 #install -m 755 source/bin/libmsrpc.a $RPM_BUILD_ROOT%{_libdir}/libmsrpc.a
261 #install -m 644 source/include/libmsrpc.h $RPM_BUILD_ROOT%{_includedir}
262 #rm -f $RPM_BUILD_ROOT%{_libdir}/samba/libmsrpc.*
263 #ln -s /%{_libdir}/libmsrpc.so $RPM_BUILD_ROOT%{_libdir}/libmsrpc.so.0
265 # make install puts libsmbsharemodes.so in the wrong place on x86_64
266 rm -f $RPM_BUILD_ROOT
/usr
/lib
*/samba
/libsmbsharemodes.so $RPM_BUILD_ROOT
/usr
/lib
*/samba
/libsmbsharemodes.a || true
267 install -m
755 source/bin
/libsmbsharemodes.so $RPM_BUILD_ROOT
%{_libdir}/libsmbsharemodes.so
268 install -m
755 source/bin
/libsmbsharemodes.a $RPM_BUILD_ROOT
%{_libdir}/libsmbsharemodes.a
269 install -m
644 source/include
/smb_share_modes.h $RPM_BUILD_ROOT
%{_includedir}
270 rm -f $RPM_BUILD_ROOT
%{_libdir}/samba
/libsmbsharemodes.
*
271 ln
-s
/%{_libdir}/libsmbsharemodes.so $RPM_BUILD_ROOT%{_libdir}/libsmbsharemodes.so
.0
273 # Install pam_smbpass.so
274 install -m755
source/bin
/pam_smbpass.so $RPM_BUILD_ROOT
/%{_libarch}/security
/pam_smbpass.so
277 ln
-s
%{_libdir}/samba/libwbclient.so $RPM_BUILD_ROOT/%{_libdir}/libwbclient.so
.0
278 ln
-s
%{_libdir}/samba/libtalloc.so $RPM_BUILD_ROOT/%{_libdir}/libtalloc.so
.1
279 ln
-s
%{_libdir}/samba/libtdb.so $RPM_BUILD_ROOT/%{_libdir}/libtdb.so
.0
280 ln
-s
%{_libdir}/samba/libnetapi.so $RPM_BUILD_ROOT/%{_libdir}/libnetapi.so
.0
283 /bin
/rm -rf $RPM_BUILD_ROOT
/usr
/lib
*/samba
/security
285 # Install the miscellany
286 echo 127.0.0.1 localhost
> $RPM_BUILD_ROOT
%{_sysconfdir}/samba
/lmhosts
288 install -m644 setup
/samba.log $RPM_BUILD_ROOT
%{_sysconfdir}/logrotate.d
/samba
289 install -m644 setup
/swat $RPM_BUILD_ROOT
%{_sysconfdir}/xinetd.d
/swat
290 install -m644 setup
/samba.sysconfig $RPM_BUILD_ROOT
%{_sysconfdir}/sysconfig
/samba
291 install -m755 setup
/smb.init $RPM_BUILD_ROOT
%{initdir}/smb
292 install -m755 setup
/winbind.init $RPM_BUILD_ROOT
%{initdir}/winbind
293 install -m644 setup
/samba.pamd $RPM_BUILD_ROOT
%{_sysconfdir}/pam.d
/samba
294 install -m755 setup
/smbprint $RPM_BUILD_ROOT
%{_bindir}
295 install -m644 setup
/smbusers $RPM_BUILD_ROOT
%{_sysconfdir}/samba
/smbusers
296 install -m644 setup
/smb.conf $RPM_BUILD_ROOT
%{_sysconfdir}/samba
/smb.conf
297 install -m755
source/client
/mount.cifs $RPM_BUILD_ROOT
/sbin
/mount.cifs
298 install -m755
source/client
/umount.cifs $RPM_BUILD_ROOT
/sbin
/umount.cifs
299 install -m755
source/script
/mksmbpasswd.sh $RPM_BUILD_ROOT
%{_bindir}
301 /bin
/rm $RPM_BUILD_ROOT
%{_sbindir}/*mount.cifs
303 ln
-s ..
/..
%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
304 ln
-s ..
/..
%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
306 # Remove "*.old" files
307 find $RPM_BUILD_ROOT
-name "
*.old"
-exec rm -f
{} \
;
309 ## don't duplicate the docs. These are installed by/with SWAT
312 ( cd docs
; ln
-s
%{_prefix}/share
/swat
/help htmldocs
)
315 ## Clean out man pages for tools not installed here
317 rm -f $RPM_BUILD_ROOT
%{_mandir}/man1
/log2pcap
.1*
318 rm -f $RPM_BUILD_ROOT
%{_mandir}/man1
/smbsh
.1*
319 rm -f $RPM_BUILD_ROOT
%{_mandir}/man5
/vfstest
.1*
323 rm -rf $RPM_BUILD_ROOT
326 ## deal with an upgrade from a broken 3.0.21b RPM
327 if [ "$
1"
-eq "
2"
]; then
328 if [ -d
/var
/cache
/samba
]; then
329 for file
in `ls
/var
/cache
/samba
/*tdb`
; do
330 /bin
/cp
-up $file
/var
/lib
/samba
/`basename $file`
332 mkdir -p
/var
/lib
/samba
/eventlog
333 for file
in `ls
/var
/cache
/samba
/eventlog
/*tdb`
; do
334 /bin
/cp
-up $file
/var
/lib
/samba
/eventlog
/`basename $file`
336 /bin
/mv
/var
/cache
/samba
/var
/cache
/samba.moved
340 if [ "$
1"
-ge "
1"
]; then
341 /sbin
/service smb condrestart
>/dev
/null
2>&1 ||
:
346 /sbin
/service smb stop
>/dev
/null
2>&1 ||
:
347 /sbin
/chkconfig
--del smb
348 # rm -rf /var/log/samba/* /var/lib/samba/*
355 # Add swat entry to /etc/services if not already there.
356 if [ ! "`grep ^\s
**swat
/etc
/services`"
]; then
357 echo 'swat
901/tcp
# Add swat service used via inetd' >> /etc/services
363 if [ "$
1"
-ge "
1"
]; then
364 /sbin
/service winbind condrestart
>/dev
/null
2>&1 ||
:
369 /sbin
/service winbind stop
>/dev
/null
2>&1 ||
:
370 /sbin
/chkconfig
--del winbind
377 #######################################################################
379 #######################################################################
382 %defattr(-,root
,root
)
384 %config(noreplace
) %{_sysconfdir}/sysconfig
/samba
385 %config(noreplace
) %{_sysconfdir}/samba
/smbusers
386 %attr(755,root
,root
) %config %{initdir}/smb
387 %config(noreplace
) %{_sysconfdir}/logrotate.d
/samba
388 %config(noreplace
) %{_sysconfdir}/pam.d
/samba
390 %attr(0755,root
,root
) %dir /var
/log
/samba
391 %attr(0755,root
,root
) %dir /var
/lib
/samba
392 %attr(1777,root
,root
) %dir /var
/spool
/samba
399 %{_bindir}/mksmbpasswd.sh
400 %{_bindir}/smbcontrol
405 %{_bindir}/eventlogadm
407 %{_libdir}/samba
/idmap
/*.so
408 %{_libdir}/samba
/nss_info
/*.so
409 %{_libdir}/samba
/vfs
/*.so
410 %{_libdir}/samba
/auth
/*.so
412 %{_mandir}/man1
/smbcontrol
.1*
413 %{_mandir}/man1
/smbstatus
.1*
414 %{_mandir}/man1
/vfstest
.1*
415 %{_mandir}/man5
/smbpasswd
.5*
416 %{_mandir}/man7
/samba
.7*
417 %{_mandir}/man8
/nmbd
.8*
418 %{_mandir}/man8
/pdbedit
.8*
419 %{_mandir}/man8
/smbd
.8*
420 %{_mandir}/man8
/tdbbackup
.8*
421 %{_mandir}/man8
/tdbdump
.8*
422 %{_mandir}/man8
/tdbtool
.8*
423 %{_mandir}/man8
/eventlogadm
.8*
424 %{_mandir}/man8
/vfs_
*.8*
425 %{_mandir}/man8
/idmap_
*.8*
431 %defattr(-,root
,root
)
432 %doc README COPYING Manifest
433 %doc WHATSNEW.txt Roadmap
435 %doc examples
/autofs examples
/LDAP examples
/libsmbclient examples
/misc examples
/printer
-accounting
436 %doc examples
/printing
441 %defattr(-,root
,root
)
442 %config(noreplace
) %{_sysconfdir}/xinetd.d
/swat
443 %dir %{_datadir}/swat
446 %{_mandir}/man8
/swat
.8*
447 %attr(755,root
,root
) %{_libdir}/samba
/*.msg
452 %defattr(-,root
,root
)
467 %{_mandir}/man8
/mount.cifs
.8.
*
468 %{_mandir}/man8
/umount.cifs
.8.
*
469 %{_mandir}/man8
/smbspool
.8*
470 %{_mandir}/man1
/smbget
.1*
471 %{_mandir}/man5
/smbgetrc
.5*
472 %{_mandir}/man1
/findsmb
.1*
473 %{_mandir}/man1
/nmblookup
.1*
474 %{_mandir}/man1
/rpcclient
.1*
475 %{_mandir}/man1
/smbcacls
.1*
476 %{_mandir}/man1
/smbclient
.1*
477 %{_mandir}/man1
/smbtar
.1*
478 %{_mandir}/man1
/smbtree
.1*
483 %defattr(-,root
,root
)
484 %dir %{_sysconfdir}/samba
485 %dir %{_libdir}/samba
486 %dir %{_libdir}/samba
/charset
487 %config(noreplace
) %{_sysconfdir}/samba
/smb.conf
488 %config(noreplace
) %{_sysconfdir}/samba
/lmhosts
489 %attr(755,root
,root
) %config %{initdir}/winbind
491 %attr(755,root
,root
) /%{_libarch}/libnss_wins.so
*
492 %attr(755,root
,root
) /%{_libarch}/libnss_winbind.so
*
493 %attr(755,root
,root
) /%{_libarch}/security
/pam_winbind.so
494 %attr(755,root
,root
) /%{_libarch}/security
/pam_smbpass.so
496 %{_includedir}/libsmbclient.h
497 %{_libdir}/libsmbclient.
*
498 #%{_includedir}/libmsrpc.h
499 #%{_libdir}/libmsrpc.*
500 %{_includedir}/smb_share_modes.h
501 %{_libdir}/libsmbsharemodes.
*
503 %{_libdir}/samba
/*.dat
504 %{_libdir}/samba
/charset
/*.so
506 %{_includedir}/netapi.h
507 %{_includedir}/wbclient.h
508 %{_includedir}/talloc.h
510 %{_libdir}/samba
/libnetapi.so
*
511 %{_libdir}/libnetapi.so
*
512 %{_libdir}/samba
/libtalloc.so
*
513 %{_libdir}/libtalloc.so
*
514 %{_libdir}/samba
/libtdb.so
*
515 %{_libdir}/libtdb.so
*
516 %{_libdir}/samba
/libwbclient.so
*
517 %{_libdir}/libwbclient.so
*
534 %{_bindir}/smbcquotas
536 %{_mandir}/man1
/ntlm_auth
.1*
537 %{_mandir}/man1
/profiles
.1*
538 %{_mandir}/man1
/smbcquotas
.1*
539 %{_mandir}/man1
/testparm
.1*
540 %{_mandir}/man5
/smb.conf
.5*
541 %{_mandir}/man5
/lmhosts
.5*
542 %{_mandir}/man8
/smbpasswd
.8*
543 %{_mandir}/man1
/wbinfo
.1*
544 %{_mandir}/man8
/winbindd
.8*
545 %{_mandir}/man8
/net
.8*
546 %{_mandir}/man7
/pam_winbind
.7*
547 %{_mandir}/man7
/libsmbclient
.7*
549 %ifarch i386 i486 i586 i686 ppc s390
551 %attr(755,root
,root
) /%{_libarch}/libnss_winbind.so
*
552 %attr(755,root
,root
) /%{_libarch}/libnss_wins.so
*
553 %attr(755,root
,root
) /%{_libarch}/security
/pam_winbind.so
559 * Fri Jan
16 2004 Gerald
(Jerry
) Carter
<jerry@samba
,org
>
560 - Removed ChangeLog entries since they are kept
in CVS