summaryrefslogtreecommitdiff
path: root/packaging/Fedora/samba4.spec
blob: 4e4de03ad30cff624ae73add536209b18532dea8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
%define main_release 2
%define alpha_version 5
%define samba_version 4.0.0alpha%{alpha_version}
%define tarball_name samba-4.0.0alpha%{alpha_version}

#Set what versions we require for tdb and talloc
%define tdb_version 1.1.1
%define talloc_version 1.2.0

%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Summary: The Samba4 CIFS and AD client and server suite
Name: samba4
Epoch: 0
Version: 4.0.0
Release: 0.%{main_release}.alpha%{alpha_version}%{?dist}
License: GPLv3+, LGPLv3+, BSD
Group: System Environment/Daemons
URL: http://www.samba.org/

Source: http://download.samba.org/samba/ftp/samba4/%{tarball_name}.tar.gz

# Red Hat specific replacement-files
Source1: %{name}.log
Source4: %{name}.sysconfig
Source5: %{name}.init

Requires(pre): %{name}-common = %{epoch}:%{version}-%{release}
Requires: pam >= 0:0.64
Requires: logrotate >= 0:3.4
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires(pre): /usr/sbin/groupadd
Requires(post): /sbin/chkconfig, /sbin/service
Requires(preun): /sbin/chkconfig, /sbin/service
BuildRequires: pam-devel, readline-devel, ncurses-devel, libacl-devel, e2fsprogs-devel
BuildRequires: popt-devel, libattr-devel, libaio-devel, sed, ldconfig
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires: libtalloc-devel >= %{talloc_version}
BuildRequires: libtdb-devel >= %{tdb_version}

%description

Samba 4 is the ambitious next version of the Samba suite that is being
developed in parallel to the stable 3.0 series. The main emphasis in
this branch is support for the Active Directory logon protocols used
by Windows 2000 and above.

%package client
Summary: Samba client programs
Group: Applications/System
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-libs = %{epoch}:%{version}-%{release}

%description client
The %{name}-client package provides some SMB/CIFS clients to complement
the built-in SMB/CIFS filesystem in Linux. These clients allow access
of SMB/CIFS shares and printing to SMB/CIFS printers.

%package libs
Summary: Samba libraries
Group: Applications/System
Requires: libtdb >= 0:%{tdb_version}
Requires: libtalloc >= 0:%{talloc_version}

%description libs
The %{name}-libs package  contains the libraries needed by programs 
that link against the SMB, RPC and other protocols provided by the Samba suite.

%package python
Summary: Samba python libraries
Group: Applications/System
Requires: %{name}-libs = %{epoch}:%{version}-%{release}

%description python
The %{name}-python package contains the python libraries needed by programs 
that use SMB, RPC and other Samba provided protocols in python programs/

%package devel
Summary: Developor tools for Samba libraries
Group: Development/Libraries
Requires: %{name}-libs = %{epoch}:%{version}-%{release}

%description devel
The %{name}-devel package contains the header files for the libraries
needed to develop programs that link against the SMB, RPC and other
libraries in the Samba suite.

%package pidl
Summary: Perl IDL compiler
Group: Development/Tools
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description pidl
The %{name}-pidl package contains the Perl IDL compiler used by Samba
and Wireshark to parse IDL and similar protocols

%package common
Summary: Files used by both Samba servers and clients
Group: Applications/System
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
Requires(post): /sbin/chkconfig, /sbin/service, coreutils
Requires(preun): /sbin/chkconfig, /sbin/service

%description common
%{Name}-common provides files necessary for both the server and client
packages of Samba.

%package winbind
Summary: Samba winbind
Group: Applications/System
Requires: %{name} = %{epoch}:%{version}-%{release}

%description winbind
The samba-winbind package provides the winbind NSS library, and some
client tools.  Winbind enables Linux to be a full member in Windows
domains and to use Windows user and group accounts on Linux.


%prep
# TAG: change for non-pre
%setup -q -n %{tarball_name}
#%setup -q

# copy Red Hat specific scripts

# Upstream patches
#(none)

mv source/VERSION source/VERSION.orig
sed -e 's/SAMBA_VERSION_VENDOR_SUFFIX=$/&%{release}/' < source/VERSION.orig > source/VERSION
cd source
script/mkversion.sh
cd ..

%build
cd source

%configure \
	--with-fhs \
	--with-lockdir=/var/lib/%{name} \
	--with-piddir=/var/run \
	--with-privatedir=/var/lib/%{name}/private \
	--with-logfilebase=/var/log/%{name} \
	--with-configdir=%{_sysconfdir}/%{name} \
	--with-winbindd-socket-dir=/var/run/winbind \
	--with-ntp-signd-socket-dir=/var/run/ntp_signd \
	--disable-gnutls

#Build PIDL for installation into vendor directories before 'make proto' gets to it
(cd pidl && %{__perl} Makefile.PL INSTALLDIRS=vendor )

#Builds using PIDL the IDL and many other things 
make proto

make everything

%install
rm -rf $RPM_BUILD_ROOT

cd source

#Don't call 'make install' as we want to call out to the PIDL install manually 
make installbin installdat installswat installmisc installlib installheader installpc installplugins installpython DESTDIR=%{buildroot}

#Install PIDL
( cd pidl && make install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT )

#Clean out crap left behind by the Pidl install
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;

cd ..

mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}
mkdir -p $RPM_BUILD_ROOT/var/run/winbindd
mkdir -p $RPM_BUILD_ROOT/var/run/ntp_signd
mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/winbindd_privileged
mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/
mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/old

mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/private
mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/sysvol

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig

# Install other stuff
install -m755 %{SOURCE5} $RPM_BUILD_ROOT/%{_initrddir}/%{name}
install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}

# winbind
mkdir -p $RPM_BUILD_ROOT/%{_lib}
ln -sf ../%{_libdir}/libnss_winbind.so  $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so.2 

# libs {
mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}

# }

install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}

#clean out some stuff we don't want in the Fedora package
rm $RPM_BUILD_ROOT/%{_bindir}/autoidl.py*
rm $RPM_BUILD_ROOT/%{_bindir}/epdump.py*
rm $RPM_BUILD_ROOT/%{_bindir}/gentest
rm $RPM_BUILD_ROOT/%{_bindir}/locktest
rm $RPM_BUILD_ROOT/%{_bindir}/masktest
rm $RPM_BUILD_ROOT/%{_bindir}/minschema.py*
rm $RPM_BUILD_ROOT/%{_bindir}/rpcclient
rm $RPM_BUILD_ROOT/%{_bindir}/samba3dump
rm $RPM_BUILD_ROOT/%{_bindir}/setnttoken
rm $RPM_BUILD_ROOT/%{_bindir}/getntacl
rm $RPM_BUILD_ROOT/%{_datadir}/samba/js/base.js

/sbin/ldconfig -N -n $RPM_BUILD_ROOT/%{_libdir}

#Fix up permission on perl install
%{_fixperms} $RPM_BUILD_ROOT/%{perl_vendorlib}

#Fix up permissions in source tree, for debuginfo
find -type f | xargs chmod -x

%clean
rm -rf $RPM_BUILD_ROOT

%pre
getent group wbpriv >/dev/null || groupadd -g 88 wbpriv
exit 0

%post
/sbin/chkconfig --add %{name}
if [ "$1" -ge "1" ]; then
	/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
exit 0

%preun
if [ $1 = 0 ] ; then
	/sbin/service %{name} stop >/dev/null 2>&1 || :
	/sbin/chkconfig --del %{name}
fi
exit 0

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig


%files
%defattr(-,root,root)
%{_sbindir}/smbd
%{_bindir}/smbstatus

%attr(755,root,root) %{_initrddir}/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %{_datadir}/samba/setup
%{_datadir}/samba/setup/*
%dir /var/lib/%{name}/sysvol
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%attr(0700,root,root) %dir /var/log/%{name}
%attr(0700,root,root) %dir /var/log/%{name}/old

%files libs
%defattr(-,root,root)
%doc WHATSNEW.txt NEWS PFIF.txt
%dir %{_datadir}/samba
%{_datadir}/samba/*.dat
%{_libdir}/*.so.*
%{_libdir}/samba
%dir %{_sysconfdir}/%{name}
#Need to mark this as being owned by Samba, but it is normally created
#by the provision script, which runs best if there is no existing
#smb.conf
#%config(noreplace) %{_sysconfdir}/%{name}/smb.conf

%files winbind
%defattr(-,root,root)
%{_bindir}/ntlm_auth
%{_bindir}/wbinfo
%{_libdir}/libnss_winbind.so
/%{_lib}/libnss_winbind.so.2
%dir /var/run/winbindd
%attr(750,root,wbpriv) %dir /var/lib/%{name}/winbindd_privileged

%files python
%defattr(-,root,root)
%{python_sitearch}/*

%files devel
%defattr(-,root,root)
%{_libdir}/libdcerpc.so
%{_libdir}/libdcerpc_atsvc.so
%{_libdir}/libdcerpc_samr.so
%{_libdir}/libgensec.so
%{_libdir}/libldb.so
%{_libdir}/libndr.so
%{_libdir}/libregistry.so
%{_libdir}/libsamba-hostconfig.so
%{_libdir}/libtorture.so

%{_libdir}/pkgconfig
%{_includedir}/*
%{_bindir}/ndrdump
%{_bindir}/nsstest

%files pidl
%defattr(-,root,root,-)
%{perl_vendorlib}/*
%{_mandir}/man1/pidl*
%{_mandir}/man3/Parse*
%attr(755,root,root) %{_bindir}/pidl

%files client
%defattr(-,root,root)
%{_bindir}/nmblookup
%{_bindir}/smbclient
%{_bindir}/cifsdd

%files common
%defattr(-,root,root)
%{_bindir}/net
%{_bindir}/testparm
%{_bindir}/ldbadd
%{_bindir}/ldbdel
%{_bindir}/ldbedit
%{_bindir}/ldbmodify
%{_bindir}/ldbsearch
%{_bindir}/ldbrename
%{_bindir}/ad2oLschema
%{_bindir}/oLschema2ldif
%{_bindir}/regdiff
%{_bindir}/regpatch
%{_bindir}/regshell
%{_bindir}/regtree
%{_bindir}/subunitrun
%{_bindir}/smbtorture

%dir /var/lib/%{name}
%attr(700,root,root) %dir /var/lib/%{name}/private
# We don't want to put a smb.conf in by default, provision should create it
#%config(noreplace) %{_sysconfdir}/%{name}/smb.conf

%doc COPYING
%doc WHATSNEW.txt

%changelog
* Thu Jun 26 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.1.alpha4.fc9
- Rework Fedora's Samba 3.2.0-1.rc2.16 spec file for Samba4