1 |
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} |
2 |
|
3 |
%global kolab_user kolab |
4 |
%global kolab_user_id 412 |
5 |
%global kolab_group kolab |
6 |
%global kolab_group_id 412 |
7 |
|
8 |
%global kolabn_user kolab-n |
9 |
%global kolabn_user_id 413 |
10 |
%global kolabn_group kolab-n |
11 |
%global kolabn_group_id 413 |
12 |
|
13 |
%global kolabr_user kolab-r |
14 |
%global kolabr_user_id 414 |
15 |
%global kolabr_group kolab-r |
16 |
%global kolabr_group_id 414 |
17 |
|
18 |
Summary: Kolab Groupware Solution |
19 |
Name: pykolab |
20 |
Version: 0.5.11 |
21 |
Release: %mkrel 5 |
22 |
License: GPLv3+ |
23 |
Group: System/Servers |
24 |
URL: http://git.kolab.org/pykolab |
25 |
Source0: http://git.kolab.org/pykolab//%{name}-%{version}.tar.gz |
26 |
Source1: kolab-saslauthd.tmpfiles.d.conf |
27 |
Patch0: mga-schema-loc.patch |
28 |
Patch1: imap-mga.patch |
29 |
BuildRequires: gettext-devel |
30 |
BuildRequires: glib2-devel |
31 |
BuildRequires: intltool |
32 |
BuildRequires: python-icalendar |
33 |
BuildRequires: python-kolabformat |
34 |
BuildRequires: python-ldap |
35 |
BuildRequires: python-nose |
36 |
BuildRequires: python-pyasn1 |
37 |
BuildRequires: python-pyasn1-modules |
38 |
BuildRequires: python-sqlalchemy |
39 |
Requires: kolab-cli = %{version}-%{release} |
40 |
Requires: python-ldap >= 2.4 |
41 |
Requires: python-pyasn1 |
42 |
Requires: python-pyasn1-modules |
43 |
Requires(pre): rpm-helper |
44 |
Requires(post): rpm-helper |
45 |
Requires(preun): rpm-helper |
46 |
Requires(postun): rpm-helper |
47 |
Requires(pre): %{_sbindir}/useradd |
48 |
Requires(pre): %{_sbindir}/usermod |
49 |
Requires(pre): %{_sbindir}/groupadd |
50 |
BuildArch: noarch |
51 |
%description |
52 |
Kolab enables you to easily build a groupware server as part of a |
53 |
collaborative environment. |
54 |
|
55 |
## |
56 |
## Kolab Telemetry Logging |
57 |
## |
58 |
%package telemetry |
59 |
Summary: Kolab Telemetry Logging Capabilities |
60 |
Group: System/Servers |
61 |
Requires: kolab-cli = %{version}-%{release} |
62 |
|
63 |
%description telemetry |
64 |
Cyrus IMAP Telemetry logging handling capabilities for Kolab Groupware |
65 |
|
66 |
## |
67 |
## Kolab XML |
68 |
## |
69 |
%package xml |
70 |
Summary: Kolab XML format wrapper for %{name} |
71 |
Group: System/Servers |
72 |
Requires: %{name} = %{version}-%{release} |
73 |
Requires: python-kolabformat >= 0.5 |
74 |
|
75 |
%description xml |
76 |
Kolab Format XML bindings wrapper for %{name} |
77 |
|
78 |
## |
79 |
## Kolab CLI |
80 |
## |
81 |
%package -n kolab-cli |
82 |
Summary: Kolab CLI components |
83 |
Group: System/Servers |
84 |
BuildRequires: intltool |
85 |
BuildRequires: gettext |
86 |
BuildRequires: python |
87 |
Requires: %{name} = %{version}-%{release} |
88 |
Requires: python-augeas |
89 |
Requires: python-cheetah |
90 |
|
91 |
%description -n kolab-cli |
92 |
Kolab CLI utilities |
93 |
|
94 |
## |
95 |
## Kolab SASL Authentication Daemon |
96 |
## |
97 |
%package -n kolab-saslauthd |
98 |
Summary: Kolab SASL Authentication Daemon |
99 |
Group: System/Servers |
100 |
BuildRequires: intltool |
101 |
BuildRequires: gettext |
102 |
BuildRequires: python |
103 |
Requires: %{name} = %{version}-%{release} |
104 |
Requires: cyrus-sasl |
105 |
Requires: sasl-plug-plain |
106 |
|
107 |
%description -n kolab-saslauthd |
108 |
Kolab SASL Authentication Daemon for multi-domain, multi-authn database deployments |
109 |
|
110 |
## |
111 |
## Kolab Server implemented in Python |
112 |
## |
113 |
%package -n kolab-server |
114 |
Summary: Kolab Server implemented in Python |
115 |
Group: System/Servers |
116 |
BuildRequires: intltool |
117 |
BuildRequires: gettext |
118 |
BuildRequires: python |
119 |
Requires: %{name} = %{version}-%{release} |
120 |
Obsoletes: perl-kolab |
121 |
|
122 |
%description -n kolab-server |
123 |
Kolab Server implemented in Python |
124 |
|
125 |
## |
126 |
## Kolab SMTP Access Policy for Postfix |
127 |
## |
128 |
%package -n postfix-kolab |
129 |
Summary: Kolab SMTP Access Policy for Postfix |
130 |
Group: System/Servers |
131 |
BuildRequires: intltool |
132 |
BuildRequires: gettext |
133 |
BuildRequires: python |
134 |
Requires: postfix |
135 |
Requires: %{name} = %{version}-%{release} |
136 |
Requires: python-sqlalchemy |
137 |
Requires: MySQL-python |
138 |
|
139 |
%description -n postfix-kolab |
140 |
Kolab SMTP Access Policy for Postfix |
141 |
|
142 |
## |
143 |
## Wallace |
144 |
## |
145 |
%package -n wallace |
146 |
Summary: Kolab Content-Filter |
147 |
Group: System/Servers |
148 |
Requires: %{name} = %{version}-%{release} |
149 |
Requires: python-sqlalchemy |
150 |
Requires: MySQL-python |
151 |
Requires: python-icalendar >= 3.0 |
152 |
Requires: %{name}-xml = %{version}-%{release} |
153 |
|
154 |
%description -n wallace |
155 |
This is the Kolab Content Filter, with plugins |
156 |
|
157 |
%prep |
158 |
%setup -q |
159 |
%patch0 -p1 -b .mga-schema-loc |
160 |
%patch1 -p1 -b .imap-mga |
161 |
|
162 |
%build |
163 |
autoreconf -fi |
164 |
|
165 |
%configure2_5x |
166 |
|
167 |
%install |
168 |
rm -rf %{buildroot} |
169 |
make install DESTDIR=%{buildroot} |
170 |
|
171 |
mkdir -p %{buildroot}/%{_unitdir} |
172 |
%{__install} -p -m 644 kolabd/kolabd.systemd %{buildroot}/%{_unitdir}/kolabd.service |
173 |
%{__install} -p -m 644 saslauthd/kolab-saslauthd.systemd %{buildroot}/%{_unitdir}/kolab-saslauthd.service |
174 |
%{__install} -p -m 644 wallace/wallace.systemd %{buildroot}/%{_unitdir}/wallace.service |
175 |
|
176 |
# Install the systemd tempfiles |
177 |
%{__install} -D -p -m 644 kolabd/kolabd.tmpfiles.d.conf %{buildroot}%{_tmpfilesdir}/kolabd.conf |
178 |
%{__install} -D -p -m 644 wallace/wallace.tmpfiles.d.conf %{buildroot}%{_tmpfilesdir}/wallace.conf |
179 |
%{__install} -D -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/kolab-saslauthd.conf |
180 |
|
181 |
|
182 |
mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig |
183 |
%{__install} -p -m 644 kolabd/kolabd.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/kolabd |
184 |
%{__install} -p -m 644 saslauthd/kolab-saslauthd.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/kolab-saslauthd |
185 |
%{__install} -p -m 644 wallace/wallace.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/wallace |
186 |
%find_lang pykolab |
187 |
|
188 |
%pre |
189 |
# Add the kolab user and group accounts |
190 |
getent group %{kolab_group} &>/dev/null || groupadd -r %{kolab_group} -g %{kolab_group_id} &>/dev/null |
191 |
getent passwd %{kolab_user} &>/dev/null || \ |
192 |
useradd -r -u %{kolab_user_id} -g %{kolab_group} -d %{_localstatedir}/lib/%{kolab_user} -s /sbin/nologin \ |
193 |
-c "Kolab System Account" %{kolab_user} &>/dev/null || : |
194 |
|
195 |
gpasswd -a apache kolab >/dev/null 2>&1 || : |
196 |
|
197 |
getent group %{kolabn_group} &>/dev/null || groupadd -r %{kolabn_group} -g %{kolabn_group_id} &>/dev/null |
198 |
getent passwd %{kolabn_user} &>/dev/null || \ |
199 |
useradd -r -u %{kolabn_user_id} -g %{kolabn_group} -d %{_localstatedir}/lib/%{kolabn_user} -s /sbin/nologin \ |
200 |
-c "Kolab System Account (N)" %{kolabn_user} &>/dev/null || : |
201 |
gpasswd -a %{kolabn_user} %{kolab_group} &>/dev/null || : |
202 |
|
203 |
getent group %{kolabr_group} &>/dev/null || groupadd -r %{kolabr_group} -g %{kolabr_group_id} &>/dev/null |
204 |
getent passwd %{kolabr_user} &>/dev/null || \ |
205 |
useradd -r -u %{kolabr_user_id} -g %{kolabr_group} -d %{_localstatedir}/lib/%{kolabr_user} -s /sbin/nologin \ |
206 |
-c "Kolab System Account (R)" %{kolabr_user} &>/dev/null || : |
207 |
|
208 |
# Make sure the kolab user and group is added |
209 |
getent passwd %{cyrus_admin} &>/dev/null || \ |
210 |
useradd -r -d %{_localstatedir}/lib/%{cyrus_admin} -s /sbin/nologin \ |
211 |
-c "Kolab Cyrus Administrator Account" %{cyrus_admin} &>/dev/null || : |
212 |
|
213 |
# Make sure our user has the correct home directory |
214 |
if [ $1 -gt 1 ] ; then |
215 |
usermod -d %{_localstatedir}/lib/%{kolab_user} %{kolab_user} &>/dev/null || : |
216 |
usermod -d %{_localstatedir}/lib/%{kolab_user} %{kolabn_user} &>/dev/null || : |
217 |
usermod -d %{_localstatedir}/lib/%{kolab_user} %{kolabr_user} &>/dev/null || : |
218 |
fi |
219 |
|
220 |
%post -n kolab-saslauthd |
221 |
if [ $1 -eq 1 ]; then |
222 |
/bin/systemctl daemon-reload >/dev/null 2>&1 || : |
223 |
else |
224 |
/bin/systemctl condrestart kolab-saslauthd |
225 |
fi |
226 |
|
227 |
%preun -n kolab-saslauthd |
228 |
if [ $1 = 0 ]; then |
229 |
/bin/systemctl --no-reload disable kolab-saslauthd.service >/dev/null 2>&1 || : |
230 |
/bin/systemctl stop kolab-saslauthd.service >/dev/null 2>&1 || : |
231 |
fi |
232 |
|
233 |
%post -n kolab-server |
234 |
if [ $1 -eq 1 ] ; then |
235 |
/bin/systemctl daemon-reload >/dev/null 2>&1 || : |
236 |
fi |
237 |
|
238 |
%preun -n kolab-server |
239 |
if [ $1 = 0 ]; then |
240 |
/bin/systemctl --no-reload disable kolabd.service >/dev/null 2>&1 || : |
241 |
/bin/systemctl stop kolabd.service >/dev/null 2>&1 || : |
242 |
fi |
243 |
|
244 |
%post -n wallace |
245 |
if [ $1 -eq 1 ] ; then |
246 |
/bin/systemctl daemon-reload >/dev/null 2>&1 || : |
247 |
else |
248 |
/bin/systemctl condrestart wallace |
249 |
fi |
250 |
|
251 |
%preun -n wallace |
252 |
if [ $1 = 0 ]; then |
253 |
/bin/systemctl --no-reload disable wallace.service |
254 |
/bin/systemctl stop wallace.service |
255 |
fi |
256 |
|
257 |
|
258 |
%files -f pykolab.lang |
259 |
%doc AUTHORS COPYING README README.tests |
260 |
%doc conf/kolab.conf |
261 |
%attr(0640,kolab-n,kolab) %config(noreplace) %{_sysconfdir}/kolab/kolab.conf |
262 |
%dir %{python_sitelib}/pykolab/ |
263 |
%exclude %{python_sitelib}/pykolab/telemetry.* |
264 |
%{python_sitelib}/pykolab/*.py |
265 |
%{python_sitelib}/pykolab/*.pyc |
266 |
%{python_sitelib}/pykolab/*.pyo |
267 |
%{python_sitelib}/pykolab/auth/ |
268 |
%{python_sitelib}/pykolab/conf/ |
269 |
%{python_sitelib}/pykolab/imap/ |
270 |
%dir %{python_sitelib}/pykolab/plugins/ |
271 |
%{python_sitelib}/pykolab/plugins/*.py |
272 |
%{python_sitelib}/pykolab/plugins/*.pyc |
273 |
%{python_sitelib}/pykolab/plugins/*.pyo |
274 |
%{python_sitelib}/pykolab/plugins/defaultfolders |
275 |
%{python_sitelib}/pykolab/plugins/dynamicquota |
276 |
%{python_sitelib}/pykolab/plugins/recipientpolicy |
277 |
%{python_sitelib}/kolab/ |
278 |
%{python_sitelib}/cyruslib.py* |
279 |
%attr(0775,kolab,kolab-n) %dir %{_localstatedir}/lib/kolab/ |
280 |
%attr(0775,kolab,kolab-n) %dir %{_localstatedir}/log/kolab/ |
281 |
|
282 |
%files telemetry |
283 |
%doc AUTHORS COPYING |
284 |
%{_sbindir}/kolab_parse_telemetry |
285 |
%{python_sitelib}/pykolab/telemetry.* |
286 |
%{python_sitelib}/pykolab/cli/telemetry/ |
287 |
|
288 |
%files xml |
289 |
%dir %{python_sitelib}/pykolab/xml |
290 |
%{python_sitelib}/pykolab/xml/*.py |
291 |
%{python_sitelib}/pykolab/xml/*.pyc |
292 |
%{python_sitelib}/pykolab/xml/*.pyo |
293 |
|
294 |
%files -n kolab-cli |
295 |
%{_sbindir}/kolab |
296 |
%{_sbindir}/kolab-conf |
297 |
%{_sbindir}/setup-kolab |
298 |
%dir %{_sysconfdir}/kolab/templates |
299 |
%{_datadir}/kolab/templates |
300 |
%dir %{python_sitelib}/pykolab/cli/ |
301 |
%{python_sitelib}/pykolab/cli/*.py |
302 |
%{python_sitelib}/pykolab/cli/*.pyc |
303 |
%{python_sitelib}/pykolab/cli/*.pyo |
304 |
%dir %{python_sitelib}/pykolab/setup/ |
305 |
%{python_sitelib}/pykolab/setup/*.py |
306 |
%{python_sitelib}/pykolab/setup/*.pyc |
307 |
%{python_sitelib}/pykolab/setup/*.pyo |
308 |
%dir %{python_sitelib}/pykolab/wap_client/ |
309 |
%{python_sitelib}/pykolab/wap_client/*.py |
310 |
%{python_sitelib}/pykolab/wap_client/*.pyc |
311 |
%{python_sitelib}/pykolab/wap_client/*.pyo |
312 |
|
313 |
%files -n kolab-saslauthd |
314 |
%doc AUTHORS COPYING |
315 |
%{_unitdir}/kolab-saslauthd.service |
316 |
%config(noreplace) %{_sysconfdir}/sysconfig/kolab-saslauthd |
317 |
%{_sbindir}/kolab-saslauthd |
318 |
%{python_sitelib}/saslauthd/ |
319 |
%{_tmpfilesdir}/kolab-saslauthd.conf |
320 |
|
321 |
%files -n kolab-server |
322 |
%doc AUTHORS COPYING |
323 |
%{_unitdir}/kolabd.service |
324 |
%config(noreplace) %{_sysconfdir}/sysconfig/kolabd |
325 |
%{_sbindir}/kolabd |
326 |
%{python_sitelib}/kolabd/ |
327 |
%{_tmpfilesdir}/kolabd.conf |
328 |
|
329 |
%files -n postfix-kolab |
330 |
%doc AUTHORS COPYING |
331 |
%{_libexecdir}/postfix/kolab_smtp_access_policy |
332 |
|
333 |
%files -n wallace |
334 |
%doc AUTHORS COPYING |
335 |
%{_unitdir}/wallace.service |
336 |
%{_sysconfdir}/sysconfig/wallace |
337 |
%{_sbindir}/wallaced |
338 |
%{python_sitelib}/wallace |
339 |
%attr(0700,%{kolab_user},%{kolab_group}) %dir %{_var}/spool/pykolab |
340 |
%attr(0700,%{kolab_user},%{kolab_group}) %dir %{_var}/spool/pykolab/wallace |
341 |
%{_tmpfilesdir}/wallace.conf |