58af9480d9c1613816ef9ad09dc325042cd4bf75
[kai/samba.git] / packaging / Fedora / samba4.spec
1 %define main_release 1
2 %define alpha_version 4
3 %define samba_version 4.0.0alpha%{alpha_version}
4 %define tarball_name samba-4.0.0alpha%{alpha_version}
5
6 #Set what versions we require for tdb and talloc
7 %define tdb_version 1.1.1
8 %define talloc_version 1.2.0
9
10 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
11
12 Summary: The Samba4 CIFS and AD client and server suite
13 Name: samba4
14 Epoch: 0
15 Version: 4.0.0
16 Release: 0.%{main_release}.alpha%{alpha_version}%{?dist}
17 License: GPLv3+, LGPLv3+, BSD
18 Group: System Environment/Daemons
19 URL: http://www.samba.org/
20
21 Source: http://download.samba.org/samba/ftp/samba4/%{tarball_name}.tar.gz
22
23 # Red Hat specific replacement-files
24 Source1: %{name}.log
25 Source4: %{name}.sysconfig
26 Source5: %{name}.init
27
28 Requires(pre): %{name}-common = %{epoch}:%{version}-%{release}
29 Requires: pam >= 0:0.64
30 Requires: logrotate >= 0:3.4
31 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
32 Requires(pre): /usr/sbin/groupadd
33 Requires(post): /sbin/chkconfig, /sbin/service
34 Requires(preun): /sbin/chkconfig, /sbin/service
35 BuildRequires: pam-devel, readline-devel, ncurses-devel, libacl-devel, e2fsprogs-devel
36 BuildRequires: popt-devel, libattr-devel, libaio-devel, sed, ldconfig
37 BuildRequires:  perl(ExtUtils::MakeMaker)
38 BuildRequires: libtalloc-devel >= %{talloc_version}
39 BuildRequires: libtdb-devel >= %{tdb_version}
40
41 %description
42
43 Samba 4 is the ambitious next version of the Samba suite that is being
44 developed in parallel to the stable 3.0 series. The main emphasis in
45 this branch is support for the Active Directory logon protocols used
46 by Windows 2000 and above.
47
48 %package client
49 Summary: Samba client programs
50 Group: Applications/System
51 Requires: %{name}-common = %{epoch}:%{version}-%{release}
52 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
53
54 %description client
55 The %{name}-client package provides some SMB/CIFS clients to complement
56 the built-in SMB/CIFS filesystem in Linux. These clients allow access
57 of SMB/CIFS shares and printing to SMB/CIFS printers.
58
59 %package libs
60 Summary: Samba libraries
61 Group: Applications/System
62 Requires: libtdb >= 0:%{tdb_version}
63 Requires: libtalloc >= 0:%{talloc_version}
64
65 %description libs
66 The %{name}-libs package  contains the libraries needed by programs 
67 that link against the SMB, RPC and other protocols provided by the Samba suite.
68
69 %package python
70 Summary: Samba python libraries
71 Group: Applications/System
72 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
73
74 %description python
75 The %{name}-python package contains the python libraries needed by programs 
76 that use SMB, RPC and other Samba provided protocols in python programs/
77
78 %package devel
79 Summary: Developor tools for Samba libraries
80 Group: Development/Libraries
81 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
82
83 %description devel
84 The %{name}-devel package contains the header files for the libraries
85 needed to develop programs that link against the SMB, RPC and other
86 libraries in the Samba suite.
87
88 %package pidl
89 Summary: Perl IDL compiler
90 Group: Development/Tools
91 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
92
93 %description pidl
94 The %{name}-pidl package contains the Perl IDL compiler used by Samba
95 and Wireshark to parse IDL and similar protocols
96
97 %package common
98 Summary: Files used by both Samba servers and clients
99 Group: Applications/System
100 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
101 Requires(post): /sbin/chkconfig, /sbin/service, coreutils
102 Requires(preun): /sbin/chkconfig, /sbin/service
103
104 %description common
105 %{Name}-common provides files necessary for both the server and client
106 packages of Samba.
107
108 %package winbind
109 Summary: Samba winbind
110 Group: Applications/System
111 Requires: %{name} = %{epoch}:%{version}-%{release}
112
113 %description winbind
114 The samba-winbind package provides the winbind NSS library, and some
115 client tools.  Winbind enables Linux to be a full member in Windows
116 domains and to use Windows user and group accounts on Linux.
117
118
119 %prep
120 # TAG: change for non-pre
121 %setup -q -n %{tarball_name}
122 #%setup -q
123
124 # copy Red Hat specific scripts
125 mkdir packaging/Fedora
126 cp %{SOURCE5} packaging/Fedora/
127
128 # Upstream patches
129 #(none)
130
131 mv source/VERSION source/VERSION.orig
132 sed -e 's/SAMBA_VERSION_VENDOR_SUFFIX=$/&%{release}/' < source/VERSION.orig > source/VERSION
133 cd source
134 script/mkversion.sh
135 cd ..
136
137 %build
138 cd source
139
140 %configure \
141         --with-fhs \
142         --with-lockdir=/var/lib/%{name} \
143         --with-piddir=/var/run \
144         --with-privatedir=/var/lib/%{name}/private \
145         --with-logfilebase=/var/log/%{name} \
146         --with-configdir=%{_sysconfdir}/%{name} \
147         --with-winbindd-socket-dir=/var/run/winbind \
148         --with-ntp-signd-socket-dir=/var/run/ntp_signd \
149         --disable-gnutls
150
151 #Build PIDL for installation into vendor directories before 'make proto' gets to it
152 (cd pidl && %{__perl} Makefile.PL INSTALLDIRS=vendor )
153
154 #Builds using PIDL the IDL and many other things 
155 make proto
156
157 make everything
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161
162 cd source
163
164 #Don't call 'make install' as we want to call out to the PIDL install manually 
165 make installbin installdat installswat installmisc installlib installheader installpc installplugins installpython DESTDIR=%{buildroot}
166
167 #Install PIDL
168 ( cd pidl && make install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT )
169
170 #Clean out crap left behind by the Pidl install
171 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
172 find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
173
174 cd ..
175
176 mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
177 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d
178 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}
179 mkdir -p $RPM_BUILD_ROOT/var/run/winbindd
180 mkdir -p $RPM_BUILD_ROOT/var/run/ntp_signd
181 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/winbindd_privileged
182 mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/
183 mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/old
184
185 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
186 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/private
187 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/sysvol
188
189 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
190
191 # Install other stuff
192 install -m755 %{SOURCE5} $RPM_BUILD_ROOT/%{_initrddir}/%{name}
193 install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}
194
195 # winbind
196 mkdir -p $RPM_BUILD_ROOT/%{_lib}
197 ln -sf ../%{_libdir}/libnss_winbind.so  $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so.2 
198
199 # libs {
200 mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}
201
202 # }
203
204 install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
205
206 #clean out some stuff we don't want in the Fedora package
207 rm $RPM_BUILD_ROOT/%{_bindir}/autoidl.py*
208 rm $RPM_BUILD_ROOT/%{_bindir}/epdump.py*
209 rm $RPM_BUILD_ROOT/%{_bindir}/gentest
210 rm $RPM_BUILD_ROOT/%{_bindir}/locktest
211 rm $RPM_BUILD_ROOT/%{_bindir}/masktest
212 rm $RPM_BUILD_ROOT/%{_bindir}/minschema.py*
213 rm $RPM_BUILD_ROOT/%{_bindir}/rpcclient
214 rm $RPM_BUILD_ROOT/%{_bindir}/samba3dump
215 rm $RPM_BUILD_ROOT/%{_bindir}/setnttoken
216 rm $RPM_BUILD_ROOT/%{_bindir}/getntacl
217 rm $RPM_BUILD_ROOT/%{_datadir}/samba/js/base.js
218
219 /sbin/ldconfig -N -n $RPM_BUILD_ROOT/%{_libdir}
220
221 #Fix up permission on perl install
222 %{_fixperms} $RPM_BUILD_ROOT/%{perl_vendorlib}
223
224 #Fix up permissions in source tree, for debuginfo
225 find -type f | xargs chmod -x
226
227 %clean
228 rm -rf $RPM_BUILD_ROOT
229
230 %pre
231 getent group wbpriv >/dev/null || groupadd -g 88 wbpriv
232 exit 0
233
234 %post
235 /sbin/chkconfig --add %{name}
236 if [ "$1" -ge "1" ]; then
237         /sbin/service %{name} condrestart >/dev/null 2>&1 || :
238 fi
239 exit 0
240
241 %preun
242 if [ $1 = 0 ] ; then
243         /sbin/service %{name} stop >/dev/null 2>&1 || :
244         /sbin/chkconfig --del %{name}
245 fi
246 exit 0
247
248 %post libs -p /sbin/ldconfig
249
250 %postun libs -p /sbin/ldconfig
251
252
253 %files
254 %defattr(-,root,root)
255 %{_sbindir}/smbd
256 %{_bindir}/smbstatus
257
258 %attr(755,root,root) %{_initrddir}/%{name}
259 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
260 %dir %{_datadir}/samba/setup
261 %{_datadir}/samba/setup/*
262 %dir /var/lib/%{name}/sysvol
263 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
264 %attr(0700,root,root) %dir /var/log/%{name}
265 %attr(0700,root,root) %dir /var/log/%{name}/old
266
267 %files libs
268 %defattr(-,root,root)
269 %doc WHATSNEW.txt NEWS PFIF.txt
270 %dir %{_datadir}/samba
271 %{_datadir}/samba/*.dat
272 %{_libdir}/*.so.*
273 %{_libdir}/samba
274 %dir %{_sysconfdir}/%{name}
275 #Need to mark this as being owned by Samba, but it is normally created
276 #by the provision script, which runs best if there is no existing
277 #smb.conf
278 #%config(noreplace) %{_sysconfdir}/%{name}/smb.conf
279
280 %files winbind
281 %defattr(-,root,root)
282 %{_bindir}/ntlm_auth
283 %{_bindir}/wbinfo
284 %{_libdir}/libnss_winbind.so
285 /%{_lib}/libnss_winbind.so.2
286 %dir /var/run/winbindd
287 %attr(750,root,wbpriv) %dir /var/lib/%{name}/winbindd_privileged
288
289 %files python
290 %defattr(-,root,root)
291 %{python_sitearch}/*
292
293 %files devel
294 %defattr(-,root,root)
295 %{_libdir}/libdcerpc.so
296 %{_libdir}/libdcerpc_atsvc.so
297 %{_libdir}/libdcerpc_samr.so
298 %{_libdir}/libgensec.so
299 %{_libdir}/libldb.so
300 %{_libdir}/libndr.so
301 %{_libdir}/libregistry.so
302 %{_libdir}/libsamba-hostconfig.so
303 %{_libdir}/libtorture.so
304
305 %{_libdir}/pkgconfig
306 %{_includedir}/*
307 %{_bindir}/ndrdump
308 %{_bindir}/nsstest
309
310 %files pidl
311 %defattr(-,root,root,-)
312 %{perl_vendorlib}/*
313 %{_mandir}/man1/pidl*
314 %{_mandir}/man3/Parse*
315 %attr(755,root,root) %{_bindir}/pidl
316
317 %files client
318 %defattr(-,root,root)
319 %{_bindir}/nmblookup
320 %{_bindir}/smbclient
321 %{_bindir}/cifsdd
322
323 %files common
324 %defattr(-,root,root)
325 %{_bindir}/net
326 %{_bindir}/testparm
327 %{_bindir}/ldbadd
328 %{_bindir}/ldbdel
329 %{_bindir}/ldbedit
330 %{_bindir}/ldbmodify
331 %{_bindir}/ldbsearch
332 %{_bindir}/ldbrename
333 %{_bindir}/ad2oLschema
334 %{_bindir}/oLschema2ldif
335 %{_bindir}/regdiff
336 %{_bindir}/regpatch
337 %{_bindir}/regshell
338 %{_bindir}/regtree
339 %{_bindir}/subunitrun
340 %{_bindir}/smbtorture
341
342 %dir /var/lib/%{name}
343 %attr(700,root,root) %dir /var/lib/%{name}/private
344 # We don't want to put a smb.conf in by default, provision should create it
345 #%config(noreplace) %{_sysconfdir}/%{name}/smb.conf
346
347 %doc COPYING
348 %doc WHATSNEW.txt
349
350 %changelog
351 * Thu Jun 26 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.1.alpha4.fc9
352 - Rework Fedora's Samba 3.2.0-1.rc2.16 spec file for Samba4