- spec file cleanup

- update sieve plugin to 1.0.3
- Resolves: #445200, #238018
This commit is contained in:
Dan Horák 2008-05-21 12:39:41 +00:00
parent 80b85ac3db
commit 32ffc73cd1
10 changed files with 133 additions and 22700 deletions

View File

@ -1,4 +1,4 @@
dovecot-1.0.13.tar.gz
dovecot-1.0.13.tar.gz.sig
dovecot-sieve-1.0.2.tar.gz
dovecot-sieve-1.0.2.tar.gz.sig
dovecot-sieve-1.0.3.tar.gz
dovecot-sieve-1.0.3.tar.gz.sig

File diff suppressed because it is too large Load Diff

View File

@ -1,89 +0,0 @@
--- dovecot-1.1.alpha1/dovecot-example.conf.default-settings 2007-07-19 03:49:18.000000000 +0200
+++ dovecot-1.1.alpha1/dovecot-example.conf 2007-07-19 10:56:26.000000000 +0200
@@ -10,17 +10,14 @@
# value inside quotes, eg.: key = "# char and trailing whitespace "
# Default values are shown for each setting, it's not required to uncomment
-# any of the lines. Exception to this are paths, they're just examples with
-# the real defaults being based on configure options. The paths listed here
-# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
-# --with-ssldir=/etc/ssl
+# any of the lines.
# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/
# Protocols we want to be serving: imap imaps pop3 pop3s
# If you only want to use dovecot-auth, you can set this to "none".
-#protocols = imap imaps
+#protocols = imap imaps pop3 pop3s
# A space separated list of IP or host addresses where to listen in for
# connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
@@ -39,13 +36,13 @@
# listen = *:10100
# ..
# }
-#listen = *
+#listen = [::]
# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
# matches the local IP (ie. you're connecting from the same computer), the
# connection is considered secure and plaintext authentication is allowed.
-#disable_plaintext_auth = yes
+#disable_plaintext_auth = no
# Should all IMAP and POP3 processes be killed when Dovecot master process
# shuts down. Setting this to "no" means that Dovecot can be upgraded without
@@ -91,8 +88,8 @@
# dropping root privileges, so keep the key file unreadable by anyone but
# root. Included doc/mkcert.sh can be used to easily generate self-signed
# certificate, just make sure to update the domains in dovecot-openssl.cnf
-#ssl_cert_file = /etc/ssl/certs/dovecot.pem
-#ssl_key_file = /etc/ssl/private/dovecot.pem
+#ssl_cert_file = /etc/pki/dovecot/certs/dovecot.pem
+#ssl_key_file = /etc/pki/dovecot/private/dovecot.pem
# If key file is password protected, give the password here. Alternatively
# give it when starting dovecot with -p parameter.
@@ -462,7 +459,7 @@
# locking methods as well. Some operating systems don't allow using some of
# them simultaneously.
#mbox_read_locks = fcntl
-#mbox_write_locks = dotlock fcntl
+#mbox_write_locks = fcntl
# Maximum time in seconds to wait for lock (all of them) before aborting.
#mbox_lock_timeout = 300
--- dovecot-1.1.alpha1/src/master/master-settings.c.default-settings 2007-07-19 03:49:18.000000000 +0200
+++ dovecot-1.1.alpha1/src/master/master-settings.c 2007-07-19 10:56:26.000000000 +0200
@@ -168,8 +168,8 @@
MEMBER(syslog_facility) "mail",
/* general */
- MEMBER(protocols) "imap imaps",
- MEMBER(listen) "*",
+ MEMBER(protocols) "imap imaps pop3 pop3s",
+ MEMBER(listen) "[::]",
MEMBER(ssl_listen) "",
MEMBER(ssl_disable) FALSE,
@@ -180,7 +180,7 @@
MEMBER(ssl_parameters_regenerate) 168,
MEMBER(ssl_cipher_list) "",
MEMBER(ssl_verify_client_cert) FALSE,
- MEMBER(disable_plaintext_auth) TRUE,
+ MEMBER(disable_plaintext_auth) FALSE,
MEMBER(verbose_ssl) FALSE,
MEMBER(shutdown_clients) TRUE,
MEMBER(nfs_check) TRUE,
@@ -243,7 +243,7 @@
MEMBER(maildir_copy_with_hardlinks) FALSE,
MEMBER(maildir_copy_preserve_filename) FALSE,
MEMBER(mbox_read_locks) "fcntl",
- MEMBER(mbox_write_locks) "dotlock fcntl",
+ MEMBER(mbox_write_locks) "fcntl",
MEMBER(mbox_lock_timeout) 300,
MEMBER(mbox_dotlock_change_timeout) 120,
MEMBER(mbox_min_index_size) 0,

