summaryrefslogtreecommitdiff
path: root/nonsystemd/dovecot-openrc
diff options
context:
space:
mode:
Diffstat (limited to 'nonsystemd/dovecot-openrc')
-rw-r--r--nonsystemd/dovecot-openrc/PKGBUILD25
-rw-r--r--nonsystemd/dovecot-openrc/dovecot.confd2
-rw-r--r--nonsystemd/dovecot-openrc/dovecot.initd39
3 files changed, 66 insertions, 0 deletions
diff --git a/nonsystemd/dovecot-openrc/PKGBUILD b/nonsystemd/dovecot-openrc/PKGBUILD
new file mode 100644
index 000000000..effeb4188
--- /dev/null
+++ b/nonsystemd/dovecot-openrc/PKGBUILD
@@ -0,0 +1,25 @@
+# Maintainer: David P. <megver83@parabola.nu>
+# Maintainer (Artix): Rafli Akmal <rafliakmaltejakusuma@gmail.com>
+# Contributor (Artix): artoo <artoo@artixlinux.org>
+# Contributor (Artix): Oscar Campos <damnwidget@artixlinux.org>
+
+pkgname=dovecot-openrc
+pkgver=20210529
+pkgrel=2
+pkgdesc="OpenRC dovecot init script"
+arch=('any')
+url="https://gitea.artixlinux.org/artixlinux/packages-openrc"
+license=('GPL2')
+groups=('openrc-galaxy')
+provides=('init-dovecot')
+conflicts=('init-dovecot')
+backup=('etc/conf.d/dovecot')
+source=("dovecot".{confd,initd})
+sha256sums=('2aa928e26d529bc34dc430991b717f31621c688d79af6142a52257d33ea852ba'
+ '75e12bdc57fff9dd2ace0f4cdb1a5f0c44621d4f6914af3424f49d0c813f0697')
+
+package() {
+ depends=('openrc' 'dovecot')
+ install -Dm755 "$srcdir/dovecot.initd" "$pkgdir/etc/init.d/dovecot"
+ install -Dm644 "$srcdir/dovecot.confd" "$pkgdir/etc/conf.d/dovecot"
+}
diff --git a/nonsystemd/dovecot-openrc/dovecot.confd b/nonsystemd/dovecot-openrc/dovecot.confd
new file mode 100644
index 000000000..9a930eef6
--- /dev/null
+++ b/nonsystemd/dovecot-openrc/dovecot.confd
@@ -0,0 +1,2 @@
+# Dovecot configuration file location
+DOVECOT_CONF=
diff --git a/nonsystemd/dovecot-openrc/dovecot.initd b/nonsystemd/dovecot-openrc/dovecot.initd
new file mode 100644
index 000000000..239556165
--- /dev/null
+++ b/nonsystemd/dovecot-openrc/dovecot.initd
@@ -0,0 +1,39 @@
+#!/usr/bin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_commands="checkconfig"
+
+supervisor=supervise-daemon
+command=/usr/bin/dovecot
+command_args="-F -c ${DOVECOT_CONF}"
+
+depend() {
+ need localmount
+ before postfix
+ after bootmisc ldap mysql ntp-client ntpd postgresql saslauthd slapd
+ use logger net
+}
+
+checkconfig() {
+ DOVECOT_INSTANCE=${SVCNAME##*.}
+ if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" ]; then
+ DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf
+ else
+ DOVECOT_CONF=/etc/dovecot/dovecot.conf
+ fi
+ if [ ! -e ${DOVECOT_CONF} ]; then
+ eerror "You will need an ${DOVECOT_CONF} first"
+ return 1
+ fi
+ if [ -x /usr/sbin/dovecot ]; then
+ DOVECOT_BASEDIR=$(/usr/bin/dovecot -c ${DOVECOT_CONF} config -h base_dir)
+ if [ $? -ne 0 ]; then
+ eerror "Error parsing ${DOVECOT_CONF}"
+ return 1
+ fi
+ else
+ eerror "dovecot not executable"
+ return 1
+ fi
+}