aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-07-22 17:47:21 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-07-22 18:29:42 +0200
commite02aad8c475a7413777e720103c1694f0d5e8487 (patch)
tree4a7d124b53252ffa06f9749884230e9210790787 /main
parent596634f4580a1f40e283b3383f4a9ef149119a4d (diff)
downloadaports-e02aad8c475a7413777e720103c1694f0d5e8487.tar.bz2
aports-e02aad8c475a7413777e720103c1694f0d5e8487.tar.xz
main/dovecot: split pop3, lmtp and submission protocols to subpkgs
I left imap in the base package, because most users expect Dovecot to provide IMAP, so moving it into a subpackage would probably confuse too many users.
Diffstat (limited to 'main')
-rw-r--r--main/dovecot/APKBUILD38
-rw-r--r--main/dovecot/dovecot.post-upgrade16
-rw-r--r--main/dovecot/split-protocols.patch30
3 files changed, 83 insertions, 1 deletions
diff --git a/main/dovecot/APKBUILD b/main/dovecot/APKBUILD
index 57232f6672..c6284b5261 100644
--- a/main/dovecot/APKBUILD
+++ b/main/dovecot/APKBUILD
@@ -1,6 +1,7 @@
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
# Contributor: Michael Mason <ms13sp@gmail.com>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dovecot
pkgver=2.3.2.1
@@ -33,11 +34,14 @@ makedepends="
sqlite-dev
zlib-dev
"
-install="$pkgname.pre-install $pkgname.post-install"
+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
@@ -52,6 +56,7 @@ subpackages="
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
@@ -158,6 +163,36 @@ dev() {
"$subpkgdir"/usr/lib/dovecot/
}
+lmtpd() {
+ pkgdesc="$pkgdesc (LMTP server)"
+ _protocol lmtp
+}
+
+pop3d() {
+ pkgdesc="$pkgdesc (POP3 daemon)"
+ _protocol pop3
+}
+
+submissiond() {
+ pkgdesc="$pkgdesc (mail submission agent)"
+ _protocol submission
+}
+
+_protocol() {
+ depends="$pkgname=$pkgver-r$pkgrel"
+ replaces="$pkgname" # for backward compatibility
+ local name="$1"
+ local protocolsd="$subpkgdir/usr/share/dovecot/protocols.d"
+
+ cd "$pkgdir"
+ _submv usr/libexec/dovecot/$name*
+ _submv etc/dovecot/conf.d/*-$name.conf
+
+ mkdir -p "$protocolsd"
+ echo "protocols = \$protocol $name" \
+ > "$protocolsd"/${subpkgname#$pkgname-}.conf
+}
+
_sieve() {
pkgdesc="Sieve and managesieve plugin for Dovecot"
depends="$pkgname=$pkgver-r$pkgrel"
@@ -258,6 +293,7 @@ _submv() {
sha512sums="c085a0d04925485423086736a3c7d919ad0ca9efeff005890382da5333edb68c7d23ccb89fbe2ac44f8f016fc993bf2c669e450794c3ab13463676cbb47c7bf7 dovecot-2.3.2.1.tar.gz
6bc24d9241f94db795a012346d9bc94b5cc7d7ce0175c03213c2b5d179d80dec95e9bdbd50bed628c8f9f7c51639e692ba5e429212a3b4a654c1e4764ac4f11c dovecot-2.3-pigeonhole-0.5.2.tar.gz
fe4fbeaedb377d809f105d9dbaf7c1b961aa99f246b77189a73b491dc1ae0aa9c68678dde90420ec53ec877c08f735b42d23edb13117d7268420e001aa30967a skip-iconv-check.patch
+794875dbf0ded1e82c5c3823660cf6996a7920079149cd8eed54231a53580d931b966dfb17185ab65e565e108545ecf6591bae82f935ab1b6ff65bb8ee93d7d5 split-protocols.patch
ba76394aac0dc16209855f7a9a66d6828e7cb198400d199cbb129a787f8037c2979eed1cb460bd9ed0914d084d8913959c0293c6dd29ea6b1c12c277fd643df0 default-config.patch
9f19698ab45969f1f94dc4bddf6de59317daee93c9421c81f2dbf8a7efe6acf89689f1d30f60f536737bb9526c315215d2bce694db27e7b8d7896036a59c31f0 dovecot.logrotate
d2758a22e5b3d1d1be867fd237466a1b5fe7ecd4355fdc51fa9e5ceab48a862f8a5d83992d2ae17a3e0b2c611ff92d0de833d7e1c5f00c6f4bfb94403dbda8e4 dovecot.initd"
diff --git a/main/dovecot/dovecot.post-upgrade b/main/dovecot/dovecot.post-upgrade
new file mode 100644
index 0000000000..2bdd73d967
--- /dev/null
+++ b/main/dovecot/dovecot.post-upgrade
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+ver_new="$1"
+ver_old="$2"
+
+if [ "$(apk version -t "$ver_old" "2.3.2.1-r1")" = "<" ]; then
+ cat >&2 <<-EOF
+ *
+ * POP3, LMTP and Submission protocols were moved into subpackages:
+ * dovecot-pop3d, dovecot-lmtpd and dovecot-submissiond. If you use
+ * some of these protocols, you have to install particular subpackage.
+ *
+ EOF
+fi
+
+exit 0
diff --git a/main/dovecot/split-protocols.patch b/main/dovecot/split-protocols.patch
new file mode 100644
index 0000000000..b4bed2ccbe
--- /dev/null
+++ b/main/dovecot/split-protocols.patch
@@ -0,0 +1,30 @@
+For each protocol $prot, which is moved into subpackage $subname,
+is installed file /usr/share/dovecot/protocols.d/$subname.conf with:
+
+ protocols = $protocols $prot
+
+--- a/doc/example-config/dovecot.conf
++++ b/doc/example-config/dovecot.conf
+@@ -20,8 +20,9 @@
+ # options. The paths listed here are for configure --prefix=/usr
+ # --sysconfdir=/etc --localstatedir=/var
+
+-# Protocols we want to be serving.
+-#protocols = imap pop3 lmtp submission
++# Enable installed protocols.
++#protocols = imap
++!include_try /usr/share/dovecot/protocols.d/*.conf
+
+ # A comma separated list of IPs or hosts where to listen in for connections.
+ # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
+--- a/src/master/master-settings.c.orig
++++ b/src/master/master-settings.c
+@@ -206,7 +206,7 @@
+ .state_dir = PKG_STATEDIR,
+ .libexec_dir = PKG_LIBEXECDIR,
+ .instance_name = PACKAGE,
+- .protocols = "imap pop3 lmtp",
++ .protocols = "imap",
+ .listen = "*, ::",
+ .ssl = "yes:no:required",
+ .default_internal_user = "dovecot",