# Contributor: Valery Kartel # Contributor: Ɓukasz Jendrysik # Contributor: Michael Mason # Maintainer: Natanael Copa pkgname=dovecot pkgver=2.2.29.1 _pkgvermajor=2.2 pkgrel=0 _pigeonholever=0.4.18 _pluginextdataver=39 _pigeonholevermajor=${_pigeonholever%.*} pkgdesc="IMAP and POP3 server" url="http://www.dovecot.org/" arch="all" license="LGPL2+" depends="libressl" 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 autoconf automake libtool" 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 $pkgname-pigeonhole-plugin-extdata:pigeonhole_extdata " source="http://www.dovecot.org/releases/$_pkgvermajor/$pkgname-$pkgver.tar.gz http://pigeonhole.dovecot.org/releases/$_pkgvermajor/$pkgname-$_pkgvermajor-pigeonhole-$_pigeonholever.tar.gz http://hg.rename-it.nl/pigeonhole-${_pigeonholevermajor}-sieve-extdata/archive/$_pluginextdataver.tar.gz dovecot.logrotate dovecot.initd extdata.conf " options="libtool" builddir="$srcdir/$pkgname-$pkgver" _builddirpigeonhole="$srcdir/$pkgname-${_pkgvermajor}-pigeonhole-$_pigeonholever" _builddirpluginextdata="$srcdir/pigeonhole-${_pigeonholevermajor/./-}-sieve-extdata-$_pluginextdataver" 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 make # 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 make # Build the extdata plugin cd "$_builddirpluginextdata" ./autogen.sh ./configure \ --prefix=/usr \ --localstatedir=/var \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-dovecot="$builddir" \ --with-pigeonhole="$_builddirpigeonhole" make } package() { cd "$builddir" make DESTDIR="$pkgdir" install 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/ rm -fr "$pkgdir"/usr/share/doc/dovecot/example-config # fix ssl dirs in default config sed -i -e 's,^ssl_cert =.*,ssl_cert =