2 # - put imap-ssl and pop3-ssl to separate packages - some want to have
3 # ssl-only system (or non-ssl only system)
4 # see also http://thread.gmane.org/gmane.linux.pld.devel.english/2509/focus=2509
6 %bcond_with toplevel # Allow toplevel folders. More info: http://www.ricky-chan.co.uk/courier/
8 Summary: Courier-IMAP server
9 Summary(pl): Serwer Courier-IMAP
14 Group: Networking/Daemons
15 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
16 # Source0-md5: f423a609d9cce0dcf193cac64eb4cbdd
18 Source2: %{name}-ssl.init
19 Source3: %{name}-pop3.init
20 Source4: %{name}-pop3-ssl.init
22 Source6: %{name}-pop3.pamd
23 Patch0: %{name}-dirs.patch
24 Patch1: %{name}-certsdir.patch
25 Patch2: %{name}-maildir.patch
26 Patch3: %{name}-toplevel.patch
27 Patch4: %{name}-drop-makedat.patch
28 URL: http://www.courier-mta.org/imap/
29 BuildRequires: autoconf >= 2.54
30 BuildRequires: automake
31 BuildRequires: courier-authlib-devel >= 0.57
32 BuildRequires: db-devel
33 BuildRequires: fam-devel
34 BuildRequires: libstdc++-devel
35 BuildRequires: openssl-devel >= 0.9.7d
37 BuildRequires: rpmbuild(macros) >= 1.268
38 BuildRequires: sed >= 4.0
39 BuildRequires: sysconftool
40 Requires(post,preun): /sbin/chkconfig
41 Requires: %{name}-common = %{version}-%{release}
42 Requires: /sbin/chkconfig
43 Requires: pam >= 0.79.0
47 Conflicts: cyrus-imapd
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 %define _libexecdir /usr/%{_lib}/courier-imap
52 %define _sysconfdir /etc/courier-imap
53 %define _certsdir %{_sysconfdir}/certs
54 %define _localstatedir /var/spool/courier-imap
57 Courier-IMAP is an IMAP server for Maildir mailboxes.
60 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
63 Summary: Common files for imap and pop3 daemons
64 Summary(pl): Pliki wspólne dla serwerów imap i pop3
65 Group: Networking/Daemons
66 Requires(post,preun): /sbin/chkconfig
67 Requires: /sbin/chkconfig
68 Requires: courier-authlib
73 Common files for imap and pop3 daemons.
75 %description common -l pl
76 Pliki wspólne dla serwerów imap i pop3.
79 Summary: Deliver to a Maildir with a quota
80 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
81 Group: Networking/Daemons
83 %description deliverquota
84 deliverquota is a temporary hack to implement E-mail delivery to a
85 Maildir with a software-imposed quota.
87 %description deliverquota -l pl
88 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
89 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
92 Summary: Tool for making mail folders in Maildir format
93 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
94 Group: Networking/Daemons
95 Conflicts: qmail-maildirmake
97 %description maildirmake
98 Maildirmake is a tool for making mail folders in Maildir format.
100 %description maildirmake -l pl
101 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
105 Summary: Courier-IMAP POP3 Server
106 Summary(pl): Serwer Courier-IMAP POP3
107 Group: Networking/Daemons
108 Requires: %{name}-common = %{version}-%{release}
109 Requires: pam >= 0.77.3
111 Obsoletes: pop3daemon
112 Conflicts: cyrus-imapd
114 Conflicts: solid-pop3d
118 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
120 %description pop3 -l pl
121 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
133 install %{SOURCE1} courier-imap.in
134 install %{SOURCE2} courier-imap-ssl.in
135 install %{SOURCE3} courier-pop3.in
136 install %{SOURCE4} courier-pop3-ssl.in
137 rm -f makedat/configure.in
141 # Change Makefile.am files and force recreate Makefile.in's.
142 find -type f -a '(' -name configure.in -o -name configure.ac ')' | while read FILE; do
143 cd "$(dirname "$FILE")"
145 if [ -f Makefile.am ]; then
146 %{__sed} -i -e '/_[L]DFLAGS=-static/d' Makefile.am
161 --with-authchangepwdir=/var/tmp \
162 --with-certsdir=%{_certsdir}
167 rm -rf $RPM_BUILD_ROOT
168 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
170 %{__make} -j1 install \
171 DESTDIR=$RPM_BUILD_ROOT
173 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
174 install courier-imap-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap-ssl
175 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
176 install courier-pop3-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3-ssl
177 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/imap
178 install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/pop3
180 rm -rf $RPM_BUILD_ROOT%{_sbindir}/mk*cert
182 install imap/README README.imap
183 install imap/ChangeLog ChangeLog
184 install maildir/README.maildirquota.txt README.maildirquota
186 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert $RPM_BUILD_ROOT%{_sbindir}
188 install tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
189 install imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
191 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
192 touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
195 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
197 # set yes to start imapd and pop3d
198 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
199 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
201 # remove unpackaged files
202 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
205 rm -rf $RPM_BUILD_ROOT
208 /sbin/chkconfig --add courier-imap
209 /sbin/chkconfig --add courier-imap-ssl
210 %service courier-imap restart "courier-imap daemon"
211 %service courier-imap-ssl restart "courier-imap-ssl daemon"
214 if [ "$1" = "0" ]; then
215 %service courier-imap stop
216 /sbin/chkconfig --del courier-imap
219 if [ "$1" = "0" ]; then
220 %service courier-imap-ssl stop
221 /sbin/chkconfig --del courier-imap-ssl
225 %triggerin -- %{name} < 3.0.5
226 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
228 echo imapd.pem has been moved automatically to %{_certsdir}
230 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
232 if [ -f /etc/sysconfig/courier-imap ]; then
233 . /etc/sysconfig/courier-imap
234 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
237 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
238 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
240 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
241 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
242 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
243 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
245 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
246 echo please look at them
249 %service -q courier-imap restart
251 %triggerin -- %{name} < 3.0.6
252 . %{_sysconfdir}/imapd-ssl
253 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
254 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
257 %triggerin -n %{name}-common -- %{name}-userdb
259 echo courier-imap-userdb is obsolete
260 echo install courier-authlib-userdb package
263 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
264 /sbin/chkconfig --del authdaemon
265 if [ -f /var/lock/subsys/authdaemon ]; then
266 kill `cat /var/lib/authdaemon/pid`
267 rm -f /var/lock/subsys/authdaemon
269 if [ -f /etc/sysconfig/authdaemon ]; then
270 . /etc/sysconfig/authdaemon
271 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
274 echo Changes to version 3.0.5 :
275 echo - config files has been splited and moved to %{_sysconfdir}
276 echo - certificates directory has changed to %{_certsdir}
280 /sbin/chkconfig --add courier-pop3
281 /sbin/chkconfig --add courier-pop3-ssl
282 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
283 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
284 /sbin/service courier-imap-pop3 stop >&2
285 /sbin/service courier-pop3 start >&2
287 %service courier-pop3 restart "courier-pop3 daemon"
289 %service courier-pop3-ssl restart "courier-pop3-ssl daemon"
292 if [ "$1" = "0" ]; then
293 %service courier-pop3 stop
294 /sbin/chkconfig --del courier-pop3
295 %service courier-pop3-ssl stop
296 /sbin/chkconfig --del courier-pop3-ssl
299 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
300 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
302 echo pop3d.pem has been moved automatically to %{_certsdir}
304 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
306 if [ -f /etc/sysconfig/courier-pop3 ]; then
307 . /etc/sysconfig/courier-pop3
308 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
311 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
312 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
314 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
315 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
317 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
318 echo please look at them
321 %service courier-pop3 restart
323 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
324 . %{_sysconfdir}/pop3d-ssl
325 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
326 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
330 %defattr(644,root,root,755)
331 %doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
332 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
333 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
334 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
335 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
336 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
337 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
338 %attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
339 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
340 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
341 %attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
342 %attr(755,root,root) %{_bindir}/imapd
343 %attr(755,root,root) %{_bindir}/maildiracl
344 %attr(755,root,root) %{_bindir}/maildirkw
345 %attr(755,root,root) %{_sbindir}/imaplogin
346 %attr(755,root,root) %{_sbindir}/mkimapdcert
347 %attr(755,root,root) %{_sbindir}/sharedindexinstall
348 %attr(755,root,root) %{_sbindir}/sharedindexsplit
349 %attr(755,root,root) %{_libexecdir}/imapd.rc
350 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
351 %{_mandir}/man8/imapd*
352 %{_mandir}/man1/maildiracl.1*
353 %{_mandir}/man1/maildirkw.1*
356 %defattr(644,root,root,755)
357 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
358 %attr(751,root,root) %dir %{_sysconfdir}
359 %attr(750,root,root) %dir %{_certsdir}
360 %attr(770,daemon,daemon) %dir %{_localstatedir}
362 %{_sysconfdir}/quotawarnmsg.example
363 %attr(755,root,root) %{_bindir}/couriertls
364 %attr(755,root,root) %{_libexecdir}/couriertcpd
365 %{_mandir}/man1/couriert*
366 %{_mandir}/man8/couriert*
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{_bindir}/deliverquota
372 %{_mandir}/man8/deliverquota*
375 %defattr(644,root,root,755)
376 %attr(755,root,root) %{_bindir}/maildirmake
377 %{_mandir}/man1/maildirmake*
380 %defattr(644,root,root,755)
381 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
382 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
383 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
385 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
386 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
387 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3-ssl
388 %attr(755,root,root) %{_bindir}/pop3d
389 %attr(755,root,root) %{_sbindir}/mkpop3dcert
390 %attr(755,root,root) %{_sbindir}/pop3login
391 %attr(755,root,root) %{_libexecdir}/pop3d.rc
392 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
393 %{_mandir}/man8/courierpop*