File diff suppressed because it is too large Load Diff

View File

@ -1,86 +0,0 @@
diff -u dovecot-0.99.14/src/pop3-login/client-authenticate.c.orig dovecot-0.99.14/src/pop3-login/client-authenticate.c
--- dovecot-0.99.14/src/pop3-login/client-authenticate.c.orig 2005-07-27 16:52:12.936927405 -0400
+++ dovecot-0.99.14/src/pop3-login/client-authenticate.c 2005-07-27 16:52:31.806073234 -0400
@@ -139,6 +139,8 @@
master_callback, &error)) {
case -1:
/* login failed */
+ client_syslog(client,t_strdup_printf("AUTHENTICATE FAILED %s",
+ error ? error : ""));
client_auth_abort(client, error);
break;
@@ -214,6 +216,8 @@
master_callback, &error)) {
case -1:
/* login failed */
+ client_syslog(client,t_strdup_printf("AUTHENTICATE FAILED %s",
+ error ? error : ""));
client_auth_abort(client, error);
break;
diff -u dovecot-0.99.14/src/login-common/auth-common.c.orig dovecot-0.99.14/src/login-common/auth-common.c
diff -u dovecot-0.99.14/src/auth/mech.c.orig dovecot-0.99.14/src/auth/mech.c
--- dovecot-0.99.14/src/auth/mech.c.orig 2005-07-27 16:39:33.637767234 -0400
+++ dovecot-0.99.14/src/auth/mech.c 2005-07-27 16:41:10.206163232 -0400
@@ -162,6 +162,29 @@
return buffer_get_modifyable_data(buf, NULL);
}
+void *mech_auth_failure(struct auth_login_reply *reply,
+ struct auth_request *auth_request,
+ const void *data, size_t data_size)
+{
+ buffer_t *buf;
+
+ buf = buffer_create_dynamic(data_stack_pool, 256, (size_t)-1);
+
+ reply->username_idx = 0;
+ buffer_append(buf, auth_request->user, strlen(auth_request->user)+1);
+
+ if (data_size == 0)
+ reply->reply_idx = (size_t)-1;
+ else {
+ reply->reply_idx = buffer_get_used_size(buf);
+ buffer_append(buf, data, data_size);
+ }
+
+ reply->result = AUTH_LOGIN_RESULT_FAILURE;
+ reply->data_size = buffer_get_used_size(buf);
+ return buffer_get_modifyable_data(buf, NULL);
+}
+
void mech_auth_finish(struct auth_request *auth_request,
const void *data, size_t data_size, int success)
{
@@ -176,7 +199,8 @@
data, data_size);
reply.result = AUTH_LOGIN_RESULT_SUCCESS;
} else {
- reply_data = NULL;
+ reply_data = mech_auth_failure(&reply, auth_request,
+ data, data_size);
reply.result = AUTH_LOGIN_RESULT_FAILURE;
}
diff -u dovecot-0.99.14/src/imap-login/client-authenticate.c.orig dovecot-0.99.14/src/imap-login/client-authenticate.c
--- dovecot-0.99.14/src/imap-login/client-authenticate.c.orig 2005-07-27 16:46:43.986682432 -0400
+++ dovecot-0.99.14/src/imap-login/client-authenticate.c 2005-07-27 16:52:32.390984759 -0400
@@ -135,6 +135,8 @@
master_callback, &error)) {
case -1:
/* login failed */
+ client_syslog(client,t_strdup_printf("AUTHENTICATE FAILED %s",
+ error ? error : ""));
client_auth_abort(client, error);
break;
@@ -215,6 +217,8 @@
master_callback, &error)) {
case -1:
/* login failed */
+ client_syslog(client,t_strdup_printf("AUTHENTICATE FAILED %s",
+ error ? error : ""));
client_auth_abort(client, error);
break;

View File

@ -1,97 +0,0 @@
diff -r -u dovecot-0.99.13.orig/configure.in dovecot-0.99.13/configure.in
--- dovecot-0.99.13.orig/configure.in 2004-12-19 23:58:19.000000000 -0500
+++ dovecot-0.99.13/configure.in 2005-01-06 18:17:36.000000000 -0500
@@ -21,6 +21,13 @@
# check posix headers
AC_CHECK_HEADERS(sys/time.h)
+AC_ARG_WITH(docdir,
+[ --with-docdir=DIR directory for documentation (DATADIR/doc/dovecot)],
+ docdir="$withval",
+ docdir=\${datadir}/doc/dovecot
+)
+AC_SUBST(docdir)
+
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 Enable IPv6 support (default)],
if test x$enableval = xno; then
diff -r -u dovecot-0.99.13.orig/doc/Makefile.am dovecot-0.99.13/doc/Makefile.am
--- dovecot-0.99.13.orig/doc/Makefile.am 2004-12-29 12:35:07.000000000 -0500
+++ dovecot-0.99.13/doc/Makefile.am 2005-01-06 18:26:44.000000000 -0500
@@ -1,20 +1,28 @@
-docdir = $(datadir)/doc/dovecot
+exampledir=$(docdir)/examples
-doc_DATA = \
- USE-WIKI-INSTEAD \
- auth.txt \
- configuration.txt \
- design.txt \
- index.txt \
- mail-storages.txt \
- multiaccess.txt \
- nfs.txt \
+doc_DATA = \
+ USE-WIKI-INSTEAD \
+ auth.txt \
+ configuration.txt \
+ design.txt \
+ index.txt \
+ mail-storages.txt \
+ multiaccess.txt \
+ nfs.txt \
securecoding.txt
-EXTRA_DIST = \
- mkcert.sh \
- dovecot-openssl.cnf \
- dovecot-ldap.conf \
- dovecot-mysql.conf \
- dovecot-pgsql.conf \
+example_DATA = \
+ ../dovecot-example.conf \
+ mkcert.sh \
+ dovecot-openssl.cnf \
+ dovecot-ldap.conf \
+ dovecot-mysql.conf \
+ dovecot-pgsql.conf
+
+ssl_DATA = \
+ dovecot-openssl.cnf
+
+EXTRA_DIST = \
+ $(example_DATA) \
+ $(ssl_DATA) \
$(doc_DATA)
diff -r -u dovecot-0.99.13.orig/Makefile.am dovecot-0.99.13/Makefile.am
--- dovecot-0.99.13.orig/Makefile.am 2003-05-05 12:46:57.000000000 -0400
+++ dovecot-0.99.13/Makefile.am 2005-01-06 18:17:36.000000000 -0500
@@ -1,11 +1,22 @@
SUBDIRS = src doc
confdir = $(sysconfdir)
-conf_DATA = dovecot-example.conf
+conf_DATA = dovecot.conf
-EXTRA_DIST = \
- config.rpath \
- dovecot.spec \
- dovecot.spec.in \
- COPYING.LGPL \
+
+doc_DATA = \
+ AUTHORS \
+ COPYING \
+ COPYING.LGPL \
+ ChangeLog \
+ INSTALL \
+ NEWS \
+ README \
+ TODO
+
+EXTRA_DIST = \
+ config.rpath \
+ dovecot.spec \
+ dovecot.spec.in \
+ COPYING.LGPL \
$(conf_DATA)

