summaryrefslogtreecommitdiff
path: root/pykolab.spec.in
blob: 000af5cc61ac61252f8c43ca4a09ee5b85890532 (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
%{!?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
Requires:           kolab-cli = %{version}-%{release}
Requires:           python-ldap >= 2.4
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 CLI
##
%package -n kolab-cli
Summary:            Kolab CLI components
Group:              Applications/System
BuildRequires:      intltool, gettext, python

%description -n kolab-cli
Kolab CLI utilities

##
## Kolab SASL Authentication Daemon
##
%package -n kolab-saslauthd
Summary:            Kolab SASL Authentication Daemon
Group:              Applications/System
BuildRequires:      intltool, gettext, python
Requires:           pykolab = %{version}-%{release}

%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
BuildRequires:      intltool, gettext, python
Requires:           pykolab = %{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
BuildRequires:      intltool, gettext, python
Requires:           postfix
Requires:           pykolab = %{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:           pykolab = %{version}-%{release}
Requires:           python-sqlalchemy
Requires:           MySQL-python

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

%prep
%setup -q

%build
%configure

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

mkdir -p \
    %{buildroot}/%{_initrddir} \
    %{buildroot}/%{_sysconfdir}/sysconfig

%{__install} -p -m 644 saslauthd/kolab-saslauthd.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/kolab-saslauthd
%{__install} -p -m 755 saslauthd/kolab-saslauthd.sysvinit %{buildroot}/%{_initrddir}/kolab-saslauthd

%{__install} -p -m 644 kolabd/kolabd.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/kolabd
%{__install} -p -m 755 kolabd/kolabd.sysvinit %{buildroot}/%{_initrddir}/kolabd

%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 || :

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
    chkconfig --add kolab-saslauthd
else
    /sbin/service kolab-saslauthd condrestart
fi

%preun -n kolab-saslauthd
if [ $1 = 0 ]; then
    /sbin/service kolab-saslauthd stop > /dev/null 2>&1
    /sbin/chkconfig --del kolab-saslauthd
fi

%post -n kolab-server
if [ $1 -eq  1 ] ; then
    chkconfig --add kolabd
else
    /sbin/service kolabd condrestart
fi

%preun -n kolab-server
if [ $1 = 0 ]; then
    /sbin/service kolabd stop > /dev/null 2>&1
    /sbin/chkconfig --del kolabd
fi

%post -n wallace
if [ $1 -eq  1 ] ; then
    chkconfig --add wallace
else
    /sbin/service wallace condrestart
fi

%preun -n wallace
if [ $1 = 0 ]; then
    /sbin/service wallace stop > /dev/null 2>&1
    /sbin/chkconfig --del wallace
fi

%clean
rm -rf %{buildroot}

%files -f pykolab.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README README.tests
%attr(0640,root,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/
%dir %{python_sitelib}/pykolab/cli/
%{python_sitelib}/pykolab/cli/*.py
%{python_sitelib}/pykolab/cli/*.pyc
%{python_sitelib}/pykolab/cli/*.pyo
%{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
%exclude %{python_sitelib}/pykolab/setup/
%exclude %{python_sitelib}/pykolab/tests/
%{python_sitelib}/kolab/
%{python_sitelib}/cyruslib.py
%{python_sitelib}/cyruslib.pyc
%{python_sitelib}/cyruslib.pyo
%dir %{_localstatedir}/lib/kolab/
%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 -n kolab-cli
%defattr(-,root,root,-)
%{_bindir}/*
%{_sbindir}/kolab
%{_sbindir}/kolab-conf

%files -n kolab-saslauthd
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%{_initrddir}/kolab-saslauthd
%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
%{_initrddir}/kolabd
%config(noreplace) %{_sysconfdir}/sysconfig/kolabd
%{_sbindir}/kolabd
%{python_sitelib}/kolabd/
%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
%{_sbindir}/wallaced
%{python_sitelib}/wallace

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