+# TODO:
+# - put imap-ssl and pop3-ssl to separate packages - some want to have
+# ssl-only system (or non-ssl only system)
+# see also http://thread.gmane.org/gmane.linux.pld.devel.english/2509/focus=2509
#
-%bcond_with toplevel # Allow toplevel folders
- # More info: http://www.ricky-chan.co.uk/courier/
+%bcond_with toplevel # Allow toplevel folders. More info: http://www.ricky-chan.co.uk/courier/
#
Summary: Courier-IMAP server
Summary(pl): Serwer Courier-IMAP
Name: courier-imap
-Version: 4.0.5
-Release: 0.5
+Version: 4.1.1
+Release: 3
License: GPL
Group: Networking/Daemons
Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
-# Source0-md5: 961372cea83bcbd07471670df1f9121b
+# Source0-md5: f423a609d9cce0dcf193cac64eb4cbdd
Source1: %{name}.init
Source2: %{name}-ssl.init
Source3: %{name}-pop3.init
Patch1: %{name}-certsdir.patch
Patch2: %{name}-maildir.patch
Patch3: %{name}-toplevel.patch
+Patch4: %{name}-drop-makedat.patch
URL: http://www.courier-mta.org/imap/
BuildRequires: autoconf >= 2.54
BuildRequires: automake
BuildRequires: libstdc++-devel
BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: procps
+BuildRequires: rpmbuild(macros) >= 1.268
BuildRequires: sed >= 4.0
BuildRequires: sysconftool
Requires(post,preun): /sbin/chkconfig
%if %{with toplevel}
%patch3 -p1
%endif
+%patch4 -p1
install %{SOURCE1} courier-imap.in
install %{SOURCE2} courier-imap-ssl.in
install %{SOURCE3} courier-pop3.in
install %{SOURCE4} courier-pop3-ssl.in
+rm -f makedat/configure.in
%build
# Change Makefile.am files and force recreate Makefile.in's.
-OLDDIR=`pwd`
-find -type f -a \( -name configure.in -o -name configure.ac \) | while read FILE; do
- cd "`dirname "$FILE"`"
+find -type f -a '(' -name configure.in -o -name configure.ac ')' | while read FILE; do
+ cd "$(dirname "$FILE")"
- if [ -f Makefile.am ]; then
- sed -i -e '/_[L]DFLAGS=-static/d' Makefile.am
- fi
+ if [ -f Makefile.am ]; then
+ %{__sed} -i -e '/_[L]DFLAGS=-static/d' Makefile.am
+ fi
- %{__libtoolize}
- %{__aclocal}
- %{__autoconf}
- %{__autoheader}
- %{__automake}
+ %{__libtoolize}
+ %{__aclocal}
+ %{__autoconf}
+ %{__autoheader}
+ %{__automake}
- cd "$OLDDIR"
+ cd -
done
%configure \
--with-db=db \
--enable-unicode \
--with-authchangepwdir=/var/tmp \
- --with-certsdir=%{_certsdir}
+ --with-certsdir=%{_certsdir} \
+ --with-mailer=/usr/lib/sendmail
%{__make}
install imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
+touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
# make config files
./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
%post
/sbin/chkconfig --add courier-imap
/sbin/chkconfig --add courier-imap-ssl
-
-if [ -f /var/lock/subsys/courier-imap ]; then
- /etc/rc.d/init.d/courier-imap restart >&2
-else
- echo "Run \"/etc/rc.d/init.d/courier-imap start\" to start courier-imap daemon."
-fi
-
-if [ -f /var/lock/subsys/courier-imap-ssl ]; then
- /etc/rc.d/init.d/courier-imap-ssl restart >&2
-else
- echo "Run \"/etc/rc.d/init.d/courier-imap-ssl start\" to start courier-imap-ssl daemon."
-fi
+%service courier-imap restart "courier-imap daemon"
+%service courier-imap-ssl restart "courier-imap-ssl daemon"
%preun
if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/courier-imap ]; then
- /etc/rc.d/init.d/courier-imap stop >&2
- fi
+ %service courier-imap stop
/sbin/chkconfig --del courier-imap
fi
if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/courier-imap-ssl ]; then
- /etc/rc.d/init.d/courier-imap-ssl stop >&2
- fi
+ %service courier-imap-ssl stop
/sbin/chkconfig --del courier-imap-ssl
fi
echo please look at them
echo
fi
-if [ -f /var/lock/subsys/courier-imap ]; then
- /etc/rc.d/init.d/courier-imap restart >&2
-fi
+%service -q courier-imap restart
%triggerin -- %{name} < 3.0.6
. %{_sysconfdir}/imapd-ssl
/sbin/chkconfig --add courier-pop3-ssl
/sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
- /etc/rc.d/init.d/courier-imap-pop3 stop >&2
- /etc/rc.d/init.d/courier-pop3 start >&2
-elif [ -f /var/lock/subsys/courier-pop3 ]; then
- /etc/rc.d/init.d/courier-pop3 restart >&2
+ /sbin/service courier-imap-pop3 stop >&2
+ /sbin/service courier-pop3 start >&2
else
- echo "Run \"/etc/rc.d/init.d/courier-pop3 start\" to start courier-pop3 daemon."
-fi
-
-if [ -f /var/lock/subsys/courier-pop3-ssl ]; then
- /etc/rc.d/init.d/courier-pop3-ssl restart >&2
-else
- echo "Run \"/etc/rc.d/init.d/courier-pop3-ssl start\" to start courier-pop3-ssl daemon."
+ %service courier-pop3 restart "courier-pop3 daemon"
fi
+%service courier-pop3-ssl restart "courier-pop3-ssl daemon"
%preun pop3
if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/courier-pop3 ]; then
- /etc/rc.d/init.d/courier-pop3 stop >&2
- fi
+ %service courier-pop3 stop
/sbin/chkconfig --del courier-pop3
- if [ -f /var/lock/subsys/courier-pop3-ssl ]; then
- /etc/rc.d/init.d/courier-pop3-ssl stop >&2
- fi
- /sbin/chkconfig --del courier-pop3-ssl
+ %service courier-pop3-ssl stop
+ /sbin/chkconfig --del courier-pop3-ssl
fi
%triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
echo please look at them
echo
fi
-if [ -f /var/lock/subsys/courier-pop3 ]; then
- /etc/rc.d/init.d/courier-pop3 restart >&2
-fi
+%service courier-pop3 restart
%triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
. %{_sysconfdir}/pop3d-ssl
%files
%defattr(644,root,root,755)
-%doc maildir/README.sharedfolders.html imap/README.proxy tcpd/README.couriertls
+%doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
%attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
%attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
%attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
+%attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
%attr(755,root,root) %{_bindir}/imapd
%attr(755,root,root) %{_bindir}/maildiracl
%attr(755,root,root) %{_bindir}/maildirkw
%files common
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog imap/BUGS INSTALL README*
-%attr(750,root,root) %dir %{_sysconfdir}
+%attr(751,root,root) %dir %{_sysconfdir}
%attr(750,root,root) %dir %{_certsdir}
%attr(770,daemon,daemon) %dir %{_localstatedir}
%dir %{_libexecdir}
%{_sysconfdir}/quotawarnmsg.example
%attr(755,root,root) %{_bindir}/couriertls
%attr(755,root,root) %{_libexecdir}/couriertcpd
-%attr(755,root,root) %{_libexecdir}/makedatprog
%{_mandir}/man1/couriert*
%{_mandir}/man8/couriert*
%{_mandir}/man8/mk*