View File

@ -1,69 +0,0 @@
--- dovecot-1.0.beta2/doc/mkcert.sh.configfile 2006-01-16 21:14:54.000000000 +0100
+++ dovecot-1.0.beta2/doc/mkcert.sh 2006-01-26 14:28:38.000000000 +0100
@@ -29,6 +29,7 @@
fi
$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 365 || exit 2
-chmod 0600 $KEYFILE
+chown root:root $CERTFILE $KEYFILE
+chmod 0600 $CERTFILE $KEYFILE
echo
$OPENSSL x509 -subject -fingerprint -noout -in $CERTFILE || exit 2
--- dovecot-1.0.beta2/dovecot-example.conf.configfile 2006-01-22 12:32:52.000000000 +0100
+++ dovecot-1.0.beta2/dovecot-example.conf 2006-01-26 14:31:23.000000000 +0100
@@ -5,17 +5,14 @@
# value inside quotes, eg.: key = "# char and trailing whitespace "
# Default values are shown after each value, it's not required to uncomment
-# any of the lines. Exception to this are paths, they're just examples
-# with real defaults being based on configure options. The paths listed here
-# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
-# --with-ssldir=/etc/ssl
+# any of the lines.
# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/
# Protocols we want to be serving:
# imap imaps pop3 pop3s
-#protocols = imap imaps
+protocols = imap imaps pop3 pop3s
# IP or host address where to listen in for connections. It's not currently
# possible to specify multiple addresses. "*" listens in all IPv4 interfaces.
@@ -24,11 +21,11 @@
# for each service, you will need to configure these settings inside the
# protocol imap/pop3 { ... } section, so you can specify different ports
# for IMAP/POP3.
-#listen = *
+listen = [::]
# IP or host address where to listen in for SSL connections. Defaults
# to above if not specified.
-#ssl_listen =
+ssl_listen = [::]
# Disable SSL/TLS support.
#ssl_disable = no
@@ -37,8 +34,8 @@
# dropping root privileges, so keep the key file unreadable by anyone but
# root. Included doc/mkcert.sh can be used to easily generate self-signed
# certificate, just make sure to update the domains in dovecot-openssl.cnf
-#ssl_cert_file = /etc/ssl/certs/dovecot.pem
-#ssl_key_file = /etc/ssl/private/dovecot.pem
+ssl_cert_file = /etc/pki/dovecot/certs/dovecot.pem
+ssl_key_file = /etc/pki/dovecot/private/dovecot.pem
# If key file is password protected, give the password here. Alternatively
# give it when starting dovecot with -p parameter.
@@ -351,8 +348,8 @@
# in is important to avoid deadlocks if other MTAs/MUAs are using multiple
# locking methods as well. Some operating systems don't allow using some of
# them simultaneously.
-#mbox_read_locks = fcntl
-#mbox_write_locks = dotlock fcntl
+mbox_read_locks = fcntl
+mbox_write_locks = fcntl
# Maximum time in seconds to wait for lock (all of them) before aborting.
#mbox_lock_timeout = 300

