Browse Source

dovecot: new upstream release 2.x

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@2687 ec354946-7b23-47d6-9f5a-488ba84defc7
iwamoto 14 years ago
parent
commit
e97b09d27c
1 changed files with 141 additions and 69 deletions
  1. 141 69
      d/dovecot/dovecot-vl.spec

+ 141 - 69
d/dovecot/dovecot-vl.spec

@@ -1,8 +1,9 @@
 Summary: Dovecot Secure imap server
 Summary(ja): Dovecot セキュア IMAP サーバ
 Name: dovecot
-Version: 1.2.15
-Release: 2%{?_dist_release}
+Version: 2.0.9
+Release: 4%{?_dist_release}
+#dovecot itself is MIT, a few sources are PD, pigeonhole is LGPLv2
 License: MIT and LGPLv2 and BSD with advertising
 Group: System Environment/Daemons
 
@@ -11,29 +12,29 @@ Group: System Environment/Daemons
 %define build_sqlite 1
 %define build_ldap 1
 
-%define build_sieve 1
-%define sieve_version 1.1.8
-%define sieve_name dovecot-sieve
+# pigeonhole
+%define build_pigeonhole 1
+%define pigeonholever 0.2.2
 
-%define build_drac 1
+# pop before smtp (drac)
+%define build_drac 0
 
 URL: http://www.dovecot.org/
 
-Source: http://www.dovecot.org/releases/1.1/%{name}-%{version}.tar.gz
+Source: http://www.dovecot.org/releases/2.0/%{name}-%{version}.tar.gz
 Source1: dovecot.init
 Source2: dovecot.pam
-Source3: maildir-migration.txt
-Source4: migrate-folders
-Source5: migrate-users
-Source6: perfect_maildir.pl
-Source7: dovecot-REDHAT-FAQ.txt
-Source8: http://dovecot.org/releases/sieve/%{sieve_name}-%{sieve_version}.tar.gz
+Source8: http://www.rename-it.nl/dovecot/2.0/dovecot-2.0-pigeonhole-%{pigeonholever}.tar.gz
 Source9: dovecot.sysconfig
+Source10: dovecot.tmpfilesd
+
+#our own
+Source14: dovecot.conf.5
 
 Source100: http://www.dovecot.org/patches/1.1/drac.c
 Source110: README.plugin-drac
 
-Patch1: dovecot-1.2-default-settings.patch
+Patch1: dovecot-2.0-defaultconfig.patch
 Patch2: dovecot-1.0.beta2-mkcert-permissions.patch
 # local filesystem rules
 Patch3: dovecot-1.0.rc7-mkcert-paths.patch
@@ -47,6 +48,8 @@ BuildRequires: openssl-devel, pam-devel, zlib-devel
 BuildRequires: bzip2-devel, libcap-devel
 BuildRequires: libtool autoconf automake, gettext-devel
 BuildRequires: pkgconfig
+BuildRequires: krb5-devel
+
 # Package includes an initscript service file, 
 # needs to require initscripts package
 Requires: initscripts
@@ -87,15 +90,17 @@ in either of maildir or mbox formats.
 The SQL drivers and authentication plugins are in their subpackages.
 
 
-%if %{build_sieve}
-%package sieve
-Requires: %{name} = %{version}-%{release}
-Summary: CMU Sieve plugin for dovecot LDA
+%if %{build_pigeonhole}
+%package pigeonhole
+Requires: %{name} = %{epoch}:%{version}-%{release}
+Obsoletes: dovecot-sieve
+Summary: Sieve and managesieve plug-in for dovecot
 Group: System Environment/Daemons
-License: MIT and LGPLv2+
+License: MIT and LGPLv2
+
+%description pigeonhole
+This package provides sieve and managesieve plug-in for dovecot LDA.
 
-%description sieve
-This package provides the CMU Sieve plugin version %{sieve_version} for dovecot LDA.
 %endif
 
 %if %{build_postgres}
