X-Git-Url: http://git.pld-linux.org/?p=packages%2Fcourier.git;a=blobdiff_plain;f=courier.spec;h=b00b1e95b71885145764eb18e17bb536fe123d2a;hp=aa152398e8b69305a2efd8889fb3e0dff64d21d7;hb=c0bdab2363ebcb0ef700dfc0eb3f023445575637;hpb=ed6b22b87c0ba156934b6a7b7135d848ffea68d9
diff --git a/courier.spec b/courier.spec
index aa15239..b00b1e9 100644
--- a/courier.spec
+++ b/courier.spec
@@ -1,45 +1,56 @@
+# TODO
+# - test and bump rel. to 1
+# - doesn't -webadmin need webserver integration?
#
# Conditional build:
-%bcond_with fam # with fam support
+%bcond_without fam # with fam support
+%bcond_with tests # without tests
#
Summary: Courier mail server
Summary(pl): Serwer poczty Courier
Name: courier
-Version: 0.45.4
+Version: 0.52.2
Release: 1
License: GPL
Group: Networking/Daemons
-Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
-# Source0-md5: ab2a668fe590f42c40649b62af704995
-Patch0: %{name}-openssl-path.patch
+# !!! Don't change it !!!
+Source0: http://heanet.dl.sourceforge.net/sourceforge/courier/%{name}-%{version}.tar.bz2
+# Source0-md5: 73cda41adc5425ade94e1f9005b2218b
+Patch0: %{name}-openssl-path.patch
Patch1: %{name}-withoutfam.patch
Patch2: %{name}-maildir.patch
Patch3: %{name}-sendmail_dir.patch
Patch4: %{name}-start_scripts.patch
-Patch5: %{name}-fix_build.patch
+Patch5: %{name}-certs.patch
+Patch6: %{name}-db.patch
URL: http://www.courier-mta.org/
BuildRequires: autoconf
BuildRequires: automake
-BuildRequires: db-devel
+BuildRequires: courier-authlib-devel >= 0.57
BuildRequires: expect
+%{?with_fam:BuildRequires: fam-devel}
+BuildRequires: gettext-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: mailcap
-BuildRequires: mysql-devel
-BuildRequires: openldap-devel
+BuildRequires: openldap-devel >= 2.3.0
BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: openssl-tools >= 0.9.7d
BuildRequires: openssl-tools-perl >= 0.9.7d
BuildRequires: pam-devel
+BuildRequires: pcre-devel
BuildRequires: perl-devel
-BuildRequires: postgresql-devel
+BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: sed >= 4.0
BuildRequires: sysconftool
-BuildRequires: zlib-devel
-%{?with_fam:BuildRequires: fam-devel}
Requires(post,preun): /sbin/chkconfig
+# only for light upgrade from old version < 0.47
+# remove it after some time
+Requires(post): courier-authlib-userdb
Requires(post): openssl-tools >= 0.9.7d
-%{?with_fam:Requires: fam}
+Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
Provides: smtpdaemon
+Obsoletes: courier-smtpauth
Obsoletes: exim
Obsoletes: masqmail
Obsoletes: nullmailer
@@ -55,21 +66,18 @@ Obsoletes: ssmtp
Obsoletes: zmailer
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define apachedir /home/services/httpd
%define _datadir %{_prefix}/share/courier
-%define _mandir /usr/share/man
-%define _libdir %{_prefix}/%{_lib}/courier
+%define _libdir %{_prefix}/%{_lib}/%{name}
%define _libexecdir %{_libdir}
%define _localstatedir /var/spool/courier
%define _sysconfdir /etc/courier
-%define initdir /etc/rc.d/init.d
+%define _certsdir %{_sysconfdir}/certs
+%define _initrddir /etc/rc.d/init.d
-# Change the following if your DocumentRoot and cgibindir differ. This is
-# the default redhat build:
-
-%define _cgibindir %{apachedir}/cgi-bin
-%define _documentrootdir %{apachedir}/html
-%define _imageurl /webmail/
+%define _webapps /etc/webapps
+%define _cgibindir %{_prefix}/lib/cgi-bin
+%define _imagedir %{_datadir}/sqwebmail/images
+%define _imageurl /webmail
%description
Courier is a fully functional mail server, that can completely take
@@ -87,8 +95,8 @@ management and spam filtering.
Courier jest w pe³ni funkcjonalnym serwerem poczty, mo¿e ca³kowicie
zast±piæ us³ugi pocztowe dawane przez sendmail, Qmaila i inne serwery.
Wprawdzie Courier nie ma wszystkich mo¿liwo¶ci istniej±cych serwerów,
-ilo¶æ nie obs³ugiwanych funkcji jest bardzo ma³a, i s± dostêpne
-lepsze alternatywy.
+ilo¶æ nie obs³ugiwanych funkcji jest bardzo ma³a, i s± dostêpne lepsze
+alternatywy.
Courier zawiera wiele rozszerzeñ SMTP: DSN, PIPELINING, 8BITMIME. Ma
tak¿e nowe rozszerzenia SMTP dla pocztowych list dyskusyjnych i
@@ -98,8 +106,8 @@ filtrowania spamu.
Summary: Courier Integrated POP3 server
Summary(pl): Zintegrowany serwer POP3 do Couriera
Group: Networking/Daemons
-Requires: %{name} = %{version}-%{release}
Requires(post): openssl-tools >= 0.9.7d
+Requires: %{name} = %{version}-%{release}
%description pop3d
This package installs Courier mail server's integrated POP3 server,
@@ -119,8 +127,8 @@ obs
Summary: Courier Integrated IMAP server
Summary(pl): Zintegrowany serwer IMAP do Couriera
Group: Networking/Daemons
-Requires: %{name} = %{version}-%{release}
Requires(post): openssl-tools >= 0.9.7d
+Requires: %{name} = %{version}-%{release}
Obsoletes: courier-imap
Obsoletes: courier-imap-common
@@ -141,7 +149,7 @@ standalone version.
%description imapd -l pl
Ten pakiet zawiera zintegrowany serwer IMAP do Couriera. Pozwala
¶ci±gaæ pocztê przy pomocy klienta IMAP. Serwer IMAP Couriera mo¿e byæ
-u¿ywany tylko ze skrzynami Maildir, nie obs³uguje skrzynek w postaci
+u¿ywany tylko ze skrzynkami Maildir, nie obs³uguje skrzynek w postaci
pojedynczych plików.
Ten pakiet wymaga serwera Courier, to NIE jest samodzielna wersja
@@ -154,8 +162,11 @@ Summary: Courier Integrated HTTP administraton panel
Summary(pl): Panel administracyjny przez HTTP dla Couriera
Group: Networking/Daemons
Requires: %{name} = %{version}-%{release}
-Requires: %{_cgibindir}
-Requires: webserver
+Requires: FHS >= 2.3-12
+Requires: webserver = apache
+Requires: webapps
+Conflicts: apache-base < 2.2.0-8
+Conflicts: apache1 < 1.3.34-5.11
%description webadmin
This is a web-based administration tool. Webadmin is a web CGI
@@ -169,8 +180,11 @@ Summary: Courier Integrated HTTP (webmail) server
Summary(pl): Zintegrowany serwer poczty przez HTTP (webmail) do Couriera
Group: Networking/Daemons
Requires: %{name} = %{version}-%{release}
-Requires: %{_cgibindir}
-Requires: %{_documentrootdir}
+Requires: FHS >= 2.3-12
+Requires: webserver = apache
+Requires: webapps
+Conflicts: apache-base < 2.2.0-8
+Conflicts: apache1 < 1.3.34-5.11
%description webmail
This package installs Courier mail server's integrated HTTP webmail
@@ -202,7 +216,8 @@ Requires: %{name} = %{version}-%{release}
This package contains tools for mail folders in Maildir format.
%description maildir-tools -l pl
-Ten pakiet zawiera narzêdzia do zarz±dzania folderami w formacie Maildir.
+Ten pakiet zawiera narzêdzia do zarz±dzania folderami w formacie
+Maildir.
%package mlm
Summary: Courier Integrated Mailing List Manager
@@ -246,57 +261,6 @@ incoming mail.
Ten pakiet zawiera zintegrowany filtr poczty dla Couriera. Jest
potrzebny do filtrowania przychodz±cej poczty.
-%package smtpauth
-Summary: Courier mail server authenticated ESMTP module
-Summary(pl): Modu³ uwierzytelniania ESMTP (SMTP AUTH) do Couriera
-Group: Networking/Daemons
-Requires: %{name} = %{version}-%{release}
-
-%description smtpauth
-Authenticated ESMTP allows remote users to authenticate themselves and
-be able to relay outbound mail through the Courier mail server.
-
-%description smtpauth -l pl
-SMTP AUTH pozwala zdalnym u¿ytkownikom na uwierzytelnianie i
-umo¿liwienie przekazania wychodz±cej poczty poprzez serwer poczty
-Courier.
-
-%package authldap
-Summary: LDAP authentication daemon for Courier mail server
-Summary(pl): Demon autentykacji LDAP do Couriera
-Group: Networking/Daemons
-PreReq: %{name} = %{version}-%{release}
-
-%description authldap
-This package provides LDAP authentication for Courier.
-
-%description authldap -l pl
-Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courierze.
-
-%package authmysql
-Summary: MySQL authentication daemon for Courier mail server
-Summary(pl): Demon autentykacji MySQL do Couriera
-Group: Networking/Daemons
-PreReq: %{name} = %{version}-%{release}
-
-%description authmysql
-This package provides MySQL authentication for Courier.
-
-%description authmysql -l pl
-Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courierze.
-
-%package authpgsql
-Summary: PostgreSQL authentication daemon for Courier mail server
-Summary(pl): Demon autentykacji PostgreSQL do Couriera
-Group: Networking/Daemons
-PreReq: %{name} = %{version}-%{release}
-
-%description authpgsql
-This package provides PostgreSQL authentication for Courier.
-
-%description authpgsql -l pl
-Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courierze.
-
%prep
%setup -q
%patch0 -p1
@@ -305,55 +269,64 @@ Ten pakiet pozwala na korzystanie z autentykacji PostgreSQL w Courierze.
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
+
+echo "
+Alias /webmail %{_imagedir}
+
+ AllowOverride None
+ Options None
+ # FIXME: is allow from all the most safest way?
+ Allow from all
+
+" > apache.conf
%build
# we don't want fax module
rm -rf courier/module.fax
cp -f /usr/share/automake/config.sub webmail
-cd rootcerts
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%{__automake}
-cd ..
-
-cd authlib
-%{__aclocal}
-%{__autoconf}
-%{__automake}
-cd ..
-
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%{__automake}
-
-cd courier
-%{__aclocal}
-%{__autoconf}
-ln -s ../ltmain.sh .
-%{__automake}
-cd ..
+# 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"`"
+
+ if [ -f Makefile.am ]; then
+ sed -i -e '/_[L]DFLAGS=-static/d' Makefile.am
+ fi
+
+ %{__libtoolize}
+ %{__aclocal}
+ %{__autoconf}
+ %{__autoheader}
+ %{__automake}
+
+ cd "$OLDDIR"
+done
%configure \
--localstatedir=%{_localstatedir} \
--sysconfdir=%{_sysconfdir} \
--mandir=%{_mandir} \
+ --enable-imagedir=%{_imagedir} \
--enable-imageurl=%{_imageurl} \
+ --with-certsdir=%{_certsdir} \
--with-db=db \
- --with-mailer=%{_sbindir}/sendmail
+ --with-mailer=%{_sbindir}/sendmail \
+ --with-mailuser=daemon \
+ --with-mailgroup=daemon \
+ --with-mailuid=2 \
+ --with-mailgid=2
%{__make}
-%{__make} check
+%{!?with_tests:%{__make} check}
%install
rm -rf $RPM_BUILD_ROOT
umask 022
-install -d -p $RPM_BUILD_ROOT{%{_prefix}/lib,/etc/{cron.hourly,pam.d},%{initdir}} \
- $RPM_BUILD_ROOT{%{_cgibindir},%{_documentrootdir}} \
- $RPM_BUILD_ROOT{%{_sysconfdir}/{userdb,hosteddomains},%{_localstatedir}{/calendar,/tmp/broken}} \
- $RPM_BUILD_ROOT/etc/cron.hourly
+install -d -p $RPM_BUILD_ROOT{/etc/{cron.hourly,pam.d},%{_initrddir}} \
+ $RPM_BUILD_ROOT{%{_prefix}/lib,%{_cgibindir},%{_webapps}/courier-webmail,%{_sysconfdir}/hosteddomains} \
+ $RPM_BUILD_ROOT{/etc/cron.hourly,%{_certsdir}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
@@ -362,7 +335,7 @@ install -d -p $RPM_BUILD_ROOT{%{_prefix}/lib,/etc/{cron.hourly,pam.d},%{initdir}
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.authpam
for X in imap esmtp pop3 webmail calendar
do
-cat > $RPM_BUILD_ROOT/etc/pam.d/$X < $RPM_BUILD_ROOT/etc/pam.d/$X < $RPM_BUILD_ROOT%{_mandir}/man1/dotforward.1
echo '.so sendmail.1' > $RPM_BUILD_ROOT%{_mandir}/man1/rmail.1
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authcram.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authdaemon.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authdaemond.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authldap.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authmysql.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authpgsql.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authpam.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authpwd.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authshadow.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authuserdb.7
-echo '.so authlib.7' > $RPM_BUILD_ROOT%{_mandir}/man7/authvchkpw.7
echo '.so esmtpd.8' > $RPM_BUILD_ROOT%{_mandir}/man8/esmtpd-msa.8
echo '.so courierfilter.8' > $RPM_BUILD_ROOT%{_mandir}/man8/filterctl.8
echo '.so makesmtpaccess.8' > $RPM_BUILD_ROOT%{_mandir}/man8/makesmtpaccess-msa.8
echo '.so courieruucp.8' > $RPM_BUILD_ROOT%{_mandir}/man8/makeuucpneighbors.8
-echo '.so makeuserdb.8' > $RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
-echo '.so makeuserdb.8' > $RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
echo '.so courierpop3d.8' > $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3login.8
%{__make} install-perms
# Move webmail and webadmin to cgibindir
-mv -f $RPM_BUILD_ROOT%{_libexecdir}/courier/webmail/webmail \
+mv -f $RPM_BUILD_ROOT%{_libdir}/courier/webmail/webmail \
$RPM_BUILD_ROOT%{_cgibindir}/webmail
-mv -f $RPM_BUILD_ROOT%{_libexecdir}/courier/webmail/webadmin \
+mv -f $RPM_BUILD_ROOT%{_libdir}/courier/webmail/webadmin \
$RPM_BUILD_ROOT%{_cgibindir}/webadmin
-# And here's why we delete all images from filelist.webmail:
-mv -f $RPM_BUILD_ROOT%{_datadir}/sqwebmail/images $RPM_BUILD_ROOT%{_documentrootdir}/webmail
-
# install a cron job to clean out webmail's cache
install webmail/cron.cmd $RPM_BUILD_ROOT/etc/cron.hourly/courier-webmail-cleancache
@@ -438,31 +383,29 @@ chmod a-w htmldoc/*
# Manually set POP3DSTART and IMAPDSTART to yes, they'll go into a separate
# package, so after it's installed they should be runnable.
-sed 's/^POP3DSTART.*/POP3DSTART=YES/' <$RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist >$RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new
-mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.new $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist
-
-sed 's/^POP3DSSLSTART.*/POP3DSSLSTART=YES/' <$RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist >$RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.new
-mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.new $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist
-
-sed 's/^IMAPDSTART.*/IMAPDSTART=YES/' <$RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist >$RPM_BUILD_ROOT%{_sysconfdir}/imapd.new
-mv -f $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new $RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist
-
-sed 's/^IMAPDSSLSTART.*/IMAPDSSLSTART=YES/' <$RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist >$RPM_BUILD_ROOT%{_sysconfdir}/imapd.new-ssl
-mv -f $RPM_BUILD_ROOT%{_sysconfdir}/imapd.new-ssl $RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist
+sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d.dist
+sed -i 's/^POP3DSSLSTART.*/POP3DSSLSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d-ssl.dist
+sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd.dist
+sed -i 's/^IMAPDSSLSTART.*/IMAPDSSLSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd-ssl.dist
# Want to have esmtpd running by default
-sed 's/^ESMTPDSTART.*/ESMTPDSTART=YES/' <$RPM_BUILD_ROOT%{_sysconfdir}/esmtpd.dist >$RPM_BUILD_ROOT%{_sysconfdir}/esmtpd.new
-mv -f $RPM_BUILD_ROOT%{_sysconfdir}/esmtpd.new $RPM_BUILD_ROOT%{_sysconfdir}/esmtpd.dist
+sed -i 's/^ESMTPDSTART.*/ESMTPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/esmtpd.dist
# run script from install-configure (make config files)
for confdist in `awk ' $5 == "config" && $1 ~ /\.dist$/ { print $1 }' $RPM_BUILD_ROOT%{_sysconfdir}/bofh <$RPM_BUILD_ROOT/etc/profile.d/courier.sh <$RPM_BUILD_ROOT/etc/profile.d/courier.csh </etc/courier/me
-cat < /etc/courier/me
+ # TODO: use %banner
+ cat <