# Contributor: Valery Kartel # Contributor: Ɓukasz Jendrysik # Contributor: Michael Mason # Maintainer: Natanael Copa pkgname=dovecot pkgver=2.2.25 pkgrel=1 _pigeonholever=0.4.14 pkgdesc="IMAP and POP3 server" url="http://www.dovecot.org/" arch="all" license="LGPL2+" depends="openssl" pkgusers="dovecot dovenull" pkggroups="dovecot dovenull" makedepends="libcap-dev zlib-dev libressl-dev bzip2-dev postgresql-dev mariadb-dev sqlite-dev heimdal-dev openldap-dev linux-headers" install="dovecot.pre-install dovecot.post-install" subpackages="$pkgname-doc $pkgname-dev $pkgname-sql $pkgname-pgsql $pkgname-mysql $pkgname-sqlite $pkgname-gssapi $pkgname-ldap $pkgname-pigeonhole-plugin:_pigeonhole " source="http://www.dovecot.org/releases/${pkgver%.*}/$pkgname-$pkgver.tar.gz http://pigeonhole.dovecot.org/releases/2.2/$pkgname-2.2-pigeonhole-$_pigeonholever.tar.gz hide-dl-errors.patch dovecot.logrotate dovecot.initd " options="libtool" _builddir="$srcdir"/$pkgname-$pkgver _builddirpigeonhole="$srcdir"/$pkgname-2.2-pigeonhole-$_pigeonholever prepare() { cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --localstatedir=/var \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-gssapi=plugin \ --with-ldap=plugin \ --with-sql=plugin \ --with-mysql \ --with-sqlite \ --with-pgsql \ --with-ssl=openssl \ --with-ssldir=/etc/ssl/dovecot \ --with-rundir=/run/dovecot \ || return 1 make || return 1 # Build pigeonhole plugin cd "$_builddirpigeonhole" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --localstatedir=/var \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-dovecot="$_builddir" \ --disable-static \ || return 1 make || return 1 } package() { cd "$_builddir" make DESTDIR="$pkgdir" install || return 1 install -d "$pkgdir"/etc/ssl/dovecot install -Dm755 "$srcdir"/dovecot.initd "$pkgdir"/etc/init.d/dovecot install -Dm644 "$srcdir"/dovecot.logrotate "$pkgdir"/etc/logrotate.d/dovecot # default config rm "$pkgdir"/etc/dovecot/* rm "$pkgdir"/usr/share/doc/dovecot/mkcert.sh mv "$pkgdir"/usr/share/doc/dovecot/dovecot-openssl.cnf "$pkgdir"/etc/dovecot/ mv "$pkgdir"/usr/share/doc/dovecot/example-config/dovecot* \ "$pkgdir"/usr/share/doc/dovecot/example-config/conf.d \ "$pkgdir"/etc/dovecot/ || return 1 rm -fr "$pkgdir"/usr/share/doc/dovecot/example-config # fix ssl dirs in default config sed -i -e 's,^ssl_cert =.*,ssl_cert =