# Contributor: Valery Kartel # Contributor: Ɓukasz Jendrysik # Contributor: Michael Mason # Maintainer: Natanael Copa pkgname=dovecot pkgver=2.2.26.0 pkgrel=0 _majorpkgver=${pkgver%.*.*} _pigeonholever=0.4.16 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" 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/$_majorpkgver/$pkgname-$pkgver.tar.gz http://pigeonhole.dovecot.org/releases/$_majorpkgver/$pkgname-$_majorpkgver-pigeonhole-$_pigeonholever.tar.gz hide-dl-errors.patch dovecot.logrotate dovecot.initd " options="libtool" builddir="$srcdir"/$pkgname-$pkgver _builddirpigeonhole="$srcdir"/$pkgname-$_majorpkgver-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 =