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.UTF-8): Serwer Courier-IMAP
14 Group: Networking/Daemons
15 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
16 # Source0-md5: e6984890e1aecf3cc6b099a1619324e6
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.61
32 BuildRequires: db-devel
33 BuildRequires: gdbm-devel
34 BuildRequires: gnet-devel
35 BuildRequires: libidn-devel
36 BuildRequires: libstdc++-devel
37 BuildRequires: libtool
38 BuildRequires: openssl-devel >= 0.9.7d
39 BuildRequires: pkgconfig
41 BuildRequires: rpmbuild(macros) >= 1.268
42 BuildRequires: sed >= 4.0
43 BuildRequires: sysconftool
44 Requires(post,preun): /sbin/chkconfig
45 Requires: %{name}-common = %{version}-%{release}
46 Requires: /sbin/chkconfig
47 Requires: pam >= 0.79.0
51 Conflicts: cyrus-imapd
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 %define _libexecdir /usr/%{_lib}/courier-imap
56 %define _sysconfdir /etc/courier-imap
57 %define _certsdir %{_sysconfdir}/certs
58 %define _localstatedir /var/spool/courier-imap
61 Courier-IMAP is an IMAP server for Maildir mailboxes.
63 %description -l pl.UTF-8
64 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
67 Summary: Common files for imap and pop3 daemons
68 Summary(pl.UTF-8): Pliki wspólne dla serwerów imap i pop3
69 Group: Networking/Daemons
70 Requires(post,preun): /sbin/chkconfig
71 Requires: /sbin/chkconfig
72 Requires: courier-authlib
77 Common files for imap and pop3 daemons.
79 %description common -l pl.UTF-8
80 Pliki wspólne dla serwerów imap i pop3.
83 Summary: Deliver to a Maildir with a quota
84 Summary(pl.UTF-8): Obsługa quoty przy dostarczaniu poczty do skrzynek Maildir
85 Group: Networking/Daemons
87 %description deliverquota
88 deliverquota is a temporary hack to implement E-mail delivery to a
89 Maildir with a software-imposed quota.
91 %description deliverquota -l pl.UTF-8
92 deliverquota jest tymczasowym rozwiązaniem implementującym
93 dostarczanie e-maili do skrzynek Maildir z programowo narzuconą quotą.
96 Summary: Tool for making mail folders in Maildir format
97 Summary(pl.UTF-8): Narzędzie do tworzenia folderów w formacie Maildir
98 Group: Networking/Daemons
99 Conflicts: qmail-maildirmake
101 %description maildirmake
102 Maildirmake is a tool for making mail folders in Maildir format.
104 %description maildirmake -l pl.UTF-8
105 Maildirmake jest narzędziem do tworzenia folderów pocztowych w
109 Summary: Courier-IMAP POP3 Server
110 Summary(pl.UTF-8): Serwer Courier-IMAP POP3
111 Group: Networking/Daemons/POP3
112 Requires: %{name}-common = %{version}-%{release}
113 Requires: pam >= 0.79.0
115 Obsoletes: pop3daemon
116 Conflicts: cyrus-imapd
118 Conflicts: solid-pop3d
122 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
124 %description pop3 -l pl.UTF-8
125 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
137 install %{SOURCE1} courier-imap.in
138 install %{SOURCE2} courier-imap-ssl.in
139 install %{SOURCE3} courier-pop3.in
140 install %{SOURCE4} courier-pop3-ssl.in
141 rm -f makedat/configure.in
144 # Change Makefile.am files and force recreate Makefile.in's.
145 find -type f -a '(' -name configure.in -o -name configure.ac ')' | while read FILE; do
146 cd "$(dirname "$FILE")"
148 if [ -f Makefile.am ]; then
149 %{__sed} -i -e '/_[L]DFLAGS=-static/d' Makefile.am
155 if grep -q AC_CONFIG_HEADER configure.in; then
166 --with-authchangepwdir=/var/tmp \
167 --with-certsdir=%{_certsdir} \
168 --with-mailer=/usr/lib/sendmail
173 rm -rf $RPM_BUILD_ROOT
174 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
176 %{__make} -j1 install \
177 DESTDIR=$RPM_BUILD_ROOT
179 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
180 install courier-imap-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap-ssl
181 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
182 install courier-pop3-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3-ssl
183 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/imap
184 install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/pop3
186 rm -rf $RPM_BUILD_ROOT%{_sbindir}/mk*cert
188 install imap/README README.imap
189 install imap/ChangeLog ChangeLog
190 install maildir/README.maildirquota.txt README.maildirquota
192 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert $RPM_BUILD_ROOT%{_sbindir}
194 install tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
195 install imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
197 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
198 touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
201 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
203 # set yes to start imapd and pop3d
204 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
205 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
207 # remove unpackaged files
208 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
211 rm -rf $RPM_BUILD_ROOT
214 /sbin/chkconfig --add courier-imap
215 /sbin/chkconfig --add courier-imap-ssl
216 %service courier-imap restart "courier-imap daemon"
217 %service courier-imap-ssl restart "courier-imap-ssl daemon"
220 if [ "$1" = "0" ]; then
221 %service courier-imap stop
222 /sbin/chkconfig --del courier-imap
225 if [ "$1" = "0" ]; then
226 %service courier-imap-ssl stop
227 /sbin/chkconfig --del courier-imap-ssl
231 %triggerin -- %{name} < 3.0.5
232 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
234 echo imapd.pem has been moved automatically to %{_certsdir}
236 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
238 if [ -f /etc/sysconfig/courier-imap ]; then
239 . /etc/sysconfig/courier-imap
240 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
243 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
244 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
246 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
247 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
248 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
249 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
251 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
252 echo please look at them
255 %service -q courier-imap restart
257 %triggerin -- %{name} < 3.0.6
258 . %{_sysconfdir}/imapd-ssl
259 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
260 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
263 %triggerin -n %{name}-common -- %{name}-userdb
265 echo courier-imap-userdb is obsolete
266 echo install courier-authlib-userdb package
269 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
270 /sbin/chkconfig --del authdaemon
271 if [ -f /var/lock/subsys/authdaemon ]; then
272 kill `cat /var/lib/authdaemon/pid`
273 rm -f /var/lock/subsys/authdaemon
275 if [ -f /etc/sysconfig/authdaemon ]; then
276 . /etc/sysconfig/authdaemon
277 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
280 echo Changes to version 3.0.5 :
281 echo - config files has been splited and moved to %{_sysconfdir}
282 echo - certificates directory has changed to %{_certsdir}
286 /sbin/chkconfig --add courier-pop3
287 /sbin/chkconfig --add courier-pop3-ssl
288 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
289 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
290 /sbin/service courier-imap-pop3 stop >&2
291 /sbin/service courier-pop3 start >&2
293 %service courier-pop3 restart "courier-pop3 daemon"
295 %service courier-pop3-ssl restart "courier-pop3-ssl daemon"
298 if [ "$1" = "0" ]; then
299 %service courier-pop3 stop
300 /sbin/chkconfig --del courier-pop3
301 %service courier-pop3-ssl stop
302 /sbin/chkconfig --del courier-pop3-ssl
305 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
306 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
308 echo pop3d.pem has been moved automatically to %{_certsdir}
310 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
312 if [ -f /etc/sysconfig/courier-pop3 ]; then
313 . /etc/sysconfig/courier-pop3
314 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
317 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
318 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
320 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
321 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
323 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
324 echo please look at them
327 %service courier-pop3 restart
329 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
330 . %{_sysconfdir}/pop3d-ssl
331 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
332 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
336 %defattr(644,root,root,755)
337 %doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
338 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
339 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
340 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
341 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
342 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
343 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
344 %attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
345 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
346 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
347 %attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
348 %attr(755,root,root) %{_bindir}/imapd
349 %attr(755,root,root) %{_bindir}/maildiracl
350 %attr(755,root,root) %{_bindir}/maildirkw
351 %attr(755,root,root) %{_sbindir}/imaplogin
352 %attr(755,root,root) %{_sbindir}/mkimapdcert
353 %attr(755,root,root) %{_sbindir}/sharedindexinstall
354 %attr(755,root,root) %{_sbindir}/sharedindexsplit
355 %attr(755,root,root) %{_libexecdir}/imapd.rc
356 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
357 %{_mandir}/man8/imapd*
358 %{_mandir}/man1/maildiracl.1*
359 %{_mandir}/man1/maildirkw.1*
362 %defattr(644,root,root,755)
363 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
364 %attr(751,root,root) %dir %{_sysconfdir}
365 %attr(750,root,root) %dir %{_certsdir}
366 %attr(770,daemon,daemon) %dir %{_localstatedir}
368 %{_sysconfdir}/quotawarnmsg.example
369 %attr(755,root,root) %{_bindir}/couriertls
370 %attr(755,root,root) %{_libexecdir}/couriertcpd
371 %{_mandir}/man1/couriert*
372 %{_mandir}/man8/couriert*
376 %defattr(644,root,root,755)
377 %attr(755,root,root) %{_bindir}/deliverquota
378 %{_mandir}/man8/deliverquota*
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_bindir}/maildirmake
383 %{_mandir}/man1/maildirmake*
386 %defattr(644,root,root,755)
387 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
388 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
389 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
390 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
391 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
392 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
393 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3-ssl
394 %attr(755,root,root) %{_bindir}/pop3d
395 %attr(755,root,root) %{_sbindir}/mkpop3dcert
396 %attr(755,root,root) %{_sbindir}/pop3login
397 %attr(755,root,root) %{_libexecdir}/pop3d.rc
398 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
399 %{_mandir}/man8/courierpop*