Sisyphus repository
Last update: 22 july 2018 | SRPMs: 18630 | Visits: 11923513
en ru br
ALT Linux repos
S:2.2.36-alt3
D:1.1-alt0.hg20070530
5.0: 1.1.6-alt2
4.1: 1.0.13-alt1
4.0: 1.0.3.hg20070801-alt1
+updates:1.0.3.hg20070801-alt1
3.0: 0.99.14-alt2

Other repositories
Upstream:1.0.13

Group :: System/Servers
RPM: dovecot

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define _libexecdir /usr/libexec
%define _ssldir %(openssl-config --openssldir)
%define _unpackaged_files_terminate_build 1

%def_disable debug

Name: dovecot
Version: 2.2.36
Release: alt3
Summary: Dovecot secure IMAP/POP3 server
License: MIT
Group: System/Servers
Url: http://www.dovecot.org/

Obsoletes: dovecot1.0
Obsoletes: dovecot1.2

Source0: %name-%version.tar.gz
Source1: dovecot.pam
Source2: dovecot.init
# XXX doesn't work for now
Source3: dovecot-auth.control
Source4: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt

Patch1: fix-mail_plugin_dir-default.patch
Patch2: dovecot-2.0-defaultconfig.patch
#Patch3: dovecot-2.1-privatetmp.patch
Patch4: dovecot-2.1.4-postreleasefix.patch
Patch5: dovecot-2.2-systemd_firsttime.patch

PreReq: mailboxes-control

# TODO remove this when splitting into modules

%add_findreq_skiplist %_libexecdir/dovecot/decode2text.sh

# Automatically added by buildreq on Tue Apr 24 2012

# optimized out: libcom_err-devel libkrb5-devel libpq-devel libstdc++-devel pkg-config
BuildRequires: bzlib-devel gcc-c++ libldap-devel libmysqlclient-devel libpam-devel libsasl2-devel libsqlite3-devel libssl-devel openssl postgresql-devel zlib-devel

%description
Dovecot is an IMAP/POP3 server for Linux/UNIX-like systems, written with
security primarily in mind. Although it's written with C, it uses
several coding techniques to avoid most of the common pitfalls.

Dovecot can work with standard mbox and maildir formats and it's fully
compatible with UW-IMAP and Courier IMAP servers as well as mail clients
accessing the mailboxes directly.

%package -n %name-devel
Summary: Libraries and headers for Dovecot
Group: Development/Other

Requires: %name = %version-%release
Obsoletes: dovecot1.0-devel
Obsoletes: dovecot1.2-devel

%description -n %name-devel
Libraries and headers for Dovecot

%prep
%setup

%patch1 -p1
%patch2 -p1
#patch3 -p1
%patch4 -p1
%patch5 -p1

sed -i 's at /usr/local at /usr at g' src/plugins/fts/decode2text.sh
sed -i 's at /usr/local at /usr at g' doc/example-config/conf.d/90-quota.conf

%build
%add_optflags -D_DEFAULT_SOURCE=1
export ACLOCAL='aclocal -I .'
%autoreconf
%configure \
   --localstatedir=%_var                   \
   --with-moduledir=%_libdir/%name/modules \
   --with-systemdsystemunitdir=%_unitdir   \
   --disable-static                        \
   --with-ssl=openssl                      \
   --with-ssldir=%_ssldir                  \
   --with-pgsql                            \
   --with-mysql                            \
   --with-sqlite                           \
   --with-ldap                             \
   --with-gssapi                           \
   #

# setup right ssl directory

sed -i 's|/etc/ssl|%_ssldir|' doc/mkcert.sh doc/example-config/conf.d/10-ssl.conf

cp %SOURCE4 src/lib
%make_build

%install
%makeinstall_std

install -D -m 0600 %SOURCE1 %buildroot%_sysconfdir/pam.d/dovecot
install -D -m 0755 %SOURCE2 %buildroot%_initdir/%name

# generate ghost .pem files

touch empty
install -D -m600 empty %buildroot%_ssldir/certs/dovecot.pem
install -D -m600 empty %buildroot%_ssldir/private/dovecot.pem

mkdir -p %buildroot/var/run/dovecot/{login,empty}
chmod 755 %buildroot/var/run/dovecot
chmod 700 %buildroot/var/run/dovecot/login
mkdir -p %buildroot/var/cache/dovecot/indexes

# Install dovecot configuration and dovecot-openssl.cnf

mkdir -p %buildroot%_sysconfdir/dovecot/conf.d
install -Dp -m 644 doc/example-config/dovecot.conf %buildroot%_sysconfdir/dovecot
install -p -m 644 doc/example-config/conf.d/*.conf %buildroot%_sysconfdir/dovecot/conf.d
install -p -m 644 doc/example-config/conf.d/*.conf.ext %buildroot%_sysconfdir/dovecot/conf.d
install -Dp -m 644 doc/dovecot-openssl.cnf %buildroot%_ssldir/dovecot-openssl.cnf

install -Dp -m755 doc/mkcert.sh %buildroot%_libexecdir/%name/mkcert.sh

mkdir -p %buildroot%_localstatedir/%name

# remove the libtool archives

find %buildroot%_libdir/%name/ -name '*.la' | xargs rm -f

# remove what we don't want

rm -f %buildroot%_sysconfdir/dovecot/README

# hi buildreq!

( cd %buildroot%_libdir; ln -s %name/lib*.so.* . )

%pre
%pre_control mailboxes
groupadd -r -f dovecot 2>/dev/null ||:
useradd -r -n -g dovecot -c 'Dovecot internal processes' \
-d %_var/run/%name -s /dev/null dovecot 2>/dev/null ||:
groupadd -r -f dovenull 2>/dev/null ||:
useradd -r -n -g dovenull -c 'Dovecot untrusted login processes' \
-d %_var/run/%name -s /dev/null dovenull 2>/dev/null ||:
%post
%post_control -s private mailboxes
%post_service %name

# TODO postun old mailboxes access?


%files
%_bindir/doveconf
%_bindir/doveadm
%_bindir/dsync
%_sbindir/dovecot
%dir %_datadir/dovecot
%_datadir/dovecot/*
%_unitdir/*

%dir %_cachedir/dovecot
%dir %_cachedir/dovecot/indexes
%dir %_runtimedir/dovecot
%dir %_runtimedir/dovecot/empty
%dir %_runtimedir/dovecot/login
%dir %_localstatedir/dovecot

%_initdir/dovecot

%dir %_sysconfdir/dovecot
%dir %_sysconfdir/dovecot/conf.d
%config(noreplace) %_sysconfdir/dovecot/dovecot.conf
%config(noreplace) %_sysconfdir/dovecot/conf.d/*
%config(noreplace) %_sysconfdir/pam.d/dovecot
%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/dovecot

%_docdir/dovecot

%_man1dir/*
%_man7dir/doveadm-search-query.*

# hi buildreq

%_libdir/lib*.so.*
%_libdir/dovecot
%exclude %_libdir/dovecot/libdovecot*.so
%exclude %_libdir/dovecot/dovecot-config

%files -n %name-devel
%_includedir/dovecot
%_datadir/aclocal/dovecot.m4
%_libdir/dovecot/libdovecot*.so
%_libdir/dovecot/dovecot-config

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin