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