@@ -165,13 +170,13 @@ cp %{SOURCE110} .
 %patch2 -p1 -b .mkcert-permissions
 %patch3 -p1 -b .mkcert-paths
 
-%if %{build_sieve}
+%if %{build_pigeonhole}
 %setup -q -D -T -a 8
 %endif
 
 %build
-rm -f ./configure
-autoreconf -i -f
+# rm -f ./configure
+# autoreconf -i -f
 %configure                           \
     INSTALL_DATA="install -c -p -m644" \
     --enable-header-install      \
@@ -189,20 +194,23 @@ autoreconf -i -f
     --with-sql-drivers           \
     --with-ssl=openssl           \
     --with-ssldir=%{ssldir}      \
+    --with-libcap                \
+    --with-zlib                  \
 %if %{build_ldap}
     --with-ldap=plugin
 %endif
 
 make %{?_smp_mflags}
 
-%if %{build_sieve}
-pushd %{sieve_name}-%{sieve_version}
-rm -f ./configure
-autoreconf -i -f
-%configure                           \
+%if %{build_pigeonhole}
+#pigeonhole
+pushd dovecot-2.0-pigeonhole-%{pigeonholever}
+autoreconf -fiv
+%configure                             \
     INSTALL_DATA="install -c -p -m644" \
-    --disable-static                 \
-    --with-dovecot=../
+    --disable-static                   \
+    --with-dovecot=../                 \
+    --without-unfinished-features
 
 make %{?_smp_mflags}
 popd
@@ -219,7 +227,19 @@ rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}
 
-install -p -m 755 src/plugins/convert/convert-tool $RPM_BUILD_ROOT%{_libexecdir}/%{name}
+%if %{build_pigeonhole}
+pushd dovecot-2.0-pigeonhole-%{pigeonholever}
+make install DESTDIR=$RPM_BUILD_ROOT
+popd
+%endif
+
+%if %{build_drac}
+install -m 755 drac.so $RPM_BUILD_ROOT/%{_libdir}/dovecot/
+ln -s ../drac.so $RPM_BUILD_ROOT/%{_libdir}/dovecot/imap/
+ln -s ../drac.so $RPM_BUILD_ROOT/%{_libdir}/dovecot/pop3/
+%endif
+
+# install -p -m 755 src/plugins/convert/convert-tool $RPM_BUILD_ROOT%{_libexecdir}/%{name}
 
 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
 install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/dovecot
@@ -230,6 +250,9 @@ install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/dovecot
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
 install -p -m 600 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/dovecot
 
+#install man pages
+install -p -D -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_mandir}/man5/dovecot.conf.5
+
 # generate ghost .pem file
 mkdir -p $RPM_BUILD_ROOT%{ssldir}/certs
 mkdir -p $RPM_BUILD_ROOT%{ssldir}/private
