imapd/cyrus.conf imapd/fsl.imapd imapd/imapd.conf imapd/imapd.spec imapd/kolab.patch imapd/Makefile imapd/rc.imapd

Git Service User git at kolabsys.com
Mon Mar 28 16:34:37 CEST 2011


 imapd/Makefile    |   23 +-
 imapd/cyrus.conf  |   35 ++++
 imapd/fsl.imapd   |  124 +++++++++++++++
 imapd/imapd.conf  |   38 ++++
 imapd/imapd.spec  |  430 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 imapd/kolab.patch |  136 -----------------
 imapd/rc.imapd    |   75 +++++++++
 7 files changed, 716 insertions(+), 145 deletions(-)

New commits:
commit 63365028e38e3816188f8f3f2d2d68d845551497
Author: Christoph Wickert <wickert at kolabsys.com>
Date:   Mon Mar 28 16:34:15 2011 +0200

    imapd: Switch to full packaging

diff --git a/imapd/Makefile b/imapd/Makefile
index fd84818..5c23ec8 100644
--- a/imapd/Makefile
+++ b/imapd/Makefile
@@ -1,13 +1,11 @@
 include ../make-helper/kolab.mk
 
-PACKAGE=imapd
-DOWNLOAD_VERSION=2.3.13
-OPENPKG_RELEASE=20081020
-VERSION=2.3.16
-RELEASE=20081020_kolab7
+PACKAGE = $(shell grep "^Name:" *.spec | sed -e "s/^Name:\s*\([a-z-]*\).*/\1/")
+VERSION = $(shell grep "^Version:" *.spec | sed -e "s/^Version:\s*\([0-9.]*\).*/\1/")
+RELEASE = $(shell grep "^Release:" *.spec | sed -e "s/^Release:\s*\([a-z0-9._-]*\).*/\1/")
 
 SOURCE_URL=ftp://ftp.andrew.cmu.edu/pub/cyrus
-SOURCE_0=cyrus-imapd-2.3.16.tar.gz
+SOURCE_0=cyrus-imapd-$(VERSION).tar.gz
 
 PATCHES=patches/cyrus-imapd-$(VERSION)/KOLAB_cyrus-imapd-$(VERSION)_Cyradm_Annotations.patch \
         patches/cyrus-imapd-$(VERSION)/KOLAB_cyrus-imapd-$(VERSION)_Folder-names.patch \
@@ -17,10 +15,17 @@ PATCHES=patches/cyrus-imapd-$(VERSION)/KOLAB_cyrus-imapd-$(VERSION)_Cyradm_Annot
         patches/cyrus-imapd-$(VERSION)/KOLAB_cyrus-imapd-$(VERSION)_UID.patch \
         patches/cyrus-imapd-$(VERSION)/KOLAB_cyrus-imapd-$(VERSION)_cross-domain-acls.patch
 
-EXTRA=$(PATCHES) kolab.patch imapd.patch
+EXTRA=$(PATCHES) cyrus.conf fsl.imapd imapd.conf imapd.patch rc.imapd
 
-BUILD_OPTIONS=--define 'with_fsl yes' --define 'with_group yes' --define 'with_group_igncase yes' --define 'with_atvdom yes' --define 'with_drac no' --define 'with_replication no' --define 'with_murder no' --define 'with_listext no' --define 'with_nntp no' --define 'with_ldap yes' --define 'with_annotate yes' --define 'with_morelogging yes' --define 'with_kolab yes' --define 'with_kolab_nocaps yes' --define 'with_crossdomain_acl yes'
+BUILD_OPTIONS=--define 'with_fsl yes' --define 'with_group yes' \
+              --define 'with_group_igncase yes' --define 'with_atvdom yes' \
+              --define 'with_drac no' --define 'with_replication no' \
+              --define 'with_murder no' --define 'with_listext no' \
+              --define 'with_nntp no' --define 'with_ldap yes' \
+              --define 'with_annotate yes' --define 'with_morelogging yes' \
+              --define 'with_kolab yes' --define 'with_kolab_nocaps yes' \
+              --define 'with_crossdomain_acl yes'
 
 include ../make-helper/package.mk
-include ../make-helper/openpkg-patched.mk
+include ../make-helper/package-new.mk
 include ../make-helper/fetch.mk
