source: branches/samba-3.3.x/packaging/RHEL/samba.spec@ 222

Last change on this file since 222 was 222, checked in by Herwig Bauernfeind, 17 years ago

Update Samba 3.3 branch to 3.3.2

File size: 14.2 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 <[email protected]>
7Name: samba
8Version: 3.3.2
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
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 source
122# RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
123
124## check for ccache
125 ccache -h 2>&1 > /dev/null
126if [ $? -eq 0 ]; then
127 CC="ccache gcc"
128else
129 CC="gcc"
130fi
131
132## always run autogen.sh
133./autogen.sh
134
135CC="$CC" CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
136 --prefix=%{_prefix} \
137 --localstatedir=/var \
138 --with-configdir=%{_sysconfdir}/samba \
139 --libdir=%{_libarchdir} \
140 --with-modulesdir=%{_libarchdir}/samba \
141 --with-pammodulesdir=%{_libarch}/security \
142 --with-lockdir=/var/lib/samba \
143 --with-logfilebase=/var/log/samba \
144 --with-mandir=%{_mandir} \
145 --with-piddir=/var/run \
146 --with-privatedir=%{_sysconfdir}/samba \
147 --with-sambabook=%{_datadir}/swat/using_samba \
148 --with-swatdir=%{_datadir}/swat \
149 --enable-cups \
150 --with-acl-support \
151 --with-ads \
152 --with-automount \
153 --with-fhs \
154 --with-pam_smbpass \
155 --with-libsmbclient \
156 --with-libsmbsharemodes \
157 --without-smbwrapper \
158 --with-pam \
159 --with-quotas \
160 --with-shared-modules=idmap_rid,idmap_ad \
161 --with-syslog \
162 --with-utmp \
163 --with-dnsupdate
164
165make showlayout
166
167## check for gcc 3.4 or later
168CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
169CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
170CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
171if [ ${CC_MAJOR} -ge 3 ]; then
172 if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
173 make pch
174 fi
175fi
176
177
178make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" %{?_smp_mflags} \
179 all modules pam_smbpass
180
181# Remove some permission bits to avoid to many dependencies
182cd ..
183find examples docs -type f | xargs -r chmod -x
184
185%install
186# Clean up in case there is trash left from a previous build
187rm -rf $RPM_BUILD_ROOT
188
189# Create the target build directory hierarchy
190mkdir -p $RPM_BUILD_ROOT%{_datadir}/swat/{help,include,using_samba/{figs,gifsa}}
191mkdir -p $RPM_BUILD_ROOT%{_includedir}
192mkdir -p $RPM_BUILD_ROOT%{_initrddir}
193mkdir -p $RPM_BUILD_ROOT{%{_libarchdir},%{_includedir}}
194mkdir -p $RPM_BUILD_ROOT%{_libarchdir}/samba/{auth,charset,idmap,vfs,pdb}
195mkdir -p $RPM_BUILD_ROOT/%{_libarch}/security
196mkdir -p $RPM_BUILD_ROOT%{_mandir}
197mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
198mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
199mkdir -p $RPM_BUILD_ROOT/sbin
200mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{logrotate.d,pam.d,samba}
201mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,logrotate.d}
202mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
203mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{samba,sysconfig}
204mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
205mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
206mkdir -p $RPM_BUILD_ROOT/var/{log,run/winbindd,spool}/samba
207
208cd source
209make DESTDIR=$RPM_BUILD_ROOT \
210 install
211cd ..
212
213# NSS winbind support
214install -m 755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
215install -m 755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so.2
216( cd $RPM_BUILD_ROOT/%{_libarch};
217 ln -sf libnss_winbind.so.2 libnss_winbind.so;
218 ln -sf libnss_wins.so.2 libnss_wins.so )
219
220## cleanup
221/bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
222
223# Install the miscellany
224echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts
225
226install -m644 setup/samba.log $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/samba
227install -m644 setup/swat $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat
228install -m644 setup/samba.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba
229install -m755 setup/smb.init $RPM_BUILD_ROOT%{initdir}/smb
230install -m755 setup/winbind.init $RPM_BUILD_ROOT%{initdir}/winbind
231install -m644 setup/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba
232install -m755 setup/smbprint $RPM_BUILD_ROOT%{_bindir}
233install -m644 setup/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers
234install -m644 setup/smb.conf $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
235install -m755 source/bin/mount.cifs $RPM_BUILD_ROOT/sbin/mount.cifs
236install -m755 source/bin/umount.cifs $RPM_BUILD_ROOT/sbin/umount.cifs
237install -m755 source/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir}
238
239/bin/rm $RPM_BUILD_ROOT%{_sbindir}/*mount.cifs
240
241ln -s ../..%{initdir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba
242ln -s ../..%{initdir}/winbind $RPM_BUILD_ROOT%{_sbindir}/winbind
243
244# Remove "*.old" files
245find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
246
247## don't duplicate the docs. These are installed by/with SWAT
248rm -rf docs/htmldocs
249rm -rf docs/manpages
250( cd docs; ln -s %{_prefix}/share/swat/help htmldocs )
251
252##
253## Clean out man pages for tools not installed here
254##
255rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
256rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
257rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
258
259
260%clean
261rm -rf $RPM_BUILD_ROOT
262
263%post
264## deal with an upgrade from a broken 3.0.21b RPM
265if [ "$1" -eq "2" ]; then
266 if [ -d /var/cache/samba ]; then
267 for file in `ls /var/cache/samba/*tdb`; do
268 /bin/cp -up $file /var/lib/samba/`basename $file`
269 done
270 mkdir -p /var/lib/samba/eventlog
271 for file in `ls /var/cache/samba/eventlog/*tdb`; do
272 /bin/cp -up $file /var/lib/samba/eventlog/`basename $file`
273 done
274 /bin/mv /var/cache/samba /var/cache/samba.moved
275 fi
276fi
277
278%preun
279if [ $1 = 0 ] ; then
280 /sbin/chkconfig --del smb
281 /sbin/chkconfig --del winbind
282 # rm -rf /var/log/samba/* /var/lib/samba/*
283 /sbin/service smb stop >/dev/null 2>&1
284fi
285exit 0
286
287%postun
288if [ "$1" -ge "1" ]; then
289 %{initdir}/smb restart >/dev/null 2>&1
290fi
291
292
293%post swat
294# Add swat entry to /etc/services if not already there.
295if [ ! "`grep ^\s**swat /etc/services`" ]; then
296 echo 'swat 901/tcp # Add swat service used via inetd' >> /etc/services
297fi
298
299%post common
300/sbin/ldconfig
301
302%postun common
303/sbin/ldconfig
304
305#######################################################################
306## Files section ##
307#######################################################################
308
309%files
310%defattr(-,root,root)
311
312%config(noreplace) %{_sysconfdir}/sysconfig/samba
313%config(noreplace) %{_sysconfdir}/samba/smbusers
314%attr(755,root,root) %config %{initdir}/smb
315%attr(755,root,root) %config %{initdir}/winbind
316%config(noreplace) %{_sysconfdir}/logrotate.d/samba
317%config(noreplace) %{_sysconfdir}/pam.d/samba
318
319%attr(0755,root,root) %dir /var/log/samba
320%attr(0755,root,root) %dir /var/lib/samba
321%attr(1777,root,root) %dir /var/spool/samba
322
323%{_sbindir}/samba
324%{_sbindir}/winbind
325
326%{_sbindir}/smbd
327%{_sbindir}/nmbd
328%{_sbindir}/winbindd
329
330%{_bindir}/mksmbpasswd.sh
331%{_bindir}/smbcontrol
332%{_bindir}/smbstatus
333%{_bindir}/tdbbackup
334%{_bindir}/tdbtool
335%{_bindir}/tdbdump
336%{_bindir}/wbinfo
337%{_bindir}/ntlm_auth
338%{_bindir}/pdbedit
339%{_bindir}/eventlogadm
340
341%{_libarchdir}/samba/idmap/*.so
342%{_libarchdir}/samba/nss_info/*.so
343%{_libarchdir}/samba/vfs/*.so
344%{_libarchdir}/samba/auth/*.so
345
346%{_mandir}/man1/smbcontrol.1*
347%{_mandir}/man1/smbstatus.1*
348%{_mandir}/man1/vfstest.1*
349%{_mandir}/man5/smbpasswd.5*
350%{_mandir}/man7/samba.7*
351%{_mandir}/man7/winbind_krb5_locator.7*
352%{_mandir}/man8/nmbd.8*
353%{_mandir}/man8/pdbedit.8*
354%{_mandir}/man8/smbd.8*
355%{_mandir}/man8/tdbbackup.8*
356%{_mandir}/man8/tdbdump.8*
357%{_mandir}/man8/tdbtool.8*
358%{_mandir}/man8/eventlogadm.8*
359%{_mandir}/man8/winbindd.8*
360%{_mandir}/man1/ntlm_auth.1*
361%{_mandir}/man1/wbinfo.1*
362%{_mandir}/man8/vfs_*.8*
363%{_mandir}/man8/idmap_*.8*
364
365
366##########
367
368%files doc
369%defattr(-,root,root)
370%doc README COPYING Manifest
371%doc WHATSNEW.txt Roadmap
372%doc docs
373%doc examples/autofs examples/LDAP examples/libsmbclient examples/misc examples/printer-accounting
374%doc examples/printing
375%doc %{_datadir}/swat/help
376%doc %{_datadir}/swat/using_samba
377
378##########
379
380%files swat
381%defattr(-,root,root)
382%config(noreplace) %{_sysconfdir}/xinetd.d/swat
383%dir %{_datadir}/swat
384%{_datadir}/swat/include
385%{_datadir}/swat/images
386%{_datadir}/swat/lang
387%{_sbindir}/swat
388%{_mandir}/man8/swat.8*
389
390##########
391
392%files client
393%defattr(-,root,root)
394/sbin/mount.cifs
395/sbin/umount.cifs
396%{_sbindir}/cifs.upcall
397
398%{_bindir}/rpcclient
399%{_bindir}/smbcacls
400%{_bindir}/sharesec
401%{_bindir}/findsmb
402%{_bindir}/smbcquotas
403%{_bindir}/nmblookup
404%{_bindir}/smbget
405%{_bindir}/smbclient
406%{_bindir}/smbprint
407%{_bindir}/smbspool
408%{_bindir}/smbtar
409%{_bindir}/net
410%{_bindir}/smbtree
411
412%{_mandir}/man8/mount.cifs.8.*
413%{_mandir}/man8/umount.cifs.8.*
414%{_mandir}/man8/cifs.upcall.8.*
415%{_mandir}/man8/smbspool.8*
416%{_mandir}/man1/smbget.1*
417%{_mandir}/man5/smbgetrc.5*
418%{_mandir}/man1/findsmb.1*
419%{_mandir}/man1/nmblookup.1*
420%{_mandir}/man1/rpcclient.1*
421%{_mandir}/man1/smbcacls.1*
422%{_mandir}/man1/sharesec.1*
423%{_mandir}/man1/smbclient.1*
424%{_mandir}/man1/smbtar.1*
425%{_mandir}/man1/smbtree.1*
426%{_mandir}/man8/net.8*
427%{_mandir}/man1/smbcquotas.1*
428
429##########
430
431%files common
432%defattr(-,root,root)
433%dir %{_sysconfdir}/samba
434%dir %{_libarchdir}/samba
435%dir %{_libarchdir}/samba/charset
436%config(noreplace) %{_sysconfdir}/samba/smb.conf
437%config(noreplace) %{_sysconfdir}/samba/lmhosts
438
439%attr(755,root,root) /%{_libarch}/libnss_wins.so*
440%attr(755,root,root) /%{_libarch}/libnss_winbind.so*
441%attr(755,root,root) /%{_libarch}/security/pam_winbind.so
442%attr(755,root,root) /%{_libarch}/security/pam_smbpass.so
443/usr/share/locale/de/LC_MESSAGES/pam_winbind.mo
444
445%{_includedir}/libsmbclient.h
446%{_libarchdir}/libsmbclient.*
447%{_includedir}/smb_share_modes.h
448%{_libarchdir}/libsmbsharemodes.*
449
450%{_libarchdir}/samba/*.dat
451%{_libarchdir}/samba/*.msg
452%{_libarchdir}/samba/charset/*.so
453
454%{_includedir}/netapi.h
455%{_includedir}/wbclient.h
456%{_includedir}/talloc.h
457%{_includedir}/tdb.h
458%{_libarchdir}/libnetapi.so*
459%{_libarchdir}/libtalloc.so*
460%{_libarchdir}/libtdb.so*
461%{_libarchdir}/libwbclient.so*
462
463%{_bindir}/testparm
464%{_bindir}/smbpasswd
465%{_bindir}/profiles
466
467%{_bindir}/ldbadd
468%{_bindir}/ldbdel
469%{_bindir}/ldbedit
470%{_bindir}/ldbmodify
471%{_bindir}/ldbrename
472%{_bindir}/ldbsearch
473
474%{_mandir}/man1/profiles.1*
475%{_mandir}/man1/testparm.1*
476%{_mandir}/man5/smb.conf.5*
477%{_mandir}/man5/lmhosts.5*
478%{_mandir}/man8/smbpasswd.8*
479%{_mandir}/man7/libsmbclient.7*
480%{_mandir}/man7/pam_winbind.7*
481
482%{_mandir}/man1/ldbadd.1*
483%{_mandir}/man1/ldbdel.1*
484%{_mandir}/man1/ldbedit.1*
485%{_mandir}/man1/ldbmodify.1*
486%{_mandir}/man1/ldbrename.1*
487%{_mandir}/man1/ldbsearch.1*
488
489%changelog
490* Fri Jan 16 2004 Gerald (Jerry) Carter <jerry@samba,org>
491- Removed ChangeLog entries since they are kept in CVS
492
493
494
Note: See TracBrowser for help on using the repository browser.