# Contributor: Valery Kartel # Contributor: Ɓukasz Jendrysik # Contributor: Michael Mason # Contributor: Jakub Jirutka # Maintainer: Natanael Copa pkgname=dovecot pkgver=2.3.4.1 _pkgvermajor=2.3 pkgrel=1 _pigeonholever=0.5.4 _pigeonholevermajor=${_pigeonholever%.*} pkgdesc="IMAP and POP3 server" url="https://www.dovecot.org/" arch="all" options="libtool" case $CARCH in x86|armhf|armv7) options="$options !check" # test failures esac license="LGPL-2.0-or-later" depends="openssl" pkgusers="dovecot dovenull" pkggroups="dovecot dovenull" makedepends=" autoconf automake bzip2-dev clucene-dev expat-dev heimdal-dev libcap-dev openssl-dev libtool linux-headers mariadb-connector-c-dev openldap-dev postgresql-dev sqlite-dev zlib-dev libsodium-dev " install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade" subpackages=" $pkgname-doc $pkgname-dev $pkgname-openrc $pkgname-lmtpd $pkgname-pop3d $pkgname-submissiond $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 skip-iconv-check.patch split-protocols.patch default-config.patch dovecot.logrotate dovecot.initd mysql-fix-double-close.patch " builddir="$srcdir/$pkgname-$pkgver" _builddir_pigeonhole="$srcdir/$pkgname-$_pkgvermajor-pigeonhole-$_pigeonholever" # secfixes: # 2.3.4.1-r0: # - CVE-2019-3814 # 2.3.1-r0: # - CVE-2017-15130 # - CVE-2017-14461 # - CVE-2017-15132 _configure() { ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --localstatedir=/var \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-static \ "$@" } build() { cd "$builddir" _configure \ --with-gssapi=plugin \ --with-ldap=plugin \ --with-sql=plugin \ --with-mysql \ --with-sqlite \ --with-pgsql \ --with-solr \ --with-lucene \ --with-ssl=openssl \ --with-ssldir=/etc/ssl/dovecot \ --with-rundir=/run/dovecot make # Build pigeonhole plugin cd "$_builddir_pigeonhole" _configure \ --with-dovecot="$builddir" \ --with-ldap=plugin make } check() { cd "$builddir" make check } package() { cd "$builddir" make DESTDIR="$pkgdir" install 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 ./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 = "$protocolsd"/${subpkgname#$pkgname-}.conf } _sieve() { pkgdesc="Sieve and managesieve plugin for Dovecot" depends="$pkgname=$pkgver-r$pkgrel" 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 and managesieve plugin for Dovecot (LDAP support)" depends="$pkgname-pigeonhole-plugin=$pkgver-r$pkgrel $pkgname-ldap=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*_sieve_storage_ldap_*') } pgsql() { pkgdesc="PostgreSQL driver for Dovecot" depends="$pkgname-sql=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*_pgsql*') } mysql() { pkgdesc="MySQL driver for Dovecot" depends="$pkgname-sql=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*_mysql*') } sqlite() { pkgdesc="SQLite driver for Dovecot" depends="$pkgname-sql=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*_sqlite*') } gssapi() { pkgdesc="GSSAPI auth plugin for Dovecot" depends="$pkgname=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*_gssapi*') } ldap() { pkgdesc="LDAP auth plugin for Dovecot" depends="$pkgname=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*[_-]ldap*') _submv $(find etc/dovecot/ -name '*-ldap.conf*') } sql() { pkgdesc="SQL plugin for dovecot" depends="$pkgname=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*-sql.*') _submv $(find etc/dovecot/ -name '*-sql.conf*') } _fts_solr() { pkgdesc="FTS-Solr plugin for dovecot" depends="$pkgname=$pkgver-r$pkgrel" cd "$pkgdir" _submv $(find usr/ -name '*fts*solr*') } _fts_lucene() { pkgdesc="FTS-Lucene plugin for dovecot" depends="$pkgname=$pkgver-r$pkgrel" 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="ff21aa0f0cae17dfa66617291688856727412defa48bad2b6be057cb509fbec1c2e134afbfee69929d06b8692a0fcbd8451671ba02860e1673ae1c9483c2c17e dovecot-2.3.4.1.tar.gz 9c82cce7540f8ab66e2e370e0220c99048d6ac53ed680cd763e0b03d0200e2451cee4303ef97b87a16e7248e1c73b92ba91b47a2a20c75cb2cd62695a28046f3 dovecot-2.3-pigeonhole-0.5.4.tar.gz fe4fbeaedb377d809f105d9dbaf7c1b961aa99f246b77189a73b491dc1ae0aa9c68678dde90420ec53ec877c08f735b42d23edb13117d7268420e001aa30967a skip-iconv-check.patch 794875dbf0ded1e82c5c3823660cf6996a7920079149cd8eed54231a53580d931b966dfb17185ab65e565e108545ecf6591bae82f935ab1b6ff65bb8ee93d7d5 split-protocols.patch 0d8f89c7ba6f884719b5f9fc89e8b2efbdc3e181de308abf9b1c1b0e42282f4df72c7bf62f574686967c10a8677356560c965713b9d146e2770aab17e95bcc07 default-config.patch 9f19698ab45969f1f94dc4bddf6de59317daee93c9421c81f2dbf8a7efe6acf89689f1d30f60f536737bb9526c315215d2bce694db27e7b8d7896036a59c31f0 dovecot.logrotate d91951b81150d7a3ef6a674c0dc7b012f538164dac4b9d27a6801d31da6813b764995a438f69b6a680463e1b60a3b4f2959654f68e565fe116ea60312d5e5e70 dovecot.initd 07500fdc27e8e76f8325e7160e3ac0dfd80e3dcb6d310499ea3b7d6c7899809bbb76c01aec78c4b8b9bf80cd8260dbc26726a612357d30f3b3c8be80f77f9abd mysql-fix-double-close.patch"