2 # - put imap-ssl and pop3-ssl to separate packages - some want to have
5 %bcond_with toplevel # Allow toplevel folders. More info: http://www.ricky-chan.co.uk/courier/
7 Summary: Courier-IMAP server
8 Summary(pl): Serwer Courier-IMAP
13 Group: Networking/Daemons
14 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
15 # Source0-md5: f423a609d9cce0dcf193cac64eb4cbdd
17 Source2: %{name}-ssl.init
18 Source3: %{name}-pop3.init
19 Source4: %{name}-pop3-ssl.init
21 Source6: %{name}-pop3.pamd
22 Patch0: %{name}-dirs.patch
23 Patch1: %{name}-certsdir.patch
24 Patch2: %{name}-maildir.patch
25 Patch3: %{name}-toplevel.patch
26 Patch4: %{name}-drop-makedat.patch
27 URL: http://www.courier-mta.org/imap/
28 BuildRequires: autoconf >= 2.54
29 BuildRequires: automake
30 BuildRequires: courier-authlib-devel >= 0.57
31 BuildRequires: db-devel
32 BuildRequires: fam-devel
33 BuildRequires: libstdc++-devel
34 BuildRequires: openssl-devel >= 0.9.7d
36 BuildRequires: rpmbuild(macros) >= 1.268
37 BuildRequires: sed >= 4.0
38 BuildRequires: sysconftool
39 Requires(post,preun): /sbin/chkconfig
40 Requires: %{name}-common = %{version}-%{release}
41 Requires: /sbin/chkconfig
42 Requires: pam >= 0.79.0
46 Conflicts: cyrus-imapd
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 %define _libexecdir /usr/%{_lib}/courier-imap
51 %define _sysconfdir /etc/courier-imap
52 %define _certsdir %{_sysconfdir}/certs
53 %define _localstatedir /var/spool/courier-imap
56 Courier-IMAP is an IMAP server for Maildir mailboxes.
59 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
62 Summary: Common files for imap and pop3 daemons
63 Summary(pl): Pliki wspólne dla serwerów imap i pop3
64 Group: Networking/Daemons
65 Requires(post,preun): /sbin/chkconfig
66 Requires: /sbin/chkconfig
67 Requires: courier-authlib
72 Common files for imap and pop3 daemons.
74 %description common -l pl
75 Pliki wspólne dla serwerów imap i pop3.
78 Summary: Deliver to a Maildir with a quota
79 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
80 Group: Networking/Daemons
82 %description deliverquota
83 deliverquota is a temporary hack to implement E-mail delivery to a
84 Maildir with a software-imposed quota.
86 %description deliverquota -l pl
87 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
88 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
91 Summary: Tool for making mail folders in Maildir format
92 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
93 Group: Networking/Daemons
94 Conflicts: qmail-maildirmake
96 %description maildirmake
97 Maildirmake is a tool for making mail folders in Maildir format.
99 %description maildirmake -l pl
100 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
104 Summary: Courier-IMAP POP3 Server
105 Summary(pl): Serwer Courier-IMAP POP3
106 Group: Networking/Daemons
107 Requires: %{name}-common = %{version}-%{release}
108 Requires: pam >= 0.77.3
110 Obsoletes: pop3daemon
111 Conflicts: cyrus-imapd
113 Conflicts: solid-pop3d
117 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
119 %description pop3 -l pl
120 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
132 install %{SOURCE1} courier-imap.in
133 install %{SOURCE2} courier-imap-ssl.in
134 install %{SOURCE3} courier-pop3.in
135 install %{SOURCE4} courier-pop3-ssl.in
136 rm -f makedat/configure.in
140 # Change Makefile.am files and force recreate Makefile.in's.
141 find -type f -a '(' -name configure.in -o -name configure.ac ')' | while read FILE; do
142 cd "$(dirname "$FILE")"
144 if [ -f Makefile.am ]; then
145 %{__sed} -i -e '/_[L]DFLAGS=-static/d' Makefile.am
160 --with-authchangepwdir=/var/tmp \
161 --with-certsdir=%{_certsdir}
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
169 %{__make} -j1 install \
170 DESTDIR=$RPM_BUILD_ROOT
172 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
173 install courier-imap-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap-ssl
174 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
175 install courier-pop3-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3-ssl
176 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/imap
177 install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/pop3
179 rm -rf $RPM_BUILD_ROOT%{_sbindir}/mk*cert
181 install imap/README README.imap
182 install imap/ChangeLog ChangeLog
183 install maildir/README.maildirquota.txt README.maildirquota
185 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert $RPM_BUILD_ROOT%{_sbindir}
187 install tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
188 install imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
190 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
191 touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
194 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
196 # set yes to start imapd and pop3d
197 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
198 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
200 # remove unpackaged files
201 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
204 rm -rf $RPM_BUILD_ROOT
207 /sbin/chkconfig --add courier-imap
208 /sbin/chkconfig --add courier-imap-ssl
209 %service courier-imap restart "courier-imap daemon"
210 %service courier-imap-ssl restart "courier-imap-ssl daemon"
213 if [ "$1" = "0" ]; then
214 %service courier-imap stop
215 /sbin/chkconfig --del courier-imap
218 if [ "$1" = "0" ]; then
219 %service courier-imap-ssl stop
220 /sbin/chkconfig --del courier-imap-ssl
224 %triggerin -- %{name} < 3.0.5
225 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
227 echo imapd.pem has been moved automatically to %{_certsdir}
229 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
231 if [ -f /etc/sysconfig/courier-imap ]; then
232 . /etc/sysconfig/courier-imap
233 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
236 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
237 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
239 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
240 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
241 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
242 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
244 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
245 echo please look at them
248 %service -q courier-imap restart
250 %triggerin -- %{name} < 3.0.6
251 . %{_sysconfdir}/imapd-ssl
252 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
253 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
256 %triggerin -n %{name}-common -- %{name}-userdb
258 echo courier-imap-userdb is obsolete
259 echo install courier-authlib-userdb package
262 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
263 /sbin/chkconfig --del authdaemon
264 if [ -f /var/lock/subsys/authdaemon ]; then
265 kill `cat /var/lib/authdaemon/pid`
266 rm -f /var/lock/subsys/authdaemon
268 if [ -f /etc/sysconfig/authdaemon ]; then
269 . /etc/sysconfig/authdaemon
270 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
273 echo Changes to version 3.0.5 :
274 echo - config files has been splited and moved to %{_sysconfdir}
275 echo - certificates directory has changed to %{_certsdir}
279 /sbin/chkconfig --add courier-pop3
280 /sbin/chkconfig --add courier-pop3-ssl
281 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
282 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
283 /sbin/service courier-imap-pop3 stop >&2
284 /sbin/service courier-pop3 start >&2
286 %service courier-pop3 restart "courier-pop3 daemon"
288 %service courier-pop3-ssl restart "courier-pop3-ssl daemon"
291 if [ "$1" = "0" ]; then
292 %service courier-pop3 stop
293 /sbin/chkconfig --del courier-pop3
294 %service courier-pop3-ssl stop
295 /sbin/chkconfig --del courier-pop3-ssl
298 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
299 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
301 echo pop3d.pem has been moved automatically to %{_certsdir}
303 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
305 if [ -f /etc/sysconfig/courier-pop3 ]; then
306 . /etc/sysconfig/courier-pop3
307 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
310 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
311 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
313 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
314 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
316 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
317 echo please look at them
320 %service courier-pop3 restart
322 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
323 . %{_sysconfdir}/pop3d-ssl
324 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
325 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
329 %defattr(644,root,root,755)
330 %doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
331 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
332 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
333 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
334 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
335 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
336 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
337 %attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
338 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
339 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
340 %attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
341 %attr(755,root,root) %{_bindir}/imapd
342 %attr(755,root,root) %{_bindir}/maildiracl
343 %attr(755,root,root) %{_bindir}/maildirkw
344 %attr(755,root,root) %{_sbindir}/imaplogin
345 %attr(755,root,root) %{_sbindir}/mkimapdcert
346 %attr(755,root,root) %{_sbindir}/sharedindexinstall
347 %attr(755,root,root) %{_sbindir}/sharedindexsplit
348 %attr(755,root,root) %{_libexecdir}/imapd.rc
349 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
350 %{_mandir}/man8/imapd*
351 %{_mandir}/man1/maildiracl.1*
352 %{_mandir}/man1/maildirkw.1*
355 %defattr(644,root,root,755)
356 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
357 %attr(751,root,root) %dir %{_sysconfdir}
358 %attr(750,root,root) %dir %{_certsdir}
359 %attr(770,daemon,daemon) %dir %{_localstatedir}
361 %{_sysconfdir}/quotawarnmsg.example
362 %attr(755,root,root) %{_bindir}/couriertls
363 %attr(755,root,root) %{_libexecdir}/couriertcpd
364 %{_mandir}/man1/couriert*
365 %{_mandir}/man8/couriert*
369 %defattr(644,root,root,755)
370 %attr(755,root,root) %{_bindir}/deliverquota
371 %{_mandir}/man8/deliverquota*
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_bindir}/maildirmake
376 %{_mandir}/man1/maildirmake*
379 %defattr(644,root,root,755)
380 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
381 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
382 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
383 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
385 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
386 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3-ssl
387 %attr(755,root,root) %{_bindir}/pop3d
388 %attr(755,root,root) %{_sbindir}/mkpop3dcert
389 %attr(755,root,root) %{_sbindir}/pop3login
390 %attr(755,root,root) %{_libexecdir}/pop3d.rc
391 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
392 %{_mandir}/man8/courierpop*