From f79562347c96687042ab5b4f7a48bcb770c0701d Mon Sep 17 00:00:00 2001 From: prockai Date: Thu, 26 Jan 2006 13:44:22 +0000 Subject: [PATCH] - new upstream version, hopefully fixes #173928, #163550 - fix #168866, use install -p to install documentation --- .cvsignore | 1 + dovecot-configfile.patch | 109 +++++++++++++++------------------------ dovecot.spec | 86 +++++++++++++++++++----------- sources | 1 + 4 files changed, 99 insertions(+), 98 deletions(-) diff --git a/.cvsignore b/.cvsignore index 98282b6..452edb5 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,2 @@ dovecot-0.99.14.tar.gz +dovecot-1.0.beta2.tar.gz diff --git a/dovecot-configfile.patch b/dovecot-configfile.patch index 47c3598..d8842fc 100644 --- a/dovecot-configfile.patch +++ b/dovecot-configfile.patch @@ -1,14 +1,26 @@ ---- dovecot-0.99.13/dovecot-example.conf 2004-12-29 13:00:24.000000000 -0500 -+++ dovecot-0.99.13/dovecot.conf 2005-01-17 11:49:56.000000000 -0500 -@@ -1,30 +1,24 @@ - ## Dovecot 1.0 configuration file +--- 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 --# Default values are shown after each value, it's not required to uncomment + $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/ @@ -19,78 +31,39 @@ # IP or host address where to listen in for connections. It's not currently # possible to specify multiple addresses. "*" listens in all IPv4 interfaces. - # "[::]" listens in all IPv6 interfaces, but may also listen in all IPv4 - # interfaces depending on the operating system. You can specify ports with - # "host:port". --#imap_listen = * --#pop3_listen = * -+imap_listen = [::] -+pop3_listen = [::] +@@ -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 non-SSL equilevants if not specified. --#imaps_listen = --#pop3s_listen = -+imaps_listen = [::] -+pop3s_listen = [::] + # to above if not specified. +-#ssl_listen = ++ssl_listen = [::] # Disable SSL/TLS support. #ssl_disable = no -@@ -33,8 +27,8 @@ +@@ -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/dovecot.pem ++ssl_cert_file = /etc/pki/dovecot/certs/dovecot.pem +ssl_key_file = /etc/pki/dovecot/private/dovecot.pem - # SSL parameter file. Master process generates this file for login processes. - # It contains Diffie Hellman and RSA parameters. -@@ -70,7 +64,7 @@ - # which login needs to be able to connect to. The sockets are created when - # running as root, so you don't have to worry about permissions. Note that - # everything in this directory is deleted when Dovecot is started. --#login_dir = /var/run/dovecot/login -+login_dir = /var/run/dovecot-login + # 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 - # chroot login process to the login_dir. Only reason not to do this is if you - # wish to run the whole Dovecot without roots. -@@ -308,7 +302,7 @@ - # with is important to avoid deadlocks if other MTAs/MUAs are using both fcntl - # and flock. Some operating systems don't allow using both of them - # simultaneously, eg. BSDs. If dotlock is used, it's always created first. --#mbox_locks = dotlock fcntl -+mbox_locks = fcntl - - # Should we create dotlock file even when we want only a read-lock? Setting - # this to yes hurts the performance when the mailbox is accessed simultaneously -diff -u -r dovecot-0.99.11.orig/doc/mkcert.sh dovecot-0.99.11/doc/mkcert.sh ---- dovecot-0.99.11.orig/doc/mkcert.sh 2004-07-22 20:04:37.000000000 -0400 -+++ dovecot-0.99.11/doc/mkcert.sh 2004-12-22 16:33:20.000000000 -0500 -@@ -4,11 +4,12 @@ - # Edit dovecot-openssl.cnf before running this. - - OPENSSL=${OPENSSL-openssl} --SSLDIR=${SSLDIR-/etc/ssl} --OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf} -+SSLDIR=${SSLDIR-/etc/pki/dovecot} -+OPENSSLCONFIG=${OPENSSLCONFIG-$SSLDIR/dovecot-openssl.cnf} -+CERTNAME=${CERTNAME-dovecot} - --CERTFILE=$SSLDIR/certs/imapd.pem --KEYFILE=$SSLDIR/private/imapd.pem -+CERTFILE=$SSLDIR/$CERTNAME.pem -+KEYFILE=$SSLDIR/private/$CERTNAME.pem - - if [ ! -d $SSLDIR/certs ]; then - echo "$SSLDIR/certs directory doesn't exist" -@@ -29,6 +30,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 + # Maximum time in seconds to wait for lock (all of them) before aborting. + #mbox_lock_timeout = 300 diff --git a/dovecot.spec b/dovecot.spec index f363be4..17c712f 100644 --- a/dovecot.spec +++ b/dovecot.spec @@ -1,14 +1,15 @@ Summary: Dovecot Secure imap server Name: dovecot -Version: 0.99.14 -Release: 10.fc5.1 +Version: 1.0 +Release: 0.beta2 License: LGPL Group: System Environment/Daemons %define build_postgres 1 %define build_mysql 1 +%define upstream 1.0.beta2 -Source: %{name}-%{version}.tar.gz +Source: %{name}-1.0.beta2.tar.gz Source1: dovecot.init Source2: dovecot.pam Source3: maildir-migration.txt @@ -43,7 +44,7 @@ BuildRequires: postgresql-devel BuildRequires: mysql-devel %endif -%define docdir %{_docdir}/%{name}-%{version} +%define docdir %{_docdir}/%{name} %define ssldir /etc/pki/%{name} %define restart_flag /var/run/%{name}-restart-after-rpm-install %define dovecot_uid 97 @@ -56,14 +57,14 @@ in either of maildir or mbox formats. %prep -%setup -q -n %{name}-%{version} +%setup -q -n %{name}-%{upstream} -%patch100 -p1 -b .config -cp $RPM_BUILD_DIR/${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}/dovecot-example.conf $RPM_BUILD_DIR/${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}/dovecot.conf +#%patch100 -p1 -b .config +#cp $RPM_BUILD_DIR/dovecot-%{upstream}/dovecot-example.conf $RPM_BUILD_DIR/${RPM_PACKAGE_NAME}-%{upstream}/dovecot.conf %patch101 -p1 -b .configfile -%patch102 -p1 -b .no-literal-plus-capability -%patch103 -p1 -b .pam-setcred -%patch104 -p1 -b .auth-log +#%patch102 -p1 -b .no-literal-plus-capability +#%patch103 -p1 -b .pam-setcred +#%patch104 -p1 -b .auth-log %build rm -f ./configure @@ -71,7 +72,8 @@ aclocal automake -a autoconf %configure \ - --with-docdir=%{docdir} \ + INSTALL_DATA="install -c -p -m644" \ + --with-doc \ %if %{build_postgres} --with-pgsql \ %endif @@ -95,25 +97,37 @@ 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}/dovecot.pem -chmod 600 $RPM_BUILD_ROOT/%{ssldir}/dovecot.pem +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 -chmod 700 $RPM_BUILD_ROOT/var/run/dovecot -mkdir -p $RPM_BUILD_ROOT/var/run/dovecot-login +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/%{_sysconfdir}/pki/dovecot/ +install -p -m644 $RPM_SOURCE_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_SOURCE_DIR/dovecot-%{upstream}/doc/dovecot-openssl.cnf $RPM_BUILD_ROOT/%{_sysconfdir}/pki/dovecot/dovecot-openssl.cnf # Install some of our own documentation -install -m644 $RPM_SOURCE_DIR/dovecot-REDHAT-FAQ.txt $RPM_BUILD_ROOT%{docdir}/REDHAT-FAQ.txt +install -p -m644 $RPM_SOURCE_DIR/dovecot-REDHAT-FAQ.txt $RPM_BUILD_ROOT%{docdir}/REDHAT-FAQ.txt -install -m755 -d $RPM_BUILD_ROOT%{docdir}/UW-to-Dovecot-Migration +mkdir -p $RPM_BUILD_ROOT%{docdir}/examples/ +install -p -m755 $RPM_SOURCE_DIR/dovecot-%{upstream}/doc/mkcert.sh $RPM_BUILD_ROOT%{docdir}/examples/mkcert.sh + +install -p -m755 -d $RPM_BUILD_ROOT%{docdir}/UW-to-Dovecot-Migration for f in maildir-migration.txt migrate-folders migrate-users perfect_maildir.pl do - install -m644 $RPM_SOURCE_DIR/$f $RPM_BUILD_ROOT%{docdir}/UW-to-Dovecot-Migration + install -p -m644 $RPM_SOURCE_DIR/$f $RPM_BUILD_ROOT%{docdir}/UW-to-Dovecot-Migration done +mv $RPM_BUILD_ROOT%{docdir} $RPM_BUILD_ROOT%{docdir}-%{version} + %pre /usr/sbin/useradd -c "dovecot" -u %{dovecot_uid} -s /sbin/nologin -r -d /usr/libexec/dovecot dovecot 2>/dev/null || : @@ -128,13 +142,17 @@ fi %post /sbin/chkconfig --add %{name} # create a ssl cert -if [ -f /usr/share/ssl/certs/dovecot.pem -a ! -f %{ssldir}/%{name}.pem ]; then -mv /usr/share/ssl/certs/dovecot.pem %{ssldir}/%{name}.pem +if [ -f %{ssldir}/%{name}.pem -a ! -f %{ssldir}/certs/%{name}.pem ]; then + mv %{ssldir}/%{name}.pem %{ssldir}/certs/%{name}.pem +else + if [ -f /usr/share/ssl/certs/dovecot.pem -a ! -f %{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 ! -f %{ssldir}/private/%{name}.pem ]; then + mv /usr/share/ssl/private/dovecot.pem %{ssldir}/private/%{name}.pem + fi fi -if [ -f /usr/share/ssl/private/dovecot.pem -a ! -f %{ssldir}/private/%{name}.pem ]; then -mv /usr/share/ssl/private/dovecot.pem %{ssldir}/private/%{name}.pem -fi -if [ ! -f %{ssldir}/%{name}.pem ]; then +if [ ! -f %{ssldir}/certs/%{name}.pem ]; then %{docdir}/examples/mkcert.sh &> /dev/null fi # Restart if it had been running before installation @@ -158,22 +176,30 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%doc %{docdir} +%doc %{docdir}-%{version} %config(noreplace) %{_sysconfdir}/dovecot.conf %config %{_sysconfdir}/rc.d/init.d/dovecot %config %{_sysconfdir}/pam.d/dovecot %config(noreplace) %{ssldir}/dovecot-openssl.cnf -%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{ssldir}/dovecot.pem +%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 %dir %{_libexecdir}/%{name} %{_libexecdir}/%{name}/* +%{_libdir}/%{name}/imap/* +%{_libdir}/%{name}/lda/* +%{_libdir}/%{name}/* %{_sbindir}/dovecot -%dir /var/run/dovecot -%attr(0750,root,dovecot) %dir /var/run/dovecot-login -%attr(0750,root,dovecot) %{docdir}/examples/mkcert.sh +%{_sbindir}/dovecotpw +%attr(0755,root,dovecot) %dir /var/run/dovecot +%attr(0750,root,dovecot) %dir /var/run/dovecot/login +%attr(0750,root,dovecot) %{docdir}-%{version}/examples/mkcert.sh %changelog +* Mon Jan 23 2006 Petr Rockai - 1.0-0.beta2 +- new upstream version, hopefully fixes #173928, #163550 +- fix #168866, use install -p to install documentation + * Fri Dec 09 2005 Jesse Keating - rebuilt diff --git a/sources b/sources index e4b16e9..1d400f7 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ a12e26fd378a46c31ec3a81ab7b55b5b dovecot-0.99.14.tar.gz +a68f623b04876815d6522ac9d7bac869 dovecot-1.0.beta2.tar.gz