diff options
Diffstat (limited to 'main/dovecot/APKBUILD')
-rw-r--r-- | main/dovecot/APKBUILD | 174 |
1 files changed, 111 insertions, 63 deletions
diff --git a/main/dovecot/APKBUILD b/main/dovecot/APKBUILD index c2c8a3e867..f6f194263c 100644 --- a/main/dovecot/APKBUILD +++ b/main/dovecot/APKBUILD @@ -16,14 +16,38 @@ 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-connector-c-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-openrc - $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 +makedepends=" + autoconf + automake + bzip2-dev + clucene-dev + expat-dev + heimdal-dev + libcap-dev + libressl-dev + libtool + linux-headers + mariadb-connector-c-dev + openldap-dev + postgresql-dev + sqlite-dev + zlib-dev + " +install="$pkgname.pre-install $pkgname.post-install" +subpackages=" + $pkgname-doc + $pkgname-dev + $pkgname-openrc + $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="https://www.dovecot.org/releases/$_pkgvermajor/$pkgname-$pkgver.tar.gz https://pigeonhole.dovecot.org/releases/$_pkgvermajor/$pkgname-$_pkgvermajor-pigeonhole-$_pigeonholever.tar.gz @@ -32,7 +56,8 @@ source="https://www.dovecot.org/releases/$_pkgvermajor/$pkgname-$pkgver.tar.gz dovecot.logrotate dovecot.initd " -_builddirpigeonhole="$srcdir/$pkgname-${_pkgvermajor}-pigeonhole-$_pigeonholever" +builddir="$srcdir/$pkgname-$pkgver" +_builddir_pigeonhole="$srcdir/$pkgname-$_pkgvermajor-pigeonhole-$_pigeonholever" # secfixes: # 2.3.1-r0: @@ -70,7 +95,7 @@ build() { make # Build pigeonhole plugin - cd "$_builddirpigeonhole" + cd "$_builddir_pigeonhole" _configure \ --with-dovecot="$builddir" \ --with-ldap=plugin @@ -84,34 +109,38 @@ 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 + cd "$pkgdir" + + install -d ./etc/ssl/dovecot + install -D -m 755 "$srcdir"/dovecot.initd ./etc/init.d/dovecot + install -D -m 644 "$srcdir"/dovecot.logrotate ./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 + rm ./etc/dovecot/* + rm ./usr/share/doc/dovecot/mkcert.sh + mv ./usr/share/doc/dovecot/dovecot-openssl.cnf ./etc/dovecot/ + mv ./usr/share/doc/dovecot/example-config/dovecot* \ + ./usr/share/doc/dovecot/example-config/conf.d \ + ./etc/dovecot/ + rm -fr ./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"/etc/dovecot/conf.d/10-ssl.conf - # set default passdb to passwd and create appropriate 'users' file - install -m 640 -o dovecot -g mail /dev/null "$pkgdir"/etc/dovecot/users + ./etc/dovecot/conf.d/10-ssl.conf + + # Set default passdb to passwd and create appropriate 'users' file. + install -m 640 -o dovecot -g mail /dev/null ./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 + ./etc/dovecot/conf.d/10-auth.conf - # Installing pigeonhole plugin - cd "$_builddirpigeonhole" + # Installing pigeonhole plugin. + cd "$_builddir_pigeonhole" make install DESTDIR="$pkgdir" # Moving config in the correct place @@ -119,17 +148,6 @@ package() { "$pkgdir"/etc/dovecot/conf.d } -_mv() { - local i - while [ $# -gt 0 ]; do - local dir=${1%/*} - mkdir -p "$subpkgdir"/$dir - mv "$pkgdir/$1" "$subpkgdir/$dir/" - [ "$(ls -A $pkgdir/$dir)" ] || rmdir "$pkgdir"/$dir - shift - done -} - dev() { default_dev mkdir -p "$subpkgdir"/usr/lib/dovecot @@ -138,70 +156,100 @@ dev() { } _sieve() { - pkgdesc="Sieve plugin for dovecot" + pkgdesc="Sieve and managesieve plugin for Dovecot" depends="$pkgname" - _mv $(cd "$pkgdir" && find usr -name '*sieve_extprograms*') - _mv $(cd "$pkgdir" && find usr -name '*sieve_imapsieve*') - _mv $(cd "$pkgdir" && find usr -name '*sieve*') - _mv $(cd "$pkgdir" && find usr -name '*pigeonhole*') - _mv $(cd "$pkgdir" && find etc/dovecot -name '*sieve*') + + cd "$pkgdir" + _submv $(find usr/ -name '*sieve_extprograms*') + _submv $(find usr/ -name '*sieve_imapsieve*') + _submv $(find usr/ -name '*sieve*') + _submv $(find usr/ -name '*pigeonhole*') + _submv $(find etc/dovecot/ -name '*sieve*') } _sieve_ldap() { - pkgdesc="Sieve plugin for dovecot (ldap support)" + pkgdesc="Sieve and managesieve plugin for Dovecot (LDAP support)" depends="$pkgname-pigeonhole-plugin $pkgname-ldap" - _mv $(cd "$pkgdir" && find usr -name '*_sieve_storage_ldap_*') - mkdir -p "$subpkgdir" + + cd "$pkgdir" + _submv $(find usr/ -name '*_sieve_storage_ldap_*') } pgsql() { - pkgdesc="postgresql driver for dovecot" + pkgdesc="PostgreSQL driver for Dovecot" depends="$pkgname-sql" - _mv $(cd "$pkgdir" && find usr -name '*_pgsql*') + + cd "$pkgdir" + _submv $(find usr/ -name '*_pgsql*') } mysql() { - pkgdesc="mysql driver for dovecot" + pkgdesc="MySQL driver for Dovecot" depends="$pkgname-sql" - _mv $(cd "$pkgdir" && find usr -name '*_mysql*') + + cd "$pkgdir" + _submv $(find usr/ -name '*_mysql*') } sqlite() { - pkgdesc="sqlite driver for dovecot" + pkgdesc="SQLite driver for Dovecot" depends="$pkgname-sql" - _mv $(cd "$pkgdir" && find usr -name '*_sqlite*') + + cd "$pkgdir" + _submv $(find usr/ -name '*_sqlite*') } gssapi() { - pkgdesc="GSSAPI auth plugin for dovecot" + pkgdesc="GSSAPI auth plugin for Dovecot" depends="$pkgname" - _mv $(cd "$pkgdir" && find usr -name '*_gssapi*') + + cd "$pkgdir" + _submv $(find usr/ -name '*_gssapi*') } ldap() { - pkgdesc="LDAP auth plugin for dovecot" + pkgdesc="LDAP auth plugin for Dovecot" depends="$pkgname" - _mv $(cd "$pkgdir" && find usr -name '*[_-]ldap*') - _mv $(cd "$pkgdir" && find etc/dovecot -name '*-ldap.conf*') + + cd "$pkgdir" + _submv $(find usr/ -name '*[_-]ldap*') + _submv $(find etc/dovecot/ -name '*-ldap.conf*') } sql() { pkgdesc="SQL plugin for dovecot" depends="$pkgname" - _mv $(cd "$pkgdir" && find usr -name '*-sql.*') - _mv $(cd "$pkgdir" && find etc/dovecot -name '*-sql.conf*') + + cd "$pkgdir" + _submv $(find usr/ -name '*-sql.*') + _submv $(find etc/dovecot/ -name '*-sql.conf*') } _fts_solr() { pkgdesc="FTS-Solr plugin for dovecot" depends="$pkgname" - _mv $(cd "$pkgdir" && find usr -name '*fts*solr*') + + cd "$pkgdir" + _submv $(find usr/ -name '*fts*solr*') } _fts_lucene() { pkgdesc="FTS-Lucene plugin for dovecot" depends="$pkgname" - _mv $(cd "$pkgdir" && find usr -name '*fts*lucene*') + + cd "$pkgdir" + _submv $(find usr/ -name '*fts*lucene*') +} + +_submv() { + local dir + while [ $# -gt 0 ]; do + dir=${1%/*} + mkdir -p "$subpkgdir"/$dir + mv "$pkgdir/$1" "$subpkgdir/$dir/" + [ "$(ls -A $pkgdir/$dir)" ] || rmdir "$pkgdir"/$dir + shift + done } sha512sums="c085a0d04925485423086736a3c7d919ad0ca9efeff005890382da5333edb68c7d23ccb89fbe2ac44f8f016fc993bf2c669e450794c3ab13463676cbb47c7bf7 dovecot-2.3.2.1.tar.gz |