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/
10 %bcond_without fam # FAM for enhanced IMAP IDLE and locking
12 Summary: Courier-IMAP server
13 Summary(pl.UTF-8): Serwer Courier-IMAP
18 Group: Networking/Daemons
19 Source0: http://downloads.sourceforge.net/courier/%{name}-%{version}.tar.bz2
20 # Source0-md5: 2f95c99b9ad1380b9f3ac733ccd741a2
22 Source2: %{name}-ssl.init
23 Source3: %{name}-pop3.init
24 Source4: %{name}-pop3-ssl.init
26 Source6: %{name}-pop3.pamd
27 Patch0: %{name}-dirs.patch
28 Patch1: %{name}-certsdir.patch
29 Patch2: %{name}-maildir.patch
30 Patch3: %{name}-toplevel.patch
31 Patch4: %{name}-drop-makedat.patch
32 URL: http://www.courier-mta.org/imap/
33 BuildRequires: autoconf >= 2.54
34 BuildRequires: automake
35 BuildRequires: courier-authlib-devel >= 0.61
36 BuildRequires: db-devel
37 BuildRequires: gdbm-devel
38 BuildRequires: gnet-devel
39 BuildRequires: libidn-devel
40 %{?with_fam:BuildRequires: gamin-devel}
41 BuildRequires: libstdc++-devel
42 BuildRequires: libtool
43 BuildRequires: openssl-devel >= 0.9.7d
44 BuildRequires: pkgconfig
46 BuildRequires: rpmbuild(macros) >= 1.268
47 BuildRequires: sed >= 4.0
48 BuildRequires: sysconftool
49 Requires(post,preun): /sbin/chkconfig
50 Requires: %{name}-common = %{version}-%{release}
51 Requires: /sbin/chkconfig
52 Requires: pam >= 0.79.0
56 Conflicts: cyrus-imapd
58 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 %define _libexecdir /usr/%{_lib}/courier-imap
61 %define _sysconfdir /etc/courier-imap
62 %define _certsdir %{_sysconfdir}/certs
63 %define _localstatedir /var/spool/courier-imap
66 Courier-IMAP is an IMAP server for Maildir mailboxes.
68 %description -l pl.UTF-8
69 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
72 Summary: Common files for imap and pop3 daemons
73 Summary(pl.UTF-8): Pliki wspólne dla serwerów imap i pop3
74 Group: Networking/Daemons
75 Requires(post,preun): /sbin/chkconfig
76 Requires: /sbin/chkconfig
77 Requires: courier-authlib
82 Common files for imap and pop3 daemons.
84 %description common -l pl.UTF-8
85 Pliki wspólne dla serwerów imap i pop3.
88 Summary: Deliver to a Maildir with a quota
89 Summary(pl.UTF-8): Obsługa quoty przy dostarczaniu poczty do skrzynek Maildir
90 Group: Networking/Daemons
92 %description deliverquota
93 deliverquota is a temporary hack to implement E-mail delivery to a
94 Maildir with a software-imposed quota.
96 %description deliverquota -l pl.UTF-8
97 deliverquota jest tymczasowym rozwiązaniem implementującym
98 dostarczanie e-maili do skrzynek Maildir z programowo narzuconą quotą.
101 Summary: Tool for making mail folders in Maildir format
102 Summary(pl.UTF-8): Narzędzie do tworzenia folderów w formacie Maildir
103 Group: Networking/Daemons
104 Conflicts: qmail-maildirmake
106 %description maildirmake
107 Maildirmake is a tool for making mail folders in Maildir format.
109 %description maildirmake -l pl.UTF-8
110 Maildirmake jest narzędziem do tworzenia folderów pocztowych w
114 Summary: Courier-IMAP POP3 Server
115 Summary(pl.UTF-8): Serwer Courier-IMAP POP3
116 Group: Networking/Daemons/POP3
117 Requires: %{name}-common = %{version}-%{release}
118 Requires: pam >= 0.79.0
120 Obsoletes: pop3daemon
121 Conflicts: cyrus-imapd
123 Conflicts: solid-pop3d
127 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
129 %description pop3 -l pl.UTF-8
130 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
142 cp -p %{SOURCE1} courier-imap.in
143 cp -p %{SOURCE2} courier-imap-ssl.in
144 cp -p %{SOURCE3} courier-pop3.in
145 cp -p %{SOURCE4} courier-pop3-ssl.in
146 rm -f makedat/configure.in
149 # Change Makefile.am files and force recreate Makefile.in's.
150 find -type f -a '(' -name configure.in -o -name configure.ac ')' | while read FILE; do
151 cd "$(dirname "$FILE")"
153 if [ -f Makefile.am ]; then
154 %{__sed} -i -e '/_[L]DFLAGS=-static/d' Makefile.am
160 if grep -q AC_CONFIG_HEADER configure.in; then
169 ac_cv_header_fam_h=no \
170 ac_cv_lib_fam_FAMOpen=no \
175 --with-authchangepwdir=/var/tmp \
176 --with-certsdir=%{_certsdir} \
177 --with-mailer=/usr/lib/sendmail
182 rm -rf $RPM_BUILD_ROOT
183 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
185 %{__make} -j1 install \
186 DESTDIR=$RPM_BUILD_ROOT
188 install -p courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
189 install -p courier-imap-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap-ssl
190 install -p courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
191 install -p courier-pop3-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3-ssl
192 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/imap
193 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/pop3
195 rm -rf $RPM_BUILD_ROOT%{_sbindir}/mk*cert
197 cp -pf imap/README README.imap
198 cp -pf imap/ChangeLog ChangeLog
199 cp -pf maildir/README.maildirquota.txt README.maildirquota
201 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert $RPM_BUILD_ROOT%{_sbindir}
203 cp -p tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
204 cp -p imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
206 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
207 touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
210 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
212 # set yes to start imapd and pop3d
213 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
214 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
216 # remove unpackaged files
217 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
220 rm -rf $RPM_BUILD_ROOT
223 /sbin/chkconfig --add courier-imap
224 /sbin/chkconfig --add courier-imap-ssl
225 %service courier-imap restart "courier-imap daemon"
226 %service courier-imap-ssl restart "courier-imap-ssl daemon"
229 if [ "$1" = "0" ]; then
230 %service courier-imap stop
231 /sbin/chkconfig --del courier-imap
234 if [ "$1" = "0" ]; then
235 %service courier-imap-ssl stop
236 /sbin/chkconfig --del courier-imap-ssl
240 %triggerin -- %{name} < 3.0.5
241 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
243 echo imapd.pem has been moved automatically to %{_certsdir}
245 mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
247 if [ -f /etc/sysconfig/courier-imap ]; then
248 . /etc/sysconfig/courier-imap
249 for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
252 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
253 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
255 sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
256 sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
257 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
258 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
260 echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
261 echo please look at them
264 %service -q courier-imap restart
266 %triggerin -- %{name} < 3.0.6
267 . %{_sysconfdir}/imapd-ssl
268 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
269 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
272 %triggerin -n %{name}-common -- %{name}-userdb
274 echo courier-imap-userdb is obsolete
275 echo install courier-authlib-userdb package
278 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
279 /sbin/chkconfig --del authdaemon
280 if [ -f /var/lock/subsys/authdaemon ]; then
281 kill `cat /var/lib/authdaemon/pid`
282 rm -f /var/lock/subsys/authdaemon
284 if [ -f /etc/sysconfig/authdaemon ]; then
285 . /etc/sysconfig/authdaemon
286 sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
289 echo Changes to version 3.0.5 :
290 echo - config files has been splited and moved to %{_sysconfdir}
291 echo - certificates directory has changed to %{_certsdir}
295 /sbin/chkconfig --add courier-pop3
296 /sbin/chkconfig --add courier-pop3-ssl
297 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
298 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
299 /sbin/service courier-imap-pop3 stop >&2
300 /sbin/service courier-pop3 start >&2
302 %service courier-pop3 restart "courier-pop3 daemon"
304 %service courier-pop3-ssl restart "courier-pop3-ssl daemon"
307 if [ "$1" = "0" ]; then
308 %service courier-pop3 stop
309 /sbin/chkconfig --del courier-pop3
310 %service courier-pop3-ssl stop
311 /sbin/chkconfig --del courier-pop3-ssl
314 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
315 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
317 echo pop3d.pem has been moved automatically to %{_certsdir}
319 mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
321 if [ -f /etc/sysconfig/courier-pop3 ]; then
322 . /etc/sysconfig/courier-pop3
323 for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
326 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
327 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
329 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
330 sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
332 echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
333 echo please look at them
336 %service courier-pop3 restart
338 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
339 . %{_sysconfdir}/pop3d-ssl
340 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
341 sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
345 %defattr(644,root,root,755)
346 %doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
347 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
348 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
349 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
350 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
351 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
352 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
353 %attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
354 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
355 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
356 %attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
357 %attr(755,root,root) %{_bindir}/imapd
358 %attr(755,root,root) %{_bindir}/maildiracl
359 %attr(755,root,root) %{_bindir}/maildirkw
360 %attr(755,root,root) %{_sbindir}/imaplogin
361 %attr(755,root,root) %{_sbindir}/mkimapdcert
362 %attr(755,root,root) %{_sbindir}/sharedindexinstall
363 %attr(755,root,root) %{_sbindir}/sharedindexsplit
364 %attr(755,root,root) %{_libexecdir}/imapd.rc
365 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
366 %{_mandir}/man8/imapd*
367 %{_mandir}/man1/maildiracl.1*
368 %{_mandir}/man1/maildirkw.1*
371 %defattr(644,root,root,755)
372 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
373 %attr(751,root,root) %dir %{_sysconfdir}
374 %attr(750,root,root) %dir %{_certsdir}
375 %attr(770,daemon,daemon) %dir %{_localstatedir}
377 %{_sysconfdir}/quotawarnmsg.example
378 %attr(755,root,root) %{_bindir}/couriertls
379 %attr(755,root,root) %{_libexecdir}/couriertcpd
380 %{_mandir}/man1/couriert*
381 %{_mandir}/man8/couriert*
385 %defattr(644,root,root,755)
386 %attr(755,root,root) %{_bindir}/deliverquota
387 %{_mandir}/man8/deliverquota*
390 %defattr(644,root,root,755)
391 %attr(755,root,root) %{_bindir}/maildirmake
392 %{_mandir}/man1/maildirmake*
395 %defattr(644,root,root,755)
396 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
397 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
398 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
399 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
400 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
401 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
402 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3-ssl
403 %attr(755,root,root) %{_bindir}/pop3d
404 %attr(755,root,root) %{_sbindir}/mkpop3dcert
405 %attr(755,root,root) %{_sbindir}/pop3login
406 %attr(755,root,root) %{_libexecdir}/pop3d.rc
407 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
408 %{_mandir}/man8/courierpop*