From 2058670f942a288119ed6093d2c3cd410e029a20 Mon Sep 17 00:00:00 2001 From: Valery Kartel Date: Wed, 9 Dec 2015 14:05:53 +0000 Subject: main/dovecot: fixups in APKBUILD and default configs - sample-configs (conf.d) moved to main package because those are used by dovecot.conf - dovecot-sample-config subpackage and corresponding dovecot-sample-config.post-install are removed - configs related to ldap auth moved to dovecot-ldap subpackage - new subpackage dovecot-sql with sql-related configs - all sql drivers now depend on dovecot-sql - init-script: default basedir set to /run/dovecot. added creation of basedir --- main/dovecot/APKBUILD | 110 +++++++++++++----------- main/dovecot/dovecot-sample-config.post-install | 10 --- main/dovecot/dovecot.initd | 4 +- main/dovecot/dovecot.pre-install | 4 +- 4 files changed, 66 insertions(+), 62 deletions(-) delete mode 100644 main/dovecot/dovecot-sample-config.post-install (limited to 'main') diff --git a/main/dovecot/APKBUILD b/main/dovecot/APKBUILD index 33ed577af..16356b247 100644 --- a/main/dovecot/APKBUILD +++ b/main/dovecot/APKBUILD @@ -1,9 +1,10 @@ +# Contributor: Valery Kartel # Contributor: Ɓukasz Jendrysik # Contributor: Michael Mason # Maintainer: Natanael Copa pkgname=dovecot pkgver=2.2.20 -pkgrel=0 +pkgrel=1 pkgdesc="IMAP and POP3 server" url="http://www.dovecot.org/" arch="all" @@ -14,31 +15,30 @@ 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 +subpackages="$pkgname-doc $pkgname-dev + $pkgname-sql $pkgname-pgsql $pkgname-mysql $pkgname-sqlite + $pkgname-gssapi $pkgname-ldap " source="http://www.dovecot.org/releases/${pkgver%.*}/$pkgname-$pkgver.tar.gz - $patches + hide-dl-errors.patch dovecot.logrotate dovecot.initd - dovecot-sample-config.post-install " options="libtool" +_builddir="$srcdir"/$pkgname-$pkgver + prepare() { - cd "$srcdir"/$pkgname-$pkgver - for i in $patches; do - msg $i - patch -p1 -i "$srcdir"/$i || return 1 + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac done } build() { - cd "$srcdir/$pkgname-$pkgver" - + cd "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -54,35 +54,38 @@ build() { --with-sqlite \ --with-pgsql \ --with-ssl=openssl \ + --with-ssldir=/etc/ssl/dovecot \ + --with-rundir=/run/dovecot \ || return 1 - make || return 1 } package() { - cd "$srcdir/$pkgname-$pkgver" + cd "$_builddir" make DESTDIR="$pkgdir" install || 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 + 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 - 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 + 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 = /dev/null -adduser -H -h /dev/null -s /sbin/nologin -D dovenull 2>/dev/null +adduser -u 90 -H -h /dev/null -s /sbin/nologin -D dovecot 2>/dev/null +adduser -u 91 -H -h /dev/null -s /sbin/nologin -D dovenull 2>/dev/null exit 0 -- cgit v1.2.3