# Contributor: Ɓukasz Jendrysik # Contributor: Michael Mason # Maintainer: Natanael Copa pkgname=dovecot pkgver=2.2.15 pkgrel=2 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 openssl-dev bzip2-dev postgresql-dev mariadb-dev sqlite-dev heimdal-dev openldap-dev linux-headers" install="dovecot.pre-install dovecot.post-install" subpackages="$pkgname-sample-config:config $pkgname-doc $pkgname-dev $pkgname-pgsql $pkgname-mysql $pkgname-sqlite $pkgname-gssapi $pkgname-ldap" patches=" hide-dl-errors.patch " source="http://www.dovecot.org/releases/${pkgver%.*}/$pkgname-$pkgver.tar.gz $patches dovecot.logrotate dovecot.initd dovecot-sample-config.post-install " prepare() { cd "$srcdir"/$pkgname-$pkgver for i in $patches; do msg $i patch -p1 -i "$srcdir"/$i || return 1 done } build() { cd "$srcdir/$pkgname-$pkgver" ./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 \ || return 1 make || return 1 } package() { cd "$srcdir/$pkgname-$pkgver" make DESTDIR="$pkgdir" install || return 1 rm "$pkgdir"/usr/lib/dovecot/*.la \ "$pkgdir"/usr/lib/dovecot/*/*.la || return 1 install -d "$pkgdir"/var/run/dovecot \ "$pkgdir"/etc/ssl/dovecot install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname install -D "$srcdir"/dovecot.logrotate "$pkgdir"/etc/logrotate.d/dovecot # default config install doc/dovecot-openssl.cnf "$pkgdir"/etc/dovecot/ cp "$pkgdir"/usr/share/doc/dovecot/example-config/dovecot.conf \ "$pkgdir"/etc/dovecot/dovecot.conf || return 1 mkdir -p "$pkgdir"/etc/dovecot/conf.d # fix ssl dirs in default config and set defautl passdb to passwd sed -i -e 's,^ssl_cert =.*,ssl_cert =