5 # - add maildir.patch (like in courier-mta)
8 %bcond_without ldap # without LDAP support
9 %bcond_without mysql # without MySQL support
10 %bcond_without pgsql # without PostgreSQL support
11 Summary: Courier-IMAP server
12 Summary(pl): Serwer Courier-IMAP
17 Group: Networking/Daemons
18 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
19 # Source0-md5: 8b0c79997905dc46cfe4cc13be74ceaf
21 Source2: %{name}-pop3.init
23 Source4: %{name}-pop3.pamd
24 Patch0: %{name}-dirs.patch
25 Patch1: %{name}-certsdir.patch
26 URL: http://www.inter7.com/courierimap/
27 BuildRequires: autoconf >= 2.54
28 BuildRequires: automake
29 BuildRequires: gdbm-devel
30 BuildRequires: libstdc++-devel
31 %{?with_mysql:BuildRequires: mysql-devel}
32 %{?with_ldap:BuildRequires: openldap-devel}
33 BuildRequires: openssl-devel >= 0.9.7d
34 %{?with_pgsql:BuildRequires: postgresql-devel}
36 BuildRequires: sysconftool
37 %{?with_mysql:BuildRequires: zlib-devel}
38 PreReq: %{name}-common = %{version}-%{release}
40 Requires(post,preun): /sbin/chkconfig
41 Requires: pam >= 0.77.3
44 Conflicts: cyrus-imapd
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 %define _libexecdir /usr/%{_lib}/courier-imap
49 %define _sysconfdir /etc/courier-imap
50 %define _certsdir %{_sysconfdir}/certs
53 Courier-IMAP is an IMAP server for Maildir mailboxes.
56 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
59 Summary: Common files for imap and pop3 daemons
60 Summary(pl): Pliki wspólne dla serwerów imap i pop3
61 Group: Networking/Daemons
63 Requires(post,preun): /sbin/chkconfig
64 Requires: %{name}-deliverquota = %{version}-%{release}
65 Requires: %{name}-maildirmake = %{version}-%{release}
66 Requires: %{name}-userdb = %{version}-%{release}
70 Common files for imap and pop3 daemons.
72 %description common -l pl
73 Pliki wspólne dla serwerów imap i pop3.
76 Summary: Commands used to create the /etc/userdb.dat
77 Summary(pl): Polecenia do tworzenia /etc/userdb.dat
78 Group: Networking/Daemons
81 Commands used to create the /etc/userdb.dat.
83 %description userdb -l pl
84 Polecenia u¿ywane do stworzenia /etc/userdb.dat.
87 Summary: Deliver to a Maildir with a quota
88 Summary(pl): Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
89 Group: Networking/Daemons
91 %description deliverquota
92 deliverquota is a temporary hack to implement E-mail delivery to a
93 Maildir with a software-imposed quota.
95 %description deliverquota -l pl
96 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
97 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
100 Summary: Tool for making mail folders in Maildir format
101 Summary(pl): Narzêdzie do tworzenia folderów w formacie Maildir
102 Group: Networking/Daemons
103 Conflicts: qmail-maildirmake
105 %description maildirmake
106 Maildirmake is a tool for making mail folders in Maildir format.
108 %description maildirmake -l pl
109 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
113 Summary: Courier-IMAP POP3 Server
114 Summary(pl): Serwer Courier-IMAP POP3
115 Group: Networking/Daemons
116 PreReq: %{name}-common = %{version}-%{release}
117 Requires: pam >= 0.77.3
119 Obsoletes: pop3daemon
120 Conflicts: cyrus-imapd
122 Conflicts: solid-pop3d
126 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
128 %description pop3 -l pl
129 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
132 Summary: LDAP authentication daemon for Courier IMAP
133 Summary(pl): Demon autentykacji LDAP do Courier IMAP
134 Group: Networking/Daemons
135 PreReq: %{name}-common = %{version}-%{release}
137 %description authldap
138 This package provides LDAP authentication for Courier IMAP.
140 %description authldap -l pl
141 Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courier IMAP.
144 Summary: MySQL authentication daemon for Courier IMAP
145 Summary(pl): Demon autentykacji MySQL do Courier IMAP
146 Group: Networking/Daemons
147 PreReq: %{name}-common = %{version}-%{release}
150 %description authmysql
151 This package provides MySQL authentication for Courier IMAP.
153 %description authmysql -l pl
154 Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courier IMAP.
157 Summary: PostgreSQL authentication daemon for Courier IMAP
158 Summary(pl): Demon autentykacji PostgreSQL do Courier IMAP
159 Group: Networking/Daemons
160 PreReq: %{name}-common = %{version}-%{release}
162 %description authpgsql
163 This package provides PostgreSQL authentication for Courier IMAP.
165 %description authpgsql -l pl
166 Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courier
174 install %{SOURCE1} courier-imap.in
175 install %{SOURCE2} courier-pop3.in
178 cp -f /usr/share/automake/config.sub .
179 cp -f /usr/share/automake/config.sub maildir
196 --libexecdir=%{_libexecdir} \
198 --with-authchangepwdir=/var/tmp \
199 --with-authdaemonvar=/var/lib/authdaemon \
200 --with-certsdir=%{_certsdir} \
201 %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
202 %{!?with_mysql:--without-authmysql} \
203 %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
204 %{!?with_pgsql:--without-authpgsql} \
205 %{!?with_ldap:--without-authldap}
210 rm -rf $RPM_BUILD_ROOT
211 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,security,sysconfig} \
212 $RPM_BUILD_ROOT{%{_sysconfdir}/shared,%{_certsdir},/var/lib/authdaemon}
215 DESTDIR=$RPM_BUILD_ROOT
217 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
218 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
219 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/imap
220 install %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/pop3
222 rm -rf $RPM_BUILD_ROOT%{_mandir}/man8/{authcram,authpam,authpwd,authshadow,authuserdb,authvchkpw,pw2userdb,vchkpw2userdb,authdaemon,authdaemond,authldap,authmysql}.8 \
223 $RPM_BUILD_ROOT%{_sbindir}/{*db,mk*cert}
225 mv -f authlib/README.authmysql.html README.authmysql.html
226 mv -f authlib/README.ldap README.ldap
227 mv -f authlib/README.authmysql.myownquery README.authmysql.myownquery
228 mv -f imap/README README.imap
229 mv -f imap/ChangeLog ChangeLog
230 mv -f maildir/README.maildirquota.txt README.maildirquota
232 install authlib/authdaemonrc $RPM_BUILD_ROOT%{_sysconfdir}
233 install authlib/authldaprc $RPM_BUILD_ROOT%{_sysconfdir}
234 install authlib/authmysqlrc $RPM_BUILD_ROOT%{_sysconfdir}
235 install authlib/authpgsqlrc $RPM_BUILD_ROOT%{_sysconfdir}
237 mv -f $RPM_BUILD_ROOT%{_datadir}/*db \
238 $RPM_BUILD_ROOT%{_sbindir}
239 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert \
240 $RPM_BUILD_ROOT%{_sbindir}
242 mv -f tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
243 mv -f imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
245 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authcram.8
246 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpam.8
247 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpwd.8
248 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authshadow.8
249 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
250 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
251 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
252 echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
253 %{?with_pgsql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
254 %{?with_mysql:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
255 %{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
256 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
257 echo ".so makeuserdb.8" >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
259 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
262 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
264 # remove unpackaged files
265 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
268 rm -rf $RPM_BUILD_ROOT
271 /sbin/chkconfig --add courier-imap
273 if [ -f /var/lock/subsys/courier-imap ]; then
274 /etc/rc.d/init.d/courier-imap restart >&2
276 echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
280 if [ "$1" = "0" ]; then
281 if [ -f /var/lock/subsys/courier-imap ]; then
282 /etc/rc.d/init.d/courier-imap stop >&2
284 /sbin/chkconfig --del courier-imap
287 %triggerpostin -- %{name} < 3.0.5
288 echo pop3d.pem has been moved automatically to %{_certsdir}
289 mv -f /var/lib/openssl/imapd.pem %{_certsdir}
291 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
292 /sbin/chkconfig --del authdaemon
293 rm -f /var/lock/subsys/authdaemon
296 /sbin/chkconfig --add courier-pop3
297 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
298 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
299 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
300 /etc/rc.d/init.d/courier-pop3 start >&2
301 elif [ -f /var/lock/subsys/courier-pop3 ]; then
302 /etc/rc.d/init.d/courier-pop3 restart >&2
304 echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
306 rm -f /etc/rc.d/init.d/courier-imap-pop3
309 if [ "$1" = "0" ]; then
310 if [ -f /var/lock/subsys/courier-pop3 ]; then
311 /etc/rc.d/init.d/courier-pop3 stop >&2
313 /sbin/chkconfig --del courier-pop3
314 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
315 /etc/rc.d/init.d/courier-imap-pop3 stop >&2
317 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
318 rm -f /etc/rc.d/init.d/courier-imap-pop3
321 %triggerpostin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
322 echo pop3d.pem has been moved automatically to %{_certsdir}
323 mv -f /var/lib/openssl/pop3d.pem %{_certsdir}
326 if ps -A |grep -q authdaemond.lda; then
327 %{_libexecdir}/authlib/authdaemond stop
328 %{_libexecdir}/authlib/authdaemond start
332 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
333 if ps -A |grep -q authdaemond.lda; then
334 %{_libexecdir}/authlib/authdaemond stop;
335 %{_libexecdir}/authlib/authdaemond start;
340 if ps -A |grep -q authdaemond.mys; then
341 %{_libexecdir}/authlib/authdaemond stop
342 %{_libexecdir}/authlib/authdaemond start
346 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
347 if ps -A |grep -q authdaemond.mys; then
348 %{_libexecdir}/authlib/authdaemond stop;
349 %{_libexecdir}/authlib/authdaemond start;
354 if ps -A |grep -q authdaemond.pgs; then
355 %{_libexecdir}/authlib/authdaemond stop
356 %{_libexecdir}/authlib/authdaemond start
360 if [ -x %{_libexecdir}/authlib/authdaemond ]; then
361 if ps -A |grep -q authdaemond.pgs; then
362 %{_libexecdir}/authlib/authdaemond stop;
363 %{_libexecdir}/authlib/authdaemond start;
368 %defattr(644,root,root,755)
369 %doc maildir/README.sharedfolders.html
370 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
371 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.imap
372 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd
373 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/imapd-ssl
374 %{_sysconfdir}/imapd.cnf
375 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
376 %attr(750,daemon,daemon) %dir %{_sysconfdir}/shared
377 %attr(755,root,root) %{_bindir}/imapd
378 %attr(755,root,root) %{_bindir}/maildiracl
379 %attr(755,root,root) %{_bindir}/maildirkw
380 %attr(755,root,root) %{_sbindir}/authenumerate
381 %attr(755,root,root) %{_sbindir}/imaplogin
382 %attr(755,root,root) %{_sbindir}/mkimapdcert
383 %attr(755,root,root) %{_sbindir}/sharedindexinstall
384 %attr(755,root,root) %{_sbindir}/sharedindexsplit
385 %attr(755,root,root) %{_libexecdir}/imapd.rc
386 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
387 %{_mandir}/man8/imapd*
388 %{_mandir}/man1/maildiracl.1*
389 %{_mandir}/man1/maildirkw.1*
392 %defattr(644,root,root,755)
393 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
394 %attr(700,root,root) /var/lib/authdaemon
395 %attr(750,root,root) %dir %{_sysconfdir}
396 %attr(750,root,root) %dir %{_certsdir}
398 %dir %{_libexecdir}/authlib
399 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authdaemonrc
400 %{_sysconfdir}/quotawarnmsg.example
401 %attr(755,root,root) %{_bindir}/couriertls
402 %attr(755,root,root) %{_libexecdir}/authlib/authdaemon
403 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond
404 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.plain
405 %attr(755,root,root) %{_libexecdir}/couriertcpd
406 %attr(755,root,root) %{_libexecdir}/makedatprog
407 %attr(755,root,root) %{_sbindir}/courierlogger
408 %{_mandir}/man8/auth[cdsuv]*
409 %{_mandir}/man8/authp[aw]*
410 %{_mandir}/man7/authlib*
411 %{_mandir}/man1/couriert*
412 %{_mandir}/man8/couriert*
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_sbindir}/makeuserdb
418 %attr(755,root,root) %{_sbindir}/pw2userdb
419 %attr(755,root,root) %{_sbindir}/userdb
420 %attr(755,root,root) %{_sbindir}/userdbpw
421 %attr(755,root,root) %{_sbindir}/vchkpw2userdb
422 %{_mandir}/man8/makeuserdb*
423 %{_mandir}/man8/userdb*
424 %{_mandir}/man8/*pw2userdb*
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_bindir}/deliverquota
429 %{_mandir}/man8/deliverquota*
432 %defattr(644,root,root,755)
433 %attr(755,root,root) %{_bindir}/maildirmake
434 %{_mandir}/man1/maildirmake*
437 %defattr(644,root,root,755)
438 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/pop3
439 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/security/blacklist.pop3
440 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d
441 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/pop3d-ssl
442 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
443 %attr(755,root,root) %{_bindir}/pop3d
444 %attr(755,root,root) %{_sbindir}/mkpop3dcert
445 %attr(755,root,root) %{_sbindir}/pop3login
446 %attr(755,root,root) %{_libexecdir}/pop3d.rc
447 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
448 %{_sysconfdir}/pop3d.cnf
449 %{_mandir}/man8/courierpop*
453 %defattr(644,root,root,755)
454 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
455 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.ldap
456 %{_mandir}/man8/authldap*
461 %defattr(644,root,root,755)
462 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
463 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.mysql
464 %{_mandir}/man8/authmysql*
469 %defattr(644,root,root,755)
470 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
471 %attr(755,root,root) %{_libexecdir}/authlib/authdaemond.pgsql
472 %{_mandir}/man8/authpgsql*