source: vendor/current/packaging/RHEL/samba.spec@ 478

Last change on this file since 478 was 478, checked in by Silvan Scherrer, 15 years ago

Samba 3.5: vendor update to 3.5.4

File size: 15.1 KB
Line 
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)
3
4Summary: Samba SMB client and server
5Vendor: Samba Team
6Packager: Samba Team <samba@samba.org>
7Name: samba
8Version: 3.5.4
9Release: 1
10Epoch: 0
11License: GNU GPL version 3
12Group: System Environment/Daemons
13URL: http://www.samba.org/
14
15Source: samba-%{version}.tar.bz2
16
17# Don't depend on Net::LDAP
18Source998: filter-requires-samba.sh
19Source999: setup.tar.bz2
20
21Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
22Prereq: fileutils sed /etc/init.d
23
24Requires: pam >= 0.64 %{auth}
25Requires: samba-common = %{version}-%{release}
26Requires: logrotate >= 3.4 initscripts >= 5.54-1
27Provides: samba = %{version}
28
29Prefix: /usr
30BuildRoot: %{_tmppath}/%{name}-%{version}-root
31BuildRequires: pam-devel, readline-devel, fileutils, libacl-devel, openldap-devel, krb5-devel, cups-devel, keyutils-devel
32
33# Working around perl dependency problem from docs
34%define __perl_requires %{SOURCE998}
35
36# rpm screws up the arch lib dir when using --target on RHEL5
37%ifarch i386 i486 i586 i686 ppc s390
38%define _libarch lib
39%else
40%define _libarch %_lib
41%endif
42
43%define _libarchdir /usr/%{_libarch}
44
45
46%description
47Samba is the protocol by which a lot of PC-related machines share
48files, printers, and other information (such as lists of available
49files and printers). The Windows NT, OS/2, and Linux operating systems
50support this natively, and add-on packages can enable the same thing
51for DOS, Windows, VMS, UNIX of all kinds, MVS, and more. This package
52provides an SMB server that can be used to provide network services to
53SMB (sometimes called "Lan Manager") clients. Samba uses NetBIOS over
54TCP/IP (NetBT) protocols and does NOT need the NetBEUI (Microsoft Raw
55NetBIOS frame) protocol.
56
57
58#######################################################################
59%package client
60Summary: Samba (SMB) client programs.
61Group: Applications/System
62Requires: samba-common = %{version}-%{release}
63Obsoletes: smbfs
64Provides: samba-client = %{version}-%{release}
65
66%description client
67The samba-client package provides some SMB clients to compliment the
68built-in SMB filesystem in Linux. These clients allow access of SMB
69shares and printing to SMB printers.
70
71
72#######################################################################
73%package common
74Summary: Files used by both Samba servers and clients.
75Group: Applications/System
76Provides: samba-common = %{version}-%{release}
77
78%description common
79Samba-common provides files necessary for both the server and client
80packages of Samba.
81
82
83#######################################################################
84%package swat
85Summary: The Samba SMB server configuration program.
86Group: Applications/System
87Requires: samba = %{version} xinetd
88Provides: samba-swat = %{version}-%{release}
89
90%description swat
91The samba-swat package includes the new SWAT (Samba Web Administration
92Tool), for remotely managing Samba's smb.conf file using your favorite
93Web browser.
94
95
96#######################################################################
97%package doc
98Summary: Samba Documentation
99Group: Documentation/Other
100Provides: samba-doc = %{version}-%{release}
101Prereq: /usr/bin/find /bin/rm /usr/bin/xargs
102
103%description doc
104The samba-doc package includes the HTML versions of the Samba manpages
105utilized 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".
107
108
109#######################################################################
110
111%prep
112%setup -q
113
114# setup the vendor files (init scripts, etc...)
115%setup -T -D -a 999 -n samba-%{version} -q
116
117%build
118
119/bin/cp setup/filter-requires-samba.sh %{SOURCE998}
120
121cd source3
122# RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
123
124## check for ccache
125if [ "$(which ccache 2> /dev/null)" != "" ]; then
126 CC="ccache gcc"
127else
128 CC="gcc"
129fi
130
131## always run autogen.sh
132./autogen.sh
133
134## ignore insufficiently linked libreadline (RH bugzilla #499837):
135export LDFLAGS="$LDFLAGS -Wl,--allow-shlib-undefined,--no-as-needed"
136
137CC="$CC" CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
138 --prefix=%{_prefix} \
139 --localstatedir=/var \
140 --with-configdir=%{_sysconfdir}/samba \
141 --libdir=%{_libarchdir} \
142 --with-modulesdir=%{_libarchdir}/samba \
143 --with-pammodulesdir=%{_libarch}/security \
144 --with-lockdir=/var/lib/samba \
145 --with-logfilebase=/var/log/samba \
146 --with-mandir=%{_mandir} \
147 --with-piddir=/var/run \
148 --with-privatedir=%{_sysconfdir}/samba \
149 --with-sambabook=%{_datadir}/swat/using_samba \
150 --with-swatdir=%{_datadir}/swat \
151 --enable-cups \
152 --with-acl-support \
153 --with-ads \
154 --with-automount \
155 --with-fhs \
156 --with-pam_smbpass \
157 --with-libsmbclient \
158 --with-libsmbsharemodes \
159 --without-smbwrapper \
160 --with-pam \
161 --with-quotas \
162 --with-shared-modules=idmap_rid,idmap_ad,idmap_hash,idmap_adex \
163 --with-syslog \
164 --with-utmp \
165 --with-dnsupdate
166
167make showlayout
168
169## check for gcc 3.4 or later
170CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
171CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
172CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
173if [ ${CC_MAJOR} -ge 3 ]; then
174 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
175 make pch
176 fi
177fi
178
179
180make all modules pam_smbpass
181
182# Remove some permission bits to avoid to many dependencies
183cd ..
184find examples docs -type f | xargs -r chmod -x
185
186%install
187# Clean up in case there is trash left from a previous build
188rm -rf $RPM_BUILD_ROOT
189
190# Create the target build directory hierarchy
191mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
192mkdir -p $RPM_BUILD_ROOT%{_includedir}
193mkdir -p $RPM_BUILD_ROOT%{_initrddir}
194mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
195mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
196mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
197mkdir -p $RPM_BUILD_ROOT%{_mandir}
198mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
199mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
200mkdir -p $RPM_BUILD_ROOT/sbin
201mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{logrotate.d,pam.d,samba}
202mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,logrotate.d}
203mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
204mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
205mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
206mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
207mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
208
209cd source3
210make DESTDIR=$RPM_BUILD_ROOT \
211 install
212cd ..
213
214# NSS winbind support
215install -m 755 nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
216install -m 755 nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so.2
217( cd $RPM_BUILD_ROOT/%{_libarch};
218 ln -sf libnss_winbind.so.2 libnss_winbind.so;
219 ln -sf libnss_wins.so.2 libnss_wins.so )
220
221## cleanup
222/bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
223
224# Install the miscellany
225echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
226
227install -m644 setup/samba.log $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/samba
228install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
229install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
230install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
231install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
232install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
233install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
234install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
235install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
236install -m755 source3/bin/mount.cifs $RPM_BUILD_ROOT/sbin/mount.cifs
237install -m755 source3/bin/umount.cifs $RPM_BUILD_ROOT/sbin/umount.cifs
238install -m755 source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
239
240/bin/rm $RPM_BUILD_ROOT%{_sbindir}/*mount.cifs
241
242ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
243ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
244
245# Remove "*.old" files
246find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
247
248## don't duplicate the docs. These are installed by/with SWAT
249rm -rf docs/htmldocs
250rm -rf docs/manpages
251( cd docs; ln -s %{_prefix}/share/swat/help htmldocs )
252
253##
254## Clean out man pages for tools not installed here
255##
256rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
257rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
258rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
259
260
261%clean
262rm -rf $RPM_BUILD_ROOT
263
264%post
265## deal with an upgrade from a broken 3.0.21b RPM
266if [ "$1" -eq "2" ]; then
267 if [ -d /var/cache/samba ]; then
268 for file in `ls /var/cache/samba/*tdb`; do
269 /bin/cp -up $file /var/lib/samba/`basename $file`
270 done
271 mkdir -p /var/lib/samba/eventlog
272 for file in `ls /var/cache/samba/eventlog/*tdb`; do
273 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
274 done
275 /bin/mv /var/cache/samba /var/cache/samba.moved
276 fi
277fi
278
279%preun
280if [ $1 = 0 ] ; then
281 /sbin/chkconfig --del smb
282 /sbin/chkconfig --del winbind
283 # rm -rf /var/log/samba/* /var/lib/samba/*
284 /sbin/service smb stop >/dev/null 2>&1
285fi
286exit 0
287
288%postun
289if [ "$1" -ge "1" ]; then
290 %{initdir}/smb restart >/dev/null 2>&1
291fi
292
293
294%post swat
295# Add swat entry to /etc/services if not already there.
296if [ ! "`grep ^\s**swat /etc/services`" ]; then
297 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
298fi
299
300%post common
301/sbin/ldconfig
302
303%postun common
304/sbin/ldconfig
305
306#######################################################################
307## Files section ##
308#######################################################################
309
310%files
311%defattr(-,root,root)
312
313%config(noreplace) %{_sysconfdir}/sysconfig/samba
314%config(noreplace) %{_sysconfdir}/samba/smbusers
315%attr(755,root,root) %config %{initdir}/smb
316%attr(755,root,root) %config %{initdir}/winbind
317%config(noreplace) %{_sysconfdir}/logrotate.d/samba
318%config(noreplace) %{_sysconfdir}/pam.d/samba
319
320%attr(0755,root,root) %dir /var/log/samba
321%attr(0755,root,root) %dir /var/lib/samba
322%attr(1777,root,root) %dir /var/spool/samba
323
324%{_sbindir}/samba
325%{_sbindir}/winbind
326
327%{_sbindir}/smbd
328%{_sbindir}/nmbd
329%{_sbindir}/winbindd
330
331%{_bindir}/mksmbpasswd.sh
332%{_bindir}/smbcontrol
333%{_bindir}/smbstatus
334%{_bindir}/tdbbackup
335%{_bindir}/tdbtool
336%{_bindir}/tdbdump
337%{_bindir}/wbinfo
338%{_bindir}/ntlm_auth
339%{_bindir}/pdbedit
340%{_bindir}/eventlogadm
341
342%{_libarchdir}/samba/idmap/*.so
343%{_libarchdir}/samba/nss_info/*.so
344%{_libarchdir}/samba/vfs/*.so
345%{_libarchdir}/samba/auth/*.so
346
347%{_mandir}/man1/smbcontrol.1*
348%{_mandir}/man1/smbstatus.1*
349%{_mandir}/man1/vfstest.1*
350%{_mandir}/man5/smbpasswd.5*
351%{_mandir}/man7/samba.7*
352%{_mandir}/man7/winbind_krb5_locator.7*
353%{_mandir}/man8/nmbd.8*
354%{_mandir}/man8/pdbedit.8*
355%{_mandir}/man8/smbd.8*
356%{_mandir}/man8/tdbbackup.8*
357%{_mandir}/man8/tdbdump.8*
358%{_mandir}/man8/tdbtool.8*
359%{_mandir}/man8/eventlogadm.8*
360%{_mandir}/man8/winbindd.8*
361%{_mandir}/man1/ntlm_auth.1*
362%{_mandir}/man1/wbinfo.1*
363%{_mandir}/man8/vfs_*.8*
364%{_mandir}/man8/idmap_*.8*
365
366
367##########
368
369%files doc
370%defattr(-,root,root)
371%doc README COPYING Manifest
372%doc WHATSNEW.txt Roadmap
373%doc docs
374%doc examples/autofs examples/LDAP examples/libsmbclient examples/misc examples/printer-accounting
375%doc examples/printing
376%doc %{_datadir}/swat/help
377%doc %{_datadir}/swat/using_samba
378
379##########
380
381%files swat
382%defattr(-,root,root)
383%config(noreplace) %{_sysconfdir}/xinetd.d/swat
384%dir %{_datadir}/swat
385%{_datadir}/swat/include
386%{_datadir}/swat/images
387%{_datadir}/swat/lang
388%{_sbindir}/swat
389%{_mandir}/man8/swat.8*
390
391##########
392
393%files client
394%defattr(-,root,root)
395/sbin/mount.cifs
396/sbin/umount.cifs
397%{_sbindir}/cifs.upcall
398
399%{_bindir}/rpcclient
400%{_bindir}/smbcacls
401%{_bindir}/sharesec
402%{_bindir}/findsmb
403%{_bindir}/smbcquotas
404%{_bindir}/nmblookup
405%{_bindir}/smbget
406%{_bindir}/smbclient
407%{_bindir}/smbprint
408%{_bindir}/smbspool
409%{_bindir}/smbtar
410%{_bindir}/net
411%{_bindir}/smbtree
412
413%{_mandir}/man8/mount.cifs.8.*
414%{_mandir}/man8/umount.cifs.8.*
415%{_mandir}/man8/cifs.upcall.8.*
416%{_mandir}/man8/smbspool.8*
417%{_mandir}/man1/smbget.1*
418%{_mandir}/man5/smbgetrc.5*
419%{_mandir}/man1/findsmb.1*
420%{_mandir}/man1/nmblookup.1*
421%{_mandir}/man1/rpcclient.1*
422%{_mandir}/man1/smbcacls.1*
423%{_mandir}/man1/sharesec.1*
424%{_mandir}/man1/smbclient.1*
425%{_mandir}/man1/smbtar.1*
426%{_mandir}/man1/smbtree.1*
427%{_mandir}/man8/net.8*
428%{_mandir}/man1/smbcquotas.1*
429
430##########
431
432%files common
433%defattr(-,root,root)
434%dir %{_sysconfdir}/samba
435%dir %{_libarchdir}/samba
436%dir %{_libarchdir}/samba/charset
437%config(noreplace) %{_sysconfdir}/samba/smb.conf
438%config(noreplace) %{_sysconfdir}/samba/lmhosts
439
440%attr(755,root,root) /%{_libarch}/libnss_wins.so*
441%attr(755,root,root) /%{_libarch}/libnss_winbind.so*
442%attr(755,root,root) /%{_libarch}/security/pam_winbind.so
443%attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
444/usr/share/locale/de/LC_MESSAGES/pam_winbind.mo
445/usr/share/locale/ar/LC_MESSAGES/pam_winbind.mo
446/usr/share/locale/cs/LC_MESSAGES/pam_winbind.mo
447/usr/share/locale/da/LC_MESSAGES/pam_winbind.mo
448/usr/share/locale/es/LC_MESSAGES/pam_winbind.mo
449/usr/share/locale/fi/LC_MESSAGES/pam_winbind.mo
450/usr/share/locale/fr/LC_MESSAGES/pam_winbind.mo
451/usr/share/locale/hu/LC_MESSAGES/pam_winbind.mo
452/usr/share/locale/it/LC_MESSAGES/pam_winbind.mo
453/usr/share/locale/ja/LC_MESSAGES/pam_winbind.mo
454/usr/share/locale/ko/LC_MESSAGES/pam_winbind.mo
455/usr/share/locale/nb/LC_MESSAGES/pam_winbind.mo
456/usr/share/locale/nl/LC_MESSAGES/pam_winbind.mo
457/usr/share/locale/pl/LC_MESSAGES/pam_winbind.mo
458/usr/share/locale/pt_BR/LC_MESSAGES/pam_winbind.mo
459/usr/share/locale/ru/LC_MESSAGES/pam_winbind.mo
460/usr/share/locale/sv/LC_MESSAGES/pam_winbind.mo
461/usr/share/locale/zh_CN/LC_MESSAGES/pam_winbind.mo
462/usr/share/locale/zh_TW/LC_MESSAGES/pam_winbind.mo
463
464%{_includedir}/libsmbclient.h
465%{_libarchdir}/libsmbclient.*
466%{_includedir}/smb_share_modes.h
467%{_libarchdir}/libsmbsharemodes.*
468
469%{_libarchdir}/samba/*.dat
470%{_libarchdir}/samba/*.msg
471%{_libarchdir}/samba/charset/*.so
472
473%{_includedir}/netapi.h
474%{_includedir}/wbclient.h
475%{_includedir}/talloc.h
476%{_includedir}/tdb.h
477%{_libarchdir}/libnetapi.so*
478%{_libarchdir}/libtalloc.so*
479%{_libarchdir}/libtdb.so*
480%{_libarchdir}/libwbclient.so*
481
482%{_bindir}/testparm
483%{_bindir}/smbpasswd
484%{_bindir}/profiles
485
486%{_bindir}/ldbadd
487%{_bindir}/ldbdel
488%{_bindir}/ldbedit
489%{_bindir}/ldbmodify
490%{_bindir}/ldbrename
491%{_bindir}/ldbsearch
492
493%{_mandir}/man1/profiles.1*
494%{_mandir}/man1/testparm.1*
495%{_mandir}/man5/smb.conf.5*
496%{_mandir}/man5/lmhosts.5*
497%{_mandir}/man8/smbpasswd.8*
498%{_mandir}/man7/libsmbclient.7*
499%{_mandir}/man8/pam_winbind.8*
500
501%{_mandir}/man1/ldbadd.1*
502%{_mandir}/man1/ldbdel.1*
503%{_mandir}/man1/ldbedit.1*
504%{_mandir}/man1/ldbmodify.1*
505%{_mandir}/man1/ldbrename.1*
506%{_mandir}/man1/ldbsearch.1*
507
508%changelog
509* Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
510- Removed ChangeLog entries since they are kept in CVS
511
512
513
Note: See TracBrowser for help on using the repository browser.