dovecot/dovecot.spec

changeset 237
76b4896bea63
parent 204
5aa32536e189
child 239
d2e66a0e1aa8
     1.1 --- a/dovecot/dovecot.spec	Tue Nov 03 16:05:28 2009 +0100
     1.2 +++ b/dovecot/dovecot.spec	Thu Nov 05 13:42:13 2009 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4  ##
     1.5  ##  dovecot.spec -- OpenPKG RPM Package Specification
     1.6 -##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.8  ##
     1.9  ##  Permission to use, copy, modify, and distribute this software for
    1.10  ##  any purpose with or without fee is hereby granted, provided that
    1.11 @@ -22,10 +22,14 @@
    1.12  ##
    1.13  
    1.14  #   package version
    1.15 -%define       V_major             1.1
    1.16 -%define       V_minor             15
    1.17 -%define       V_minor_sieve       6
    1.18 -%define       V_managesieve       0.10.6
    1.19 +%define       V_major             1.2
    1.20 +%define       V_minor             6
    1.21 +%define       V_sieve_base        1.2
    1.22 +%define       V_sieve             0.1.13
    1.23 +%define       V_managesieve_base  1.2.6
    1.24 +%define       V_managesieve       0.11.9
    1.25 +%define       V_managesieved_base 1.2
    1.26 +%define       V_managesieved      0.11.9
    1.27  
    1.28  #   package information
    1.29  Name:         dovecot
    1.30 @@ -38,33 +42,33 @@
    1.31  Group:        Mail
    1.32  License:      MIT+LGPL
    1.33  Version:      %{V_major}.%{V_minor}
    1.34 -Release:      20090521
    1.35 +Release:      20091101
    1.36  
    1.37  #   package options
    1.38  %option       with_fsl          yes
    1.39  %option       with_pam          yes
    1.40 +%option       with_sieve        yes
    1.41 +%option       with_managesieve  yes
    1.42  %option       with_ldap         no
    1.43  %option       with_mysql        no
    1.44  %option       with_pgsql        no
    1.45  %option       with_sqlite       no
    1.46 -%option       with_pop3d        no
    1.47 -%option       with_managesieve  no
    1.48 -%option       with_sieve        yes
    1.49  
    1.50  #   list of sources
    1.51  Source0:      http://www.dovecot.org/releases/%{V_major}/dovecot-%{V_major}.%{V_minor}.tar.gz
    1.52 -Source1:      http://www.dovecot.org/releases/sieve/dovecot-sieve-%{V_major}.%{V_minor_sieve}.tar.gz
    1.53 -Source2:      http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_major}-managesieve-%{V_managesieve}.tar.gz
    1.54 +Source1:      http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_sieve_base}-sieve-%{V_sieve}.tar.gz
    1.55 +Source2:      http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved}.tar.gz
    1.56  Source3:      fsl.dovecot
    1.57  Source4:      rc.dovecot
    1.58 +Source5:      dovecot.conf
    1.59  Patch0:       dovecot.patch
    1.60 -Patch1:       http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_major}.%{V_minor}-managesieve-%{V_managesieve}.diff.gz
    1.61 +Patch1:       http://www.rename-it.nl/dovecot/%{V_major}/dovecot-%{V_managesieve_base}-managesieve-%{V_managesieve}.diff.gz
    1.62  
    1.63  #   build information
    1.64  Prefix:       %{l_prefix}
    1.65  BuildRoot:    %{l_buildroot}
    1.66  BuildPreReq:  OpenPKG, openpkg >= 20060823
    1.67 -PreReq:       OpenPKG, openpkg >= 20060823, MTA
    1.68 +PreReq:       OpenPKG, openpkg >= 20060823, MTA, x509
    1.69  BuildPreReq:  libiconv, openssl
    1.70  PreReq:       libiconv, openssl
    1.71  %if "%{with_fsl}" == "yes"
    1.72 @@ -76,7 +80,6 @@
    1.73  PreReq:       openldap
    1.74  %endif
    1.75  %if "%{with_managesieve}" == "yes"
    1.76 -BuildPreReq:  autoconf, automake, pkgconfig, libtool
    1.77  BuildPreReq:  gettext
    1.78  PreReq:       gettext
    1.79  %endif
    1.80 @@ -109,17 +112,22 @@
    1.81      prog dovecot = {
    1.82          version   = %{V_major}.%{V_minor}
    1.83          url       = http://www.dovecot.org/download.html
    1.84 -        regex     = dovecot-(1\.1(\.\d+)+)\.tar\.gz
    1.85 +        regex     = dovecot-(__VER__)\.tar\.gz
    1.86      }
    1.87      prog dovecot:sieve = {
    1.88 -        version   = %{V_major}.%{V_minor_sieve}
    1.89 -        url       = http://www.dovecot.org/download.html
    1.90 -        regex     = dovecot-sieve-(%{V_major}(\.\d+)+)\.tar\.gz
    1.91 +        version   = %{V_sieve}
    1.92 +        url       = http://www.rename-it.nl/dovecot/%{V_major}/
    1.93 +        regex     = dovecot-%{V_sieve_base}-sieve-(__VER__)\.tar\.gz
    1.94 +    }
    1.95 +    prog dovecot:managesieved = {
    1.96 +        version   = %{V_managesieved}
    1.97 +        url       = http://www.rename-it.nl/dovecot/%{V_major}/
    1.98 +        regex     = dovecot-%{V_managesieved_base}-managesieve-(__VER__)\.tar\.gz
    1.99      }
   1.100      prog dovecot:managesieve = {
   1.101          version   = %{V_managesieve}
   1.102          url       = http://www.rename-it.nl/dovecot/%{V_major}/
   1.103 -        regex     = dovecot-%{V_major}-managesieve-(__VER__)\.tar\.gz
   1.104 +        regex     = dovecot-%{V_managesieve_base}-managesieve-(__VER__)\.diff\.gz
   1.105      }
   1.106  
   1.107  %prep
   1.108 @@ -130,16 +138,10 @@
   1.109  %if "%{with_managesieve}" == "yes"
   1.110      %setup -q -T -D -a 2
   1.111      %{l_gzip} -dc <%{PATCH1} | %{l_patch} -p1 -b
   1.112 -    %{l_shtool} subst \
   1.113 -        -e 's;/usr/\(libexec/dovecot/managesieve\);%{l_prefix}/\1;g' \
   1.114 -        dovecot-example.conf
   1.115  %endif
   1.116      %{l_sed} <%{PATCH0} %{l_value -s -a} | %{l_patch} -p0 -b
   1.117  
   1.118  %build
   1.119 -%if "%{with_managesieve}" == "yes"
   1.120 -    autoreconf -i --force || true
   1.121 -%endif
   1.122      cppflags="%{l_cppflags}"
   1.123      ldflags="%{l_ldflags} %{l_fsl_ldflags}"
   1.124      libs="%{l_fsl_libs}"
   1.125 @@ -166,18 +168,16 @@
   1.126      CPPFLAGS="$cppflags" \
   1.127      LDFLAGS="$ldflags" \
   1.128      LIBS="$libs" \
   1.129 -    GREP="grep" \
   1.130      ./configure \
   1.131          --prefix=%{l_prefix} \
   1.132 +        --mandir=%{l_prefix}/man \
   1.133          --sysconfdir=%{l_prefix}/etc/dovecot \
   1.134          --with-ssldir=%{l_prefix}/etc/dovecot/ssl \
   1.135          --datadir=%{l_prefix}/share/dovecot \
   1.136          --docdir=%{l_prefix}/share/dovecot/doc \
   1.137          --with-rundir=%{l_prefix}/var/dovecot/run \
   1.138 -        --with-statedir=%{l_prefix}/var/dovecot/dat \
   1.139          --with-libiconv-prefix=%{l_prefix} \
   1.140          --with-ssl=openssl \
   1.141 -        --with-deliver \
   1.142          --with-docs \
   1.143  %if "%{with_ldap}" == "yes"
   1.144          --with-ldap \
   1.145 @@ -214,122 +214,108 @@
   1.146  %else
   1.147          --without-pam \
   1.148  %endif
   1.149 -%if "%{with_pop3d}" == "yes"
   1.150 -        --with-pop3d \
   1.151 -%else
   1.152 -        --without-pop3d \
   1.153 -%endif
   1.154          --without-gc \
   1.155          --without-gssapi \
   1.156          --without-lucene \
   1.157 -        --without-vpopmail
   1.158 +        --without-vpopmail \
   1.159 +        --enable-shared \
   1.160 +        --disable-static
   1.161      %{l_make} %{l_mflags -O}
   1.162  
   1.163  %if "%{with_sieve}" == "yes"
   1.164      #   build optional Dovecot LDA sieve plugin
   1.165 -    ( cd dovecot-sieve-%{V_major}.%{V_minor_sieve}
   1.166 +    ( cd dovecot-%{V_sieve_base}-sieve-%{V_sieve}
   1.167        CC="%{l_cc}" \
   1.168        CFLAGS="%{l_cflags -O}" \
   1.169        CPPFLAGS="%{l_cppflags}" \
   1.170        LDFLAGS="%{l_ldflags}" \
   1.171 -      GREP="grep" \
   1.172        ./configure \
   1.173            --prefix=%{l_prefix} \
   1.174 -          --with-dovecot=..
   1.175 +          --mandir=%{l_prefix}/man \
   1.176 +          --with-dovecot=`pwd`/..
   1.177        %{l_make} %{l_mflags -O}
   1.178      ) || exit $?
   1.179  %endif
   1.180 -
   1.181  %if "%{with_managesieve}" == "yes"
   1.182 -    #   build optional Dovecot managesieve package
   1.183 -    ( cd dovecot-%{V_major}-managesieve-%{V_managesieve}
   1.184 +    #   build optional Dovecot LDA managesieve daemon
   1.185 +    ( cd dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved}
   1.186        CC="%{l_cc}" \
   1.187        CFLAGS="%{l_cflags -O}" \
   1.188        CPPFLAGS="%{l_cppflags}" \
   1.189        LDFLAGS="%{l_ldflags}" \
   1.190 -      GREP="grep" \
   1.191        ./configure \
   1.192            --prefix=%{l_prefix} \
   1.193 -          --with-dovecot=.. \
   1.194 -          --with-dovecot-sieve=../dovecot-sieve-%{V_major}.%{V_minor_sieve}
   1.195 +          --mandir=%{l_prefix}/man \
   1.196 +          --with-dovecot-sieve=`pwd`/../dovecot-%{V_sieve_base}-sieve-%{V_sieve} \
   1.197 +          --with-dovecot=`pwd`/..
   1.198        %{l_make} %{l_mflags -O}
   1.199      ) || exit $?
   1.200  %endif
   1.201  
   1.202  %install
   1.203      rm -rf $RPM_BUILD_ROOT
   1.204 -    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.205 +    %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   1.206  
   1.207  %if "%{with_sieve}" == "yes"
   1.208      #   install optional Dovecot LDA sieve plugin
   1.209 -    ( cd dovecot-sieve-%{V_major}.%{V_minor_sieve}
   1.210 -      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.211 +    ( cd dovecot-%{V_sieve_base}-sieve-%{V_sieve}
   1.212 +      %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   1.213      ) || exit $?
   1.214  %endif
   1.215 -
   1.216  %if "%{with_managesieve}" == "yes"
   1.217 -    #   install optional Dovecot managesieve package
   1.218 -    ( cd dovecot-%{V_major}-managesieve-%{V_managesieve}
   1.219 -      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.220 +    #   install optional Dovecot LDA managesieve daemon
   1.221 +    ( cd dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved}
   1.222 +      %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   1.223      ) || exit $?
   1.224  %endif
   1.225  
   1.226 -    #   adjust file names of configuration files
   1.227 -    ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot
   1.228 -      for i in dovecot dovecot-db dovecot-ldap dovecot-sql; do
   1.229 -          mv ${i}{-example,}.conf
   1.230 -      done
   1.231 -    ) || exit $?
   1.232 -
   1.233      #   create additional dirctories
   1.234      %{l_shtool} mkdir -f -p -m 755 \
   1.235          $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ssl \
   1.236 -        $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/dat \
   1.237          $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/log \
   1.238          $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/run/login
   1.239  
   1.240 -    #   install runcommand script
   1.241 +    #   install run-command script
   1.242      %{l_shtool} mkdir -f -p -m 755 \
   1.243          $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.244 -%if "%{with_pop3d}" == "yes"
   1.245 -    cmd='/<\/\{0,1\}with_pop3d>/d'
   1.246 -%else
   1.247 -    cmd='/<with_pop3d>/,/<\/with_pop3d>/d'
   1.248 -%endif
   1.249      %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.250 -        -e "$cmd" \
   1.251          %{SOURCE rc.dovecot} \
   1.252          $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.253  
   1.254 -    #   install OSSP fsl configuration
   1.255 -    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   1.256 -    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.257 -        %{SOURCE fsl.dovecot} \
   1.258 -        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   1.259 -
   1.260      #   strip installation
   1.261 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/dovecot*example.conf
   1.262      rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/{,*}/*.la \
   1.263          >/dev/null 2>&1 || true
   1.264 -    rmdir $RPM_BUILD_ROOT%{l_prefix}/include/dovecot \
   1.265 -        $RPM_BUILD_ROOT%{l_prefix}/include \
   1.266 -        >/dev/null 2>&1 || true
   1.267      strip \
   1.268          $RPM_BUILD_ROOT%{l_prefix}/sbin/* \
   1.269          $RPM_BUILD_ROOT%{l_prefix}/libexec/dovecot/* \
   1.270          >/dev/null 2>&1 || true
   1.271  
   1.272 +    #   install default server configuration
   1.273 +    %{l_shtool} mkdir -f -p -m 755 \
   1.274 +        $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot
   1.275 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.276 +        %{SOURCE dovecot.conf} \
   1.277 +        $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/
   1.278 +
   1.279 +    #   install OSSP fsl configuration
   1.280 +    %{l_shtool} mkdir -f -p -m 755 \
   1.281 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   1.282 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.283 +        %{SOURCE fsl.dovecot} \
   1.284 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   1.285 +
   1.286      #   generate file list
   1.287      %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
   1.288          '%not %dir %{l_prefix}/etc/fsl' \
   1.289          '%config %{l_prefix}/etc/fsl/fsl.dovecot' \
   1.290          '%config %attr(0600,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/dovecot/*' \
   1.291 -        '%config %attr(0640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dovecot/dovecot.conf' \
   1.292 +        '%config %attr(0644,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dovecot/dovecot.conf' \
   1.293          '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dovecot/ssl' \
   1.294 -        '%dir %attr(0755,%{l_musr},%{l_mgrp}) %{l_prefix}/var/dovecot' \
   1.295 -        '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/dat' \
   1.296 -        '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/log' \
   1.297 -        '%dir %attr(0750,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/run' \
   1.298 -        '%dir %attr(0750,%{l_musr},%{l_ngrp}) %{l_prefix}/var/dovecot/run/login' \
   1.299 +        '%dir %attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot' \
   1.300 +        '%dir %attr(0770,%{l_susr},%{l_rgrp}) %{l_prefix}/var/dovecot/log' \
   1.301 +        '%dir %attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot/run' \
   1.302 +        '%dir %attr(0750,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot/run/login' \
   1.303          '%doc %{l_prefix}/share/dovecot/doc' \
   1.304          '%doc %{l_prefix}/share/dovecot/doc/wiki'
   1.305  
   1.306 @@ -350,7 +336,6 @@
   1.307      [ $1 -eq 0 ] || exit 0
   1.308      %{l_rc} dovecot stop 2>/dev/null
   1.309      rm -f $RPM_INSTALL_PREFIX/var/dovecot/*           >/dev/null 2>&1 || true
   1.310 -    rm -f $RPM_INSTALL_PREFIX/var/dovecot/dat/*       >/dev/null 2>&1 || true
   1.311      rm -f $RPM_INSTALL_PREFIX/var/dovecot/log/*       >/dev/null 2>&1 || true
   1.312      rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/*       >/dev/null 2>&1 || true
   1.313      rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/login/* >/dev/null 2>&1 || true

mercurial