source: branches/samba-3.5.x/packaging/RHEL/samba.spec@ 736

Last change on this file since 736 was 736, checked in by Silvan Scherrer, 13 years ago

Samba Server 3.5: update branche to 3.5.16

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