]> git.pld-linux.org Git - packages/courier-imap.git/blobdiff - courier-imap.spec
- version -> version-release
[packages/courier-imap.git] / courier-imap.spec
index bcf5ba8620b3ae3e4911205b2ca736e5651a5834..93781c9acd9a51256777cb4e23379a0579f5f9ea 100644 (file)
@@ -1,18 +1,17 @@
 #
 # Conditional build:
-# _without_ldap - without LDAP support
-# _without_mysql - without MySQL support
-# _without_pgsql - without PostgreSQL support
-#
+%bcond_without ldap    # without LDAP support
+%bcond_without mysql   # without MySQL support
+%bcond_without pgsql   # without PostgreSQL support
 Summary:       Courier-IMAP server
 Summary(pl):   Serwer Courier-IMAP
 Name:          courier-imap
-Version:       1.7.0
-Release:       1
+Version:       2.2.1
+Release:       4
 License:       GPL
 Group:         Networking/Daemons
 Source0:       http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
-# Source0-md5: f74abb58b45810cc485426bc8bad14e6
+# Source0-md5: 27c90ce2ac2412bc90994cacbd75616b
 Source1:       %{name}.init
 Source2:       %{name}-pop3.init
 Source3:       %{name}-authdaemon.init
@@ -21,23 +20,27 @@ Source5:    %{name}-pop3.pamd
 Source6:       %{name}.sysconfig
 Source7:       %{name}-pop3.sysconfig
 Source8:       %{name}-authdaemon.sysconfig
-# Patch0:              ftp://ftp.pld.org.pl/people/siefca/patches/courier/%{name}-myownquery.patch
+Patch0:                %{name}-no_res_query.patch
 URL:           http://www.inter7.com/courierimap/
-%{!?_without_pgsql:BuildRequires:      postgresql-devel}
-%{!?_without_mysql:BuildRequires:      mysql-devel}
-%{!?_without_mysql:BuildRequires:      zlib-devel}
-%{!?_without_ldap:BuildRequires:       openldap-devel}
+BuildRequires: autoconf
+BuildRequires: automake
 BuildRequires: gdbm-devel
 BuildRequires: libstdc++-devel
-BuildRequires: openssl-devel >= 0.9.7
+%{?with_mysql:BuildRequires:   mysql-devel}
+%{?with_ldap:BuildRequires:    openldap-devel}
+BuildRequires: openssl-devel >= 0.9.7c
+%{?with_pgsql:BuildRequires:   postgresql-devel}
+BuildRequires: sysconftool
+%{?with_mysql:BuildRequires:   zlib-devel}
 PreReq:                %{name}-common = %{version}
 PreReq:                rc-scripts
 Requires(post,preun):  /sbin/chkconfig
+Requires:      pam >= 0.77.3
 Provides:      imapdaemon
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 Obsoletes:     imapdaemon
 Conflicts:     cyrus-imapd
 Conflicts:     imap
-BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _libexecdir     /usr/lib/courier-imap
 %define                _sysconfdir     /etc/courier-imap
@@ -54,8 +57,8 @@ Summary(pl):  Pliki wsp
 Group:         Networking/Daemons
 PreReq:                rc-scripts
 Requires(post,preun):  /sbin/chkconfig
-Requires:      %{name}-maildirmake
 Requires:      %{name}-deliverquota
+Requires:      %{name}-maildirmake
 Requires:      %{name}-userdb
 
 %description common
@@ -105,13 +108,14 @@ formacie Maildir.
 Summary:       Courier-IMAP POP3 Server
 Summary(pl):   Serwer Courier-IMAP POP3
 Group:         Networking/Daemons
-PreReq:                %{name}-common = %{version}
+PreReq:                %{name}-common = %{version}-%{release}
+Requires:      pam >= 0.77.3
 Provides:      pop3daemon
 Obsoletes:     pop3daemon
 Conflicts:     cyrus-imapd
 Conflicts:     imap-pop3
-Conflicts:     tpop3d
 Conflicts:     solid-pop3d
+Conflicts:     tpop3d
 
 %description pop3
 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
@@ -123,7 +127,7 @@ Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
 Summary:       LDAP authentication daemon for Courier IMAP
 Summary(pl):   Demon autentykacji LDAP do Courier IMAP
 Group:         Networking/Daemons
