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 # [set $man.base.url.for.relative.links]/maildirquota.html
9 %bcond_with toplevel # Allow toplevel folders. More info: http://www.ricky-chan.co.uk/courier/
11 Summary: Courier-IMAP server
12 Summary(pl.UTF-8): Serwer Courier-IMAP
17 Group: Networking/Daemons
18 Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
19 # Source0-md5: 67dbd0e698f03d1a50db906318af8db9
21 Source2: %{name}-ssl.init
22 Source3: %{name}-pop3.init
23 Source4: %{name}-pop3-ssl.init
25 Source6: %{name}-pop3.pamd
26 Patch0: %{name}-dirs.patch
27 Patch1: %{name}-certsdir.patch
28 Patch2: %{name}-maildir.patch
29 Patch3: %{name}-toplevel.patch
30 Patch4: %{name}-drop-makedat.patch
31 URL: http://www.courier-mta.org/imap/
32 BuildRequires: autoconf >= 2.54
33 BuildRequires: automake
34 BuildRequires: courier-authlib-devel >= 0.61
35 BuildRequires: db-devel
36 BuildRequires: gdbm-devel
37 BuildRequires: gnet-devel
38 BuildRequires: libidn-devel
39 BuildRequires: libstdc++-devel
40 BuildRequires: libtool
41 BuildRequires: openssl-devel >= 0.9.7d
42 BuildRequires: pkgconfig
44 BuildRequires: rpmbuild(macros) >= 1.268
45 BuildRequires: sed >= 4.0
46 BuildRequires: sysconftool
47 Requires(post,preun): /sbin/chkconfig
48 Requires: %{name}-common = %{version}-%{release}
49 Requires: /sbin/chkconfig
50 Requires: pam >= 0.79.0
54 Conflicts: cyrus-imapd
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %define _libexecdir /usr/%{_lib}/courier-imap
59 %define _sysconfdir /etc/courier-imap
60 %define _certsdir %{_sysconfdir}/certs
61 %define _localstatedir /var/spool/courier-imap
64 Courier-IMAP is an IMAP server for Maildir mailboxes.
66 %description -l pl.UTF-8
67 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
70 Summary: Common files for imap and pop3 daemons
71 Summary(pl.UTF-8): Pliki wspólne dla serwerów imap i pop3
72 Group: Networking/Daemons
73 Requires(post,preun): /sbin/chkconfig
74 Requires: /sbin/chkconfig
75 Requires: courier-authlib
80 Common files for imap and pop3 daemons.
82 %description common -l pl.UTF-8
83 Pliki wspólne dla serwerów imap i pop3.
86 Summary: Deliver to a Maildir with a quota
87 Summary(pl.UTF-8): Obsługa quoty przy dostarczaniu poczty do skrzynek Maildir
88 Group: Networking/Daemons
90 %description deliverquota
91 deliverquota is a temporary hack to implement E-mail delivery to a
92 Maildir with a software-imposed quota.
94 %description deliverquota -l pl.UTF-8
95 deliverquota jest tymczasowym rozwiązaniem implementującym
96 dostarczanie e-maili do skrzynek Maildir z programowo narzuconą quotą.
99 Summary: Tool for making mail folders in Maildir format
100 Summary(pl.UTF-8): Narzędzie do tworzenia folderów w formacie Maildir
101 Group: Networking/Daemons
102 Conflicts: qmail-maildirmake
104 %description maildirmake
105 Maildirmake is a tool for making mail folders in Maildir format.
107 %description maildirmake -l pl.UTF-8
108 Maildirmake jest narzędziem do tworzenia folderów pocztowych w
112 Summary: Courier-IMAP POP3 Server
113 Summary(pl.UTF-8): Serwer Courier-IMAP POP3
114 Group: Networking/Daemons/POP3
115 Requires: %{name}-common = %{version}-%{release}
116 Requires: pam >= 0.79.0
118 Obsoletes: pop3daemon
119 Conflicts: cyrus-imapd
121 Conflicts: solid-pop3d
125 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
127 %description pop3 -l pl.UTF-8
128 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
140 install %{SOURCE1} courier-imap.in
141 install %{SOURCE2} courier-imap-ssl.in
142 install %{SOURCE3} courier-pop3.in
143 install %{SOURCE4} courier-pop3-ssl.in
144 rm -f makedat/configure.in
147 # Change Makefile.am files and force recreate Makefile.in's.
148 find -type f -a '(' -name configure.in -o -name configure.ac ')' | while read FILE; do
149 cd "$(dirname "$FILE")"
151 if [ -f Makefile.am ]; then
152 %{__sed} -i -e '/_[L]DFLAGS=-static/d' Makefile.am
158 if grep -q AC_CONFIG_HEADER configure.in; then
169 --with-authchangepwdir=/var/tmp \
170 --with-certsdir=%{_certsdir} \
171 --with-mailer=/usr/lib/sendmail
176 rm -rf $RPM_BUILD_ROOT
177 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
179 %{__make} -j1 install \
180 DESTDIR=$RPM_BUILD_ROOT
182 install -p courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
183 install -p courier-imap-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap-ssl
184 install -p courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
185 install -p courier-pop3-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3-ssl
186 cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/imap
187 cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/pop3
189 rm -rf $RPM_BUILD_ROOT%{_sbindir}/mk*cert
191 cp -af imap/README README.imap
192 cp -af imap/ChangeLog ChangeLog
193 cp -af maildir/README.maildirquota.txt README.maildirquota
195 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert $RPM_BUILD_ROOT%{_sbindir}
197 cp -a tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
198 cp -a imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
200 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
201 touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
204 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
206 # set yes to start imapd and pop3d
207 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
208 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
210 # remove unpackaged files
211 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
214 rm -rf $RPM_BUILD_ROOT
217 /sbin/chkconfig --add courier-imap
218 /sbin/chkconfig --add courier-imap-ssl
219 %service courier-imap restart "courier-imap daemon"
220 %service courier-imap-ssl restart "courier-imap-ssl daemon"
223 if [ "$1" = "0" ]; then
224 %service courier-imap stop
225 /sbin/chkconfig --del courier-imap
228 if [ "$1" = "0" ]; then
229 %service courier-imap-ssl stop
230 /sbin/chkconfig --del courier-imap-ssl
234 %triggerin -- %{name} < 3.0.5
235 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
237 echo imapd.pem has been moved automatically to %{_certsdir}
239 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
241 if [ -f /etc/sysconfig/courier-imap ]; then
242 . /etc/sysconfig/courier-imap
243 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
246 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
247 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
249 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
250 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
251 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
252 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
254 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
255 echo please look at them
258 %service -q courier-imap restart
260 %triggerin -- %{name} < 3.0.6
261 . %{_sysconfdir}/imapd-ssl
262 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
263 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
266 %triggerin -n %{name}-common -- %{name}-userdb
268 echo courier-imap-userdb is obsolete
269 echo install courier-authlib-userdb package
272 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
273 /sbin/chkconfig --del authdaemon
274 if [ -f /var/lock/subsys/authdaemon ]; then
275 kill `cat /var/lib/authdaemon/pid`
276 rm -f /var/lock/subsys/authdaemon
278 if [ -f /etc/sysconfig/authdaemon ]; then
279 . /etc/sysconfig/authdaemon
280 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
283 echo Changes to version 3.0.5 :
284 echo - config files has been splited and moved to %{_sysconfdir}
285 echo - certificates directory has changed to %{_certsdir}
289 /sbin/chkconfig --add courier-pop3
290 /sbin/chkconfig --add courier-pop3-ssl
291 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
292 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
293 /sbin/service courier-imap-pop3 stop >&2
294 /sbin/service courier-pop3 start >&2
296 %service courier-pop3 restart "courier-pop3 daemon"
298 %service courier-pop3-ssl restart "courier-pop3-ssl daemon"
301 if [ "$1" = "0" ]; then
302 %service courier-pop3 stop
303 /sbin/chkconfig --del courier-pop3
304 %service courier-pop3-ssl stop
305 /sbin/chkconfig --del courier-pop3-ssl
308 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
309 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
311 echo pop3d.pem has been moved automatically to %{_certsdir}
313 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
315 if [ -f /etc/sysconfig/courier-pop3 ]; then
316 . /etc/sysconfig/courier-pop3
317 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
320 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
321 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
323 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
324 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
326 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
327 echo please look at them
330 %service courier-pop3 restart
332 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
333 . %{_sysconfdir}/pop3d-ssl
334 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
335 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
339 %defattr(644,root,root,755)
340 %doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
341 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
342 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
343 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
344 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
345 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
346 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
347 %attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
348 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
349 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
350 %attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
351 %attr(755,root,root) %{_bindir}/imapd
352 %attr(755,root,root) %{_bindir}/maildiracl
353 %attr(755,root,root) %{_bindir}/maildirkw
354 %attr(755,root,root) %{_sbindir}/imaplogin
355 %attr(755,root,root) %{_sbindir}/mkimapdcert
356 %attr(755,root,root) %{_sbindir}/sharedindexinstall
357 %attr(755,root,root) %{_sbindir}/sharedindexsplit
358 %attr(755,root,root) %{_libexecdir}/imapd.rc
359 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
360 %{_mandir}/man8/imapd*
361 %{_mandir}/man1/maildiracl.1*
362 %{_mandir}/man1/maildirkw.1*
365 %defattr(644,root,root,755)
366 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
367 %attr(751,root,root) %dir %{_sysconfdir}
368 %attr(750,root,root) %dir %{_certsdir}
369 %attr(770,daemon,daemon) %dir %{_localstatedir}
371 %{_sysconfdir}/quotawarnmsg.example
372 %attr(755,root,root) %{_bindir}/couriertls
373 %attr(755,root,root) %{_libexecdir}/couriertcpd
374 %{_mandir}/man1/couriert*
375 %{_mandir}/man8/couriert*
379 %defattr(644,root,root,755)
380 %attr(755,root,root) %{_bindir}/deliverquota
381 %{_mandir}/man8/deliverquota*
384 %defattr(644,root,root,755)
385 %attr(755,root,root) %{_bindir}/maildirmake
386 %{_mandir}/man1/maildirmake*
389 %defattr(644,root,root,755)
390 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
391 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
392 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
393 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
394 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
395 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
396 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3-ssl
397 %attr(755,root,root) %{_bindir}/pop3d
398 %attr(755,root,root) %{_sbindir}/mkpop3dcert
399 %attr(755,root,root) %{_sbindir}/pop3login
400 %attr(755,root,root) %{_libexecdir}/pop3d.rc
401 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
402 %{_mandir}/man8/courierpop*