# # Copyright 1998 - 2012 Double Precision, Inc. See COPYING for # distribution information. # # Need to version-upgrade RH builds due to different directory locations. # Summary: Courier IMAP server Name: courier-imap Version: 4.16.2 Release: 2%{?dist} License: GPLv3 Source: https://downloads.sourceforge.net/courier/%{name}-%{version}.tar.bz2 Requires: coreutils sed Requires: courier-authlib >= 0.60.6.20080629 BuildRequires: procps BuildRequires: coreutils perl BuildRequires: courier-authlib-devel >= 0.60.6.20080629 BuildRequires: libidn-devel BuildRequires: courier-unicode-devel BuildRequires: gdbm-devel BuildRequires: openssl-devel BuildRequires: perl-generators BuildRequires: /usr/include/fam.h # RH 7.0 resets sysconfdir & mandir, put them back where they belong %define _sysconfdir %{_prefix}/etc %define _mandir %{_prefix}/man %define _prefix /usr/lib/courier-imap %define _localstatedir /var/run %define initdir %(if test -d /etc/init.d/. ; then echo /etc/init.d ; else echo /etc/rc.d/init.d ; fi) %define pamconfdir /etc/pam.d %description Courier-IMAP is an IMAP server for Maildir mailboxes. This package contains the standalone version of the IMAP server that's included in the Courier mail server package. This package is a standalone version for use with other mail servers. Do not install this package if you intend to install the full Courier mail server. Install the Courier package instead. %prep %setup -q %if %(test '%{xflags}' = '%%{xflags}' && echo 1 || echo 0) %define xflags %{nil} %endif PATH=/usr/bin:$PATH %configure \ --with-redhat \ %{?xflags: %{xflags}} %build %{__make} %{_smp_mflags} %{__make} check %install %{__mkdir_p} $RPM_BUILD_ROOT%{pamconfdir} %{__mkdir_p} $RPM_BUILD_ROOT%{initdir} %{__make} install DESTDIR=$RPM_BUILD_ROOT # Copy standard sysvinit file install -Dm 744 packaging/systemd/courier-imap.sysvinit $RPM_BUILD_ROOT/%{initdir}/courier-imap cat >$RPM_BUILD_ROOT/%{_datadir}/dhparams.pem.dist <libs/imap/mkdhparams.tmp TLS_DHPARAMS=$RPM_BUILD_ROOT/%{_datadir}/dhparams.pem.dist.tmp %{__spec_rmbuild_shell} libs/imap/mkdhparams.tmp rm -f libs/imap/mkdhparams.tmp cat $RPM_BUILD_ROOT/%{_datadir}/dhparams.pem.dist.tmp >>$RPM_BUILD_ROOT/%{_datadir}/dhparams.pem.dist rm -f $RPM_BUILD_ROOT/%{_datadir}/dhparams.pem.dist.tmp %{__mkdir_p} $RPM_BUILD_ROOT/etc/cron.monthly %{__ln_s} %{_sbindir}/mkdhparams $RPM_BUILD_ROOT/etc/cron.monthly/courier-imap-mkdhparams # # Fix imapd.dist # %{__sed} 's/^IMAPDSTART=.*/IMAPDSTART=YES/' \ <$RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist \ >$RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist.tmp %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist.tmp \ $RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist %{__sed} 's/^IMAPDSSLSTART=.*/IMAPDSSLSTART=YES/' \ <$RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist \ >$RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist.tmp %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist.tmp \ $RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist %{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist %{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist %{__sed} 's/^POP3DSTART=.*/POP3DSTART=YES/' \ <$RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist \ >$RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist.tmp %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist.tmp \ $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist %{__sed} 's/^POP3DSSLSTART=.*/POP3DSSLSTART=YES/' \ <$RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist \ >$RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist.tmp %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist.tmp \ $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist %{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist %{__chmod} 600 $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist # # Red Hat /etc/profile.d scripts # %{__mkdir_p} $RPM_BUILD_ROOT/etc/profile.d %{__cat} >$RPM_BUILD_ROOT/etc/profile.d/courier-imap.sh <$RPM_BUILD_ROOT/etc/profile.d/courier-imap.csh <$RPM_BUILD_ROOT%{_datadir}/configlist </dev/null %preun if test "$1" = "0" then rm -f %{_localstatedir}/couriersslcache /sbin/chkconfig --del courier-imap fi %{_libexecdir}/imapd.rc stop %{_libexecdir}/imapd-ssl.rc stop %{_libexecdir}/pop3d.rc stop %{_libexecdir}/pop3d-ssl.rc stop %files %defattr(-, bin, bin) /etc/cron.monthly/* %attr(644, root, root) %config(noreplace) %{pamconfdir}/imap %attr(644, root, root) %config(noreplace) %{pamconfdir}/pop3 %attr(755, bin, bin) %config /etc/profile.d/courier-imap.csh %attr(755, bin, bin) %config /etc/profile.d/courier-imap.sh %attr(755, bin, bin) %{initdir}/courier-imap %dir %{_prefix} %if "%{_prefix}" != "%{_exec_prefix}" %dir %{_exec_prefix} %endif %{_libexecdir} %dir %{_sysconfdir} %dir %{_sysconfdir}/shared %dir %{_sysconfdir}/shared.tmp %config %{_sysconfdir}/imap* %config %{_sysconfdir}/pop3* %config %{_sysconfdir}/quotawarnmsg.example %{_bindir} %{_sbindir} %{_mandir} %dir %{_datadir} %{_datadir}/configlist %{_datadir}/mk* %{_datadir}/sysconftool %attr(600, root, root) %{_datadir}/dhparams.pem.dist %doc NEWS AUTHORS COPYING libs/imap/BUGS README README.imap README.maildirquota %doc README.sharedfolders %doc README.proxy* %ghost %attr(600, root, root) %{_localstatedir}/imapd.pid %ghost %attr(600, root, root) %{_localstatedir}/imapd-ssl.pid %ghost %attr(600, root, root) %{_localstatedir}/imapd.pid.lock %ghost %attr(600, root, root) %{_localstatedir}/imapd-ssl.pid.lock %ghost %attr(600, root, root) %{_localstatedir}/pop3d.pid %ghost %attr(600, root, root) %{_localstatedir}/pop3d-ssl.pid %ghost %attr(600, root, root) %{_localstatedir}/pop3d.pid.lock %ghost %attr(600, root, root) %{_localstatedir}/pop3d-ssl.pid.lock