#
# Conditional build:
-%bcond_with gssapi # with GSSAPI support
+%bcond_without gssapi # without GSSAPI support
%bcond_without ldap # without LDAP auth
%bcond_without mysql # without MySQL auth
%bcond_without pgsql # without PostgreSQL auth
Summary: IMAP and POP3 server written with security primarily in mind
Summary(pl.UTF-8): Serwer IMAP i POP3 pisany głównie z myślą o bezpieczeństwie
Name: dovecot
-Version: 1.2.3
+Version: 2.0.4
Release: 1
Epoch: 1
License: MIT (libraries), LGPL v2.1 (the rest)
Group: Networking/Daemons
-Source0: http://dovecot.org/releases/1.2/%{name}-%{version}.tar.gz
-# Source0-md5: 28905211d9301022a1ed20df71ad2b08
+Source0: http://dovecot.org/releases/2.0/%{name}-%{version}.tar.gz
+# Source0-md5: ff1cd0dbfca4a26cce782f7d31cb2028
Source1: %{name}.pamd
Source2: %{name}.init
Source3: %{name}.sysconfig
BuildRequires: automake
BuildRequires: bzip2-devel
%{?with_sasl:BuildRequires: cyrus-sasl-devel >= 2.0}
-BuildRequires: findutils
BuildRequires: gettext-devel
%{?with_gssapi:BuildRequires: heimdal-devel}
BuildRequires: libcap-devel
%setup -q
%patch0 -p1
-%{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' dovecot-example.conf
+%{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf
%build
touch config.rpath
%{__libtoolize}
-%{__aclocal}
+%{__aclocal} -I .
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
--disable-static \
%{?debug:--enable-debug} \
- --enable-header-install \
- %{?with_ldap:--with-ldap=plugin} \
+ %{?with_ldap:--with-ldap=yes} \
%{?with_mysql:--with-mysql} \
%{?with_pgsql:--with-pgsql} \
%{?with_sqlite:--with-sqlite} \
%{?with_gssapi:--with-gssapi=plugin} \
+ --with-sql=plugin \
+ --with-pam \
--with-zlib \
--with-bzlib \
--with-libcap \
--with-ssl=openssl \
+ --with-moduledir=%{_libdir}/%{name}/plugins \
--with-ssldir=/var/lib/openssl \
- --sysconfdir=/etc/%{name}
+ --sysconfdir=/etc
%{__make}
install -d $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login}
%{__make} install \
- moduledir=%{_libdir}/%{name}/plugins \
DESTDIR=$RPM_BUILD_ROOT
-mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{dovecot-example.conf,dovecot.conf}
+mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
install %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
-rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins{,/auth,/imap}/*.la
+rm $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins{,/*}/*.la
-# devel
-for folder in deliver imap lib lib-imap lib-mail lib-storage; do
- install -d $RPM_BUILD_ROOT%{_includedir}/%{name}/$folder
- install -p -m644 src/$folder/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}/$folder/
-done
-for dir in lib lib-auth lib-charset lib-imap lib-index lib-mail lib-storage; do
- for file in $(find src/$dir -name '*.a'); do
- install -D -m644 $file $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/$file
- done
-done
mv $RPM_BUILD_ROOT%{_libdir}/%{name}/dovecot-config $RPM_BUILD_ROOT%{_libdir}/%{name}-devel
-rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
+rm -r $RPM_BUILD_ROOT%{_docdir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%groupadd -g 172 dovecot
%useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
+%groupadd -g 254 dovenull
+%useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
%post
/sbin/chkconfig --add dovecot
if [ "$1" = "0" ]; then
%userremove dovecot
%groupremove dovecot
+ %userremove dovenull
+ %groupremove dovenull
fi
%triggerpostun -- dovecot < 1:1.1
echo "Configuration change default_mail_env -> mail_location"
%{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
+%triggerpostun -- dovecot < 1:2.0.0
+i=0
+for a in /etc/dovecot/dovecot-db-example.conf \
+ /etc/dovecot/dovecot-dict-sql-example.conf \
+ /etc/dovecot/dovecot-ldap-example.conf \
+ /etc/dovecot/dovecot-sql-example.conf \
+ /etc/dovecot/dovecot.conf; do
+ if [ -f "$a" ]; then
+ [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
+ i=1
+ echo "Trying to migrate $a config file to dovecot 2."
+ cp -a "$a" "$a-1.2.org"
+ # convert config and prefix stderr lines with #
+ ( %{_bindir}/doveconf -n -c "$a-1.2.org" 3>&2 2>&1 1>&3 | sed 's/^/#/' ) 2>&1 > "$a" || :
+ fi
+done
+if [ "$i" -eq 1 ]; then
+ echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
+fi
+
%files
%defattr(644,root,root,755)
# COPYING contains some notes, not actual LGPL text
%doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
+%attr(755,root,root) %{_bindir}/doveadm
+%attr(755,root,root) %{_bindir}/doveconf
+%attr(755,root,root) %{_bindir}/dsync
%attr(755,root,root) %{_sbindir}/%{name}
-%attr(755,root,root) %{_sbindir}/%{name}pw
-%attr(750,root,root) %dir %{_sysconfdir}/%{name}
+%attr(751,root,root) %dir %{_sysconfdir}/%{name}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}-db-example.conf
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}-dict-sql-example.conf
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}-ldap-example.conf
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}-sql-example.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
+%attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%attr(754,root,root) /etc/rc.d/init.d/%{name}
%dir %{_libdir}/%{name}
+%attr(755,root,root) %{_libdir}/%{name}/anvil
+%attr(755,root,root) %{_libdir}/%{name}/auth
%attr(755,root,root) %{_libdir}/%{name}/checkpassword-reply
+%attr(755,root,root) %{_libdir}/%{name}/config
%attr(755,root,root) %{_libdir}/%{name}/deliver
%attr(755,root,root) %{_libdir}/%{name}/dict
-%attr(755,root,root) %{_libdir}/%{name}/dovecot-auth
+%attr(755,root,root) %{_libdir}/%{name}/director
+%attr(755,root,root) %{_libdir}/%{name}/dns-client
+%attr(755,root,root) %{_libdir}/%{name}/doveadm-server
+%attr(755,root,root) %{_libdir}/%{name}/dovecot-lda
%attr(755,root,root) %{_libdir}/%{name}/gdbhelper
-%attr(755,root,root) %{_libdir}/%{name}/idxview
%attr(755,root,root) %{_libdir}/%{name}/imap
%attr(755,root,root) %{_libdir}/%{name}/imap-login
-%attr(755,root,root) %{_libdir}/%{name}/imap-utf7
-%attr(755,root,root) %{_libdir}/%{name}/convert-tool
-%attr(755,root,root) %{_libdir}/%{name}/expire-tool
%attr(755,root,root) %{_libdir}/%{name}/listview
-%attr(755,root,root) %{_libdir}/%{name}/logview
+%attr(755,root,root) %{_libdir}/%{name}/lmtp
+%attr(755,root,root) %{_libdir}/%{name}/log
%attr(755,root,root) %{_libdir}/%{name}/maildirlock
%attr(755,root,root) %{_libdir}/%{name}/pop3
%attr(755,root,root) %{_libdir}/%{name}/pop3-login
%attr(755,root,root) %{_libdir}/%{name}/rawlog
-%attr(755,root,root) %{_libdir}/%{name}/ssl-build-param
-%attr(755,root,root) %{_libdir}/%{name}/threadview
+%attr(755,root,root) %{_libdir}/%{name}/script
+%attr(755,root,root) %{_libdir}/%{name}/script-login
+%attr(755,root,root) %{_libdir}/%{name}/ssl-params
+%attr(755,root,root)%{_libdir}/%{name}/lib*.so*
%dir %{_libdir}/%{name}/plugins
%attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
%dir %{_libdir}/%{name}/plugins/auth
%attr(755,root,root)%{_libdir}/%{name}/plugins/auth/*.so
-%dir %{_libdir}/%{name}/plugins/imap
-%attr(755,root,root)%{_libdir}/%{name}/plugins/imap/*.so
-%dir %{_libdir}/%{name}/plugins/lda
-%attr(755,root,root) %{_libdir}/%{name}/plugins/lda/*.so
-%dir %{_libdir}/%{name}/plugins/pop3
-%attr(755,root,root) %{_libdir}/%{name}/plugins/pop3/*.so
+%dir %{_libdir}/%{name}/plugins/dict
+%attr(755,root,root)%{_libdir}/%{name}/plugins/dict/*.so
+%dir %{_libdir}/%{name}/plugins/doveadm
+%attr(755,root,root)%{_libdir}/%{name}/plugins/doveadm/*.so
%dir /var/lib/dovecot
%dir /var/run/dovecot
-%attr(750,root,dovecot) %dir /var/run/dovecot/login
+%attr(750,root,dovenull) %dir /var/run/dovecot/login
+
+%{_mandir}/man1/deliver.1*
+%{_mandir}/man1/dove*.1*
+%{_mandir}/man1/dsync.1*
+%{_mandir}/man7/doveadm-search-query.7*
%files devel
%defattr(644,root,root,755)
%{_libdir}/%{name}-devel
%{_includedir}/%{name}
+%{_aclocaldir}/dovecot.m4