diff --git a/imapd/cyrus.conf b/imapd/cyrus.conf
new file mode 100644
index 0000000..75c1d54
--- /dev/null
+++ b/imapd/cyrus.conf
@@ -0,0 +1,35 @@
+##
+##  cyrus.conf -- Cyrus IMAP master server configuration
+##
+
+START {
+    recover      cmd="ctl_cyrusdb -r"
+    #syncclient  cmd="sync_client -r"
+    #idled       cmd="idled"
+    #mupdatepush cmd="ctl_mboxlist -m"
+}
+
+SERVICES {
+    imap         cmd="imapd"       listen="127.0.0.1:143"        provide_uuid=33 prefork=2
+    #imaps       cmd="imapd -s"    listen="127.0.0.1:993"        provide_uuid=33 prefork=0
+    pop3         cmd="pop3d"       listen="127.0.0.1:110"        provide_uuid=33 prefork=2
+    #pop3s       cmd="pop3d -s"    listen="127.0.0.1:995"        provide_uuid=33 prefork=0
+    #nntp        cmd="nntpd"       listen="127.0.0.1:119"                        prefork=0
+    #nntps       cmd="nntpd -s"    listen="127.0.0.1:563"                        prefork=0
+    sieve        cmd="timsieved"   listen="127.0.0.1:2000"                       prefork=1
+    lmtp         cmd="lmtpd"       listen="127.0.0.1:2003"                       prefork=1
+    lmtpunix     cmd="lmtpd"       listen="@l_prefix@/var/imapd/socket/lmtp"     prefork=0
+    #notify      cmd="notifyd"     listen="@l_prefix@/var/imapd/socket/notify"   prefork=1  proto="udp"
+    #ptloader    cmd="ptloader"    listen="@l_prefix@/var/imapd/socket/ptloader" prefork=1
+    #fud         cmd="fud"         listen="127.0.0.1:4201"                       prefork=1  proto="udp"
+    #mupdate     cmd="mupdate"     listen="127.0.0.1:2004"                       prefork=1
+    #syncserver  cmd="sync_server" listen="127.0.0.1:2005"                       prefork=-1
+}
+
+EVENTS {
+    checkpoint   cmd="ctl_cyrusdb -c"       period=30
+    delprune     cmd="ctl_deliver -E 3"     period=1440
+    tlsprune     cmd="tls_prune"            period=1440
+    squatter     cmd="squatter -r -s user"  period=1440
+}
+
diff --git a/imapd/fsl.imapd b/imapd/fsl.imapd
new file mode 100644
index 0000000..28aefe8
--- /dev/null
+++ b/imapd/fsl.imapd
@@ -0,0 +1,124 @@
+##
+##  fsl.imapd -- OSSP fsl configuration
+##
+
+ident (imapd|imaps|imap)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/imapd.log",
+            perm=0644
+        )
+    }
+};
+
+ident (pop3d|pop3s|pop3)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/pop3d.log",
+            perm=0644
+        )
+    }
+};
+
+ident (sieve)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/sieve.log",
+            perm=0644
+        )
+    }
+};
+
+ident (lmtp|lmtpunix)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/lmtpd.log",
+            perm=0644
+        )
+    }
+};
+
+ident (idled)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/idled.log",
+            perm=0644
+        )
+    }
+};
+
+ident (notifyd)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/notifyd.log",
+            perm=0644
+        )
+    }
+};
+
+ident (cyrdeliver)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/cyrdeliver.log",
+            perm=0644
+        )
+    }
+};
+
+ident (master)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/cyrmaster.log",
+            perm=0644
+        )
+    }
+};
+
+ident (cyr_expire|ctl_cyrusdb|tls_prune|delprune)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/cyr_db.log",
+            perm=0666
+        )
+    }
+};
+
+ident (squatter)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/imapd/log/misc.log",
+            perm=0666
+        )
+    }
+};
+
diff --git a/imapd/imapd.conf b/imapd/imapd.conf
new file mode 100644
index 0000000..59f1941
--- /dev/null
+++ b/imapd/imapd.conf
@@ -0,0 +1,38 @@
+##
+##  imapd.conf -- Cyrus IMAP daemon configuration
+##
+
+configdirectory:        @l_prefix@/var/imapd
+partition-default:      @l_prefix@/var/imapd/spool
+temp_path:              @l_prefix@/var/imapd/tmp
+sievedir:               @l_prefix@/var/imapd/sieve
+lmtpsocket:             @l_prefix@/var/imapd/socket/lmtp
+sendmail:               @l_prefix@/sbin/sendmail
+
+admins:                 @l_susr@
+defaultacl:             @l_susr@ lrswipcda
+sasl_pwcheck_method:    saslauthd
+sasl_mech_list:         PLAIN
+allowplaintext:         yes
+allowanonymouslogin:    no
+allowusermoves:         no
+
+servername:             mail.example.com
+defaultdomain:          example.com
+virtdomains:            yes
+unixhierarchysep:       yes
+altnamespace:           no
+
+autocreatequota:        10000
+quotawarn:              90
+timeout:                30
+reject8bit:             no
+
+#sync_host:             mail2.example.com
+#sync_realm:            example.com
+#sync_authname:         xxxxx
+#sync_password:         xxxxx
+#sync_machineid:        33
+#sync_log:              yes
+#sync_repeat_interval:  60
+
diff --git a/imapd/imapd.spec b/imapd/imapd.spec
new file mode 100644
index 0000000..96b7322
--- /dev/null
+++ b/imapd/imapd.spec
@@ -0,0 +1,430 @@
+##
+##  imapd.spec -- OpenPKG RPM Package Specification
+##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+
+#   package information
+Name:         imapd
+Summary:      Cyrus IMAP Server
+URL:          http://cyrusimap.web.cmu.edu/
+Vendor:       Carnegie Mellon University
+Packager:     OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class:        BASE
+Group:        Mail
+License:      BSD
+Version:      2.3.16
+Release:      20081020_kolab7
+
+#   package options
+%option       with_fsl             yes
+%option       with_group           no
+%option       with_group_igncase   no
+%option       with_atvdom          no
+%option       with_drac            no
+%option       with_replication     no
+%option       with_murder          no
+%option       with_listext         no
+%option       with_nntp            no
+%option       with_ldap            no
+%option       with_annotate        no
+%option       with_morelogging     no
+%option       with_kolab           no
+%option       with_kolab_nocaps    no
+%option       with_crossdomain_acl no
+
+#   fixing implicit inter-module dependencies and correlations
+%if "%{with_kolab}" == "yes"
+%undefine     with_group_igncase
+%undefine     with_ldap
+%undefine     with_annotate
+%define       with_group_igncase yes
+%define       with_ldap          yes
+%define       with_annotate      yes
+%endif
+
+#   list of sources
+#   (ping p at rdus.de if the Kolab patches are unavailable for the latest Cyrus IMAPd version)
+Source0:      ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-%{version}.tar.gz
+Source1:      rc.imapd
+Source2:      cyrus.conf
+Source3:      imapd.conf
+Source4:      fsl.imapd
+Patch0:       imapd.patch
+Patch1:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Groups2.patch
+Patch2:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_cross-domain-acls.patch
+Patch3:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Cyradm_Annotations.patch
+Patch4:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Logging.patch
+Patch5:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_UID.patch
+Patch6:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Folder-names.patch
+Patch7:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_timsieved_starttls-sendcaps.patch
+
+#   build information
+Prefix:       %{l_prefix}
+BuildRoot:    %{l_buildroot}
+BuildPreReq:  OpenPKG, openpkg >= 20060823, perl, perl-openpkg, make, config
+PreReq:       OpenPKG, openpkg >= 20060823, perl, MTA
+BuildPreReq:  sasl, db >= 4.4, openssl
+PreReq:       sasl, db >= 4.4, openssl
+%if "%{with_fsl}" == "yes"
+BuildPreReq:  fsl
+PreReq:       fsl
+%endif
+%if "%{with_ldap}" == "yes"
+BuildPreReq:  openldap >= 2.2.14
+PreReq:       openldap >= 2.2.14
+%endif
+%if "%{with_drac}" == "yes"
+BuildPreReq:  drac
+PreReq:       drac
+%endif
+AutoReq:      no
+AutoReqProv:  no
+
+%description
+    The Cyrus IMAP server is an IMAP4 and POP3 daemon that differs from
+    other IMAP server implementations in that it is generally intended
+    to be run on sealed servers, where normal users are not permitted to
+    log in. The mailbox database is stored in parts of the filesystem
+    that are private to the Cyrus IMAP system. All user access to mail
+    is through the IMAP, POP3, or KPOP protocols.
+
+%track
+    prog imapd = {
+        version   = %{version}
+        url       = ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/
+        regex     = cyrus-imapd-(\d+\.\d+\.\d+)\.tar\.gz
+    }
+
+%prep
+    %setup -q -n cyrus-imapd-%{version}
+    %patch -p0
+
+    #   upgrade config scripts for better platform support
+    %{l_prefix}/bin/config install
+
+    #   add optional group file support with support to ignore case
+%if "%{with_group}" == "yes"
+    %patch -p1 -P 1
+    %{l_shtool} subst \
+        -e 's;/etc/imapd\.group;%{l_prefix}/etc/imapd/imapd.group;' \
+        lib/auth_unix.c
+%endif
+
+    # kolab/issue1141 (Cannot give users from other domains access to a folder (rt#5747))
+%if "%{with_crossdomain_acl}" == "yes"
+    %patch -p0 -P 2
+%endif
+
+    #   add optional folder annotation support
+%if "%{with_annotate}" == "yes"
+    %patch -p1 -P 3
+%endif
+
+    #   add optional support for extended logging
+%if "%{with_morelogging}" == "yes"
+     %patch -p1 -P 4
+%endif
+
+    #   add optional support for ldap
+%if "%{with_ldap}" == "yes"
+    %{l_shtool} subst -e 's;\(IMAP_LIBS="${LIB_SASL}\) \(.*"\);\1 -lldap -llber \2;g' configure
+%endif
+
+    #   add optional kolab specific stuff for ldap and goodchars
+%if "%{with_kolab}" == "yes"
+     sed <%{PATCH5} -e '3,14d' | %{l_patch} -p1
+     %patch -p1 -P 6
+%endif
+
+    #   kolab/issue2443 (kontact aborts sieve when imapd sends capabilities after starttls)
+%if "%{with_kolab_nocaps}" == "yes"
+     %patch -p1 -P 7
+%endif
+
+    #   add optional DRAC file support
+%if "%{with_drac}" == "yes"
+    %{l_shtool} subst -e 's;@DRACLIBS@;-ldrac;g' contrib/drac_auth.patch
+    %{l_patch} -p0 <contrib/drac_auth.patch
+%endif
+
+    #   make sure config2header rebuilds imapopts based on imapoptions
+    rm -f lib/imapopts.h lib/imapopts.c >/dev/null 2>&1 || true
+
+    #   fix Berkeley-DB detection
+    %{l_shtool} subst\
+        -e 's;-L/usr/local/lib;;g' \
+        -e 's;-I/usr/local/include;;g' \
+        -e 's;db-4\.[0-9];db;g' \
+        -e 's;-l\$dbname;%{l_prefix}/lib/lib$dbname.a;g' \
+        configure
+
+    #   ensure correct linking of Berkeley-DB in perl bindings
+    loclibs=""
+    case "%{l_platform -t}" in
+        *-sunos* )
+            %{l_shtool} subst \
+                -e 's;^\( *.LIBS..*\)\(\"\],.*\)$;\1 -ldb -lrt\2;' \
+                perl/sieve/managesieve/Makefile.PL perl/imap/Makefile.PL
+            ;;
+        * )
+            %{l_shtool} subst \
+                -e 's;^\( *.LIBS..*\)\(\"\],.*\)$;\1 -ldb\2;' \
+                perl/sieve/managesieve/Makefile.PL perl/imap/Makefile.PL
+            ;;
+    esac
+
+    #   ensure invocation of correct Perl
+    %{l_shtool} subst \
+        -e 's;^\(.) exec\) \(perl .*\)$;\1 %{l_prefix}/bin/\2;' \
+        perl/imap/cyradm.sh
+    %{l_shtool} subst \
+        -e 's;^\(exec\) \(perl .*\)$;\1 %{l_prefix}/bin/\2;' \
+        perl/sieve/scripts/*.pl snmp/[a-z]* tools/[a-z]*
+
+    #   adjust hard-coded location of sieve
+    %{l_shtool} subst \
+        -e 's;"/usr/sieve";"%{l_prefix}/var/imapd/sieve";g' \
+        lib/imapopts.c tools/masssievec tools/rehash tools/translatesieve tools/upgradesieve
+
+    #   adjust default config to install environment for use in "mkimap" install helper script
+    %{l_shtool} install -c -m 644 \
+        -e "s;\\(@l_prefix@\\);$RPM_BUILD_ROOT\\1;g" %{l_value -s -a} \
+        %{SOURCE imapd.conf} imapd.conf-mkimap
+    %{l_shtool} subst \
+        -e 's;^exec perl ;exec %{l_prefix}/bin/perl ;' \
+        -e 's;/etc/imapd.conf;%{l_prefix}/etc/imapd/imapd.conf;' \
+        -e 's;^\($sievedir = \).*$;\1 shift || "%{l_prefix}/var/imapd/sieve"\;;' \
+        tools/mkimap
+
+    #   adjust syslog identifier of "deliver" program
+    %{l_shtool} subst \
+        -e '/alt_config/s;"deliver";"cyrdeliver";' \
+        imap/deliver.c
+
+    #   avoid name clash with postfix
+    %{l_shtool} subst \
+        -e '/snprintf(buf, sizeof(buf), "%s/s;/reconstruct";/cyrreconstruct";' \
+        -e '/snprintf(buf, sizeof(buf), "%s/s;/quota";/cyrquota";' \
+        imap/imapd.c
+
+    #   fix up man pages
+    %{l_shtool} subst \
+        -e 's;\(\\fB\|\.B \)/etc/\(cyrus.conf\|imapd.conf\);\1%{l_prefix}/etc/imapd/\2;g' \
+        -e 's;\(\\fB\|\.B \)/var/run/\(cyrus-master.pid\);\1%{l_prefix}/var/imapd/\2;g' \
+        man/*.[1-8]
+    %{l_shtool} subst \
+        -e 's;"/var/imap/;"%{l_prefix}/var/imapd/;g' \
+        man/cyrus.conf.5
+    %{l_shtool} subst \
+        -e 's;/usr/cyrus/bin/;%{l_prefix}/bin/;g' \
+        -e 's;/usr/local/bin/gdb;%{l_prefix}/bin/gdb;g' \
+        -e 's;/usr/sieve;%{l_prefix}/var/imapd/sieve;g' \
+        -e 's;/var/imap/md5;%{l_prefix}/var/imapd/md5;g' \
+        man/imapd.conf.5
+
+%build
+    #   configure program
+    export CC="%{l_cc}"
+    export CPPFLAGS="%{l_cppflags}"
+    export CFLAGS="%{l_cflags -O}"
+    export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}"
+    export LIBS="%{l_fsl_libs}"
+%if "%{with_atvdom}" == "yes"
+    CPPFLAGS="$CPPFLAGS -DATVDOM"
+%endif
+%if "%{with_drac}" == "yes"
+    CPPFLAGS="$CPPFLAGS -DDRAC_AUTH"
+%endif
+    case "%{l_platform -t}" in
+        *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;;
+    esac
+    ./configure \
+        --prefix=%{l_prefix} \
+        --mandir=%{l_prefix}/man \
+        --sysconfdir=%{l_prefix}/etc/imapd \
+        --with-service-path=%{l_prefix}/bin \
+        --with-lib-subdir=%{l_prefix}/lib \
+        --with-openssl=%{l_prefix} \
+        --with-bdb=%{l_prefix} \
+        --with-bdb-incdir=%{l_prefix}/include \
+        --with-bdb-libdir=%{l_prefix}/lib \
+        --with-sasl=%{l_prefix} \
+        --with-staticsasl=%{l_prefix} \
+        --with-com_err \
+        --without-libwrap \
+        --enable-idled \
+        --disable-gssapi \
+        --without-gss_impl \
+        --with-perl=%{l_prefix}/bin/perl \
+        --without-snmp \
+        --with-cyrus-prefix=%{l_prefix} \
+        --with-cyrus-user=%{l_rusr} \
+        --with-cyrus-group=%{l_rgrp} \
+        --with-pidfile=%{l_prefix}/var/imapd/cyrmaster.pid \
+%if "%{with_ldap}" == "yes"
+        --with-ldap=%{l_prefix} \
+%endif
+%if "%{with_replication}" == "yes"
+        --enable-replication \
+%endif
+%if "%{with_murder}" == "yes"
+        --enable-murder \
+%endif
+%if "%{with_listext}" == "yes"
+        --enable-listext \
+%endif
+%if "%{with_nntp}" == "yes"
+        --enable-nntp \
+%endif
+%if "%{with_kolab_nocaps}" == "yes"
+        --with-extraident=kolab-nocaps \
+%else
+        --with-extraident=openpkg \
+%endif
+        --without-krb
+
+    #   build program
+    %{l_make} %{l_mflags}
+
+%install
+    rm -rf $RPM_BUILD_ROOT
+
+    #   install package
+    %{l_make} %{l_mflags} install \
+        DESTDIR=$RPM_BUILD_ROOT
+
+    #   create additional directories
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/imapd \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
+        $RPM_BUILD_ROOT%{l_prefix}/var/imapd/log \
+        $RPM_BUILD_ROOT%{l_prefix}/var/imapd/tmp \
+        $RPM_BUILD_ROOT%{l_prefix}/var/imapd/sieve \
+        $RPM_BUILD_ROOT%{l_prefix}/var/imapd/spool \
+        $RPM_BUILD_ROOT%{l_prefix}/bin
+
+    #   install sieve administration script
+    %{l_shtool} install -c -m 755 \
+        perl/sieve/scripts/sieveshell.pl \
+        $RPM_BUILD_ROOT%{l_prefix}/bin/sieveshell
+
+    #   install sieve command line compiler
+    %{l_shtool} install -c -m 755 \
+        sieve/sievec \
+        $RPM_BUILD_ROOT%{l_prefix}/bin/sievec
+
+    #   offer a sane default configuration
+    l_hostname=`%{l_shtool} echo -e %h`
+    l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
+    %{l_shtool} install -c -m 644 %{l_value -s -a} \
+        -e "s;@l_hostname@;$l_hostname;g" \
+        -e "s;@l_domainname@;$l_domainname;g" \
+        %{SOURCE cyrus.conf} %{SOURCE imapd.conf} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/
+
+    #   install run-command script
+    %{l_shtool} install -c -m 755 %{l_value -s -a} \
+        %{SOURCE rc.imapd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   use "mkimap" to create additional directories and install the tool
+    ./tools/mkimap imapd.conf-mkimap \
+        $RPM_BUILD_ROOT%{l_prefix}/var/imapd/sieve
+    %{l_shtool} install -c -m 755 \
+        tools/mkimap $RPM_BUILD_ROOT%{l_prefix}/bin/
+
+    #   rename files which are likely to cause namespace conflicts
+    ( cd $RPM_BUILD_ROOT%{l_prefix}
+      for i in deliver master quota reconstruct; do
+          mv bin/$i        bin/cyr$i
+          mv man/man8/$i.8 man/man8/cyr$i.8
+      done
+    ) || exit $?
+
+    #   install OSSP fsl configuration
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
+    %{l_shtool} install -c -m 644 %{l_value -s -a} \
+        %{SOURCE fsl.imapd} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+
+    #   strip binaries and remove obsolete man pages
+    strip $RPM_BUILD_ROOT%{l_prefix}/bin/*                >/dev/null 2>&1 || true
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man5/krb.equiv.5 >/dev/null 2>&1 || true
+
+    #   determine installation files
+    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%config %{l_prefix}/etc/fsl/fsl.imapd' \
+        '%config %{l_prefix}/etc/imapd/imapd.conf' \
+        '%config %{l_prefix}/etc/imapd/cyrus.conf' \
+        '%dir %attr(0750,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/imapd' \
+        '%dir %attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/imapd/*' \
+        '%dir %attr(0770,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/imapd/*/*' \
+        '%dir %attr(0770,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/imapd/tmp' \
+        '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/imapd/socket' \
+        `cat perl-openpkg-files`
+
+%files -f files
+
+%clean
+    rm -rf $RPM_BUILD_ROOT
+
+%pre
+    #   before upgrade, save status and stop service
+    if [ $1 -eq 2 ]; then
+        eval `%{l_rc} imapd status 2>/dev/null | tee %{l_tmpfile}`
+        %{l_rc} imapd stop 2>/dev/null
+    fi
+    exit 0
+
+%post
+    if [ $1 -eq 1 ]; then
+        #   display final hints on initial installation
+        ( echo "To complete the Cyrus IMAP installation do:"
+          echo "1. start SASL and Cyrus IMAP with:"
+          echo "   $RPM_INSTALL_PREFIX/bin/openpkg rc sasl start"
+          echo "   $RPM_INSTALL_PREFIX/bin/openpkg rc imapd start"
+          echo "2. hook Cyrus IMAP into your particular MTA manually"
+          echo "   (usually configure mail delivery via LMTP)"
+          echo "3. create mailboxes for each of your users:"
+          echo "   \$ $RPM_INSTALL_PREFIX/bin/cyradm --user=%{l_susr} localhost"
+          echo "   cyradm> createmailbox user.<user>"
+          echo "   cyradm> setaclmailbox user.<user> <user> lrswipcd"
+          echo "   cyradm> mboxconfig user.<user> comment \"<name>\""
+          echo "   cyradm> setquota user.<user> STORAGE 500000"
+        ) | %{l_rpmtool} msg -b -t notice
+    elif [ $1 -eq 2 ]; then
+        #   after upgrade, restore status
+        eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
+        [ ".$imapd_active" = .yes ] && %{l_rc} imapd start
+    fi
+    exit 0
+
+%preun
+    #   before erase, stop service and remove log and temporary files
+    if [ $1 -eq 0 ]; then
+        %{l_rc} imapd stop 2>/dev/null
+        rm -f  $RPM_INSTALL_PREFIX/var/imapd/socket/*   >/dev/null 2>&1 || true
+        rm -rf $RPM_INSTALL_PREFIX/var/imapd/tmp/*      >/dev/null 2>&1 || true
+    fi
+    exit 0
+
diff --git a/imapd/kolab.patch b/imapd/kolab.patch
deleted file mode 100644
index e2252e5..0000000
--- a/imapd/kolab.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-diff -ur imapd.spec.orig imapd.spec
---- imapd.spec.orig	2008-10-20 20:12:23.000000000 +0200
-+++ imapd.spec	2010-02-08 17:49:08.705491666 +0100
-@@ -31,23 +31,25 @@
- Class:        BASE
- Group:        Mail
- License:      BSD
--Version:      2.3.13
--Release:      20081020
-+Version:      2.3.16
-+Release:      20081020_kolab7
- 
- #   package options
--%option       with_fsl           yes
--%option       with_group         no
--%option       with_group_igncase no
--%option       with_atvdom        no
--%option       with_drac          no
--%option       with_replication   no
--%option       with_murder        no
--%option       with_listext       no
--%option       with_nntp          no
--%option       with_ldap          no
--%option       with_annotate      no
--%option       with_morelogging   no
--%option       with_kolab         no
-+%option       with_fsl             yes
-+%option       with_group           no
-+%option       with_group_igncase   no
-+%option       with_atvdom          no
-+%option       with_drac            no
-+%option       with_replication     no
-+%option       with_murder          no
-+%option       with_listext         no
-+%option       with_nntp            no
-+%option       with_ldap            no
-+%option       with_annotate        no
-+%option       with_morelogging     no
-+%option       with_kolab           no
-+%option       with_kolab_nocaps    no
-+%option       with_crossdomain_acl no
- 
- #   fixing implicit inter-module dependencies and correlations
- %if "%{with_kolab}" == "yes"
-@@ -67,12 +69,13 @@
- Source3:      imapd.conf
- Source4:      fsl.imapd
- Patch0:       imapd.patch
--Patch1:       imapd.patch.group
--Patch2:       http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/cyrus-imapd/cyrus-imapd-2.3.11/KOLAB_cyrus-imapd-2.3.11-_Annotations2.patch
--Patch3:       http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/cyrus-imapd/cyrus-imapd-2.3.11/KOLAB_cyrus-cyradm-2.3.11_Annotations.patch
--Patch4:       http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/cyrus-imapd/cyrus-imapd-2.3.11/KOLAB_cyrus-imapd-2.3.11-_Logging.patch
--Patch5:       http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/cyrus-imapd/cyrus-imapd-2.3.11/KOLAB_cyrus-imapd-2.3.11-_UID.patch
--Patch6:       http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/cyrus-imapd/cyrus-imapd-2.3.11/KOLAB_cyrus-imapd-2.3.11-_Folder-names.patch
-+Patch1:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Groups2.patch
-+Patch2:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_cross-domain-acls.patch
-+Patch3:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Cyradm_Annotations.patch
-+Patch4:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Logging.patch
-+Patch5:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_UID.patch
-+Patch6:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_Folder-names.patch
-+Patch7:       patches/cyrus-imapd-%{version}/KOLAB_cyrus-imapd-%{version}_timsieved_starttls-sendcaps.patch
- 
- #   build information
- Prefix:       %{l_prefix}
-@@ -120,19 +123,19 @@
- 
-     #   add optional group file support with support to ignore case
- %if "%{with_group}" == "yes"
--    cp %{PATCH imapd.patch.group} imapd.patch.group
--%if "%{with_group_igncase}" == "yes"
--    %{l_shtool} subst -e 's;^\(\+.*\)strcmp;\1strcasecmp;' imapd.patch.group
--%endif
--    %{l_patch} -p1 <imapd.patch.group
-+    %patch -p1 -P 1
-     %{l_shtool} subst \
-         -e 's;/etc/imapd\.group;%{l_prefix}/etc/imapd/imapd.group;' \
-         lib/auth_unix.c
- %endif
- 
-+    # kolab/issue1141 (Cannot give users from other domains access to a folder (rt#5747))
-+%if "%{with_crossdomain_acl}" == "yes"
-+    %patch -p0 -P 2
-+%endif
-+
-     #   add optional folder annotation support
- %if "%{with_annotate}" == "yes"
--    sed <%{PATCH2} -e '5,27d' | %{l_patch} -p1
-     %patch -p1 -P 3
- %endif
- 
-@@ -152,6 +155,11 @@
-      %patch -p1 -P 6
- %endif
- 
-+    #   kolab/issue2443 (kontact aborts sieve when imapd sends capabilities after starttls)
-+%if "%{with_kolab_nocaps}" == "yes"
-+     %patch -p1 -P 7
-+%endif
-+
-     #   add optional DRAC file support
- %if "%{with_drac}" == "yes"
-     %{l_shtool} subst -e 's;@DRACLIBS@;-ldrac;g' contrib/drac_auth.patch
-@@ -287,7 +295,11 @@
- %if "%{with_nntp}" == "yes"
-         --enable-nntp \
- %endif
-+%if "%{with_kolab_nocaps}" == "yes"
-+        --with-extraident=kolab-nocaps \
-+%else
-         --with-extraident=openpkg \
-+%endif
-         --without-krb
- 
-     #   build program
-@@ -411,9 +423,6 @@
-     #   before erase, stop service and remove log and temporary files
-     if [ $1 -eq 0 ]; then
-         %{l_rc} imapd stop 2>/dev/null
--        rm -f  $RPM_INSTALL_PREFIX/var/imapd/*.db       >/dev/null 2>&1 || true
--        rm -f  $RPM_INSTALL_PREFIX/var/imapd/db.backup* >/dev/null 2>&1 || true
--        rm -f  $RPM_INSTALL_PREFIX/var/imapd/log/*.log  >/dev/null 2>&1 || true
-         rm -f  $RPM_INSTALL_PREFIX/var/imapd/socket/*   >/dev/null 2>&1 || true
-         rm -rf $RPM_INSTALL_PREFIX/var/imapd/tmp/*      >/dev/null 2>&1 || true
-     fi
-diff -ur fsl.imapd.orig fsl.imapd
---- fsl.imapd.orig	2007-12-11 10:53:12.000000000 +0100
-+++ fsl.imapd	2010-02-08 17:35:54.886390975 +0100
-@@ -14,7 +14,7 @@
-     }
- };
- 
--ident (pop3.)/.+ q{
-+ident (pop3d|pop3s|pop3)/.+ q{
-     prefix(
-         prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
-     )
diff --git a/imapd/rc.imapd b/imapd/rc.imapd
new file mode 100644
index 0000000..18ae341
--- /dev/null
+++ b/imapd/rc.imapd
@@ -0,0 +1,75 @@
+#!@l_prefix@/bin/openpkg rc
+##
+##  rc.imapd -- Run-Commands
+##
+
+%config
+    imapd_enable="$openpkg_rc_def"
+    imapd_flags=""
+    imapd_log_prolog="true"
+    imapd_log_epilog="true"
+    imapd_log_numfiles="10"
+    imapd_log_minsize="1M"
+    imapd_log_complevel="9"
+    imapd_log_daemons="cyrmaster imapd pop3d sieve lmtpd idled cyr_db misc"
+    POP_type="cyrus"
+    POP_logfile="@l_prefix@/var/imapd/log/pop3d.log"
+
+%common
+    imapd_pidfile="@l_prefix@/var/imapd/cyrmaster.pid"
+    imapd_signal () {
+        [ -f $imapd_pidfile ] && kill -$1 `cat $imapd_pidfile`
+    }
+
+%status -u @l_susr@ -o
+    imapd_usable="unknown"
+    imapd_active="no"
+    rcService imapd enable yes && \
+        imapd_signal 0 && imapd_active="yes"
+    echo "imapd_enable=\"$imapd_enable\""
+    echo "imapd_usable=\"$imapd_usable\""
+    echo "imapd_active=\"$imapd_active\""
+
+%start -u @l_susr@
+    rcService imapd enable yes || exit 0
+    rcService imapd active yes && exit 0
+    @l_prefix@/bin/cyrmaster -d ${imapd_flags}
+
+%stop -u @l_susr@
+    rcService imapd enable yes || exit 0
+    rcService imapd active no && exit 0
+    imapd_signal TERM
+    rm -f $imapd_pidfile >/dev/null 2>&1 || true
+
+%restart -u @l_susr@
+    rcService imapd enable yes || exit 0
+    rcService imapd active no && exit 0
+    imapd_signal TERM
+    rc imapd stop
+    sleep 2
+    rc imapd start
+
+%reload -u @l_susr@
+    rcService imapd enable yes || exit 0
+    rcService imapd active no && exit 0
+    imapd_signal HUP
+
+%daily -u @l_susr@
+    rcService imapd enable yes || exit 0
+    rcTmp -i
+    hintfile=`rcTmp -f -n hint`
+    for daemon in $imapd_log_daemons; do
+        if [ -f @l_prefix@/var/imapd/log/$daemon.log ]; then
+            shtool rotate -f \
+                -n $imapd_log_numfiles -s $imapd_log_minsize -d \
+                -z $imapd_log_complevel -m 664 -o @l_rusr@ -g @l_rgrp@ \
+                -P "$imapd_log_prolog" \
+                -E "$imapd_log_epilog; echo 1 >$hintfile" \
+                @l_prefix@/var/imapd/log/$daemon.log
+        fi
+    done
+    if [ -s $hintfile ]; then
+        rc imapd restart
+    fi
+    rcTmp -k
+





More information about the commits mailing list