# HG changeset patch # User Michael Schloh von Bennewitz # Date 1243446968 -7200 # Node ID 5aa32536e189d1fa459c13b56e28907a3c220bc6 # Parent d6cbdf7bfcd77bff595c40b474a324a3b34bbef4 Update version, adjust and improve patch, correct managesieve patch logic, and introduce managesieve build logic. diff -r d6cbdf7bfcd7 -r 5aa32536e189 dovecot/dovecot.patch --- a/dovecot/dovecot.patch Sat May 23 16:09:22 2009 +0200 +++ b/dovecot/dovecot.patch Wed May 27 19:56:08 2009 +0200 @@ -1,6 +1,30 @@ +Index: configure +diff -Nau configure.orig configure +--- configure.orig 2009-05-18 03:39:51.000000000 +0200 ++++ configure 2009-05-27 14:29:11.972121045 +0200 +@@ -28482,14 +28482,14 @@ + + if test $want_pgsql != no; then + # based on code from PHP +- for i in /usr /usr/local /usr/local/pgsql; do +- for j in include include/pgsql include/postgres include/postgresql ""; do ++ for i in @l_prefix@; do ++ for j in include/postgresql; do + if test -r "$i/$j/libpq-fe.h"; then + PGSQL_INCLUDE=$i/$j + fi + done +- for lib in lib lib64; do +- for j in $lib $lib/pgsql $lib/postgres $lib/postgresql ""; do ++ for lib in lib; do ++ for j in $lib; do + if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then + PGSQL_LIBDIR=$i/$j + fi Index: configure.in ---- configure.in.orig 2009-03-13 23:06:16 +0100 -+++ configure.in 2009-03-14 09:11:12 +0100 +diff -Nau configure.in.orig configure.in +--- configure.in.orig 2009-05-18 03:39:35.000000000 +0200 ++++ configure.in 2009-05-27 14:29:11.926298334 +0200 @@ -1962,14 +1962,14 @@ if test $want_pgsql != no; then @@ -20,31 +44,10 @@ if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then PGSQL_LIBDIR=$i/$j fi -Index: configure ---- configure.orig 2009-03-13 23:06:32 +0100 -+++ configure 2009-03-14 09:11:12 +0100 -@@ -27966,14 +27966,14 @@ - - if test $want_pgsql != no; then - # based on code from PHP -- for i in /usr /usr/local /usr/local/pgsql; do -- for j in include include/pgsql include/postgres include/postgresql ""; do -+ for i in @l_prefix@; do -+ for j in include/postgresql; do - if test -r "$i/$j/libpq-fe.h"; then - PGSQL_INCLUDE=$i/$j - fi - done -- for lib in lib lib64; do -- for j in $lib $lib/pgsql $lib/postgres $lib/postgresql ""; do -+ for lib in lib; do -+ for j in $lib; do - if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then - PGSQL_LIBDIR=$i/$j - fi Index: doc/dovecot-sql-example.conf ---- doc/dovecot-sql-example.conf.orig 2009-01-05 21:49:58 +0100 -+++ doc/dovecot-sql-example.conf 2009-03-14 09:11:12 +0100 +diff -Nau doc/dovecot-sql-example.conf.orig doc/dovecot-sql-example.conf +--- doc/dovecot-sql-example.conf.orig 2009-01-05 21:49:58.000000000 +0100 ++++ doc/dovecot-sql-example.conf 2009-05-27 14:29:11.973657746 +0200 @@ -47,7 +47,8 @@ # the default my.cnf location # option_group - Read options from the given group (default: client) @@ -65,30 +68,25 @@ #connect = Index: dovecot-example.conf ---- dovecot-example.conf.orig 2009-03-13 22:23:14 +0100 -+++ dovecot-example.conf 2009-03-14 09:12:40 +0100 -@@ -11,16 +11,14 @@ - - # 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 -+# the real defaults being based on configure options. +diff -Nau dovecot-example.conf.orig dovecot-example.conf +--- dovecot-example.conf.orig 2009-05-13 18:41:46.000000000 +0200 ++++ dovecot-example.conf 2009-05-27 14:29:11.981522023 +0200 +@@ -13,11 +13,10 @@ + # those. These are exceptions to this though: No sections (e.g. namespace {}) + # or plugin settings are added by default, they're listed only as examples. + # Paths are also 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 ++# options. # Base directory where to store runtime data. -#base_dir = /var/run/dovecot/ +#base_dir = @l_prefix@/var/dovecot/run - # Protocols we want to be serving: imap imaps pop3 pop3s + # Protocols we want to be serving: imap imaps pop3 pop3s managesieve # If you only want to use dovecot-auth, you can set this to "none". --#protocols = imap imaps -+#protocols = imap - - # A space separated list of IP or host addresses where to listen in for - # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6 -@@ -38,7 +36,7 @@ - # listen = *:10100 +@@ -43,7 +42,7 @@ + # listen = *:12000 # .. # } -#listen = * @@ -96,7 +94,7 @@ # Disable LOGIN command and all other plaintext authentications unless # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP -@@ -60,7 +58,9 @@ +@@ -65,7 +64,9 @@ # Log file to use for error messages, instead of sending them to syslog. # /dev/stderr can be used to log into stderr. @@ -107,18 +105,16 @@ # Log file to use for informational and debug messages. # Default is the same as log_path. -@@ -82,17 +82,17 @@ +@@ -87,7 +88,7 @@ # IP or host address where to listen in for SSL connections. Remember to also # add imaps and/or pop3s to protocols setting. Defaults to same as "listen" # setting if not specified. -#ssl_listen = +#ssl_listen = 127.0.0.1 - # Disable SSL/TLS support. --#ssl_disable = no -+#ssl_disable = yes - - # PEM encoded X.509 SSL/TLS certificate and private key. They're opened before + # Disable SSL/TLS support. + #ssl_disable = no +@@ -96,8 +97,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 @@ -129,7 +125,7 @@ # If key file is password protected, give the password here. Alternatively # give it when starting dovecot with -p parameter. Since this file is often -@@ -135,7 +135,7 @@ +@@ -140,7 +141,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. @@ -138,7 +134,7 @@ # chroot login process to the login_dir. Only reason not to do this is if you # wish to run the whole Dovecot without roots. -@@ -145,7 +145,7 @@ +@@ -150,7 +151,7 @@ # and don't use it anywhere else. The user must also belong to a group where # only it has access, it's used to control access for authentication process. # Note that this user is NOT used to access mails. @@ -147,10 +143,10 @@ # Set max. process size in megabytes. If you don't use # login_process_per_connection you might need to grow this. -@@ -266,8 +266,8 @@ +@@ -271,8 +272,8 @@ # System user and group used to access mails. If you use multiple, userdb # can override these by returning uid or gid fields. You can use either numbers - # or names. + # or names. -#mail_uid = -#mail_gid = +#mail_uid = @l_rusr@ @@ -158,7 +154,7 @@ # Group to enable temporarily for privileged operations. Currently this is # used only with INBOX when either its initial creation or dotlocking fails. -@@ -502,8 +502,12 @@ +@@ -507,20 +508,24 @@ ## protocol imap { @@ -172,16 +168,22 @@ # IMAP executable location. Changing this allows you to execute other # binaries before the imap process is executed. -@@ -515,7 +519,7 @@ + # + # This would write rawlogs into ~/dovecot.rawlog/ directory: +- # mail_executable = /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap ++ # mail_executable = @l_prefix@/libexec/dovecot/rawlog @l_prefix@/libexec/dovecot/imap + # + # This would attach gdb into the imap process and write backtraces into # /tmp/gdbhelper.* files: - # mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap +- # mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap ++ # mail_executable = @l_prefix@/libexec/dovecot/gdbhelper @l_prefix@/libexec/dovecot/imap # - #mail_executable = /usr/libexec/dovecot/imap + #mail_executable = @l_prefix@/libexec/dovecot/imap # Maximum IMAP command line length in bytes. Some clients generate very long # command lines with huge mailboxes, so you may need to raise this if you get -@@ -529,7 +533,7 @@ +@@ -534,7 +539,7 @@ # Support for dynamically loadable plugins. mail_plugins is a space separated # list of plugins to load. #mail_plugins = @@ -190,7 +192,7 @@ # Send IMAP capabilities in greeting message. This makes it unnecessary for # clients to request it with CAPABILITY command, so it saves one round-trip. -@@ -571,12 +575,16 @@ +@@ -576,12 +581,16 @@ ## protocol pop3 { @@ -209,7 +211,7 @@ # Don't try to set mails non-recent or seen with POP3 sessions. This is # mostly intended to reduce disk I/O. With maildir it doesn't move files -@@ -636,7 +644,7 @@ +@@ -641,7 +650,7 @@ # Support for dynamically loadable plugins. mail_plugins is a space separated # list of plugins to load. #mail_plugins = @@ -218,7 +220,7 @@ # Workarounds for various client bugs: # outlook-no-nuls: -@@ -654,6 +662,10 @@ +@@ -701,6 +710,10 @@ ## protocol lda { @@ -229,7 +231,7 @@ # Address to use when sending rejection mails. postmaster_address = postmaster@example.com -@@ -664,7 +676,7 @@ +@@ -711,7 +724,7 @@ # Support for dynamically loadable plugins. mail_plugins is a space separated # list of plugins to load. #mail_plugins = @@ -238,7 +240,7 @@ # If user is over quota, return with temporary failure instead of # bouncing the mail. -@@ -678,7 +690,7 @@ +@@ -725,7 +738,7 @@ #deliver_log_format = msgid=%m: %$ # Binary to use for sending mails. @@ -247,7 +249,7 @@ # Subject: header to use for rejection mails. You can use the same variables # as for rejection_reason below. -@@ -689,7 +701,7 @@ +@@ -736,7 +749,7 @@ #rejection_reason = Your message to <%t> was automatically rejected:%n%r # UNIX socket path to master authentication server to find users. @@ -256,7 +258,7 @@ } ## -@@ -697,7 +709,7 @@ +@@ -744,7 +757,7 @@ ## # Executable location @@ -265,7 +267,7 @@ # Set max. process size in megabytes. #auth_process_size = 256 -@@ -787,7 +799,7 @@ +@@ -834,7 +847,7 @@ #auth_ntlm_use_winbind = no # Path for Samba's ntlm_auth helper binary. @@ -274,7 +276,7 @@ # Number of seconds to delay before replying to failed authentications. #auth_failure_delay = 2 -@@ -820,7 +832,7 @@ +@@ -867,7 +880,7 @@ #passdb passwd-file { # File contains a list of usernames, one per line @@ -283,7 +285,7 @@ #deny = yes #} -@@ -903,13 +915,13 @@ +@@ -950,13 +963,13 @@ # SQL database #passdb sql { # Path for SQL configuration file, see doc/dovecot-sql-example.conf @@ -299,7 +301,7 @@ #} # vpopmail authentication -@@ -974,13 +986,13 @@ +@@ -1021,13 +1034,13 @@ # SQL database #userdb sql { # Path for SQL configuration file, see doc/dovecot-sql-example.conf @@ -315,7 +317,7 @@ #} # vpopmail -@@ -993,7 +1005,7 @@ +@@ -1040,7 +1053,7 @@ # authentication with BSDs internally accesses shadow files, which also # requires roots. Note that this user is NOT used to access mails. # That user is specified by userdb above. @@ -324,7 +326,7 @@ # Directory where to chroot the process. Most authentication backends don't # work if this is set, and there's no point chrooting if auth_user is root. -@@ -1017,7 +1029,7 @@ +@@ -1064,7 +1077,7 @@ # Master socket provides access to userdb information. It's typically # used to give Dovecot's local delivery agent access to userdb so it # can find mailbox locations. @@ -333,7 +335,7 @@ #mode = 0600 # Default user/group is the one who started dovecot-auth (root) #user = -@@ -1027,7 +1039,7 @@ +@@ -1074,7 +1087,7 @@ # The client socket is generally safe to export to everyone. Typical use # is to export it to your SMTP server so it can do SMTP AUTH lookups # using it. @@ -342,7 +344,7 @@ #mode = 0660 #} #} -@@ -1041,7 +1053,7 @@ +@@ -1088,7 +1101,7 @@ #auth external { # socket connect { # master { @@ -351,7 +353,7 @@ # } # } #} -@@ -1057,8 +1069,8 @@ +@@ -1104,8 +1117,8 @@ # referenced using URIs in format "proxy::". dict { @@ -362,7 +364,7 @@ } # Path to Berkeley DB's configuration file. See doc/dovecot-db-example.conf -@@ -1109,7 +1121,7 @@ +@@ -1156,7 +1169,7 @@ # one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter # specifies how many seconds to wait between stat()ing dovecot-acl file # to see if it changed. @@ -371,7 +373,7 @@ # Convert plugin. If set, specifies the source storage path which is # converted to destination storage (mail_location) when the user logs in. -@@ -1128,14 +1140,14 @@ +@@ -1175,14 +1188,14 @@ # until the message can be saved within quota limits. The configuration file # is a text file where each line is in format: # Mails are first deleted in lowest -> highest priority number order @@ -389,8 +391,9 @@ #expire_dict = proxy::expire Index: src/deliver/deliver.c ---- src/deliver/deliver.c.orig 2009-02-27 00:31:13 +0100 -+++ src/deliver/deliver.c 2009-03-14 09:11:12 +0100 +diff -Nau src/deliver/deliver.c.orig src/deliver/deliver.c +--- src/deliver/deliver.c.orig 2009-02-27 00:31:13.000000000 +0100 ++++ src/deliver/deliver.c 2009-05-27 14:29:11.983461484 +0200 @@ -41,7 +41,7 @@ #include @@ -401,8 +404,9 @@ /* After buffer grows larger than this, create a temporary file to /tmp Index: src/master/master-settings.c ---- src/master/master-settings.c.orig 2009-03-13 20:11:53 +0100 -+++ src/master/master-settings.c 2009-03-14 09:11:12 +0100 +diff -Nau src/master/master-settings.c.orig src/master/master-settings.c +--- src/master/master-settings.c.orig 2009-05-13 19:32:34.000000000 +0200 ++++ src/master/master-settings.c 2009-05-27 14:29:11.985776641 +0200 @@ -178,14 +178,14 @@ MEMBER(syslog_facility) "mail", @@ -433,7 +437,7 @@ MEMBER(login_greeting) "Dovecot ready.", MEMBER(login_log_format_elements) "user=<%u> method=%m rip=%r lip=%l %c", MEMBER(login_log_format) "%$: %s", -@@ -317,7 +317,7 @@ +@@ -325,7 +325,7 @@ MEMBER(anonymous_username) "anonymous", MEMBER(krb5_keytab) "", MEMBER(gssapi_hostname) "", diff -r d6cbdf7bfcd7 -r 5aa32536e189 dovecot/dovecot.spec --- a/dovecot/dovecot.spec Sat May 23 16:09:22 2009 +0200 +++ b/dovecot/dovecot.spec Wed May 27 19:56:08 2009 +0200 @@ -23,10 +23,9 @@ # package version %define V_major 1.1 -%define V_minor 13 +%define V_minor 15 %define V_minor_sieve 6 -%define V_minor_managesieve 1 -%define V_managesieve 0.10.3 +%define V_managesieve 0.10.6 # package information Name: dovecot @@ -39,7 +38,7 @@ Group: Mail License: MIT+LGPL Version: %{V_major}.%{V_minor} -Release: 20090418 +Release: 20090521 # package options %option with_fsl yes @@ -55,10 +54,11 @@ # list of sources Source0: http://www.dovecot.org/releases/%{V_major}/dovecot-%{V_major}.%{V_minor}.tar.gz Source1: http://www.dovecot.org/releases/sieve/dovecot-sieve-%{V_major}.%{V_minor_sieve}.tar.gz -Source2: fsl.dovecot -Source3: rc.dovecot +Source2: http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_major}-managesieve-%{V_managesieve}.tar.gz +Source3: fsl.dovecot +Source4: rc.dovecot Patch0: dovecot.patch -Patch1: http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_major}.%{V_minor_managesieve}-managesieve-%{V_managesieve}.diff.gz +Patch1: http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_major}.%{V_minor}-managesieve-%{V_managesieve}.diff.gz # build information Prefix: %{l_prefix} @@ -119,7 +119,7 @@ prog dovecot:managesieve = { version = %{V_managesieve} url = http://www.rename-it.nl/dovecot/%{V_major}/ - regex = dovecot-%{V_major}\.%{V_minor_managesieve}-managesieve-(__VER__)\.diff\.gz + regex = dovecot-%{V_major}-managesieve-(__VER__)\.tar\.gz } %prep @@ -127,15 +127,19 @@ %if "%{with_sieve}" == "yes" %setup -q -T -D -a 1 %endif +%if "%{with_managesieve}" == "yes" + %setup -q -T -D -a 2 + %{l_gzip} -dc <%{PATCH1} | %{l_patch} -p1 -b + %{l_shtool} subst \ + -e 's;/usr/\(libexec/dovecot/managesieve\);%{l_prefix}/\1;g' \ + dovecot-example.conf +%endif %{l_sed} <%{PATCH0} %{l_value -s -a} | %{l_patch} -p0 -b + +%build %if "%{with_managesieve}" == "yes" - sleep 1 - %{l_gzip} -dc <%{PATCH1} | %{l_patch} -p1 -b - sleep 1 autoreconf -i --force || true %endif - -%build cppflags="%{l_cppflags}" ldflags="%{l_ldflags} %{l_fsl_ldflags}" libs="%{l_fsl_libs}" @@ -236,6 +240,22 @@ ) || exit $? %endif +%if "%{with_managesieve}" == "yes" + # build optional Dovecot managesieve package + ( cd dovecot-%{V_major}-managesieve-%{V_managesieve} + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + GREP="grep" \ + ./configure \ + --prefix=%{l_prefix} \ + --with-dovecot=.. \ + --with-dovecot-sieve=../dovecot-sieve-%{V_major}.%{V_minor_sieve} + %{l_make} %{l_mflags -O} + ) || exit $? +%endif + %install rm -rf $RPM_BUILD_ROOT %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT @@ -247,6 +267,13 @@ ) || exit $? %endif +%if "%{with_managesieve}" == "yes" + # install optional Dovecot managesieve package + ( cd dovecot-%{V_major}-managesieve-%{V_managesieve} + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT + ) || exit $? +%endif + # adjust file names of configuration files ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot for i in dovecot dovecot-db dovecot-ldap dovecot-sql; do