diff options
author | Valery Kartel <valery.kartel@gmail.com> | 2015-12-09 14:05:53 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-12-09 14:18:30 +0000 |
commit | 2058670f942a288119ed6093d2c3cd410e029a20 (patch) | |
tree | f48bc3dc52c81e0a2b9c670c9d5da3b2010f5829 /main/dovecot | |
parent | 5d74af04f0fafd8bb11d5e9a53f119f294314356 (diff) | |
download | aports-2058670f942a288119ed6093d2c3cd410e029a20.tar.bz2 aports-2058670f942a288119ed6093d2c3cd410e029a20.tar.xz |
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
Diffstat (limited to 'main/dovecot')
-rw-r--r-- | main/dovecot/APKBUILD | 110 | ||||
-rw-r--r-- | main/dovecot/dovecot-sample-config.post-install | 10 | ||||
-rw-r--r-- | main/dovecot/dovecot.initd | 4 | ||||
-rw-r--r-- | main/dovecot/dovecot.pre-install | 4 |
4 files changed, 66 insertions, 62 deletions
diff --git a/main/dovecot/APKBUILD b/main/dovecot/APKBUILD index 33ed577af5..16356b2476 100644 --- a/main/dovecot/APKBUILD +++ b/main/dovecot/APKBUILD @@ -1,9 +1,10 @@ +# Contributor: Valery Kartel <valery.kartel@gmail.com> # Contributor: Ćukasz Jendrysik <scadu@yandex.com> # Contributor: Michael Mason <ms13sp@gmail.com> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> 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 = </etc/ssl/dovecot/server.pem,' \ -e 's,^ssl_key =.*,ssl_key = </etc/ssl/dovecot/server.key,' \ - "$pkgdir"/usr/share/doc/dovecot/example-config/conf.d/10-ssl.conf\ - || return 1 - - # install ssl config by default - cp "$pkgdir"/usr/share/doc/dovecot/example-config/conf.d/10-ssl.conf\ - "$pkgdir"/etc/dovecot/conf.d/ || return 1 + "$pkgdir"/etc/dovecot/conf.d/10-ssl.conf || return 1 + # set default passdb to passwd and create appropriate 'users' file + install -m 640 -o dovecot -g mail /dev/null "$pkgdir"/etc/dovecot/users + sed -i -e 's,!include auth-system.conf.ext,!include auth-passwdfile.conf.ext,' \ + -e 's,#!include auth-passwdfile.conf.ext,#!include auth-system.conf.ext,' \ + "$pkgdir"/etc/dovecot/conf.d/10-auth.conf || return 1 } _mv() { @@ -91,55 +94,64 @@ _mv() { local dir=${1%/*} mkdir -p "$subpkgdir"/$dir mv "$pkgdir/$1" "$subpkgdir/$dir/" + [ "$(ls -A $pkgdir/$dir)" ] || rmdir "$pkgdir"/$dir shift done } +dev() { + default_dev + mv "$pkgdir"/usr/lib/dovecot/dovecot-config \ + "$subpkgdir"/usr/lib/dovecot/ +} pgsql() { pkgdesc="postgresql driver for dovecot" - _mv $(cd "$pkgdir" && find usr -name '*pgsql.so') + depends="$pkgname-sql" + _mv $(cd "$pkgdir" && find usr -name '*_pgsql*') } mysql() { pkgdesc="mysql driver for dovecot" - _mv $(cd "$pkgdir" && find usr -name '*mysql.so') + depends="$pkgname-sql" + _mv $(cd "$pkgdir" && find usr -name '*_mysql*') } sqlite() { pkgdesc="sqlite driver for dovecot" - _mv $(cd "$pkgdir" && find usr -name '*sqlite.so') + depends="$pkgname-sql" + _mv $(cd "$pkgdir" && find usr -name '*_sqlite*') } gssapi() { pkgdesc="GSSAPI auth plugin for dovecot" - _mv $(cd "$pkgdir" && find usr -name '*gssapi.so') + depends="$pkgname" + _mv $(cd "$pkgdir" && find usr -name '*_gssapi*') } ldap() { - pkgdesc="LDAP plugin for dovecot" - _mv $(cd "$pkgdir" && find usr -name '*ldap.so') + pkgdesc="LDAP auth plugin for dovecot" + depends="$pkgname" + _mv $(cd "$pkgdir" && find usr -name '*_ldap*') + _mv $(cd "$pkgdir" && find etc/dovecot -name '*-ldap.conf*') } -config() { - pkgdesc="Sample configuration files for dovecot" - install="dovecot-sample-config.post-install" - _mv usr/share/doc/dovecot/example-config - mkdir -p "$subpkgdir"/etc/dovecot/conf.d +sql() { + pkgdesc="SQL plugin for dovecot" + depends="$pkgname" + _mv $(cd "$pkgdir" && find usr -name '*-sql.*') + _mv $(cd "$pkgdir" && find etc/dovecot -name '*-sql.conf*') } md5sums="2dbeff4385eff699caa6f6b81b838d0f dovecot-2.2.20.tar.gz 49f7a03284cc657857fe2ae22b8c82a0 hide-dl-errors.patch 1a88280b65efb6cb7f70bc5a88bf264c dovecot.logrotate -f730fd2f5e94cdb8ce0ff4df54ebb49b dovecot.initd -95cf57ecc835882228bbbb019ce3abf8 dovecot-sample-config.post-install" +ddd77573827e0662be21303fb795eef3 dovecot.initd" sha256sums="9d8fd10bfc0d4d78c38b55bab7d88398bd785ce401fcf2e7c2ffb9eae0152dcd dovecot-2.2.20.tar.gz d6accdd6e271647c01ab8fa0a9491ee822486484961e2d5c252bf70e816d2bfa hide-dl-errors.patch 2ac04bb7b5c503cd87ba044482e651dbe5c9d84a4268891fb2aa9ba26e62f833 dovecot.logrotate -6cad7099764c04b6ed1a1c4fbc308d66657ad31db627dd058cbbde4e883ccc00 dovecot.initd -7dab0591eca7fe1473ae7b39ed9ae0d7d51617ffea01252ace5c3aa68150693f dovecot-sample-config.post-install" +3f74548051297cedc7f8d203f1d1d9dc904fe89004b54b52921d2050520daa6f dovecot.initd" sha512sums="ceb028d2481865d27eaeea82e8e16948b34437a4fd39ca64f762772d2cda42876f0eb4b69bd69f1307bff71817340a902a0e7ca89dfcab7b9f802b32be3ef1e8 dovecot-2.2.20.tar.gz 1e9a1f2990019236546c7be581a4d6d0b430110d27a00bc3298f5c154ef9a4aadefa193d02a017912f826d771058fd5c6ef6cb454e14f0d15749fa8f3a68c64a hide-dl-errors.patch 58756fa06a063777ef7c4d1e67b63adbde5462264e14bd7a3187a318f498fff21ac2a8d53bb216f56fef4588206e14112da79542b6dfdf503988786f27bb6544 dovecot.logrotate -f3f0dfce9713ee9fcb8e07f8b8f7f2c88906adee1a97e5272346c77ff7fc1099c7340c75271ba08972d32fb45b92a9272dec68d3fbbee8ee76eb0ea9c5630c10 dovecot.initd -c5665334b0664ae29f52c022a8ffc2e520cfc506e399d2e614464dd5770caade794eeaf3406fe8ded1d927b06672d0597e2fe53d32fbfaf9f4cf025bce792a5b dovecot-sample-config.post-install" +d7f67991e11979da91162eb64a0b924655d0ac155d97bcc42a40c758003d60b7c096945544e6b321aa8ecb3416fe17b14b5898f1dba5e5a4b3e4c9c21295c8cb dovecot.initd" diff --git a/main/dovecot/dovecot-sample-config.post-install b/main/dovecot/dovecot-sample-config.post-install deleted file mode 100644 index 7f1a204fab..0000000000 --- a/main/dovecot/dovecot-sample-config.post-install +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -cd /usr/share/doc/dovecot/example-config || exit 0 - -for i in dovecot.conf conf.d/*; do - if ! [ -e /etc/dovecot/$i ]; then - cp $i /etc/dovecot/$i - fi -done - diff --git a/main/dovecot/dovecot.initd b/main/dovecot/dovecot.initd index fdfb5a9fd2..880a39f254 100644 --- a/main/dovecot/dovecot.initd +++ b/main/dovecot/dovecot.initd @@ -29,8 +29,10 @@ checkconfig() { eerror "dovecot not executable" return 1 fi - DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/var/run/dovecot} + DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/run/dovecot} DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid + checkpath --directory --owner dovecot:dovecot --mode 0755 \ + ${DOVECOT_BASEDIR} } start() { diff --git a/main/dovecot/dovecot.pre-install b/main/dovecot/dovecot.pre-install index a1b2d088e8..432a3b846d 100644 --- a/main/dovecot/dovecot.pre-install +++ b/main/dovecot/dovecot.pre-install @@ -1,5 +1,5 @@ #!/bin/sh -adduser -H -h /dev/null -s /sbin/nologin -D dovecot 2>/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 |