-PreReq:                %{name}-common = %{version}
+PreReq:                %{name}-common = %{version}-%{release}
 
 %description authldap
 This package provides LDAP authentication for Courier IMAP.
@@ -135,7 +139,7 @@ Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courier IMAP.
 Summary:       MySQL authentication daemon for Courier IMAP
 Summary(pl):   Demon autentykacji MySQL do Courier IMAP
 Group:         Networking/Daemons
-PreReq:                %{name}-common = %{version}
+PreReq:                %{name}-common = %{version}-%{release}
 Requires:      zlib
 
 %description authmysql
@@ -148,7 +152,7 @@ Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courier IMAP.
 Summary:       PostgreSQL authentication daemon for Courier IMAP
 Summary(pl):   Demon autentykacji PostgreSQL do Courier IMAP
 Group:         Networking/Daemons
-PreReq:                %{name}-common = %{version}
+PreReq:                %{name}-common = %{version}-%{release}
 
 %description authpgsql
 This package provides PostgreSQL authentication for Courier IMAP.
@@ -159,18 +163,25 @@ IMAP.
 
 %prep
 %setup -q
-#%patch0 -p1
+%patch0 -p1
 
 %build
+cp -f /usr/share/automake/config.sub .
+cp -f /usr/share/automake/config.sub maildir
+cd authlib
+%{__aclocal}
+%{__automake}
+%{__autoconf}
+cd ..
 %configure \
        --enable-unicode \
        --with-authchangepwdir=/var/tmp \
        --with-authdaemonvar=/var/lib/authdaemon \