View File

@ -7,15 +7,32 @@
# chkconfig: - 65 35
# description: Dovecot Imap Server
# processname: dovecot
# config: /etc/dovecot.conf
### BEGIN INIT INFO
# Provides: dovecot
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start: $remote_fs
# Should-Stop: $remote_fs
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop Dovecot Imap server
# Description: Dovecot is an IMAP server for Linux/UNIX-like systems,
# written with security primarily in mind. It also contains
# a small POP3 server.
### END INIT INFO
# Source function library.
. /etc/init.d/functions
test -x /usr/sbin/dovecot || exit 0
RETVAL=0
prog="Dovecot Imap"
start() {
[ -x /usr/sbin/dovecot ] || exit 5
[ -f /etc/dovecot.conf ] || exit 6
echo -n $"Starting $prog: "
daemon /usr/sbin/dovecot
RETVAL=$?
@ -58,7 +75,7 @@ case "$1" in
;;
*)
echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
exit 1
exit 2
esac
exit $RETVAL

View File

@ -1,18 +1,8 @@
#%define dovecot_hg a744ae38a9e1
#%define sieve_hg 0367450c9382
%define upstream 1.0.13
%define sieve_upstream 1.0.2
%define pkg_version 1.0.13
%define my_release 6
%define pkg_release %{my_release}%{?dist}
%define pkg_sieve_version 1.0.2
%define pkg_sieve_release %{my_release}%{?dist}
Summary: Dovecot Secure imap server
Name: dovecot
Epoch: 1
Version: %{pkg_version}
Release: %{pkg_release}
Version: 1.0.13
Release: 7%{?dist}
License: MIT and LGPLv2 and BSD with advertising
Group: System Environment/Daemons
@ -23,9 +13,11 @@ Group: System Environment/Daemons
%define build_gssapi 1
%define build_sieve 1
%define sieve_version 1.0.3
%define sieve_name dovecot-sieve
Source: http://dovecot.org/releases/%{name}-%{upstream}.tar.gz
URL: http://www.dovecot.org/
Source: http://www.dovecot.org/releases/1.0/%{name}-%{version}.tar.gz
Source1: dovecot.init
Source2: dovecot.pam
Source3: maildir-migration.txt
@ -33,31 +25,25 @@ Source4: migrate-folders
Source5: migrate-users
Source6: perfect_maildir.pl
Source7: dovecot-REDHAT-FAQ.txt
Source8: http://dovecot.org/releases/sieve/%{sieve_name}-%{sieve_upstream}.tar.gz
Source8: http://dovecot.org/releases/sieve/%{sieve_name}-%{sieve_version}.tar.gz
Patch100: dovecot-1.0.rc15-default-settings.patch
# RHBZ #146198
Patch102: dovecot-1.0.rc2-pam-setcred.patch
Patch103: dovecot-1.0.beta2-mkcert-permissions.patch
# local filesystem rules
Patch105: dovecot-1.0.rc7-mkcert-paths.patch
# http://dovecot.org/list/dovecot/2007-April/021429.html
# will be replaced by a new quota mechanism in 1.1
Patch106: dovecot-1.0.rc27-quota-warning.patch
#Patch107: dovecot-1.1-unicodedata.patch
#Patch200: dovecot-%{dovecot_hg}.patch
# RHBZ #145241
Patch200: dovecot-1.0.rc32-split.patch
# XXX this patch needs review and forward porting
#Patch105: dovecot-auth-log.patch
# Patches 500+ from upstream fixes
Patch1000: http://www.dovecot.org/patches/1.0/dovecot-1.0.3-winbind.patch
URL: http://www.dovecot.org/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: openssl-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: zlib-devel
BuildRequires: libtool
BuildRequires: autoconf
BuildRequires: automake
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: openssl-devel, pam-devel, zlib-devel
BuildRequires: libtool autoconf automake
# gettext-devel is needed for running autoconf because of the
# presence of AM_ICONV
BuildRequires: gettext-devel
@ -65,9 +51,10 @@ BuildRequires: gettext-devel
Requires: openssl >= 0.9.7f-4
# Package includes an initscript service file, needs to require initscripts package
Requires: initscripts
Requires(pre): /sbin/chkconfig, /usr/sbin/useradd, /sbin/service, /bin/touch, /bin/rm
Requires(post): /sbin/chkconfig, /usr/sbin/useradd, /sbin/chkconfig, /bin/mv, /bin/rm
Requires(pre): /usr/sbin/useradd
Requires(post): /sbin/chkconfig, /usr/sbin/useradd, /sbin/chkconfig
Requires(preun): /usr/sbin/userdel, /usr/sbin/groupdel, /sbin/chkconfig, /sbin/service
Requires(postun): /sbin/service
%if %{build_postgres}
BuildRequires: postgresql-devel
@ -91,7 +78,6 @@ BuildRequires: krb5-devel
%define docdir %{_docdir}/%{name}
%define ssldir %{_sysconfdir}/pki/%{name}
%define restart_flag /var/run/%{name}-restart-after-rpm-install
%define dovecot_uid 97
%define dovecot_gid 97
@ -108,19 +94,12 @@ The SQL drivers and authentication plugins are in their subpackages.
Requires: %{name} = %{epoch}:%{version}-%{release}
Summary: CMU Sieve plugin for dovecot LDA
Group: System Environment/Daemons
Version: %{pkg_sieve_version}
Release: %{pkg_sieve_release}
License: MIT and LGPLv2+
%description sieve
This package provides the CMU Sieve plugin for dovecot LDA.
This package provides the CMU Sieve plugin version %{sieve_version} for dovecot LDA.
%endif
%define version %{pkg_version}
%define release %{pkg_release}
%if %{build_postgres}
%package pgsql
Requires: %{name} = %{epoch}:%{version}-%{release}
@ -169,20 +148,18 @@ This package provides the SQLite backend for dovecot-auth etc.
%prep
%setup -q -n %{name}-%{upstream}
%setup -q
%patch100 -p1 -b .default-settings
%patch102 -p1 -b .pam-setcred
%patch103 -p1 -b .mkcert-permissions
%patch105 -p1 -b .mkcert-paths
#%patch107 -p1 -b .unicodedata
%patch106 -p1 -b .quota-warning
%patch200 -p1 -b .split
#%patch200 -p1 -b .%{dovecot_hg}
%patch1000 -p1 -b .winbind
%if %{build_sieve}
%setup -q -n %{name}-%{upstream} -D -T -a 8
%setup -q -D -T -a 8
%endif
%build
@ -192,6 +169,7 @@ autoreconf -i
%configure \
INSTALL_DATA="install -c -p -m644" \
--with-doc \
--disable-static \
%if %{build_postgres}
--with-pgsql \
%endif
@ -222,13 +200,14 @@ autoreconf -i
make %{?_smp_mflags}
%if %{build_sieve}
cd %{sieve_name}-%{sieve_upstream}
cd %{sieve_name}-%{sieve_version}
rm -f ./configure
libtoolize -f
autoreconf
%configure \
INSTALL_DATA="install -c -p -m644" \
--disable-static \
--with-dovecot=../
make %{?_smp_mflags}
@ -237,44 +216,42 @@ make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT/%{_datadir}/%{name}
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/dovecot
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/dovecot
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/dovecot
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/dovecot
# generate ghost .pem file
mkdir -p $RPM_BUILD_ROOT/%{ssldir}/certs
mkdir -p $RPM_BUILD_ROOT/%{ssldir}/private
touch $RPM_BUILD_ROOT/%{ssldir}/certs/dovecot.pem
chmod 600 $RPM_BUILD_ROOT/%{ssldir}/certs/dovecot.pem
touch $RPM_BUILD_ROOT/%{ssldir}/private/dovecot.pem
chmod 600 $RPM_BUILD_ROOT/%{ssldir}/private/dovecot.pem
mkdir -p $RPM_BUILD_ROOT%{ssldir}/certs
mkdir -p $RPM_BUILD_ROOT%{ssldir}/private
touch $RPM_BUILD_ROOT%{ssldir}/certs/dovecot.pem
chmod 600 $RPM_BUILD_ROOT%{ssldir}/certs/dovecot.pem
touch $RPM_BUILD_ROOT%{ssldir}/private/dovecot.pem
chmod 600 $RPM_BUILD_ROOT%{ssldir}/private/dovecot.pem
mkdir -p $RPM_BUILD_ROOT/var/run/dovecot/login
chmod 755 $RPM_BUILD_ROOT/var/run/dovecot
chmod 700 $RPM_BUILD_ROOT/var/run/dovecot/login
# Install dovecot.conf and dovecot-openssl.cnf
mkdir -p $RPM_BUILD_ROOT/%{ssldir}
install -p -m644 $RPM_BUILD_DIR/dovecot-%{upstream}/dovecot-example.conf $RPM_BUILD_ROOT/%{_sysconfdir}/dovecot.conf
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/dovecot-*example.conf # dovecot seems to install this by itself
install -p -m644 $RPM_BUILD_DIR/dovecot-%{upstream}/doc/dovecot-openssl.cnf $RPM_BUILD_ROOT/%{ssldir}/dovecot-openssl.cnf
mkdir -p $RPM_BUILD_ROOT%{ssldir}
install -p -m644 dovecot-example.conf $RPM_BUILD_ROOT%{_sysconfdir}/dovecot.conf
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/dovecot-*example.conf # dovecot seems to install this by itself
install -p -m644 doc/dovecot-openssl.cnf $RPM_BUILD_ROOT%{ssldir}/dovecot-openssl.cnf
# Install some of our own documentation
install -p -m644 %{SOURCE7} $RPM_BUILD_ROOT%{docdir}/REDHAT-FAQ.txt
# Install the licensing files into the documentation area
install -p -m644 $RPM_BUILD_DIR/dovecot-%{upstream}/COPYING $RPM_BUILD_ROOT%{docdir}/COPYING
install -p -m644 $RPM_BUILD_DIR/dovecot-%{upstream}/COPYING.MIT $RPM_BUILD_ROOT%{docdir}/COPYING.MIT
install -p -m644 $RPM_BUILD_DIR/dovecot-%{upstream}/COPYING.LGPL $RPM_BUILD_ROOT%{docdir}/COPYING.LGPL
install -p -m644 COPYING* $RPM_BUILD_ROOT%{docdir}
mkdir -p $RPM_BUILD_ROOT%{docdir}/examples/
install -p -m755 $RPM_BUILD_DIR/dovecot-%{upstream}/doc/mkcert.sh $RPM_BUILD_ROOT%{_libexecdir}/%{name}/mkcert.sh
for f in `cd $RPM_BUILD_DIR/dovecot-%{upstream}/doc; echo *.conf`; do
install -p -m644 $RPM_BUILD_DIR/dovecot-%{upstream}/doc/$f $RPM_BUILD_ROOT%{docdir}/examples/$f;
install -p -m755 doc/mkcert.sh $RPM_BUILD_ROOT%{_libexecdir}/%{name}/mkcert.sh
for f in `cd doc; echo *.conf`; do
install -p -m644 doc/$f $RPM_BUILD_ROOT%{docdir}/examples/$f;
done
install -p -m755 -d $RPM_BUILD_ROOT%{docdir}/UW-to-Dovecot-Migration
@ -288,79 +265,76 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/dovecot
%if %{build_sieve}
# dovecot-sieve
pushd %{sieve_name}-%{sieve_upstream}
pushd %{sieve_name}-%{sieve_version}
make install DESTDIR=$RPM_BUILD_ROOT
popd
%endif
#remove the static libs and libtool archives
find $RPM_BUILD_ROOT/%{_libdir}/%{name}/ -name '*.a' -or -name '*.la' | xargs rm -f
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/dovecot-config
#remove the libtool archives
find $RPM_BUILD_ROOT%{_libdir}/%{name}/ -name '*.la' | xargs rm -f
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/dovecot-config
#prepare the filelist
(
find ${RPM_BUILD_ROOT}/%{_libdir}/%{name} -type d | sed -e "s|^|%dir |";
find ${RPM_BUILD_ROOT}/%{_libdir}/%{name} -! -type d | \
grep -v 'lib90_cmusieve_plugin\.so\|libdriver_.*\.so\|libauthdb_.*\.so\|libmech_.*\.so';
find ${RPM_BUILD_ROOT}%{_libdir}/%{name} -type d | sed -e "s|^|%dir |";
find ${RPM_BUILD_ROOT}%{_libdir}/%{name} -! -type d | \
grep -v 'lib90_cmusieve_plugin\.so\|libdriver_.*\.so\|libauthdb_.*\.so\|libmech_.*\.so';
) | sed -e "s|$RPM_BUILD_ROOT||" >libs.filelist
%pre
/usr/sbin/useradd -c "dovecot" -u %{dovecot_uid} -s /sbin/nologin -r -d /usr/libexec/dovecot dovecot 2>/dev/null || :
# stop service during installation, keep flag if it was running to restart later
rm -f %{restart_flag}
/sbin/service %{name} status >/dev/null 2>&1
if [ $? -eq 0 ]; then
touch %{restart_flag}
/sbin/service %{name} stop >/dev/null 2>&1
fi
%post
/sbin/chkconfig --add %{name}
# create a ssl cert
if [ -f %{ssldir}/%{name}.pem -a ! -e %{ssldir}/certs/%{name}.pem ]; then
mv %{ssldir}/%{name}.pem %{ssldir}/certs/%{name}.pem
else
if [ -f /usr/share/ssl/certs/dovecot.pem -a ! -e %{ssldir}/certs/%{name}.pem ]; then
mv /usr/share/ssl/certs/dovecot.pem %{ssldir}/certs/%{name}.pem
fi
if [ -f /usr/share/ssl/private/dovecot.pem -a ! -e %{ssldir}/private/%{name}.pem ]; then
mv /usr/share/ssl/private/dovecot.pem %{ssldir}/private/%{name}.pem
fi
fi
if [ ! -f %{ssldir}/certs/%{name}.pem ]; then
SSLDIR=%{ssldir} OPENSSLCONFIG=%{ssldir}/dovecot-openssl.cnf \
%{_libexecdir}/%{name}/mkcert.sh &> /dev/null
fi
if ! test -f /var/run/dovecot/login/ssl-parameters.dat; then
dovecot --build-ssl-parameters &>/dev/null
fi
# Restart if it had been running before installation
if [ -e %{restart_flag} ]; then
rm %{restart_flag}
/sbin/service %{name} start >/dev/null 2>&1
fi
exit 0
%preun
if [ $1 = 0 ]; then
/usr/sbin/userdel dovecot 2>/dev/null || :
/usr/sbin/groupdel dovecot 2>/dev/null || :
[ -f /var/lock/subsys/%{name} ] && /sbin/service %{name} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
%clean
rm -rf $RPM_BUILD_ROOT
%pre
/usr/sbin/useradd -c "dovecot" -u %{dovecot_uid} -s /sbin/nologin -r -d /usr/libexec/dovecot dovecot 2>/dev/null || :
%post
/sbin/chkconfig --add %{name}
# create a ssl cert only when installing, not during upgrade
if [ $1 = 1 ]; then
if [ -f %{ssldir}/%{name}.pem -a ! -e %{ssldir}/certs/%{name}.pem ]; then
mv %{ssldir}/%{name}.pem %{ssldir}/certs/%{name}.pem
else
if [ -f /usr/share/ssl/certs/dovecot.pem -a ! -e %{ssldir}/certs/%{name}.pem ]; then
mv /usr/share/ssl/certs/dovecot.pem %{ssldir}/certs/%{name}.pem
fi
if [ -f /usr/share/ssl/private/dovecot.pem -a ! -e %{ssldir}/private/%{name}.pem ]; then
mv /usr/share/ssl/private/dovecot.pem %{ssldir}/private/%{name}.pem
fi
fi
if [ ! -f %{ssldir}/certs/%{name}.pem ]; then
SSLDIR=%{ssldir} OPENSSLCONFIG=%{ssldir}/dovecot-openssl.cnf \
%{_libexecdir}/%{name}/mkcert.sh &> /dev/null
fi
if ! test -f /var/run/dovecot/login/ssl-parameters.dat; then
dovecot --build-ssl-parameters &>/dev/null
fi
fi
exit 0
%preun
if [ $1 = 0 ]; then
/sbin/service %{name} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
%postun
if [ $1 = 0 ]; then
/usr/sbin/userdel dovecot 2>/dev/null || :
/usr/sbin/groupdel dovecot 2>/dev/null || :
elif [ "$1" -ge "1" ]; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%files -f libs.filelist
%defattr(-,root,root)
%doc %{docdir}-%{version}
%config(noreplace) %{_sysconfdir}/dovecot.conf
%config %{_sysconfdir}/rc.d/init.d/dovecot
%defattr(-,root,root,-)
%doc %{docdir}-%{version}
%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/dovecot.conf
%{_initrddir}/dovecot
%config(noreplace) %{_sysconfdir}/pam.d/dovecot
%dir %{ssldir}
%dir %{ssldir}/certs
@ -368,7 +342,6 @@ rm -rf $RPM_BUILD_ROOT
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{ssldir}/certs/dovecot.pem
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{ssldir}/private/dovecot.pem
%{_libexecdir}/%{name}
%dir %{_libdir}/%{name}
%{_sbindir}/dovecot
%{_sbindir}/dovecotpw
%attr(0755,root,dovecot) %dir /var/run/dovecot
@ -378,12 +351,13 @@ rm -rf $RPM_BUILD_ROOT
%if %{build_sieve}
%files sieve
%defattr(-,root,root)
%defattr(-,root,root,-)
%{_libdir}/%{name}/lda/lib90_cmusieve_plugin.so
%endif
%if %{build_mysql}
%files mysql
%defattr(-,root,root,-)
%{_libdir}/%{name}/sql/libdriver_mysql.so
#%{_libdir}/%{name}/auth/libdriver_mysql.so
#%{_libdir}/%{name}/dict/libdriver_mysql.so
@ -391,6 +365,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{build_postgres}
%files pgsql
%defattr(-,root,root,-)
%{_libdir}/%{name}/sql/libdriver_pgsql.so
#%{_libdir}/%{name}/auth/libdriver_pgsql.so
#%{_libdir}/%{name}/dict/libdriver_pgsql.so
@ -398,6 +373,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{build_sqlite}
%files sqlite
%defattr(-,root,root,-)
%{_libdir}/%{name}/sql/libdriver_sqlite.so
#%{_libdir}/%{name}/auth/libdriver_sqlite.so
#%{_libdir}/%{name}/dict/libdriver_sqlite.so
@ -405,15 +381,22 @@ rm -rf $RPM_BUILD_ROOT
#%if %{build_ldap}
#%files ldap
#%defattr(-,root,root,-)
#%{_libdir}/%{name}/auth/libauthdb_ldap.so
#%endif
#%if %{build_gssapi}
#%files gssapi
#%defattr(-,root,root,-)
#%{_libdir}/%{name}/auth/libmech_gssapi.so
#%endif
%changelog
* Tue May 20 2008 Dan Horak <dan[at]danny.cz> - 1:1.0.13-7
- spec file cleanup
- update sieve plugin to 1.0.3
- Resolves: #445200, #238018
* Sun Mar 09 2008 Tomas Janousek <tjanouse@redhat.com> - 1:1.0.13-6
- update to latest upstream stable (1.0.13)

View File

@ -1,4 +1,4 @@
281bd9dee8d6c1674977257acc80ce64 dovecot-1.0.13.tar.gz
e0cf121ac0819a6a85eb94b21bc45889 dovecot-1.0.13.tar.gz.sig
508926fc9ff8e0f6e13506e237d4916b dovecot-sieve-1.0.2.tar.gz
fdb27eafe011a7a1ed92531f334e4f8c dovecot-sieve-1.0.2.tar.gz.sig
cbe4361899ffb4d9cb62151cb44427b6 dovecot-sieve-1.0.3.tar.gz
149fefe048496ad412b4ba0c492ba5a9 dovecot-sieve-1.0.3.tar.gz.sig