/[packages]/cauldron/cyrus-imapd/current/SPECS/cyrus-imapd.spec
ViewVC logotype

Annotation of /cauldron/cyrus-imapd/current/SPECS/cyrus-imapd.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 647190 - (hide annotations) (download)
Sun Jul 6 14:10:12 2014 UTC (9 years, 9 months ago) by ovitters
File size: 23141 byte(s)
SILENT remove cleaning buildroot in install
1 ennael 33418 # 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 spuhler 410430 %define IDLED 1
11 ennael 33418 %{?_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 colin 400402 %define build_rmquota 0
23     %{?_with_rmquota: %define build_rmquota 1}
24 ennael 33418
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 spuhler 604056 ##%define build_virtualdomains_in_ldap 1
45     ##%{?_without_virtualdomains_in_ldap: %define build_virtualdomains_in_ldap 0}
46 ennael 33418
47     Summary: A high-performance mail store with IMAP and POP3 support
48     Name: cyrus-imapd
49 spuhler 331230 Version: 2.4.17
50 jquelin 632200 Release: %mkrel 16
51 ennael 33418 License: OSI Approved
52     Group: System/Servers
53     URL: http://asg.web.cmu.edu/cyrus/imapd/
54 spuhler 331230 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 ennael 33418 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 guillomovitch 232091 Source10: cyrus-imapd.service
62 ennael 33418 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 spuhler 232749 Source22: cyr_systemd_helper
70 ennael 33418 # 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 colin 400402 # (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 ennael 33418 # Autocreate INBOX patch (http://email.uoa.gr/projects/cyrus/autocreate/)
78 colin 400402 Patch3: http://www.vx.sk/download/patches/cyrus-imapd/cyrus-imapd-2.4.4-autocreate-0.10-0.patch
79 ennael 33418 # Create on demand folder requested by sieve filter (http://email.uoa.gr/projects/cyrus/autosievefolder/)
80 colin 400402 Patch4: http://www.vx.sk/download/patches/cyrus-imapd/cyrus-imapd-2.4.12-autosieve-0.6.0.patch
81 ennael 33418 # 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 colin 400402 Patch6: cyrus-imapd-2.4.17-plaintext-cmd-line.patch
85 ennael 33418 # (oe) for kolab2: Patch to support virtdomains: ldap (parse domain from "email" field an LDAP user entry)
86 spuhler 604056 # Patch8: cyrus-imapd-kolab-ldap.diff
87 ennael 33418 # (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 colin 412408 Patch22: cyrus-imapd.2.4.17-user_deny.db-silence.patch
100 spuhler 606498 Patch23: prefork-conf-chroot.patch
101 ennael 33418 #Requires: krb5-libs
102 guillomovitch 232094 Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd
103 tmb 233547 Requires(preun):/usr/sbin/userdel /usr/sbin/groupdel
104 tmb 233654 Requires(post): rpm-helper >= 0.24.8-1
105     Requires(preun): rpm-helper >= 0.24.8-1
106    
107 ennael 33418 Provides: imap
108     Provides: imap-server
109 spuhler 196262 BuildRequires: autoconf
110 ennael 33418 BuildRequires: libsasl-devel >= 2.1.15
111 spuhler 201745 BuildRequires: ext2fs-devel
112 ennael 33418 BuildRequires: perl-devel
113     BuildRequires: tcp_wrappers-devel
114 spuhler 201745 BuildRequires: db-devel
115 ennael 33418 BuildRequires: openssl-devel
116     BuildRequires: flex
117     BuildRequires: bison
118     BuildRequires: groff >= 1.15-8
119     %if %{with_snmp}
120 spuhler 196262 BuildRequires: net-snmp-devel >= 5.1
121 spuhler 201745 BuildRequires: elfutils-devel
122 ennael 33418 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 spuhler 606498 # (gb) stick to /usr/lib/cyrus-imapd as this is an existing practice
149 ennael 33418 # 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 colin 400402 %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 ennael 33418
247 colin 400402 %patch6 -p1 -F 4 -b .plaintext.orig
248 ennael 33418
249     # (oe) for kolab2: Patch to support virtdomains: ldap (parse domain from "email" field an LDAP user entry)
250 spuhler 604056 # %if %{build_virtualdomains_in_ldap}
251     # %patch8 -p1 -b .kolab-ldap.orig
252     # %endif
253 colin 400402 %if %{with_ldap}
254     %patch10 -p1 -b .ptloader.orig
255     %endif
256 ennael 33418 %patch11 -p1 -b .secprops.orig
257    
258     %patch13 -p1 -b .getrlimit.orig
259     %patch14 -p1 -b .skiplist_verbosity.orig
260 colin 400398
261 colin 400402 # (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 ennael 33418 %patch19 -p1 -b .mkimap.orig
266     %patch21 -p1 -b .sieve_port.orig
267 colin 412409 %patch22 -p1 -b .user_deny_verbosity
268 spuhler 606498 # we run Postfix chroot
269     %patch23 -p1 -b .prefork-conf-chroot
270 ennael 33418 ## 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 spuhler 410430 --enable-idled \
316 ennael 33418 %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 luigiwalser 232025 --with-extraident="Mageia-RPM-%{version}-%{release}" \
333 ennael 33418 --with-syslogfacility=MAIL \
334 spuhler 606498 --with-bdb \
335 ennael 33418 --enable-murder \
336     --enable-netscapehack \
337     --enable-nntp \
338     --with-perl=%{__perl} \
339     --with-cyrus-prefix=%{_cyrexecdir} \
340 spuhler 606498 --with-service-path=%{_cyrexecdir}
341 ennael 33418
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     %makeinstall_std
373     %makeinstall_std -C man
374    
375     %{__install} -m 755 imtest/imtest %{buildroot}%{_cyrexecdir}/
376     %{__install} -m 755 perl/imap/cyradm %{buildroot}%{_cyrexecdir}/
377    
378     # Install tools
379     for tool in dohash masssievec mkimap mknewsgroups rehash translatesieve undohash upgradesieve ; do
380     test -f tools/${tool} && %{__install} -m 755 tools/${tool} %{buildroot}%{_cyrexecdir}/
381     done
382     %{__install} -m 755 %{SOURCE13} %{buildroot}%{_cyrexecdir}/imapcreate
383    
384     # Create directories
385     %{__install} -d \
386     %if %{with_snmp}
387     %{buildroot}%{_datadir}/snmp/mibs \
388     %endif
389     %if %{with_ldap}
390     %{buildroot}%{_vardata}/ptclient/ \
391     %endif
392 guillomovitch 232091 %{buildroot}%{_unitdir} \
393 ennael 33418 %{buildroot}%{_sysconfdir}/{pam.d,sysconfig,cron.daily} \
394     %{buildroot}%{_libdir}/sasl \
395     %{buildroot}%{_bindir} \
396     %{buildroot}%{_spooldata}/stage. \
397     %{buildroot}%{_vardata}/{user,quota,proc,log,msg,socket,db,sieve,rpm,backup}
398 spuhler 606498 # we need this dir for the chrooted postfix for making lmtp working
399     %if %{PREFORK}
400     %{__install} -d 750 %{buildroot}%{_var}/spool/postfix/extern/cyrus
401     %endif
402 ennael 33418
403     # Install additional files
404     %{__install} -m 755 %{SOURCE15} %{buildroot}%{_cyrexecdir}/cvt_cyrusdb_all
405    
406     # Install config files
407     %{__install} -m 644 %{_cyrusconf} %{buildroot}%{_sysconfdir}/cyrus.conf
408     %{__install} -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/imapd.conf
409    
410     %{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/pop
411     %{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/imap
412     %{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/sieve
413     %{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/mupdate
414     %{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/lmtp
415     %{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/nntp
416     %{__install} -m 644 cyrus-imapd.pamd %{buildroot}%{_sysconfdir}/pam.d/csync
417    
418     %{__install} -m 644 %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
419 guillomovitch 232091 %{__install} -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/%{name}.service
420 ennael 33418 %{__install} -m 755 %{SOURCE20} %{buildroot}%{_sysconfdir}/cron.daily/%{name}
421 spuhler 232749 %{__install} -m 755 %{SOURCE22} %{buildroot}%{_cyrexecdir}/cyr_systemd_helper
422 ennael 33418
423     %if %{with_snmp}
424     # Install snmp mibs
425     %{__install} -m 644 master/CYRUS-MASTER.mib %{buildroot}%{_datadir}/snmp/mibs/CYRUS-MASTER-MIB.txt
426     %{__install} -m 644 %{SOURCE21} %{buildroot}%{_datadir}/snmp/mibs/CMU-MIB.txt
427     %endif
428    
429     # Install README.RPM
430     %{__install} -m 644 %{SOURCE14} README.RPM
431     cat << EOF >> README.RPM
432    
433     RPM BUILD TIME CONFIGURATION OPTIONS
434    
435     This RPM package has been compiled with the following options:
436    
437     use saslauth group
438     SASLGROUP: %{SASLGROUP}
439    
440     use preforking cyrus.conf
441     PREFORK: %{PREFORK}
442    
443     enable IDLED support
444     IDLED: %{IDLED}
445    
446     enable full directory hash
447     FULLDIRHASH: %{FULLDIRHASH}
448    
449     EOF
450    
451     # Install templates
452     %{__install} -m 755 -d doc/conf
453     %{__install} -m 644 %{_confdir}/*.conf doc/conf/
454    
455     # Rename 'master' binary and manpage to avoid crash with postfix
456     mv -f %{buildroot}%{_cyrexecdir}/master %{buildroot}%{_cyrexecdir}/cyrus-master
457     mv -f %{buildroot}%{_mandir}/man8/master.8 %{buildroot}%{_mandir}/man8/cyrus-master.8
458     cp -af doc/man/master.8.html doc/man/cyrus-master.8.html
459    
460     # Create symlinks
461     ln -sf ../lib/cyrus-imapd/cyradm %{buildroot}%{_bindir}/
462     ln -sf ../lib/cyrus-imapd/imtest %{buildroot}%{_bindir}/
463     ln -sf ../lib/cyrus-imapd/imapcreate %{buildroot}%{_bindir}/
464    
465     # required if upgrading from 2.2.x -> 2.3.6+
466     %{__install} -m 755 tools/migrate-metadata %{buildroot}%{_cyrexecdir}/migrate-metadata
467    
468     # provide the cyrusMaster.conf file, discovered by doing:
469     # /usr/lib/cyrus-imapd/cyrus-master -p /var/run/cyrus-master.pid -D
470     %if %{with_snmp}
471     install -d %{buildroot}/var/lib/net-snmp
472     echo "# placeholder" > %{buildroot}/var/lib/net-snmp/cyrusMaster.conf
473     %endif
474    
475     # cleanup
476     find %{buildroot}%{perl_vendorarch} -name "*.annotate" | xargs rm -f
477    
478     %pre
479     # Create 'cyrus' user on target host
480     %if %{SASLGROUP}
481     /usr/sbin/groupadd -r %{_saslgroup} 2> /dev/null || :
482     /usr/sbin/useradd -c "Cyrus IMAP Server" -d %{_vardata} -g %{_cyrusgroup} \
483     -G %{_saslgroup} -s /bin/bash -r %{_cyrususer} 2> /dev/null || :
484     %else
485     /usr/sbin/useradd -c "Cyrus IMAP Server" -d %{_vardata} -g %{_cyrusgroup} \
486     -s /bin/bash -r %{_cyrususer} 2> /dev/null || :
487     %endif
488    
489     %post
490     if [ $1 = 1 ] ; then
491     # make sure we own the stuff, otherwise /var/log/mail/* will fill
492     # the whole disk with error messages...
493     chown -R %{_cyrususer}:%{_cyrusgroup} %{_vardata} %{_spooldata}
494     fi
495     %_create_ssl_certificate cyrus-imapd
496     chown %{_cyrususer}:%{_cyrusgroup} /etc/pki/tls/private/cyrus-imapd.pem
497    
498    
499     # Force synchronous updates only on ext2 filesystems
500     # Note: This will slow down user creation for 10.000+ users!
501     for i in %{_vardata}/{user,quota} %{_spooldata}
502     do
503     if [ `find $i -maxdepth 0 -printf %F` = "ext2" ]; then
504     chattr -R +S $i 2>/dev/null
505     fi
506     done
507    
508     # Add sieve service if necessary
509     if ! grep -q ^sieve %{_sysconfdir}/services; then
510     echo -e 'sieve\t\t2000/tcp\t\t\t# Sieve mail filter daemon' >> %{_sysconfdir}/services
511     fi
512    
513     # Add lmtp service if necessary
514     if ! grep -q ^lmtp %{_sysconfdir}/services; then
515     echo -e 'lmtp\t\t2003/tcp\t\t\t# Local mail delivery protocol (rfc2033)' >> %{_sysconfdir}/services
516     fi
517    
518     # upgrade from previous versions with compiled in database backends
519     rm -f %{_vardata}/rpm/db.cfg.cache 2> /dev/null
520    
521     # "ctl_deliver -E" is deprecated, now is "cyr_expire -E"
522     if grep -q "ctl_deliver *-E" %{_sysconfdir}/cyrus.conf ; then
523     perl -pi -e "s/ctl_deliver *-E/cyr_expire -E/" %{_sysconfdir}/cyrus.conf
524     fi
525     # compile to byte code sieve scripts on upgrade
526     # masssievec needs to run:
527     # - for versions before 2.2.0 (2.1.x) since they had no bytecode
528     # - upgrading from 2.2.0 since the bytecode has changed
529     # - upgrading from 2.2.1 since the bytecode has changed
530     if [ $1 != 1 ] ; then
531     if [ -f %{_vardata}/rpm/version ] ; then
532     oldversion=`cat %{_vardata}/rpm/version`
533     if [ "$oldversion" = "2.2.0" -o "$oldversion" = "2.2.1" ] ; then
534     compile_needed=1
535     else
536     compile_needed=0
537     fi
538     else
539     # versions prior to 2.2.x didn't write the file
540     compile_needed=1
541     fi
542     if [ $compile_needed = 1 ] ; then
543     echo "compiling sieve scripts"
544     su cyrus -c "%{_cyrexecdir}/masssievec %{_cyrexecdir}/sievec"
545     fi
546     fi
547 spuhler 394129
548     # let's put a dummy imap/user_deny.db in so it doesn't fill the logs
549     touch /var/lib/imap/user_deny.db
550     chown cyrus:mail /var/lib/imap/user_deny.db
551    
552 ennael 33418 # cache the installed version for next upgrade
553     echo %{version} > %{_vardata}/rpm/version
554    
555     %_post_service %{name}
556    
557     %preun
558     %_preun_service %{name}
559     if [ $1 = 0 ]; then
560     /usr/sbin/userdel %{_cyrususer} 2> /dev/null || :
561     %if %{SASLGROUP}
562     if [ "`grep ^%{_saslgroup}: %{_sysconfdir}/group | cut -d: -f4-`" = "" ]; then
563     /usr/sbin/groupdel %{_saslgroup} 2> /dev/null || :
564     fi
565     %endif
566     rm -f %{_vardata}/socket/lmtp 2> /dev/null
567     rm -f %{_vardata}/rpm/version 2> /dev/null
568     fi
569    
570     %triggerin -- %{name} < 2.0.0
571     #To avoid automatic restart of the daemon when upgrading from versions
572     #1.x.x of Cyrus IMAPd in rpm form, be sure the old daemon is stopped
573     /sbin/service %{name} stop >/dev/null 2>&1 || :
574    
575     %files
576     %doc doc/* extradocs/*
577 guillomovitch 232092 %config(noreplace) %{_sysconfdir}/*.conf
578 guillomovitch 232091 %{_unitdir}/%{name}.service
579 guillomovitch 232092 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
580     %config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/pop
581     %config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/imap
582     %config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/sieve
583     %config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/lmtp
584     %config(noreplace) %{_sysconfdir}/cron.daily/%{name}
585     %dir %{_cyrexecdir}
586     %{_cyrexecdir}/arbitron
587     %{_cyrexecdir}/chk_cyrus
588     %{_cyrexecdir}/ctl_cyrusdb
589     %{_cyrexecdir}/ctl_deliver
590     %{_cyrexecdir}/ctl_mboxlist
591     %{_cyrexecdir}/cvt_cyrusdb
592     %{_cyrexecdir}/cvt_cyrusdb_all
593     %{_cyrexecdir}/cyr_dbtool
594     %{_cyrexecdir}/cyr_df
595     %{_cyrexecdir}/cyrdump
596     %{_cyrexecdir}/cyr_expire
597     %{_cyrexecdir}/cyr_synclog
598     %{_cyrexecdir}/cyr_sequence
599     %{_cyrexecdir}/cyr_userseen
600 spuhler 232749 %{_cyrexecdir}/cyr_systemd_helper
601 guillomovitch 232092 %{_cyrexecdir}/cyrus-master
602     %{_cyrexecdir}/dohash
603     %{_cyrexecdir}/fud
604     %{_cyrexecdir}/imapd
605     %{_cyrexecdir}/ipurge
606     %{_cyrexecdir}/lmtpd
607     %{_cyrexecdir}/masssievec
608     %{_cyrexecdir}/mbexamine
609     %{_cyrexecdir}/mbpath
610     %{_cyrexecdir}/migrate-metadata
611     %{_cyrexecdir}/mkimap
612     %{_cyrexecdir}/mknewsgroups
613     %{_cyrexecdir}/notifyd
614     %{_cyrexecdir}/pop3d
615     %{_cyrexecdir}/quota
616     %{_cyrexecdir}/reconstruct
617     %{_cyrexecdir}/rehash
618     %{_cyrexecdir}/sievec
619     %{_cyrexecdir}/sieved
620     %{_cyrexecdir}/squatter
621     %{_cyrexecdir}/timsieved
622     %{_cyrexecdir}/tls_prune
623     %{_cyrexecdir}/translatesieve
624     %{_cyrexecdir}/undohash
625     %{_cyrexecdir}/unexpunge
626     %{_cyrexecdir}/upgradesieve
627 ennael 33418 %if %{with_ldap}
628 guillomovitch 232092 %{_cyrexecdir}/ptdump
629     %{_cyrexecdir}/ptexpire
630     %{_cyrexecdir}/ptloader
631 ennael 33418 %endif
632 colin 400398 %if %build_autocreate
633 colin 400404 %{_cyrexecdir}/compile_sieve
634 colin 400398 %endif
635 guillomovitch 232092 %{_cyrexecdir}/smmapd
636 ennael 33418 %if %{IDLED}
637 guillomovitch 232092 %{_cyrexecdir}/idled
638 ennael 33418 %endif
639     %attr(4754,%{_cyrususer},%{_cyrusgroup}) %{_cyrexecdir}/deliver
640     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %dir %{_vardata}
641     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/user
642     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/quota
643     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/proc
644     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/log
645     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/msg
646     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/socket
647     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/db
648     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/sieve
649     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/rpm
650     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/backup
651     %if %{with_ldap}
652     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_vardata}/ptclient
653     %endif
654     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %dir %{_spooldata}
655     %attr(0750,%{_cyrususer},%{_cyrusgroup}) %{_spooldata}/*
656     %if %{with_snmp}
657 guillomovitch 232092 %{_datadir}/snmp/mibs/*
658 ennael 33418 %attr(0644,%{_cyrususer},%{_cyrusgroup}) /var/lib/net-snmp/cyrusMaster.conf
659     %endif
660 spuhler 606498 %if %{PREFORK}
661     %attr(0750,cyrus,postfix) %dir %{_var}/spool/postfix/extern/cyrus
662     %endif
663 guillomovitch 232092 %{_mandir}/man5/*
664     %{_mandir}/man8/arbitron.8*
665     %{_mandir}/man8/chk_cyrus.8*
666     %{_mandir}/man8/ctl_cyrusdb.8*
667     %{_mandir}/man8/ctl_deliver.8*
668     %{_mandir}/man8/ctl_mboxlist.8*
669     %{_mandir}/man8/cvt_cyrusdb.8*
670     %{_mandir}/man8/cyr_dbtool.8*
671     %{_mandir}/man8/cyr_df.8*
672     %{_mandir}/man8/cyr_expire.8*
673     %{_mandir}/man8/cyr_synclog.8*
674     %{_mandir}/man8/cyrus-master.8*
675     %{_mandir}/man8/deliver.8*
676     %{_mandir}/man8/fud.8*
677     %{_mandir}/man8/idled.8*
678     %{_mandir}/man8/imapd.8*
679     %{_mandir}/man8/ipurge.8*
680     %{_mandir}/man8/lmtpd.8*
681     %{_mandir}/man8/mbexamine.8*
682     %{_mandir}/man8/mbpath.8*
683     %{_mandir}/man8/notifyd.8*
684     %{_mandir}/man8/pop3d.8*
685     %{_mandir}/man8/quota.8*
686     %{_mandir}/man8/reconstruct.8*
687     %{_mandir}/man8/rmnews.8*
688     %{_mandir}/man8/smmapd.8*
689     %{_mandir}/man8/squatter.8*
690     %{_mandir}/man8/sync_client.8*
691     %{_mandir}/man8/syncnews.8*
692     %{_mandir}/man8/sync_reset.8*
693     %{_mandir}/man8/sync_server.8*
694     %{_mandir}/man8/timsieved.8*
695     %{_mandir}/man8/tls_prune.8*
696     %{_mandir}/man8/unexpunge.8*
697 ennael 33418 %doc COPYRIGHT README README.RPM
698 colin 400398 %if %{build_autocreate}
699 colin 400404 %doc README.autocreate
700 colin 400398 %endif
701 ennael 33418
702     %files murder
703     %doc doc/text/install-murder
704     %config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/mupdate
705     %config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/csync
706 guillomovitch 232092 %{_cyrexecdir}/lmtpproxyd
707     %{_cyrexecdir}/mupdate
708     %{_cyrexecdir}/pop3proxyd
709     %{_cyrexecdir}/proxyd
710 ennael 33418
711     %files nntp
712     %doc doc/text/install-netnews
713     %config(noreplace) %verify(not size,not md5) %{_sysconfdir}/pam.d/nntp
714 guillomovitch 232092 %{_cyrexecdir}/fetchnews
715     %{_cyrexecdir}/nntpd
716     %{_mandir}/man8/nntpd.8*
717     %{_mandir}/man8/fetchnews.8*
718 ennael 33418
719     %files devel
720     %{_includedir}/cyrus
721     %{_libdir}/lib*.a
722 guillomovitch 232092 %{_mandir}/man3/imclient.3*
723 ennael 33418
724     %files -n perl-Cyrus
725     %doc perl/imap/README perl/imap/Changes perl/imap/examples
726     %{perl_vendorarch}/auto/Cyrus
727     %{perl_vendorarch}/Cyrus
728 guillomovitch 232092 %{_mandir}/man3/Cyrus*
729 ennael 33418
730     %files utils
731 guillomovitch 232092 %{_cyrexecdir}/cyradm
732     %{_cyrexecdir}/imtest
733     %{_cyrexecdir}/imapcreate
734     %{_bindir}/*
735     %{_mandir}/man1/*

  ViewVC Help
Powered by ViewVC 1.1.30