-       %{!?_without_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
-       %{?_without_mysql:--without-authmysql} \
-       %{!?_without_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
-       %{?_without_pgsql:--without-authpgsql} \
-       %{?_without_ldap:--without-authldap}
+       %{?with_mysql:--with-mysql-libs=%{_libdir} --with-mysql-includes=%{_includedir}/mysql} \
+       %{!?with_mysql:--without-authmysql} \
+       %{?with_pgsql:--with-pgsql-libs=%{_libdir} --with-pgsql-includes=%{_includedir}/postgresql} \
+       %{!?with_pgsql:--without-authpgsql} \
+       %{!?with_ldap:--without-authldap}
 
 %{__make}
 
@@ -179,7 +190,8 @@ rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,security,sysconfig} \
        $RPM_BUILD_ROOT{%{_sysconfdir},/var/lib/authdaemon}
 
-%{__make} install DESTDIR=$RPM_BUILD_ROOT
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
 
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
@@ -223,9 +235,9 @@ echo ".so man7/authlib.7"   >$RPM_BUILD_ROOT%{_mandir}/man8/authuserdb.8
 echo ".so man7/authlib.7"      >$RPM_BUILD_ROOT%{_mandir}/man8/authvchkpw.8
 echo ".so man7/authlib.7"      >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemon.8
 echo ".so man7/authlib.7"      >$RPM_BUILD_ROOT%{_mandir}/man8/authdaemond.8
-%{!?_without_pgsql:echo ".so man7/authlib.7"   >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
-%{!?_without_mysql:echo ".so man7/authlib.7"   >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
-%{!?_without_ldap:echo ".so man7/authlib.7"    >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
+%{?with_pgsql:echo ".so man7/authlib.7"        >$RPM_BUILD_ROOT%{_mandir}/man8/authpgsql.8}
+%{?with_mysql:echo ".so man7/authlib.7"        >$RPM_BUILD_ROOT%{_mandir}/man8/authmysql.8}
+%{?with_ldap:echo ".so man7/authlib.7" >$RPM_BUILD_ROOT%{_mandir}/man8/authldap.8}
 echo ".so makeuserdb.8"        >$RPM_BUILD_ROOT%{_mandir}/man8/pw2userdb.8
 echo ".so makeuserdb.8"        >$RPM_BUILD_ROOT%{_mandir}/man8/vchkpw2userdb.8
 
@@ -271,7 +283,7 @@ fi
 
 %post pop3
 /sbin/chkconfig --add courier-pop3
-/sbin/chkconfig --del courier-imap-pop3 2>&1 >/dev/null
+/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
@@ -291,7 +303,7 @@ if [ "$1" = "0" ]; then
        if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
                /etc/rc.d/init.d/courier-imap-pop3 stop >&2
        fi
-       /sbin/chkconfig --del courier-imap-pop3 2>&1 >/dev/null
+       /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
        rm -f /etc/rc.d/init.d/courier-imap-pop3
 fi
 
@@ -308,11 +320,13 @@ fi
 
 %preun authldap
 METHOD=plain
-. /etc/sysconfig/authdaemon
-if [ "$1" = "$0" -a "$METHOD" = "ldap" ]; then
-       if [ -f /var/lock/subsys/authdaemon ]; then
-               /etc/rc.d/init.d/authdaemon stop >&2
-       fi
+if [ -e /etc/sysconfig/authdaemon ]; then
+    . /etc/sysconfig/authdaemon
+    if [ "$1" = "$0" -a "$METHOD" = "ldap" ]; then
+           if [ -f /var/lock/subsys/authdaemon ]; then
+                   /etc/rc.d/init.d/authdaemon stop >&2
+           fi
+    fi
 fi
 
 %post authmysql
@@ -328,13 +342,37 @@ fi
 
 %preun authmysql
 METHOD=plain
+if [ -e /etc/sysconfig/authdaemon ]; then
+    . /etc/sysconfig/authdaemon
+    if [ "$1" = "$0" -a "$METHOD" = "mysql" ]; then
+           if [ -f /var/lock/subsys/authdaemon ]; then
+                   /etc/rc.d/init.d/authdaemon stop >&2
+           fi
+    fi
+fi
+
+%post authpgsql
+METHOD=plain
 . /etc/sysconfig/authdaemon
-if [ "$1" = "$0" -a "$METHOD" = "mysql" ]; then
+if [ "$METHOD" = "pgsql" ]; then
        if [ -f /var/lock/subsys/authdaemon ]; then
-               /etc/rc.d/init.d/authdaemon stop >&2
+               /etc/rc.d/init.d/authdaemon restart >&2
+       else
+               echo "Run \"/etc/rc.d/init.d/authdaemon start\" to start courier-imap authdaemon."
        fi
 fi
 
+%preun authpgsql
+METHOD=plain
+if [ -e /etc/sysconfig/authdaemon ]; then
+    . /etc/sysconfig/authdaemon
+    if [ "$1" = "$0" -a "$METHOD" = "pgsql" ]; then
+           if [ -f /var/lock/subsys/authdaemon ]; then
+                   /etc/rc.d/init.d/authdaemon stop >&2
+           fi
+    fi
+fi
+
 %files
 %defattr(644,root,root,755)
 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/pam.d/imap
@@ -343,9 +381,11 @@ fi
 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
 %{_sysconfdir}/imapd.cnf
 %attr(755,root,root) %{_bindir}/imapd
+%attr(755,root,root) %{_bindir}/maildirkw
 %attr(755,root,root) %{_sbindir}/imaplogin
 %attr(755,root,root) %{_sbindir}/mkimapdcert
 %{_mandir}/man8/imapd*
+%{_mandir}/man1/maildirkw.1*
 
 %files common
 %defattr(644,root,root,755)
@@ -368,6 +408,7 @@ fi
 %{_mandir}/man8/authp[aw]*
 %{_mandir}/man7/authlib*
 %{_mandir}/man1/couriert*
+%{_mandir}/man8/couriert*
 %{_mandir}/man8/mk*
 
 %files userdb
@@ -403,7 +444,7 @@ fi
 %{_sysconfdir}/pop3d.cnf
 %{_mandir}/man8/courierpop*
 
-%if %{?_without_ldap:0}%{!?_without_ldap:1}
+%if %{with ldap}
 %files authldap
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
@@ -411,7 +452,7 @@ fi
 %{_mandir}/man8/authldap*
 %endif
 
-%if %{?_without_mysql:0}%{!?_without_mysql:1}
+%if %{with mysql}
 %files authmysql
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
@@ -419,7 +460,7 @@ fi
 %{_mandir}/man8/authmysql*
 %endif
 
-%if %{?_without_pgsql:0}%{!?_without_pgsql:1}
+%if %{with pgsql}
 %files authpgsql
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
This page took 0.040164 seconds and 4 git commands to generate.