summaryrefslogtreecommitdiff
path: root/pykolab.spec.in
blob: 8a43f44395c27bc22b94f4040c8fcdab827463fc (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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%global kolab_user kolab
%global kolab_user_id 412
%global kolab_group kolab
%global kolab_group_id 412

%global kolabn_user kolab-n
%global kolabn_user_id 413
%global kolabn_group kolab-n
%global kolabn_group_id 413

%global kolabr_user kolab-r
%global kolabr_user_id 414
%global kolabr_group kolab-r
%global kolabr_group_id 414

Summary:            Kolab Groupware Solution
Name:               pykolab
Version:            @VERSION@
Release:            @RELEASE@%{?dist}
License:            GPLv3+
Group:              Applications/System
URL:                http://kolab.org/
Source0:            http://files.kolab.org/releases/%{name}-%{version}.tar.gz
BuildRoot:          %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch:          noarch
BuildRequires:      gcc
BuildRequires:      gettext
BuildRequires:      glib2-devel
BuildRequires:      intltool
BuildRequires:      python
BuildRequires:      python-icalendar
BuildRequires:      python-kolabformat
BuildRequires:      python-ldap
BuildRequires:      python-nose
BuildRequires:      python-pyasn1
BuildRequires:      python-pyasn1-modules
BuildRequires:      python-sqlalchemy
Requires:           kolab-cli = %{version}-%{release}
Requires:           python-ldap >= 2.4
Requires:           python-pyasn1
Requires:           python-pyasn1-modules
Requires:           python-sqlalchemy
Requires(pre):      /usr/sbin/useradd
Requires(pre):      /usr/sbin/usermod
Requires(pre):      /usr/sbin/groupadd

%description
Kolab enables you to easily build a groupware server as part of a
collaborative environment.

##
## Kolab Telemetry Logging
##
%package telemetry
Summary:            Kolab Telemetry Logging Capabilities
Group:              Applications/System
Requires:           kolab-cli = %{version}-%{release}

%description telemetry
Cyrus IMAP Telemetry logging handling capabilities for Kolab Groupware

##
## Kolab XML
##
%package xml
Summary:            Kolab XML format wrapper for %{name}
Group:              Applications/System
Requires:           %{name} = %{version}-%{release}
Requires:           python-kolabformat >= 0.5

%description xml
Kolab Format XML bindings wrapper for %{name}

##
## Kolab CLI
##
%package -n kolab-cli
Summary:            Kolab CLI components
Group:              Applications/System
Requires:           %{name} = %{version}-%{release}
Requires:           python-augeas
Requires:           python-cheetah

%description -n kolab-cli
Kolab CLI utilities

##
## Kolab SASL Authentication Daemon
##
%package -n kolab-saslauthd
Summary:            Kolab SASL Authentication Daemon
Group:              Applications/System
Requires:           %{name} = %{version}-%{release}
Requires:           cyrus-sasl
Requires:           cyrus-sasl-plain

%description -n kolab-saslauthd
Kolab SASL Authentication Daemon for multi-domain, multi-authn database deployments

##
## Kolab Server implemented in Python
##
%package -n kolab-server
Summary:            Kolab Server implemented in Python
Group:              Applications/System
Requires:           %{name} = %{version}-%{release}

%description -n kolab-server
Kolab Server implemented in Python

##
## Kolab SMTP Access Policy for Postfix
##
%package -n postfix-kolab
Summary:            Kolab SMTP Access Policy for Postfix
Group:              Applications/System
Requires:           postfix
Requires:           %{name} = %{version}-%{release}
Requires:           python-sqlalchemy
Requires:           MySQL-python

%description -n postfix-kolab
Kolab SMTP Access Policy for Postfix

##
## Wallace
##
%package -n wallace
Summary:            Kolab Content-Filter
Group:              Applications/System
Requires:           %{name} = %{version}-%{release}
Requires:           python-sqlalchemy
Requires:           MySQL-python
Requires:           python-icalendar >= 3.0
Requires:           %{name}-xml = %{version}-%{release}

%description -n wallace
This is the Kolab Content Filter, with plugins

%prep
%setup -q

%build
%configure

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}

%if 0%{?fedora} >= 15
mkdir -p %{buildroot}/%{_unitdir}
%{__install} -p -m 644 kolabd/kolabd.systemd %{buildroot}/%{_unitdir}/kolabd.service
%{__install} -p -m 644 saslauthd/kolab-saslauthd.systemd %{buildroot}/%{_unitdir}/kolab-saslauthd.service
%{__install} -p -m 644 wallace/wallace.systemd %{buildroot}/%{_unitdir}/wallace.service
mkdir -p %{buildroot}/%{_sysconfdir}/tmpfiles.d/
%{__install} -p -m 644 kolabd/kolabd.tmpfiles.d.conf %{buildroot}/%{_sysconfdir}/tmpfiles.d/kolabd.conf
%{__install} -p -m 644 wallace/wallace.tmpfiles.d.conf %{buildroot}/%{_sysconfdir}/tmpfiles.d/wallace.conf
%else
mkdir -p %{buildroot}/%{_initddir}
%{__install} -p -m 755 kolabd/kolabd.sysvinit %{buildroot}/%{_initrddir}/kolabd
%{__install} -p -m 755 saslauthd/kolab-saslauthd.sysvinit %{buildroot}/%{_initrddir}/kolab-saslauthd
%{__install} -p -m 755 wallace/wallace.sysvinit %{buildroot}/%{_initrddir}/wallace
%endif

mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig
%{__install} -p -m 644 kolabd/kolabd.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/kolabd
%{__install} -p -m 644 saslauthd/kolab-saslauthd.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/kolab-saslauthd
%{__install} -p -m 644 wallace/wallace.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/wallace

%find_lang pykolab

%pre
# Add the kolab user and group accounts
getent group %{kolab_group} &>/dev/null || groupadd -r %{kolab_group} -g %{kolab_group_id} &>/dev/null
getent passwd %{kolab_user} &>/dev/null || \
    useradd -r -u %{kolab_user_id} -g %{kolab_group} -d %{_localstatedir}/lib/%{kolab_user} -s /sbin/nologin \
        -c "Kolab System Account" %{kolab_user} &>/dev/null || :

gpasswd -a apache kolab >/dev/null 2>&1 || :

getent group %{kolabn_group} &>/dev/null || groupadd -r %{kolabn_group} -g %{kolabn_group_id} &>/dev/null
getent passwd %{kolabn_user} &>/dev/null || \
    useradd -r -u %{kolabn_user_id} -g %{kolabn_group} -d %{_localstatedir}/lib/%{kolabn_user} -s /sbin/nologin \
        -c "Kolab System Account (N)" %{kolabn_user} &>/dev/null || :
    gpasswd -a %{kolabn_user} %{kolab_group} &>/dev/null || :

getent group %{kolabr_group} &>/dev/null || groupadd -r %{kolabr_group} -g %{kolabr_group_id} &>/dev/null
getent passwd %{kolabr_user} &>/dev/null || \
    useradd -r -u %{kolabr_user_id} -g %{kolabr_group} -d %{_localstatedir}/lib/%{kolabr_user} -s /sbin/nologin \
        -c "Kolab System Account (R)" %{kolabr_user} &>/dev/null || :

# Make sure the kolab user and group is added
getent passwd %{cyrus_admin} &>/dev/null || \
    useradd -r -d %{_localstatedir}/lib/%{cyrus_admin} -s /sbin/nologin \
        -c "Kolab Cyrus Administrator Account" %{cyrus_admin} &>/dev/null || :

# Make sure our user has the correct home directory
if [ $1 -gt 1 ] ; then
    usermod -d %{_localstatedir}/lib/%{kolab_user} %{kolab_user} &>/dev/null || :
    usermod -d %{_localstatedir}/lib/%{kolab_user} %{kolabn_user} &>/dev/null || :
    usermod -d %{_localstatedir}/lib/%{kolab_user} %{kolabr_user} &>/dev/null || :
fi

%post -n kolab-saslauthd
if [ $1 -eq 1 ]; then
%if 0%{?fedora} >= 15
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
%else
    /sbin/chkconfig --add kolab-saslauthd
%endif
else
    /sbin/service kolab-saslauthd condrestart
fi

%preun -n kolab-saslauthd
if [ $1 = 0 ]; then
%if 0%{?fedora} >= 15
    /bin/systemctl --no-reload disable kolab-saslauthd.service >/dev/null 2>&1 || :
    /bin/systemctl stop kolab-saslauthd.service >/dev/null 2>&1 || :
%else
    /sbin/service kolab-saslauthd stop > /dev/null 2>&1
    /sbin/chkconfig --del kolab-saslauthd
%endif
fi

%post -n kolab-server
if [ $1 -eq  1 ] ; then
%if 0%{?fedora} >= 15
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
%else
    /sbin/chkconfig --add kolabd
%endif
fi

%preun -n kolab-server
if [ $1 = 0 ]; then
%if 0%{?fedora} >= 15
    /bin/systemctl --no-reload disable kolabd.service >/dev/null 2>&1 || :
    /bin/systemctl stop kolabd.service >/dev/null 2>&1 || :
%else
    /sbin/service kolabd stop > /dev/null 2>&1
    /sbin/chkconfig --del kolabd
%endif
fi

%post -n wallace
if [ $1 -eq  1 ] ; then
%if 0%{?fedora} >= 15
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
%else
    chkconfig --add wallace
%endif
else
%if 0%{?fedora} >= 15
    /bin/systemctl reload-or-try-restart wallace.service
%else
    /sbin/service wallace condrestart
%endif
fi

%preun -n wallace
if [ $1 = 0 ]; then
%if 0%{?fedora} >= 15
    /bin/systemctl --no-reload disable wallace.service
    /bin/systemctl stop wallace.service
%else
    /sbin/service wallace stop > /dev/null 2>&1
    /sbin/chkconfig --del wallace
%endif
fi

%check
# RHEL's python unittest does not have assertIsInstance()
%if 0%{?rhel} > 1
nosetests -v tests/unit/ ||:
%else
nosetests -v tests/unit/
%endif

%clean
rm -rf %{buildroot}

%files -f pykolab.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README README.tests
%doc conf/kolab.conf
%attr(0640,kolab-n,kolab) %config(noreplace) %{_sysconfdir}/kolab/kolab.conf
%dir %{python_sitelib}/pykolab/
%exclude %{python_sitelib}/pykolab/telemetry.*
%{python_sitelib}/pykolab/*.py
%{python_sitelib}/pykolab/*.pyc
%{python_sitelib}/pykolab/*.pyo
%{python_sitelib}/pykolab/auth/
%{python_sitelib}/pykolab/conf/
%{python_sitelib}/pykolab/imap/
%dir %{python_sitelib}/pykolab/plugins/
%{python_sitelib}/pykolab/plugins/*.py
%{python_sitelib}/pykolab/plugins/*.pyc
%{python_sitelib}/pykolab/plugins/*.pyo
%{python_sitelib}/pykolab/plugins/defaultfolders
%{python_sitelib}/pykolab/plugins/dynamicquota
%{python_sitelib}/pykolab/plugins/recipientpolicy
# No sieve script management without our modified version of
# python-sievelib
%exclude %{python_sitelib}/pykolab/plugins/sievemgmt
%{python_sitelib}/kolab/
%{python_sitelib}/cyruslib.py*
%attr(0775,kolab,kolab-n) %dir %{_localstatedir}/lib/kolab/
%attr(0775,kolab,kolab-n) %dir %{_localstatedir}/log/kolab/

%files telemetry
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%{_sbindir}/kolab_parse_telemetry
#%{python_sitelib}/pykolab/cli/commandgroups/telemetry.py
%{python_sitelib}/pykolab/telemetry.*
%{python_sitelib}/pykolab/cli/telemetry/

%files xml
%dir %{python_sitelib}/pykolab/xml
%{python_sitelib}/pykolab/xml/*.py
%{python_sitelib}/pykolab/xml/*.pyc
%{python_sitelib}/pykolab/xml/*.pyo

%files -n kolab-cli
%defattr(-,root,root,-)
%{_sbindir}/kolab
%{_sbindir}/kolab-conf
%{_sbindir}/setup-kolab
%dir %{_sysconfdir}/kolab/templates
%{_datadir}/kolab/templates
%dir %{python_sitelib}/pykolab/cli/
%{python_sitelib}/pykolab/cli/*.py
%{python_sitelib}/pykolab/cli/*.pyc
%{python_sitelib}/pykolab/cli/*.pyo
%dir %{python_sitelib}/pykolab/cli/wap
%{python_sitelib}/pykolab/cli/wap/*.py
%{python_sitelib}/pykolab/cli/wap/*.pyc
%{python_sitelib}/pykolab/cli/wap/*.pyo
%dir %{python_sitelib}/pykolab/setup/
%{python_sitelib}/pykolab/setup/*.py
%{python_sitelib}/pykolab/setup/*.pyc
%{python_sitelib}/pykolab/setup/*.pyo
%dir %{python_sitelib}/pykolab/wap_client/
%{python_sitelib}/pykolab/wap_client/*.py
%{python_sitelib}/pykolab/wap_client/*.pyc
%{python_sitelib}/pykolab/wap_client/*.pyo
# No sieve script management without our modified version of
# python-sievelib
%exclude %{python_sitelib}/pykolab/cli/sieve

%files -n kolab-saslauthd
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%if 0%{?fedora} >= 15
%{_unitdir}/kolab-saslauthd.service
%else
%{_initrddir}/kolab-saslauthd
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/kolab-saslauthd
%{_sbindir}/kolab-saslauthd
%{python_sitelib}/saslauthd/
%dir %{_localstatedir}/run/kolab-saslauthd
%dir %{_localstatedir}/run/saslauthd

%files -n kolab-server
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%if 0%{?fedora} >= 15
%{_unitdir}/kolabd.service
%{_sysconfdir}/tmpfiles.d/kolabd.conf
%else
%{_initrddir}/kolabd
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/kolabd
%{_sbindir}/kolabd
%{python_sitelib}/kolabd/
%attr(0770,kolab,kolab) %dir %{_localstatedir}/run/kolabd

%files -n postfix-kolab
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%{_libexecdir}/postfix/kolab_smtp_access_policy

%files -n wallace
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%if 0%{?fedora} >= 15
%{_unitdir}/wallace.service
%{_sysconfdir}/tmpfiles.d/wallace.conf
%else
%{_initrddir}/wallace
%endif
%{_sysconfdir}/sysconfig/wallace
%{_sbindir}/wallaced
%{python_sitelib}/wallace
%attr(0700,%{kolab_user},%{kolab_group}) %dir %{_var}/spool/pykolab
%attr(0700,%{kolab_user},%{kolab_group}) %dir %{_var}/spool/pykolab/wallace

%changelog
* @DATESTAMP@ Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> @VERSION@-@RELEASE@
- Initial package of new upstream version