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
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/
20 Source: http://download.samba.org/samba/ftp/samba4/%{tarball_name}.tar.gz
22 # Red Hat specific replacement-files
24 Source4: %{name}.sysconfig
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}
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.
48 Summary: Samba client programs
49 Group: Applications/System
50 Requires: %{name}-common = %{version}-%{release}
51 Requires: %{name}-libs = %{version}-%{release}
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.
59 Summary: Samba libraries
60 Group: Applications/System
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.
67 Summary: Samba python libraries
68 Group: Applications/System
69 Requires: %{name}-libs = %{version}-%{release}
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/
76 Summary: Developer tools for Samba libraries
77 Group: Development/Libraries
78 Requires: %{name}-libs = %{version}-%{release}
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.
86 Summary: Perl IDL compiler
87 Group: Development/Tools
88 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
91 The %{name}-pidl package contains the Perl IDL compiler used by Samba
92 and Wireshark to parse IDL and similar protocols
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
102 %{Name}-common provides files necessary for both the server and client
106 Summary: Samba winbind
107 Group: Applications/System
108 Requires: %{name} = %{version}-%{release}
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.
117 # TAG: change for non-pre
118 %setup -q -n %{tarball_name}
121 # copy Red Hat specific scripts
126 mv source/VERSION source/VERSION.orig
127 sed -e 's/SAMBA_VERSION_VENDOR_SUFFIX=$/&%{release}/' < source/VERSION.orig > source/VERSION
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 \
146 #Build PIDL for installation into vendor directories before 'make proto' gets to it
147 (cd pidl && %{__perl} Makefile.PL INSTALLDIRS=vendor )
149 #Builds using PIDL the IDL and many other things
155 rm -rf $RPM_BUILD_ROOT
159 #Don't call 'make install' as we want to call out to the PIDL install manually
160 make install DESTDIR=%{buildroot}
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
167 ( cd pidl && make install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT )
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 \;
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
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
188 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
190 # Install other stuff
191 install -m755 %{SOURCE5} $RPM_BUILD_ROOT/%{_initrddir}/%{name}
192 install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}
195 mkdir -p $RPM_BUILD_ROOT/%{_lib}
196 ln -sf ../%{_libdir}/libnss_winbind.so $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so.2
199 mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}
203 install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
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
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}
222 #Fix up permission on perl install
223 %{_fixperms} $RPM_BUILD_ROOT/%{perl_vendorlib}
225 #Fix up permissions in source tree, for debuginfo
226 find source/heimdal -type f | xargs chmod -x
229 rm -rf $RPM_BUILD_ROOT
232 getent group wbpriv >/dev/null || groupadd -g 88 wbpriv
236 /sbin/chkconfig --add %{name}
237 if [ "$1" -ge "1" ]; then
238 /sbin/service %{name} condrestart >/dev/null 2>&1 || :
244 /sbin/service %{name} stop >/dev/null 2>&1 || :
245 /sbin/chkconfig --del %{name}
249 %post libs -p /sbin/ldconfig
251 %postun libs -p /sbin/ldconfig
255 %defattr(-,root,root)
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
269 %defattr(-,root,root)
270 %doc WHATSNEW.txt NEWS PFIF.txt
271 %dir %{_datadir}/samba
272 %{_datadir}/samba/*.dat
274 #Only needed if Samba's build produces plugins
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
280 #%config(noreplace) %{_sysconfdir}/%{name}/smb.conf
283 %defattr(-,root,root)
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
292 %defattr(-,root,root)
296 %defattr(-,root,root)
297 %{_libdir}/libdcerpc.so
298 %{_libdir}/libdcerpc_atsvc.so
299 %{_libdir}/libdcerpc_samr.so
300 %{_libdir}/libgensec.so
303 %{_libdir}/libregistry.so
304 %{_libdir}/libsamba-hostconfig.so
305 %{_libdir}/libtorture.so
313 %defattr(-,root,root,-)
315 %{_mandir}/man1/pidl*
316 %{_mandir}/man3/Parse*
317 %attr(755,root,root) %{_bindir}/pidl
320 %defattr(-,root,root)
326 %defattr(-,root,root)
335 %{_bindir}/ad2oLschema
336 %{_bindir}/oLschema2ldif
341 %{_bindir}/subunitrun
342 %{_bindir}/smbtorture
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
353 * Mon Jun 30 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.2.alpha5.fc9
354 - Update per review feedback
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