@@ -244,44 +267,32 @@ 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 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
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dovecot/conf.d
+install -p -m 644 doc/example-config/dovecot.conf $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
+install -p -m 644 doc/example-config/conf.d/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/dovecot/conf.d
+install -p -m 644 doc/example-config/conf.d/*.conf.ext $RPM_BUILD_ROOT%{_sysconfdir}/dovecot/conf.d
+install -p -m 644 doc/dovecot-openssl.cnf $RPM_BUILD_ROOT%{ssldir}/dovecot-openssl.cnf
+
+# Install pigeonhole conf
+pushd dovecot-2.0-pigeonhole-%{pigeonholever}
+install -p -m 644 doc/example-config/conf.d/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/dovecot/conf.d
+popd
 
 # Install some of our own documentation
-install -p -m644 %{SOURCE7} $RPM_BUILD_ROOT%{docdir}/REDHAT-FAQ.txt
+# install -p -m644 %{SOURCE7} $RPM_BUILD_ROOT%{docdir}/REDHAT-FAQ.txt
 
 # Install the licensing files into the documentation area
 install -p -m644 COPYING* $RPM_BUILD_ROOT%{docdir}
 
 mkdir -p $RPM_BUILD_ROOT%{docdir}/examples/
 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
-for f in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}
-do
-    install -p -m644 $f $RPM_BUILD_ROOT%{docdir}/UW-to-Dovecot-Migration
-done
+# for f in `cd doc; echo *.conf`; do
+#      install -p -m644 doc/$f $RPM_BUILD_ROOT%{docdir}/examples/$f;
+# done
 
 mv $RPM_BUILD_ROOT%{docdir} $RPM_BUILD_ROOT%{docdir}-%{version}
 mkdir -p $RPM_BUILD_ROOT/var/lib/dovecot
 
-%if %{build_sieve}
-# dovecot-sieve
-pushd %{sieve_name}-%{sieve_version}
-make install DESTDIR=$RPM_BUILD_ROOT
-popd
-%endif
-
-%if %{build_drac}
-install -m 755 drac.so $RPM_BUILD_ROOT/%{_libdir}/dovecot/
-ln -s ../drac.so $RPM_BUILD_ROOT/%{_libdir}/dovecot/imap/
-ln -s ../drac.so $RPM_BUILD_ROOT/%{_libdir}/dovecot/pop3/
-%endif
-
 #remove the libtool archives
 find $RPM_BUILD_ROOT%{_libdir}/%{name}/ -name '*.la' | xargs rm -f
 
@@ -292,6 +303,11 @@ find $RPM_BUILD_ROOT%{_libdir}/%{name}/ -name '*.la' | xargs rm -f
         grep -v 'dovecot-config\|lib90_cmusieve_plugin\.so\|libdriver_.*\.so\|libauthdb_.*\.so\|libmech_.*\.so\|drac\.so';
 ) | sed -e "s|$RPM_BUILD_ROOT||" >libs.filelist
 
+#remove what we don't want
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/dovecot/README
+pushd doc
+#rm -f securecoding.txt thread-refs.txt
+popd
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -301,6 +317,9 @@ rm -rf $RPM_BUILD_ROOT
 getent group dovecot >/dev/null || groupadd -r dovecot
 getent passwd dovecot >/dev/null || \
 useradd -r -g dovecot -d /usr/libexec/dovecot -s /sbin/nologin -c "Dovecot IMAP server" dovecot
+getent group dovenull >/dev/null || groupadd -r dovenull
+getent passwd dovenull >/dev/null || \
+useradd -r -g dovenull -d /usr/libexec/dovecot -s /sbin/nologin -c "Dovecot's unauthorized user" dovenull
 exit 0
 
 %post
@@ -327,11 +346,23 @@ if [ "$1" -ge "1" ]; then
     /sbin/service %{name} condrestart 2>/dev/null || :
 fi
 
+%check
+make check
+cd dovecot-2.0-pigeonhole-%{pigeonholever}
+make check
 
 %files -f libs.filelist
 %defattr(-,root,root,-)
-%doc %{docdir}-%{version}
-%config(noreplace) %{_sysconfdir}/dovecot.conf
+%doc doc/* AUTHORS ChangeLog COPYING COPYING.LGPL COPYING.MIT NEWS README
+# %doc AUTHORS ChangeLog NEWS README doc/*.txt
+
+%dir %{_sysconfdir}/dovecot
+%dir %{_sysconfdir}/dovecot/conf.d
+%config(noreplace) %{_sysconfdir}/dovecot/dovecot.conf
+%config(noreplace) %{_sysconfdir}/dovecot/conf.d/*.conf
+%config(noreplace) %{_sysconfdir}/dovecot/conf.d/*.conf.ext
+# %config(noreplace) %{_sysconfdir}/dovecot.conf
+
 %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/dovecot
 %{_initrddir}/dovecot
 %config(noreplace) %{_sysconfdir}/pam.d/dovecot
@@ -341,24 +372,52 @@ fi
 %config(noreplace) %{ssldir}/dovecot-openssl.cnf
 %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}
 %{_sbindir}/dovecot
-%{_sbindir}/dovecotpw
+# %{_sbindir}/dovecotpw
+%{_bindir}/doveadm
+%{_bindir}/doveconf
+%{_bindir}/dsync
+
 %attr(0755,root,dovecot) %dir /var/run/dovecot
-%attr(0750,root,dovecot) %dir /var/run/dovecot/login
+%attr(0750,root,dovenull) %dir /var/run/dovecot/login
 # %attr(0755,root,dovecot) %{_libexecdir}/%{name}/mkcert.sh
 %attr(0750,dovecot,dovecot) %dir /var/lib/dovecot
 
-%if %{build_sieve}
-%files sieve
+%{_mandir}/man1/deliver.1.gz
+%{_mandir}/man1/doveadm*.1.gz
+%{_mandir}/man1/doveconf.1.gz
+%{_mandir}/man1/dovecot*.1.gz
+%{_mandir}/man1/dsync.1.gz
+%{_mandir}/man5/dovecot.conf.5.gz
+%{_mandir}/man7/doveadm-search-query.7.gz
+
+%if %{build_pigeonhole}
+%files pigeonhole
 %defattr(-,root,root,-)
-%{_libdir}/%{name}/lda/lib90_cmusieve_plugin.so
+%{_bindir}/sieve-dump
+%{_bindir}/sieve-test
+%{_bindir}/sievec
+%config(noreplace) %{_sysconfdir}/dovecot/conf.d/90-sieve.conf
+%config(noreplace) %{_sysconfdir}/dovecot/conf.d/20-managesieve.conf
+%{_libexecdir}/%{name}/managesieve
+%{_libexecdir}/%{name}/managesieve-login
+
+%dir %{_libdir}/dovecot/settings
+%{_libdir}/dovecot/settings/libmanagesieve_*.so
+
+%{_mandir}/man1/sieve-test.1.gz
+%{_mandir}/man1/sieve-dump.1.gz
+%{_mandir}/man1/sievec.1.gz
+%{_mandir}/man1/sieved.1.gz
+%{_mandir}/man7/pigeonhole.7.gz
 %endif
 
 %if %{build_mysql}
 %files mysql
 %defattr(-,root,root,-)
-%{_libdir}/%{name}/sql/libdriver_mysql.so
+%{_libdir}/%{name}/libdriver_mysql.so
 %{_libdir}/%{name}/auth/libdriver_mysql.so
 %{_libdir}/%{name}/dict/libdriver_mysql.so
 %endif
@@ -366,7 +425,7 @@ fi
 %if %{build_postgres}
 %files pgsql
 %defattr(-,root,root,-)
-%{_libdir}/%{name}/sql/libdriver_pgsql.so
+%{_libdir}/%{name}/libdriver_pgsql.so
 %{_libdir}/%{name}/auth/libdriver_pgsql.so
 %{_libdir}/%{name}/dict/libdriver_pgsql.so
 %endif
@@ -374,7 +433,7 @@ fi
 %if %{build_sqlite}
 %files sqlite
 %defattr(-,root,root,-)
-%{_libdir}/%{name}/sql/libdriver_sqlite.so
+%{_libdir}/%{name}/libdriver_sqlite.so
 %{_libdir}/%{name}/auth/libdriver_sqlite.so
 %{_libdir}/%{name}/dict/libdriver_sqlite.so
 %endif
@@ -398,9 +457,22 @@ fi
 %defattr(-,root,root,-)
 %{_includedir}/%{name}
 %{_libdir}/%{name}/dovecot-config
-
+%{_datadir}/aclocal/dovecot.m4
 
 %changelog
+* Mon Jan 24 2011 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 2.0.9-4
+- fix source url
+
+* Wed Jan 19 2011 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 2.0.9-3
+- disable drac sub package (drac plugin not work with dovecot 2.x)
+
+* Mon Jan 17 2011 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 2.0.9-2
+- fix config file path in dovecot.init
+- fix group of /var/run/dovecot/login 
+
+* Sun Jan 16 2011 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 2.0.9-1
+- new upstream release 2.0.x
+
 * Tue Jan 11 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.15-2
 - rebuild with openssl-1.0.0c