# Contributor: Valery Kartel # Contributor: Ɓukasz Jendrysik # Contributor: Michael Mason # Maintainer: Natanael Copa pkgname=dovecot pkgver=2.2.33.2 _pkgvermajor=2.2 pkgrel=4 _pigeonholever=0.4.21 _pluginextdataver=39 _pigeonholevermajor=${_pigeonholever%.*} pkgdesc="IMAP and POP3 server" url="http://www.dovecot.org/" arch="all" options="!check" license="LGPL-2.0-or-later" 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 expat-dev clucene-dev" install="dovecot.pre-install dovecot.post-install" subpackages="$pkgname-doc $pkgname-dev $pkgname-pigeonhole-plugin-extdata:_sieve_extdata $pkgname-pigeonhole-plugin-ldap:_sieve_ldap $pkgname-pigeonhole-plugin:_sieve $pkgname-sql $pkgname-pgsql $pkgname-mysql $pkgname-sqlite $pkgname-gssapi $pkgname-ldap $pkgname-fts-solr:_fts_solr $pkgname-fts-lucene:_fts_lucene " 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 skip-iconv-check.patch 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" _configure() { ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --localstatedir=/var \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-static \ "$@" } build() { cd "$builddir" _configure \ --libexecdir=/usr/lib/$pkgname \ --with-gssapi=plugin \ --with-ldap=plugin \ --with-sql=plugin \ --with-mysql \ --with-sqlite \ --with-pgsql \ --with-solr \ --with-lucene \ --with-ssl=openssl \ --with-ssldir=/etc/ssl/dovecot \ --with-rundir=/run/dovecot make # Build pigeonhole plugin cd "$_builddirpigeonhole" _configure \ --with-dovecot="$builddir" \ --with-ldap=plugin make # Build the extdata plugin cd "$_builddirpluginextdata" ./autogen.sh _configure \ --with-dovecot="$builddir" \ --with-pigeonhole="$_builddirpigeonhole" make } check() { cd "$builddir" make check } 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 =