1 |
# use saslauth group if |
2 |
%define SASLGROUP 0 |
3 |
%{?_with_saslgroup: %{expand: %%define SASLGROUP 1}} |
4 |
|
5 |
# preforking cyrus.conf as default |
6 |
%define PREFORK 1 |
7 |
%{?_without_prefork: %{expand: %%define PREFORK 0}} |
8 |
|
9 |
# enable idled (default no) |
10 |
%define IDLED 1 |
11 |
%{?_with_idled: %{expand: %%define IDLED 1}} |
12 |
|
13 |
# enable automatic mailbox creation on deliver (default no): |
14 |
%define build_autocreate 1 |
15 |
%{?_without_autocreate: %define build_autocreate 0} |
16 |
|
17 |
# create on demand folder requested by sieve filter (default no): |
18 |
%define build_autosieve 1 |
19 |
%{?_without_autosieve: %define build_autosieve 0} |
20 |
|
21 |
# remove quota files extension: |
22 |
%define build_rmquota 0 |
23 |
%{?_with_rmquota: %define build_rmquota 1} |
24 |
|
25 |
# snmp support |
26 |
%global with_snmp 1 |
27 |
%{?_without_snmp: %global with_snmp 0} |
28 |
|
29 |
# ldap/pts support |
30 |
%global with_ldap 1 |
31 |
%{?_without_ldap: %global with_ldap 0} |
32 |
|
33 |
%global with_mysql 1 |
34 |
%{?_without_mysql: %global with_mysql 0} |
35 |
|
36 |
%global with_pgsql 1 |
37 |
%{?_without_pgsql: %global with_pgsql 0} |
38 |
|
39 |
%global with_sqlite 1 |
40 |
%{?_without_sqlite: %global with_sqlite 0} |
41 |
|
42 |
# virtual domains in LDAP support |
43 |
# needed by Kolab2 |
44 |
##%define build_virtualdomains_in_ldap 1 |
45 |
##%{?_without_virtualdomains_in_ldap: %define build_virtualdomains_in_ldap 0} |
46 |
|
47 |
Summary: A high-performance mail store with IMAP and POP3 support |
48 |
Name: cyrus-imapd |
49 |
Version: 2.4.17 |
50 |
Release: %mkrel 16 |
51 |
License: OSI Approved |
52 |
Group: System/Servers |
53 |
URL: http://asg.web.cmu.edu/cyrus/imapd/ |
54 |
Source0: ftp://ftp.cyrusimap.org/cyrus-imapd/%{name}-%{version}.tar.gz |
55 |
Source1: ftp://ftp.cyrusimap.org/cyrus-imapd//%{name}-%{version}.tar.gz.sig |
56 |
Source2: cyrus-procmailrc |
57 |
Source4: cyrus-user-procmailrc.template |
58 |
Source6: cyrus-imapd.imap-2.1.x-conf |
59 |
Source7: cyrus-imapd.pamd-0.77 |
60 |
Source8: cyrus-imapd.pamd |
61 |
Source10: cyrus-imapd.service |
62 |
Source12: cyrus-imapd.sysconfig |
63 |
Source13: http://clement.hermann.free.fr/scripts/Cyrus/imapcreate.pl |
64 |
Source14: cyrus-imapd.README.RPM |
65 |
Source15: cyrus-imapd.cvt_cyrusdb_all |
66 |
Source19: cyrus-imapd-procmail+cyrus.mc |
67 |
Source20: cyrus-imapd.cron-daily |
68 |
Source21: http://ftp.andrew.cmu.edu/pub/net/mibs/cmu/cmu.mib |
69 |
Source22: cyr_systemd_helper |
70 |
# This patch fixes the perl install path for mdk9.0 and later |
71 |
Patch1: cyrus-imapd-mdk9.0perl-patch |
72 |
# cyrus-master instead of master in syslog |
73 |
Patch2: cyrus-imapd-logident.patch |
74 |
# (cg) Updated auto* patches for 2.4.x found via: |
75 |
# https://blog.vx.sk/archives/13-Autocreate-and-autosieve-patches-for-Cyrus-IMAP-Server-24.html |
76 |
# available here; http://www.vx.sk/download/patches/cyrus-imapd/ |
77 |
# Autocreate INBOX patch (http://email.uoa.gr/projects/cyrus/autocreate/) |
78 |
Patch3: http://www.vx.sk/download/patches/cyrus-imapd/cyrus-imapd-2.4.4-autocreate-0.10-0.patch |
79 |
# Create on demand folder requested by sieve filter (http://email.uoa.gr/projects/cyrus/autosievefolder/) |
80 |
Patch4: http://www.vx.sk/download/patches/cyrus-imapd/cyrus-imapd-2.4.12-autosieve-0.6.0.patch |
81 |
# Remove QUOTA patch (http://email.uoa.gr/projects/cyrus/quota-patches/rmquota/) |
82 |
Patch5: http://email.uoa.gr/download/cyrus/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9-rmquota-0.5-0.diff |
83 |
# command line switch to disallow plaintext login |
84 |
Patch6: cyrus-imapd-2.4.17-plaintext-cmd-line.patch |
85 |
# (oe) for kolab2: Patch to support virtdomains: ldap (parse domain from "email" field an LDAP user entry) |
86 |
# Patch8: cyrus-imapd-kolab-ldap.diff |
87 |
# (bluca) add ptloader to cyrus.conf |
88 |
Patch10: cyrus-imapd-ptloader-conf.diff |
89 |
# (bluca) fix LDAP_OPT_X_SASL_SECPROPS error in ptloader |
90 |
Patch11: cyrus-imapd-ptloader-secprops.diff |
91 |
# remove verbosity of some syslog messages (simon matter) |
92 |
Patch13: cyrus-imapd-2.1.16-getrlimit.patch |
93 |
Patch14: cyrus-imapd-2.3.12-skiplist_verbosity.patch |
94 |
# Other patches from simon matter |
95 |
Patch17: cyrus-imapd-2.3.7-mancyrusdb.patch |
96 |
Patch18: cyrus-imapd-2.3.13-make_md5_sha1_dirs.patch |
97 |
Patch19: cyrus-imapd-2.3.11-mkimap.patch |
98 |
Patch21: cyrus-imapd-2.3.16-sieve_port.patch |
99 |
Patch22: cyrus-imapd.2.4.17-user_deny.db-silence.patch |
100 |
Patch23: prefork-conf-chroot.patch |
101 |
#Requires: krb5-libs |
102 |
Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd |
103 |
Requires(preun):/usr/sbin/userdel /usr/sbin/groupdel |
104 |
Requires(post): rpm-helper >= 0.24.8-1 |
105 |
Requires(preun): rpm-helper >= 0.24.8-1 |
106 |
|
107 |
Provides: imap |
108 |
Provides: imap-server |
109 |
BuildRequires: autoconf |
110 |
BuildRequires: libsasl-devel >= 2.1.15 |
111 |
BuildRequires: ext2fs-devel |
112 |
BuildRequires: perl-devel |
113 |
BuildRequires: tcp_wrappers-devel |
114 |
BuildRequires: db-devel |
115 |
BuildRequires: openssl-devel |
116 |
BuildRequires: flex |
117 |
BuildRequires: bison |
118 |
BuildRequires: groff >= 1.15-8 |
119 |
%if %{with_snmp} |
120 |
BuildRequires: net-snmp-devel >= 5.1 |
121 |
BuildRequires: elfutils-devel |
122 |
Requires: net-snmp-mibs |
123 |
%endif |
124 |
%if %{with_ldap} |
125 |
BuildRequires: openldap-devel |
126 |
%else |
127 |
%if %{build_virtualdomains_in_ldap} |
128 |
BuildRequires: openldap-devel |
129 |
%endif |
130 |
%endif |
131 |
%if %{with_mysql} |
132 |
BuildRequires: mysql-devel |
133 |
%endif |
134 |
%if %{with_pgsql} |
135 |
BuildRequires: postgresql-devel |
136 |
%endif |
137 |
%if %{with_sqlite} |
138 |
BuildRequires: sqlite3-devel |
139 |
%endif |
140 |
|
141 |
%if %{SASLGROUP} |
142 |
%define _saslgroup saslauth |
143 |
%endif |
144 |
%define _cyrususer cyrus |
145 |
%define _cyrusgroup mail |
146 |
%define _vardata %{_var}/lib/imap |
147 |
%define _spooldata %{_var}/spool/imap |
148 |
# (gb) stick to /usr/lib/cyrus-imapd as this is an existing practice |
149 |
# from MDK 10.0 and below + /etc/init.d/cyrus-imapd would need to |
150 |
# runtime-detect the libdir since this ought to be an arch-independent |
151 |
# script. |
152 |
%define _cyrexecdir %{_prefix}/lib/cyrus-imapd |
153 |
%define _confdir master/conf |
154 |
%if %{PREFORK} |
155 |
%define _cyrusconf %{_confdir}/prefork.conf |
156 |
%else |
157 |
%define _cyrusconf %{_confdir}/normal.conf |
158 |
%endif |
159 |
|
160 |
%description |
161 |
The Cyrus IMAP Server is a scaleable enterprise mail system |
162 |
designed for use from small to large enterprise environments using |
163 |
standards-based technologies. |
164 |
|
165 |
A full Cyrus IMAP implementation allows a seamless mail and bulletin |
166 |
board environment to be set up across multiple servers. It differs from |
167 |
other IMAP server implementations in that it is run on "sealed" |
168 |
servers, where users are not normally permitted to log in. The mailbox |
169 |
database is stored in parts of the filesystem that are private to the |
170 |
Cyrus IMAP system. All user access to mail is through software using |
171 |
the IMAP, POP3, or KPOP protocols. TLSv1 and SSL are supported for |
172 |
security. |
173 |
|
174 |
This is the main package, install also the %{name}-utils package (it |
175 |
contains server administration tools and depends on the perl-Cyrus |
176 |
package). |
177 |
|
178 |
%package murder |
179 |
Summary: Cyrus IMAP server murder aggregator system files |
180 |
Group: System/Servers |
181 |
Requires: %{name} = %{version}-%{release} |
182 |
|
183 |
%description murder |
184 |
The %{name}-murder package contains the Cyrus murder aggregator system, |
185 |
i.e. IMAP, POP3 and LMTP proxies, and the mupdate mailbox master daemon. |
186 |
It allows for cluster setups where there are many backend Cyrus spools |
187 |
and frontend proxy servers. |
188 |
|
189 |
%package nntp |
190 |
Summary: Cyrus IMAP server murder nntp support files |
191 |
Group: System/Servers |
192 |
Requires: %{name} = %{version}-%{release} |
193 |
Conflicts: leafnode |
194 |
|
195 |
%description nntp |
196 |
Cyrus has the ability to export Usenet via IMAP and/or export shared |
197 |
IMAP mailboxes via NNTP. This is made possible by a new NNTP daemon |
198 |
which is included in this package. |
199 |
|
200 |
%package devel |
201 |
Summary: Cyrus IMAPd development files |
202 |
Group: Development/Other |
203 |
|
204 |
%description devel |
205 |
This package contains header files and libraries necessary for |
206 |
developing applications which use the imclient library. |
207 |
|
208 |
The main package is %{name}. |
209 |
|
210 |
%package -n perl-Cyrus |
211 |
Summary: Cyrus IMAPd utility Perl modules |
212 |
Group: Development/Perl |
213 |
|
214 |
%description -n perl-Cyrus |
215 |
This package contains Perl modules necessary to use the Cyrus server |
216 |
administrative utilities. |
217 |
|
218 |
The main package is %{name}. |
219 |
|
220 |
%package utils |
221 |
Summary: Cyrus IMAPd server admin utilities |
222 |
Group: System/Servers |
223 |
Requires: perl-Cyrus = %{version}-%{release} |
224 |
|
225 |
%description utils |
226 |
This package contains Cyrus IMAPd server administrative tools. It |
227 |
can be installed on systems other than the one running the server. |
228 |
|
229 |
This package depends on the perl-Cyrus package. |
230 |
The main package is %{name}. |
231 |
|
232 |
%prep |
233 |
|
234 |
%setup -q -n %{name}-%{version} |
235 |
%patch1 -b .mdk9.0perl.orig |
236 |
%patch2 |
237 |
%if %{build_autocreate} |
238 |
%patch3 -p1 -b .autocreate.orig |
239 |
%endif |
240 |
%if %{build_autosieve} |
241 |
%patch4 -p1 -b .autosieve.orig |
242 |
%endif |
243 |
%if %{build_rmquota} |
244 |
%patch5 -p1 -b .rmquota.orig |
245 |
%endif |
246 |
|
247 |
%patch6 -p1 -F 4 -b .plaintext.orig |
248 |
|
249 |
# (oe) for kolab2: Patch to support virtdomains: ldap (parse domain from "email" field an LDAP user entry) |
250 |
# %if %{build_virtualdomains_in_ldap} |
251 |
# %patch8 -p1 -b .kolab-ldap.orig |
252 |
# %endif |
253 |
%if %{with_ldap} |
254 |
%patch10 -p1 -b .ptloader.orig |
255 |
%endif |
256 |
%patch11 -p1 -b .secprops.orig |
257 |
|
258 |
%patch13 -p1 -b .getrlimit.orig |
259 |
%patch14 -p1 -b .skiplist_verbosity.orig |
260 |
|
261 |
# (cg) No loner applies (needs rediffing) |
262 |
#patch17 -p1 -b .mancyrusdb.orig |
263 |
# (cg) Seems to be refactored upstream - no longer needed? |
264 |
#patch18 -p1 -b .make_md5_sha1_dirs.orig |
265 |
%patch19 -p1 -b .mkimap.orig |
266 |
%patch21 -p1 -b .sieve_port.orig |
267 |
%patch22 -p1 -b .user_deny_verbosity |
268 |
# we run Postfix chroot |
269 |
%patch23 -p1 -b .prefork-conf-chroot |
270 |
## Extra documentation |
271 |
mkdir -p extradocs |
272 |
for i in %{SOURCE2} %{SOURCE4} %{SOURCE19} ; do |
273 |
cp $i extradocs |
274 |
done |
275 |
|
276 |
## remove cvs file |
277 |
rm -f doc/text/.cvsignore |
278 |
|
279 |
## regenerate html man pages |
280 |
pushd man |
281 |
for mp in *[1-8] ; do groff -m man -T html $mp > ../doc/man/$mp.html ; done |
282 |
popd |
283 |
|
284 |
# fix build under mdx8.2 |
285 |
perl -ni -e "print unless /^AC_PREREQ/" configure.in |
286 |
|
287 |
# fix conditional pam config file |
288 |
install -m 0644 %{SOURCE8} cyrus-imapd.pamd |
289 |
|
290 |
# cleanup |
291 |
for i in `find . -type d -name CVS` `find . -type d -name .svn` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do |
292 |
if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null |
293 |
done |
294 |
|
295 |
%build |
296 |
%serverbuild |
297 |
|
298 |
CPPFLAGS="-I%{_includedir}/et $CPPFLAGS" |
299 |
export CPPFLAGS |
300 |
CFLAGS="$RPM_OPT_FLAGS -fPIC" |
301 |
export CFLAGS |
302 |
LDFLAGS="-L%{_libdir}" |
303 |
export LDFLAGS |
304 |
|
305 |
#with the existing autom4te.cache autoheader would fail with the message |
306 |
#Can't locate object method "path" via package "Request" at /usr/share/autoconf/Autom4te/C4che.pm line 69, <GEN1> line 111. |
307 |
# |
308 |
|
309 |
rm -rf autom4te.cache configure |
310 |
export WANT_AUTOCONF_2_5=1 |
311 |
libtoolize --copy --force; aclocal -I cmulocal; autoheader; autoconf |
312 |
|
313 |
%configure2_5x \ |
314 |
%if %{IDLED} |
315 |
--enable-idled \ |
316 |
%endif |
317 |
%if !%{with_snmp} |
318 |
--without-snmp \ |
319 |
%endif |
320 |
%if %{with_ldap} |
321 |
--with-ldap=/usr \ |
322 |
%endif |
323 |
%if %{with_mysql} |
324 |
--with-mysql --with-mysql-incdir=/usr/include/mysql \ |
325 |
%endif |
326 |
%if %{with_pgsql} |
327 |
--with-pgsql \ |
328 |
%endif |
329 |
%if %{with_sqlite} |
330 |
--with-sqlite \ |
331 |
%endif |
332 |
--with-extraident="Mageia-RPM-%{version}-%{release}" \ |
333 |
--with-syslogfacility=MAIL \ |
334 |
--with-bdb \ |
335 |
--enable-murder \ |
336 |
--enable-netscapehack \ |
337 |
--enable-nntp \ |
338 |
--with-perl=%{__perl} \ |
339 |
--with-cyrus-prefix=%{_cyrexecdir} \ |
340 |
--with-service-path=%{_cyrexecdir} |
341 |
|
342 |
make clean |
343 |
# no parallel make - 2.3.10 |
344 |
make |
345 |
|
346 |
# Modify docs master --> cyrus-master |
347 |
pushd man |
348 |
perl -pi -e "s#master\(8\)#cyrus-master(8)#" `ls *5 *8` |
349 |
cd ../doc |
350 |
perl -pi -e "s#master#cyrus-master#g;" man.html |
351 |
cd man |
352 |
perl -pi -e "s#master\(8\)#cyrus-master(8)#;" `ls *html` |
353 |
popd |
354 |
|
355 |
# Modify path in perl scripts |
356 |
pushd perl/imap/examples |
357 |
perl -pi -e "s#/usr/local/bin/perl#%{__perl}#" `find . -type f -name "*.pl"` |
358 |
popd |
359 |
|
360 |
# Cleanup of doc dir |
361 |
find doc perl -name CVS -type d | xargs -r rm -fr |
362 |
find doc -name "*~" -type f | xargs -r rm -f |
363 |
find doc -name "*.*.orig" -type f | xargs -r rm -f |
364 |
|
365 |
rm -f doc/Makefile.dist |
366 |
rm -f doc/text/htmlstrip.c |
367 |
|
368 |
# modify lmtp socket path in .conf files |
369 |
perl -pi -e "s#/var/imap#%{_vardata}#" %{_confdir}/*.conf |
370 |
|
371 |
%install |
372 |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} |
373 |
|
374 |
%makeinstall_std |
375 |
%makeinstall_std -C man |
376 |
|
377 |
%{__install} -m 755 imtest/imtest %{buildroot}%{_cyrexecdir}/ |
378 |
%{__install} -m 755 perl/imap/cyradm %{buildroot}%{_cyrexecdir}/ |
379 |
|
380 |
# Install tools |
381 |
for tool in dohash masssievec mkimap mknewsgroups rehash translatesieve undohash upgradesieve ; do |
382 |
test -f tools/${tool} && %{__install} -m 755 tools/${tool} %{buildroot}%{_cyrexecdir}/ |
383 |
done |
384 |
%{__install} -m 755 %{SOURCE13} %{buildroot}%{_cyrexecdir}/imapcreate |
385 |
|
386 |
# Create directories |
387 |
%{__install} -d \ |
388 |
%if %{with_snmp} |
389 |
%{buildroot}%{_datadir}/snmp/mibs \ |
390 |
%endif |
391 |
%if %{with_ldap} |
392 |
%{buildroot}%{_vardata}/ptclient/ \ |
393 |
%endif |
394 |
%{buildroot}%{_unitdir} \ |
395 |
%{buildroot}%{_sysconfdir}/{pam.d,sysconfig,cron.daily} \ |
396 |
%{buildroot}%{_libdir}/sasl \ |
397 |
%{buildroot}%{_bindir} \ |
398 |
%{buildroot}%{_spooldata}/stage. \ |
399 |
%{buildroot}%{_vardata}/{user,quota,proc,log,msg,socket,db,sieve,rpm,backup} |
400 |
# we need this dir for the chrooted postfix for making lmtp working |
401 |
%if %{PREFORK} |
402 |
%{__install} -d 750 %{buildroot}%{_var}/spool/postfix/extern/cyrus |
403 |
%endif |
404 |
|
405 |
# Install additional files |
406 |
%{__install} -m 755 %{SOURCE15} %{buildroot}%{_cyrexecdir}/cvt_cyrusdb_all |
407 |
|
408 |
# Install config files |
409 |
%{__install} -m 644 %{_cyrusconf} %{buildroot}%{_sysconfdir}/cyrus.conf |
410 |
%{__install} -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/imapd.conf |
411 |
|
412 |
%{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/pop |
413 |
%{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/imap |
414 |
%{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/sieve |
415 |
%{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/mupdate |
416 |
%{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/lmtp |
417 |
%{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/nntp |
418 |
%{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/csync |
419 |
|
420 |
%{__install} -m 644 %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/%{name} |
421 |
%{__install} -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/%{name}.service |
422 |
%{__install} -m 755 %{SOURCE20} %{buildroot}%{_sysconfdir}/cron.daily/%{name} |
423 |
%{__install} -m 755 %{SOURCE22} %{buildroot}%{_cyrexecdir}/cyr_systemd_helper |
424 |
|
425 |
%if %{with_snmp} |
426 |
# Install snmp mibs |
427 |
%{__install} -m 644 master/CYRUS-MASTER.mib %{buildroot}%{_datadir}/snmp/mibs/CYRUS-MASTER-MIB.txt |
428 |
%{__install} -m 644 %{SOURCE21} %{buildroot}%{_datadir}/snmp/mibs/CMU-MIB.txt |
429 |
%endif |
430 |
|
431 |
# Install README.RPM |
432 |
%{__install} -m 644 %{SOURCE14} README.RPM |
433 |
cat << EOF >> README.RPM |
434 |
|
435 |
RPM BUILD TIME CONFIGURATION OPTIONS |
436 |
|
437 |
This RPM package has been compiled with the following options: |
438 |
|
439 |
use saslauth group |
440 |
SASLGROUP: %{SASLGROUP} |
441 |
|
442 |
use preforking cyrus.conf |
443 |
PREFORK: %{PREFORK} |
444 |
|
445 |
enable IDLED support |
446 |
IDLED: %{IDLED} |
447 |
|
448 |
enable full directory hash |
449 |
FULLDIRHASH: %{FULLDIRHASH} |
450 |
|
451 |
EOF |
452 |
|
453 |
# Install templates |
454 |
%{__install} -m 755 -d doc/conf |
455 |
%{__install} -m 644 %{_confdir}/*.conf doc/conf/ |
456 |
|
457 |
# Rename 'master' binary and manpage to avoid crash with postfix |
458 |
mv -f %{buildroot}%{_cyrexecdir}/master %{buildroot}%{_cyrexecdir}/cyrus-master |
459 |
mv -f %{buildroot}%{_mandir}/man8/master.8 %{buildroot}%{_mandir}/man8/cyrus-master.8 |
460 |
cp -af doc/man/master.8.html doc/man/cyrus-master.8.html |
461 |
|
462 |
# Create symlinks |
463 |
ln -sf ../lib/cyrus-imapd/cyradm %{buildroot}%{_bindir}/ |
464 |
ln -sf ../lib/cyrus-imapd/imtest %{buildroot}%{_bindir}/ |
465 |
ln -sf ../lib/cyrus-imapd/imapcreate %{buildroot}%{_bindir}/ |
466 |
|
467 |
# required if upgrading from 2.2.x -> 2.3.6+ |
468 |
%{__install} -m 755 tools/migrate-metadata %{buildroot}%{_cyrexecdir}/migrate-metadata |
469 |
|
470 |
# provide the cyrusMaster.conf file, discovered by doing: |
471 |
# /usr/lib/cyrus-imapd/cyrus-master -p /var/run/cyrus-master.pid -D |
472 |
%if %{with_snmp} |
473 |
install -d %{buildroot}/var/lib/net-snmp |
474 |
echo "# placeholder" > %{buildroot}/var/lib/net-snmp/cyrusMaster.conf |
475 |
%endif |
476 |
|
477 |
# cleanup |
478 |
find %{buildroot}%{perl_vendorarch} -name "*.annotate" | xargs rm -f |
479 |
|
480 |
%pre |
481 |
# Create 'cyrus' user on target host |
482 |
%if %{SASLGROUP} |
483 |
/usr/sbin/groupadd -r %{_saslgroup} 2> /dev/null || : |
484 |
/usr/sbin/useradd -c "Cyrus IMAP Server" -d %{_vardata} -g %{_cyrusgroup} \ |
485 |
-G %{_saslgroup} -s /bin/bash -r %{_cyrususer} 2> /dev/null || : |
486 |
%else |
487 |
/usr/sbin/useradd -c "Cyrus IMAP Server" -d %{_vardata} -g %{_cyrusgroup} \ |
488 |
-s /bin/bash -r %{_cyrususer} 2> /dev/null || : |
489 |
%endif |
490 |
|
491 |
%post |
492 |
if [ $1 = 1 ] ; then |
493 |
# make sure we own the stuff, otherwise /var/log/mail/* will fill |
494 |
# the whole disk with error messages... |
495 |
chown -R %{_cyrususer}:%{_cyrusgroup} %{_vardata} %{_spooldata} |
496 |
fi |
497 |
%_create_ssl_certificate cyrus-imapd |
498 |
chown %{_cyrususer}:%{_cyrusgroup} /etc/pki/tls/private/cyrus-imapd.pem |
499 |
|
500 |
|
501 |
# Force synchronous updates only on ext2 filesystems |
502 |
# Note: This will slow down user creation for 10.000+ users! |
503 |
for i in %{_vardata}/{user,quota} %{_spooldata} |
504 |
do |
505 |
if [ `find $i -maxdepth 0 -printf %F` = "ext2" ]; then |
506 |
chattr -R +S $i 2>/dev/null |
507 |
fi |
508 |
done |
509 |
|
510 |
# Add sieve service if necessary |
511 |
if ! grep -q ^sieve %{_sysconfdir}/services; then |
512 |
echo -e 'sieve\t\t2000/tcp\t\t\t# Sieve mail filter daemon' >> %{_sysconfdir}/services |
513 |
fi |
514 |
|
515 |
# Add lmtp service if necessary |
516 |
if ! grep -q ^lmtp %{_sysconfdir}/services; then |
517 |
echo -e 'lmtp\t\t2003/tcp\t\t\t# Local mail delivery protocol (rfc2033)' >> %{_sysconfdir}/services |
518 |
fi |
519 |
|
520 |
# upgrade from previous versions with compiled in database backends |
521 |
rm -f %{_vardata}/rpm/db.cfg.cache 2> /dev/null |
522 |
|
523 |
# "ctl_deliver -E" is deprecated, now is "cyr_expire -E" |
524 |
if grep -q "ctl_deliver *-E" %{_sysconfdir}/cyrus.conf ; then |
525 |
perl -pi -e "s/ctl_deliver *-E/cyr_expire -E/" %{_sysconfdir}/cyrus.conf |
526 |
fi |
527 |
# compile to byte code sieve scripts on upgrade |
528 |
# masssievec needs to run: |
529 |
# - for versions before 2.2.0 (2.1.x) since they had no bytecode |
530 |
# - upgrading from 2.2.0 since the bytecode has changed |
531 |
# - upgrading from 2.2.1 since the bytecode has changed |
532 |
if [ $1 != 1 ] ; then |
533 |
if [ -f %{_vardata}/rpm/version ] ; then |
534 |
oldversion=`cat %{_vardata}/rpm/version` |
535 |
if [ "$oldversion" = "2.2.0" -o "$oldversion" = "2.2.1" ] ; then |
536 |
compile_needed=1 |
537 |
else |
538 |
compile_needed=0 |
539 |
fi |
540 |
else |
541 |
# versions prior to 2.2.x didn't write the file |
542 |
compile_needed=1 |
543 |
fi |
544 |
if [ $compile_needed = 1 ] ; then |
545 |
echo "compiling sieve scripts" |
546 |
su cyrus -c "%{_cyrexecdir}/masssievec %{_cyrexecdir}/sievec" |
547 |
fi |
548 |
fi |
549 |
|
550 |
# let's put a dummy imap/user_deny.db in so it doesn't fill the logs |
551 |
touch /var/lib/imap/user_deny.db |
552 |
chown cyrus:mail /var/lib/imap/user_deny.db |
553 |
|
554 |
# cache the installed version for next upgrade |
555 |
echo %{version} > %{_vardata}/rpm/version |
556 |
|
557 |
%_post_service %{name} |
558 |
|
559 |
%preun |
560 |
%_preun_service %{name} |
561 |
if [ $1 = 0 ]; then |
562 |
/usr/sbin/userdel %{_cyrususer} 2> /dev/null || : |
563 |
%if %{SASLGROUP} |
564 |
if [ "`grep ^%{_saslgroup}: %{_sysconfdir}/group | cut -d: -f4-`" = "" ]; then |
565 |
/usr/sbin/groupdel %{_saslgroup} 2> /dev/null || : |
566 |
fi |
567 |
%endif |
568 |
rm -f %{_vardata}/socket/lmtp 2> /dev/null |
569 |
rm -f %{_vardata}/rpm/version 2> /dev/null |
570 |
fi |
571 |
|
572 |
%triggerin -- %{name} < 2.0.0 |
573 |
#To avoid automatic restart of the daemon when upgrading from versions |
574 |
#1.x.x of Cyrus IMAPd in rpm form, be sure the old daemon is stopped |
575 |
/sbin/service %{name} stop >/dev/null 2>&1 || : |
576 |
|
577 |
%files |
578 |
%doc doc/* extradocs/* |
579 |
%config(noreplace) %{_sysconfdir}/*.conf |
580 |
%{_unitdir}/%{name}.service |
581 |
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} |
582 |
%config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/pop |
583 |
%config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/imap |
584 |
%config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/sieve |
585 |
%config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/lmtp |
586 |
%config(noreplace) %{_sysconfdir}/cron.daily/%{name} |
587 |
%dir %{_cyrexecdir} |
588 |
%{_cyrexecdir}/arbitron |
589 |
%{_cyrexecdir}/chk_cyrus |
590 |
%{_cyrexecdir}/ctl_cyrusdb |
591 |
%{_cyrexecdir}/ctl_deliver |
592 |
%{_cyrexecdir}/ctl_mboxlist |
593 |
%{_cyrexecdir}/cvt_cyrusdb |
594 |
%{_cyrexecdir}/cvt_cyrusdb_all |
595 |
%{_cyrexecdir}/cyr_dbtool |
596 |
%{_cyrexecdir}/cyr_df |
597 |
%{_cyrexecdir}/cyrdump |
598 |
%{_cyrexecdir}/cyr_expire |
599 |
%{_cyrexecdir}/cyr_synclog |
600 |
%{_cyrexecdir}/cyr_sequence |
601 |
%{_cyrexecdir}/cyr_userseen |
602 |
%{_cyrexecdir}/cyr_systemd_helper |
603 |
%{_cyrexecdir}/cyrus-master |
604 |
%{_cyrexecdir}/dohash |
605 |
%{_cyrexecdir}/fud |
606 |
%{_cyrexecdir}/imapd |
607 |
%{_cyrexecdir}/ipurge |
608 |
%{_cyrexecdir}/lmtpd |
609 |
%{_cyrexecdir}/masssievec |
610 |
%{_cyrexecdir}/mbexamine |
611 |
%{_cyrexecdir}/mbpath |
612 |
%{_cyrexecdir}/migrate-metadata |
613 |
%{_cyrexecdir}/mkimap |
614 |
%{_cyrexecdir}/mknewsgroups |
615 |
%{_cyrexecdir}/notifyd |
616 |
%{_cyrexecdir}/pop3d |
617 |
%{_cyrexecdir}/quota |
618 |
%{_cyrexecdir}/reconstruct |
619 |
%{_cyrexecdir}/rehash |
620 |
%{_cyrexecdir}/sievec |
621 |
%{_cyrexecdir}/sieved |
622 |
%{_cyrexecdir}/squatter |
623 |
%{_cyrexecdir}/timsieved |
624 |
%{_cyrexecdir}/tls_prune |
625 |
%{_cyrexecdir}/translatesieve |
626 |
%{_cyrexecdir}/undohash |
627 |
%{_cyrexecdir}/unexpunge |
628 |
%{_cyrexecdir}/upgradesieve |
629 |
%if %{with_ldap} |
630 |
%{_cyrexecdir}/ptdump |
631 |
%{_cyrexecdir}/ptexpire |
632 |
%{_cyrexecdir}/ptloader |
633 |
%endif |
634 |
%if %build_autocreate |
635 |
%{_cyrexecdir}/compile_sieve |
636 |
%endif |
637 |
%{_cyrexecdir}/smmapd |
638 |
%if %{IDLED} |
639 |
%{_cyrexecdir}/idled |
640 |
%endif |
641 |
%attr(4754,%{_cyrususer},%{_cyrusgroup}) %{_cyrexecdir}/deliver |
642 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %dir %{_vardata} |
643 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/user |
644 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/quota |
645 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/proc |
646 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/log |
647 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/msg |
648 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/socket |
649 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/db |
650 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/sieve |
651 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/rpm |
652 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/backup |
653 |
%if %{with_ldap} |
654 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/ptclient |
655 |
%endif |
656 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %dir %{_spooldata} |
657 |
%attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_spooldata}/* |
658 |
%if %{with_snmp} |
659 |
%{_datadir}/snmp/mibs/* |
660 |
%attr(0644,%{_cyrususer},%{_cyrusgroup}) /var/lib/net-snmp/cyrusMaster.conf |
661 |
%endif |
662 |
%if %{PREFORK} |
663 |
%attr(0750,cyrus,postfix) %dir %{_var}/spool/postfix/extern/cyrus |
664 |
%endif |
665 |
%{_mandir}/man5/* |
666 |
%{_mandir}/man8/arbitron.8* |
667 |
%{_mandir}/man8/chk_cyrus.8* |
668 |
%{_mandir}/man8/ctl_cyrusdb.8* |
669 |
%{_mandir}/man8/ctl_deliver.8* |
670 |
%{_mandir}/man8/ctl_mboxlist.8* |
671 |
%{_mandir}/man8/cvt_cyrusdb.8* |
672 |
%{_mandir}/man8/cyr_dbtool.8* |
673 |
%{_mandir}/man8/cyr_df.8* |
674 |
%{_mandir}/man8/cyr_expire.8* |
675 |
%{_mandir}/man8/cyr_synclog.8* |
676 |
%{_mandir}/man8/cyrus-master.8* |
677 |
%{_mandir}/man8/deliver.8* |
678 |
%{_mandir}/man8/fud.8* |
679 |
%{_mandir}/man8/idled.8* |
680 |
%{_mandir}/man8/imapd.8* |
681 |
%{_mandir}/man8/ipurge.8* |
682 |
%{_mandir}/man8/lmtpd.8* |
683 |
%{_mandir}/man8/mbexamine.8* |
684 |
%{_mandir}/man8/mbpath.8* |
685 |
%{_mandir}/man8/notifyd.8* |
686 |
%{_mandir}/man8/pop3d.8* |
687 |
%{_mandir}/man8/quota.8* |
688 |
%{_mandir}/man8/reconstruct.8* |
689 |
%{_mandir}/man8/rmnews.8* |
690 |
%{_mandir}/man8/smmapd.8* |
691 |
%{_mandir}/man8/squatter.8* |
692 |
%{_mandir}/man8/sync_client.8* |
693 |
%{_mandir}/man8/syncnews.8* |
694 |
%{_mandir}/man8/sync_reset.8* |
695 |
%{_mandir}/man8/sync_server.8* |
696 |
%{_mandir}/man8/timsieved.8* |
697 |
%{_mandir}/man8/tls_prune.8* |
698 |
%{_mandir}/man8/unexpunge.8* |
699 |
%doc COPYRIGHT README README.RPM |
700 |
%if %{build_autocreate} |
701 |
%doc README.autocreate |
702 |
%endif |
703 |
|
704 |
%files murder |
705 |
%doc doc/text/install-murder |
706 |
%config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/mupdate |
707 |
%config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/csync |
708 |
%{_cyrexecdir}/lmtpproxyd |
709 |
%{_cyrexecdir}/mupdate |
710 |
%{_cyrexecdir}/pop3proxyd |
711 |
%{_cyrexecdir}/proxyd |
712 |
|
713 |
%files nntp |
714 |
%doc doc/text/install-netnews |
715 |
%config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/nntp |
716 |
%{_cyrexecdir}/fetchnews |
717 |
%{_cyrexecdir}/nntpd |
718 |
%{_mandir}/man8/nntpd.8* |
719 |
%{_mandir}/man8/fetchnews.8* |
720 |
|
721 |
%files devel |
722 |
%{_includedir}/cyrus |
723 |
%{_libdir}/lib*.a |
724 |
%{_mandir}/man3/imclient.3* |
725 |
|
726 |
%files -n perl-Cyrus |
727 |
%doc perl/imap/README perl/imap/Changes perl/imap/examples |
728 |
%{perl_vendorarch}/auto/Cyrus |
729 |
%{perl_vendorarch}/Cyrus |
730 |
%{_mandir}/man3/Cyrus* |
731 |
|
732 |
%files utils |
733 |
%{_cyrexecdir}/cyradm |
734 |
%{_cyrexecdir}/imtest |
735 |
%{_cyrexecdir}/imapcreate |
736 |
%{_bindir}/* |
737 |
%{_mandir}/man1/* |