# TODO
# - test and bump rel. to 1
# - doesn't -webadmin need webserver integration?
+# - use rc-scripts here in %%post scriptlets
#
# Conditional build:
%bcond_without fam # with fam support
Summary(pl): Serwer poczty Courier
Name: courier
Version: 0.52.2
-Release: 1
+Release: 2
License: GPL
Group: Networking/Daemons
-# !!! Don't change it !!!
-Source0: http://heanet.dl.sourceforge.net/sourceforge/courier/%{name}-%{version}.tar.bz2
+Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
# Source0-md5: 73cda41adc5425ade94e1f9005b2218b
Patch0: %{name}-openssl-path.patch
Patch1: %{name}-withoutfam.patch
BuildRequires: sed >= 4.0
BuildRequires: sysconftool
Requires(post,preun): /sbin/chkconfig
+Requires(post,preun): rc-scripts
# only for light upgrade from old version < 0.47
# remove it after some time
Requires(post): courier-authlib-userdb
Group: Networking/Daemons
Requires: %{name} = %{version}-%{release}
Requires: FHS >= 2.3-12
-Requires: webserver = apache
Requires: webapps
+Requires: webserver = apache
Conflicts: apache-base < 2.2.0-8
Conflicts: apache1 < 1.3.34-5.11
Group: Networking/Daemons
Requires: %{name} = %{version}-%{release}
Requires: FHS >= 2.3-12
-Requires: webserver = apache
Requires: webapps
+Requires: webserver = apache
Conflicts: apache-base < 2.2.0-8
Conflicts: apache1 < 1.3.34-5.11
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.authpam
for X in imap esmtp pop3 webmail calendar
do
- cat > $RPM_BUILD_ROOT/etc/pam.d/$X <<EOF
+ cat > $RPM_BUILD_ROOT/etc/pam.d/$X <<'EOF'
#%PAM-1.0
auth required pam_unix.so shadow nullok
account required pam_unix.so
echo
%post
-/sbin/chkconfig --add courier
-
if [ "$1" = "1" ]; then
- /bin/hostname -f > /etc/courier/me
- # TODO: use %banner
- cat <<EOF
+ [ -s %{_sysconfdir}/me ] || /bin/hostname -f > %{_sysconfdir}/me
+ %banner -e %{name} <<'EOF'
Now courier will refuse to accept SMTP messages except to localhost
-add hosts to /etc/courier/esmtpacceptmailfor.dir/default
+add hosts to %{_sysconfdir}/esmtpacceptmailfor.dir/default
run makeacceptmailfor
-Add hosts to /etc/courier/locals you want to accept mail for
+Add hosts to %{_sysconfdir}/locals you want to accept mail for
run makealiases
Enter user, who should receive mail for root, mailer-daemon and postmaster
-into /etc/courier/aliases/system
+into %{_sysconfdir}/aliases/system
Default maildir is in ~/Mail/Maildir
EOF
fi
-if [ -e /var/lock/subsys/courier ]; then
- %{_initrddir}/courier restart
-else
- echo
- echo 'Type "%{_initrddir}/courier start" to start courier'
- echo
-fi
+/sbin/chkconfig --add courier
+%service courier restart
%preun
if [ "$1" = "0" ]; then
- if [ -e /var/lock/subsys/courier ]; then
- %{_initrddir}/courier stop
- fi
+ %service courier stop
/sbin/chkconfig --del courier
fi
%post imapd
+# TODO: use rc-scripts here
if [ -e %{_localstatedir}/tmp/imapd.pid ]; then
%{_sbindir}/imapd stop
%{_sbindir}/imapd start
fi
fi
-%triggerin webmail -- apache1
+%triggerin webmail -- apache1 < 1.3.37-3, apache1-base
%webapp_register apache courier-webmail
-%triggerun webmail -- apache1
+%triggerun webmail -- apache1 < 1.3.37-3, apache1-base
%webapp_unregister apache courier-webmail
-%triggerin webmail -- apache >= 2.0.0
+%triggerin webmail -- apache < 2.2.0, apache-base
%webapp_register httpd courier-webmail
-%triggerun webmail -- apache >= 2.0.0
+%triggerun webmail -- apache < 2.2.0, apache-base
%webapp_unregister httpd courier-webmail
%triggerpostun webmail -- courier-webmail < 0.52.2-0.2
%attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/locals
%attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/courierd
%attr(640,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/aliases/system
-%attr(644,root,root) %{_sysconfdir}/quotawarnmsg.example
+%{_sysconfdir}/quotawarnmsg.example
%dir %{_libdir}
%dir %{_libdir}/courier
%dir %{_datadir}
%attr(755,root,root) %{_bindir}/testmxlookup
%attr(640,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ldapaliasrc
%attr(700,daemon,daemon) %{_sbindir}/courierldapaliasd
-%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/esmtp
+%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/esmtp
%attr(754,root,root) /etc/rc.d/init.d/courier
%attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
%attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
%files pop3d
%defattr(644,root,root,755)
%doc htmldoc/*pop3d*
-%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
+%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
%{_mandir}/man8/courierpop3d.8*
%{_mandir}/man8/courierpop3login.8*
%{_mandir}/man8/mkpop3dcert.8*
%files imapd
%defattr(644,root,root,755)
%doc htmldoc/*imapd*
-%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
+%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
%{_mandir}/man8/imapd.8*
%{_mandir}/man8/mkimapdcert.8*
%attr(755,root,root) %{_datadir}/courierwebadmin/admin-40imap.pl
-%attr(644,root,root) %{_datadir}/courierwebadmin/admin-40imap.html
+%{_datadir}/courierwebadmin/admin-40imap.html
%attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
%attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
%attr(600,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
%defattr(644,root,root,755)
%doc htmldoc/pcp* gpglib/README.html
%attr(755,root,root) %{_cgibindir}/webmail
-%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/webmail
-%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/calendar
+%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/webmail
+%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/calendar
%attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sqwebmaild
%attr(755,root,root) %{_sbindir}/webmaild
%dir %{_datadir}/sqwebmail