2 %define alpha_version 5
3 %define samba_version 4.0.0alpha%{alpha_version}
4 %define tarball_name samba-4.0.0alpha%{alpha_version}
6 #Set what versions we require for tdb and talloc
7 %define tdb_version 1.1.1
8 %define talloc_version 1.2.0
10 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
12 Summary: The Samba4 CIFS and AD client and server suite
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/
21 Source: http://download.samba.org/samba/ftp/samba4/%{tarball_name}.tar.gz
23 # Red Hat specific replacement-files
25 Source4: %{name}.sysconfig
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}
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.
49 Summary: Samba client programs
50 Group: Applications/System
51 Requires: %{name}-common = %{epoch}:%{version}-%{release}
52 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
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.
60 Summary: Samba libraries
61 Group: Applications/System
62 Requires: libtdb >= 0:%{tdb_version}
63 Requires: libtalloc >= 0:%{talloc_version}
64 Requires(post): /sbin/ldconfig
65 Requires(postun): /sbin/ldconfig
68 The %{name}-libs package contains the libraries needed by programs
69 that link against the SMB, RPC and other protocols provided by the Samba suite.
72 Summary: Samba python libraries
73 Group: Applications/System
74 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
77 The %{name}-python package contains the python libraries needed by programs
78 that use SMB, RPC and other Samba provided protocols in python programs/
81 Summary: Developer tools for Samba libraries
82 Group: Development/Libraries
83 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
86 The %{name}-devel package contains the header files for the libraries
87 needed to develop programs that link against the SMB, RPC and other
88 libraries in the Samba suite.
91 Summary: Perl IDL compiler
92 Group: Development/Tools
93 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
96 The %{name}-pidl package contains the Perl IDL compiler used by Samba
97 and Wireshark to parse IDL and similar protocols
100 Summary: Files used by both Samba servers and clients
101 Group: Applications/System
102 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
103 Requires(post): /sbin/chkconfig, /sbin/service, coreutils
104 Requires(preun): /sbin/chkconfig, /sbin/service
107 %{Name}-common provides files necessary for both the server and client
111 Summary: Samba winbind
112 Group: Applications/System
113 Requires: %{name} = %{epoch}:%{version}-%{release}
116 The samba-winbind package provides the winbind NSS library, and some
117 client tools. Winbind enables Linux to be a full member in Windows
118 domains and to use Windows user and group accounts on Linux.
122 # TAG: change for non-pre
123 %setup -q -n %{tarball_name}
126 # copy Red Hat specific scripts
131 mv source/VERSION source/VERSION.orig
132 sed -e 's/SAMBA_VERSION_VENDOR_SUFFIX=$/&%{release}/' < source/VERSION.orig > source/VERSION
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 \
151 #Build PIDL for installation into vendor directories before 'make proto' gets to it
152 (cd pidl && %{__perl} Makefile.PL INSTALLDIRS=vendor )
154 #Builds using PIDL the IDL and many other things
160 rm -rf $RPM_BUILD_ROOT
164 #Don't call 'make install' as we want to call out to the PIDL install manually
165 make install DESTDIR=%{buildroot}
167 #Undo the PIDL install, we want to try again with the right options
168 rm -rf $RPM_BUILD_ROOT/%{_libdir}/perl5
169 rm -rf $RPM_BUILD_ROOT/%{_datadir}/perl5
172 ( cd pidl && make install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT )
174 #Clean out crap left behind by the Pidl install
175 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
176 find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
180 mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
181 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d
182 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}
183 mkdir -p $RPM_BUILD_ROOT/var/run/winbindd
184 mkdir -p $RPM_BUILD_ROOT/var/run/ntp_signd
185 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/winbindd_privileged
186 mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/
187 mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/old
189 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
190 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/private
191 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/sysvol
193 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
195 # Install other stuff
196 install -m755 %{SOURCE5} $RPM_BUILD_ROOT/%{_initrddir}/%{name}
197 install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}
200 mkdir -p $RPM_BUILD_ROOT/%{_lib}
201 ln -sf ../%{_libdir}/libnss_winbind.so $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so.2
204 mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}
208 install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
210 #clean out some stuff we don't want in the Fedora package
211 rm $RPM_BUILD_ROOT/%{_bindir}/autoidl.py*
212 rm $RPM_BUILD_ROOT/%{_bindir}/epdump.py*
213 rm $RPM_BUILD_ROOT/%{_bindir}/gentest
214 rm $RPM_BUILD_ROOT/%{_bindir}/locktest
215 rm $RPM_BUILD_ROOT/%{_bindir}/masktest
216 rm $RPM_BUILD_ROOT/%{_bindir}/minschema.py*
217 rm $RPM_BUILD_ROOT/%{_bindir}/rpcclient
218 rm $RPM_BUILD_ROOT/%{_bindir}/samba3dump
219 rm $RPM_BUILD_ROOT/%{_bindir}/setnttoken
220 rm $RPM_BUILD_ROOT/%{_bindir}/getntacl
221 rm $RPM_BUILD_ROOT/%{_datadir}/samba/js/base.js
223 #This makes the right links, as rpmlint requires that the
224 #ldconfig-created links be recorded in the RPM.
225 /sbin/ldconfig -N -n $RPM_BUILD_ROOT/%{_libdir}
227 #Fix up permission on perl install
228 %{_fixperms} $RPM_BUILD_ROOT/%{perl_vendorlib}
230 #Fix up permissions in source tree, for debuginfo
231 find source/heimdal -type f | xargs chmod -x
234 rm -rf $RPM_BUILD_ROOT
237 getent group wbpriv >/dev/null || groupadd -g 88 wbpriv
241 /sbin/chkconfig --add %{name}
242 if [ "$1" -ge "1" ]; then
243 /sbin/service %{name} condrestart >/dev/null 2>&1 || :
249 /sbin/service %{name} stop >/dev/null 2>&1 || :
250 /sbin/chkconfig --del %{name}
254 %post libs -p /sbin/ldconfig
256 %postun libs -p /sbin/ldconfig
260 %defattr(-,root,root)
264 %attr(755,root,root) %{_initrddir}/%{name}
265 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
266 %dir %{_datadir}/samba/setup
267 %{_datadir}/samba/setup/*
268 %dir /var/lib/%{name}/sysvol
269 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
270 %attr(0700,root,root) %dir /var/log/%{name}
271 %attr(0700,root,root) %dir /var/log/%{name}/old
274 %defattr(-,root,root)
275 %doc WHATSNEW.txt NEWS PFIF.txt
276 %dir %{_datadir}/samba
277 %{_datadir}/samba/*.dat
279 #Only needed if Samba's build produces plugins
281 %dir %{_sysconfdir}/%{name}
282 #Need to mark this as being owned by Samba, but it is normally created
283 #by the provision script, which runs best if there is no existing
285 #%config(noreplace) %{_sysconfdir}/%{name}/smb.conf
288 %defattr(-,root,root)
291 %{_libdir}/libnss_winbind.so
292 /%{_lib}/libnss_winbind.so.2
293 %dir /var/run/winbindd
294 %attr(750,root,wbpriv) %dir /var/lib/%{name}/winbindd_privileged
297 %defattr(-,root,root)
301 %defattr(-,root,root)
302 %{_libdir}/libdcerpc.so
303 %{_libdir}/libdcerpc_atsvc.so
304 %{_libdir}/libdcerpc_samr.so
305 %{_libdir}/libgensec.so
308 %{_libdir}/libregistry.so
309 %{_libdir}/libsamba-hostconfig.so
310 %{_libdir}/libtorture.so
318 %defattr(-,root,root,-)
320 %{_mandir}/man1/pidl*
321 %{_mandir}/man3/Parse*
322 %attr(755,root,root) %{_bindir}/pidl
325 %defattr(-,root,root)
331 %defattr(-,root,root)
340 %{_bindir}/ad2oLschema
341 %{_bindir}/oLschema2ldif
346 %{_bindir}/subunitrun
347 %{_bindir}/smbtorture
349 %dir /var/lib/%{name}
350 %attr(700,root,root) %dir /var/lib/%{name}/private
351 # We don't want to put a smb.conf in by default, provision should create it
352 #%config(noreplace) %{_sysconfdir}/%{name}/smb.conf
358 * Mon Jun 30 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.2.alpha5.fc9
359 - Update per review feedback
362 * Thu Jun 26 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.1.alpha4.fc9
363 - Rework Fedora's Samba 3.2.0-1.rc2.16 spec file for Samba4