commit:     fe99916a6310adad8cca2e1494681af0a476646b
Author:     Sandino Araico Sanchez <sandino <AT> sandino <DOT> net>
AuthorDate: Wed Jan 27 13:28:27 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Jan 27 13:29:18 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe99916a

net-mail/dbmail: version bump to 3.2.5

Signed-off-by: Sandino Araico Sanchez <sandino <AT> sandino.net>
Closes: https://bugs.gentoo.org/728060
Closes: https://github.com/gentoo/gentoo/pull/16994
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 net-mail/dbmail/Manifest                     |  1 +
 net-mail/dbmail/dbmail-3.2.5.ebuild          | 96 ++++++++++++++++++++++++++++
 net-mail/dbmail/files/README.gentoo          | 41 ++++++++++++
 net-mail/dbmail/files/dbmail-imapd.initd     | 74 ++++++++-------------
 net-mail/dbmail/files/dbmail-lmtpd.initd     | 74 ++++++++-------------
 net-mail/dbmail/files/dbmail-pop3d.initd     | 74 ++++++++-------------
 net-mail/dbmail/files/dbmail-timsieved.initd | 71 ++++++++------------
 7 files changed, 246 insertions(+), 185 deletions(-)

diff --git a/net-mail/dbmail/Manifest b/net-mail/dbmail/Manifest
index 46eddcf7a2a..8d47f7766f6 100644
--- a/net-mail/dbmail/Manifest
+++ b/net-mail/dbmail/Manifest
@@ -1 +1,2 @@
 DIST dbmail-3.2.3.tar.gz 2444227 BLAKE2B 
baa812fb3e925e6d896762596426208fc2ac5fcb01cb8100cfbd0464f1342f934c099ca52fd857e05fc82b97227155e9dcfc987d6c9b5c37e7daf21b167c9841
 SHA512 
29cc89830278f2ff28a4221fc81d4ff13cc371fbca7fb51d5376e9243234220b552cb4b6ec035c150e6cfa178435c4f36b9ce132fc02334bc6cdeb1a41c8ed85
+DIST dbmail-3.2.5.tar.gz 2463966 BLAKE2B 
f4099c6f869dbb041d7eccdf20f3a34d36918237cc0386c71a1d339da8651b9301e676b25201856038045bb9590f880353c6ccafd57330f9cf48382c1b4c603c
 SHA512 
6b0d7e1f6f7449869db1e094ffce9e1ef315c60784ea5ae5f814f2cf9a18c358b4c5d107a420c7317961ffa343fc59c9083789177514aee96523927688f276a0

diff --git a/net-mail/dbmail/dbmail-3.2.5.ebuild 
b/net-mail/dbmail/dbmail-3.2.5.ebuild
new file mode 100644
index 00000000000..ab3f44a299a
--- /dev/null
+++ b/net-mail/dbmail/dbmail-3.2.5.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit systemd readme.gentoo-r1
+
+DESCRIPTION="Fast and scalable sql based email services"
+HOMEPAGE="https://www.dbmail.org/";
+SRC_URI="https://github.com/dbmail/dbmail/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+doc jemalloc ldap libressl sieve ssl static systemd"
+
+DEPEND="dev-db/libzdb
+       sieve? ( >=mail-filter/libsieve-2.2.1 )
+       ldap? ( >=net-nds/openldap-2.3.33 )
+       jemalloc? ( dev-libs/jemalloc )
+       app-text/asciidoc
+       app-text/xmlto
+       app-crypt/mhash
+       sys-libs/zlib
+       dev-libs/gmime:2.6
+       >=dev-libs/glib-2.16
+       dev-libs/libevent
+       ssl? (
+               !libressl? ( dev-libs/openssl:0= )
+               libressl? ( dev-libs/libressl:0= )
+       )"
+RDEPEND="${DEPEND}
+       acct-group/dbmail
+       acct-user/dbmail"
+DOCS=( AUTHORS README.md INSTALL THANKS UPGRADING )
+
+README_GENTOO_SUFFIX=""
+
+src_prepare() {
+       sed -i -e "s:nobody:dbmail: ; s:nogroup:dbmail: ; 
s:/var/run:/run/dbmail:" dbmail.conf || die
+       # change config path to our default and use the conf.d and init.d files 
from the contrib dir
+       sed -i -e "s:/etc/dbmail.conf:/etc/dbmail/dbmail.conf:" 
contrib/startup-scripts/gentoo/init.d-dbmail || die
+
+       default
+}
+
+src_configure() {
+       econf \
+               --enable-manpages \
+               --sysconfdir=/etc/dbmail \
+               $(use_enable doc manpages) \
+               $(use_enable static) \
+               $(use_enable systemd) \
+               $(use_with jemalloc) \
+               $(use_with sieve) \
+               $(use_with ldap auth-ldap)
+}
+
+src_install() {
+       emake DESTDIR="${D}" SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" 
install
+       einstalldocs
+
+       docompress -x /usr/share/doc/${PF}/sql
+       dodoc -r sql
+       dodoc -r test-scripts
+       dodoc -r contrib
+       ## TODO: install other contrib stuff
+
+       insinto /etc/dbmail
+       newins dbmail.conf dbmail.conf.dist
+
+       # use custom init scripts until updated in upstream contrib
+       newinitd "${FILESDIR}/dbmail-imapd.initd" dbmail-imapd
+       newinitd "${FILESDIR}/dbmail-lmtpd.initd" dbmail-lmtpd
+       newinitd "${FILESDIR}/dbmail-pop3d.initd" dbmail-pop3d
+       newinitd "${FILESDIR}/dbmail-timsieved.initd" dbmail-timsieved
+
+       dobin contrib/mailbox2dbmail/mailbox2dbmail
+       doman contrib/mailbox2dbmail/mailbox2dbmail.1
+
+       # ldap schema
+       if use ldap; then
+               insinto /etc/openldap/schema
+               doins "${S}/dbmail.schema"
+       fi
+
+       keepdir /var/lib/dbmail
+       fperms 750 /var/lib/dbmail
+       fowners dbmail:dbmail /var/lib/dbmail
+       
+       readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+}

diff --git a/net-mail/dbmail/files/README.gentoo 
b/net-mail/dbmail/files/README.gentoo
new file mode 100644
index 00000000000..b7e052261a9
--- /dev/null
+++ b/net-mail/dbmail/files/README.gentoo
@@ -0,0 +1,41 @@
+Please read the INSTALL file in /usr/share/doc/${PF}/
+for remaining instructions on setting up dbmail users and 
+for finishing configuration to connect to your MTA and 
+to connect to your db.
+
+DBMail requires either SQLite, PostgreSQL or MySQL.
+Database schemes can be found in /usr/share/doc/${PF}/
+You will also want to follow the installation instructions
+on setting up the maintenance program to delete old messages.
+Don't forget to edit /etc/dbmail/dbmail.conf as well.
+
+For regular maintenance, add this to crontab:
+0 3 * * * /usr/bin/dbmail-util -cpdy >/dev/null 2>&1
+
+Please make sure to run etc-update.
+If you get an error message about plugins not found
+please add the library_directory configuration switch to
+dbmail.conf and set it to the correct path
+(usually /usr/lib/dbmail or /usr/lib64/dbmail on amd64)
+A sample can be found in dbmail.conf.dist after etc-update.
+
+We are now using the init script from upstream.
+Please edit /etc/conf.d/dbmail to set which services to start
+and delete /etc/init.d/dbmail-* when you are done. (don't
+forget to rc-update del dbmail-* first)
+
+Changed pid directory to /run/dbmail (see
+http://www.dbmail.org/mantis/view.php?id=949 for details)
+
+The database config has changed to support libzdb db URI
+Please check the documentation (or Bug #479664)
+
+The database schema has changed since 3.0.x make sure
+to run the migration script
+
+Please be aware, that the single init-script for all services
+has been replaced with seperate init scripts for the individual services.
+Make sure to add dbmail-(imapd|lmtpd|pop3d|timsieved) using rc-update
+and remove dbmail if you want to take advantage of this change.
+
+

diff --git a/net-mail/dbmail/files/dbmail-imapd.initd 
b/net-mail/dbmail/files/dbmail-imapd.initd
index f2e16dff170..c2925f9ecb0 100644
--- a/net-mail/dbmail/files/dbmail-imapd.initd
+++ b/net-mail/dbmail/files/dbmail-imapd.initd
@@ -1,11 +1,5 @@
-#!/sbin/openrc-run
+#!/sbin/runscript
 #
-# chkconfig: - 91 35
-# description: Starts and stops dbmail-impad
-#
-
-
-PROGRAM=dbmail-imapd
 
 BIN_DIR=/usr/sbin
 PID_DIR=/run/dbmail
@@ -18,51 +12,37 @@ CONFIG=/etc/dbmail/dbmail.conf
 #extra_started_commands="reload"
 
 depend() {
-        need net
-        # This won't cause a hard failure if neither is installed, however.
-        use mysql
-        use pgsql
-        after mta
+       need net
+       use mysql
+       use pgsql
+       after mta
 }
 
-initService() {
-    # Avoid using root's TMPDIR
-    unset TMPDIR
-
-    # Check that config file exists.
-    if [ ! -e $CONFIG ]; then
-        eerror "Config file not found ($CONFIG)"
-        eerror "An example config can be found in /etc/dbmail/dbmail.conf.dist"
-        return 1
-    fi
-
-    checkpath -d $PID_DIR -m 750 -o dbmail:dbmail
-
-    RETVAL=0
+checkconfig() {
+       if [ ! -e "/etc/dbmail/dbmail.conf" ]; then
+               eerror "You need to create apropriate config"
+               eerror "in /etc/dbmail/ . Example can be found in 
/etc/dbmail/dbmail.conf.dist"
+               return 1
+       fi
+       # Avoid using root's TMPDIR
+       unset TMPDIR
 }
 
+
 start() {
-       initService
-        ebegin "Starting DBMail IMAP daemon ($PROGRAM)"
-            start-stop-daemon --start --quiet \
-                --pidfile $PID_DIR/$PROGRAM.$PID \
-                --exec $BIN_DIR/$PROGRAM \
-                --name $PROGRAM \
-                -- -f $CONFIG -p $PID_DIR/$PROGRAM.$PID 2>&1
-        eend $?
-}
+       checkconfig && \
+       ebegin "Starting DBMail IMAP daemon"
+           start-stop-daemon --start --quiet \
+               --exec /usr/sbin/dbmail-imapd \
+               --name dbmail-imapd \
+               -- -p ${PIDFILE} -f /etc/dbmail/dbmail.conf 2>&1
+       eend $?
+}      
 
 stop() {
-        ebegin "Stopping DBMail IMAP daemon ($PROGRAM)"
-            start-stop-daemon --stop --quiet --retry 15 \
-                --pidfile $PID_DIR/$PROGRAM.$PID
-        eend $?
-}
+       ebegin "Stopping DBMail IMAP daemon"
+           start-stop-daemon --stop --quiet --retry 5 \
+               --pidfile ${PIDFILE}
+       eend $?
+}      
 
-## not in 3.1.x yet
-#reload() {#
-#       ebegin "Reloading DBMail IMAP daemon ($PROGRAM)"
-#           start-stop-daemon --quiet --signal HUP \
-#               --pidfile $PID_DIR/$PROGRAM.$PID
-#       eend $?
-#}

diff --git a/net-mail/dbmail/files/dbmail-lmtpd.initd 
b/net-mail/dbmail/files/dbmail-lmtpd.initd
index 7062098fb7b..083d0e6b8a8 100644
--- a/net-mail/dbmail/files/dbmail-lmtpd.initd
+++ b/net-mail/dbmail/files/dbmail-lmtpd.initd
@@ -1,11 +1,5 @@
-#!/sbin/openrc-run
+#!/sbin/runscript
 #
-# chkconfig: - 91 35
-# description: Starts and stops dbmail-lmtpd
-#
-
-
-PROGRAM=dbmail-lmtpd
 
 BIN_DIR=/usr/sbin
 PID_DIR=/run/dbmail
@@ -18,51 +12,37 @@ CONFIG=/etc/dbmail/dbmail.conf
 #extra_started_commands="reload"
 
 depend() {
-        need net
-        # This won't cause a hard failure if neither is installed, however.
-        use mysql
-        use pgsql
-        after mta
+       need net
+       use mysql
+       use pgsql
+       after mta
 }
 
-initService() {
-    # Avoid using root's TMPDIR
-    unset TMPDIR
-
-    # Check that config file exists.
-    if [ ! -e $CONFIG ]; then
-        eerror "Config file not found ($CONFIG)"
-        eerror "An example config can be found in /etc/dbmail/dbmail.conf.dist"
-        return 1
-    fi
-
-    checkpath -d $PID_DIR -m 750 -o dbmail:dbmail
-
-    RETVAL=0
+checkconfig() {
+       if [ ! -e "/etc/dbmail/dbmail.conf" ]; then
+               eerror "You need to create apropriate config"
+               eerror "in /etc/dbmail/ . Example can be found in 
/etc/dbmail/dbmail.conf.dist"
+               return 1
+       fi
+       # Avoid using root's TMPDIR
+       unset TMPDIR
 }
 
+
 start() {
-       initService
-        ebegin "Starting DBMail LMTP daemon ($PROGRAM)"
-            start-stop-daemon --start --quiet \
-                --pidfile $PID_DIR/$PROGRAM.$PID \
-                --exec $BIN_DIR/$PROGRAM \
-                --name $PROGRAM \
-                -- -f $CONFIG -p $PID_DIR/$PROGRAM.$PID 2>&1
-        eend $?
-}
+       checkconfig && \
+       ebegin "Starting DBMail LMTP daemon"
+           start-stop-daemon --start --quiet \
+               --exec /usr/sbin/dbmail-lmtpd \
+               --name dbmail-lmtpd \
+               -- -p ${PIDFILE} -f /etc/dbmail/dbmail.conf 2>&1
+       eend $?
+}      
 
 stop() {
-        ebegin "Stopping DBMail LMTP daemon ($PROGRAM)"
-            start-stop-daemon --stop --quiet --retry 15 \
-                --pidfile $PID_DIR/$PROGRAM.$PID
-        eend $?
-}
+       ebegin "Stopping DBMail LMTP daemon"
+           start-stop-daemon --stop --quiet --retry 5 \
+               --pidfile ${PIDFILE}
+       eend $?
+}      
 
-## not in 3.1.x yet
-#reload() {#
-#       ebegin "Reloading DBMail LMTP daemon ($PROGRAM)"
-#           start-stop-daemon --quiet --signal HUP \
-#               --pidfile $PID_DIR/$PROGRAM.$PID
-#       eend $?
-#}

diff --git a/net-mail/dbmail/files/dbmail-pop3d.initd 
b/net-mail/dbmail/files/dbmail-pop3d.initd
index 156c030be37..16c4d371f2e 100644
--- a/net-mail/dbmail/files/dbmail-pop3d.initd
+++ b/net-mail/dbmail/files/dbmail-pop3d.initd
@@ -1,11 +1,5 @@
-#!/sbin/openrc-run
+#!/sbin/runscript
 #
-# chkconfig: - 91 35
-# description: Starts and stops dbmail-pop3d
-#
-
-
-PROGRAM=dbmail-pop3d
 
 BIN_DIR=/usr/sbin
 PID_DIR=/run/dbmail
@@ -18,51 +12,37 @@ CONFIG=/etc/dbmail/dbmail.conf
 #extra_started_commands="reload"
 
 depend() {
-        need net
-        # This won't cause a hard failure if neither is installed, however.
-        use mysql
-        use pgsql
-        after mta
+       need net
+       use mysql
+       use pgsql
+       after mta
 }
 
-initService() {
-    # Avoid using root's TMPDIR
-    unset TMPDIR
-
-    # Check that config file exists.
-    if [ ! -e $CONFIG ]; then
-        eerror "Config file not found ($CONFIG)"
-        eerror "An example config can be found in /etc/dbmail/dbmail.conf.dist"
-        return 1
-    fi
-
-    checkpath -d $PID_DIR -m 750 -o dbmail:dbmail
-
-    RETVAL=0
+checkconfig() {
+       if [ ! -e "/etc/dbmail/dbmail.conf" ]; then
+               eerror "You need to create apropriate config"
+               eerror "in /etc/dbmail/ . Example can be found in 
/etc/dbmail/dbmail.conf.dist"
+               return 1
+       fi
+       # Avoid using root's TMPDIR
+       unset TMPDIR
 }
 
+
 start() {
-       initService
-        ebegin "Starting DBMail POP3 daemon ($PROGRAM)"
-            start-stop-daemon --start --quiet \
-                --pidfile $PID_DIR/$PROGRAM.$PID \
-                --exec $BIN_DIR/$PROGRAM \
-                --name $PROGRAM \
-                -- -f $CONFIG -p $PID_DIR/$PROGRAM.$PID 2>&1
-        eend $?
-}
+       checkconfig && \
+       ebegin "Starting DBMail POP3 daemon"
+           start-stop-daemon --start --quiet \
+               --exec /usr/sbin/dbmail-pop3d \
+               --name dbmail-pop3d \
+               -- -p ${PIDFILE} -f /etc/dbmail/dbmail.conf 2>&1
+       eend $?
+}      
 
 stop() {
-        ebegin "Stopping DBMail POP3 daemon ($PROGRAM)"
-            start-stop-daemon --stop --quiet --retry 15 \
-                --pidfile $PID_DIR/$PROGRAM.$PID
-        eend $?
-}
+       ebegin "Stopping DBMail POP3 daemon"
+           start-stop-daemon --stop --quiet --retry 5 \
+               --pidfile ${PIDFILE}
+       eend $?
+}      
 
-## not in 3.1.x yet
-#reload() {#
-#       ebegin "Reloading DBMail POP3 daemon ($PROGRAM)"
-#           start-stop-daemon --quiet --signal HUP \
-#               --pidfile $PID_DIR/$PROGRAM.$PID
-#       eend $?
-#}

diff --git a/net-mail/dbmail/files/dbmail-timsieved.initd 
b/net-mail/dbmail/files/dbmail-timsieved.initd
index c5402bdf876..657bfd58666 100644
--- a/net-mail/dbmail/files/dbmail-timsieved.initd
+++ b/net-mail/dbmail/files/dbmail-timsieved.initd
@@ -1,10 +1,9 @@
-#!/sbin/openrc-run
+#!/sbin/runscript
 #
 # chkconfig: - 91 35
 # description: Starts and stops dbmail-timsieved
 #
 
-
 PROGRAM=dbmail-timsieved
 
 BIN_DIR=/usr/sbin
@@ -14,55 +13,39 @@ PID=pid
 # Where is the dbmail.conf file located?
 CONFIG=/etc/dbmail/dbmail.conf
 
-## not in 3.1.x yet
-#extra_started_commands="reload"
+PIDFILE="/run/dbmail-timsieved.pid"
 
 depend() {
-        need net
-        # This won't cause a hard failure if neither is installed, however.
-        use mysql
-        use pgsql
-        after mta
+       need net
+       use mysql
+       use pgsql
+       after mta
 }
 
-initService() {
-    # Avoid using root's TMPDIR
-    unset TMPDIR
-    
-    # Check that config file exists.
-    if [ ! -e $CONFIG ]; then
-        eerror "Config file not found ($CONFIG)"
-        eerror "An example config can be found in /etc/dbmail/dbmail.conf.dist"
-        return 1
-    fi
-
-    checkpath -d $PID_DIR -m 750 -o dbmail:dbmail
-
-    RETVAL=0
+checkconfig() {
+       if [ ! -e "/etc/dbmail/dbmail.conf" ]; then
+               eerror "You need to create apropriate config"
+               eerror "in /etc/dbmail/ . Example can be found in 
/etc/dbmail/dbmail.conf.dist"
+               return 1
+       fi
+       # Avoid using root's TMPDIR
+       unset TMPDIR
 }
 
+
 start() {
-       initService
-        ebegin "Starting DBMail SIEVE daemon ($PROGRAM)"
-            start-stop-daemon --start --quiet \
-                --pidfile $PID_DIR/$PROGRAM.$PID \
-                --exec $BIN_DIR/$PROGRAM \
-                --name $PROGRAM \
-                -- -f $CONFIG -p $PID_DIR/$PROGRAM.$PID 2>&1
-        eend $?
-}
+       checkconfig && \
+       ebegin "Starting DBMail SIEVE daemon"
+           start-stop-daemon --start --quiet \
+               --exec /usr/sbin/dbmail-timsieved \
+               -- -p ${PIDFILE} -f /etc/dbmail/dbmail.conf 2>&1
+       eend $?
+}      
 
 stop() {
-        ebegin "Stopping DBMail SIEVE daemon ($PROGRAM)"
-            start-stop-daemon --stop --quiet --retry 15 \
-                --pidfile $PID_DIR/$PROGRAM.$PID
-        eend $?
-}
+       ebegin "Stopping DBMail SIEVE daemon"
+           start-stop-daemon --stop --quiet --retry 5 \
+               --pidfile ${PIDFILE}
+       eend $?
+}      
 
-## not in 3.1.x yet
-#reload() {#
-#       ebegin "Reloading DBMail SIEVE daemon ($PROGRAM)"
-#           start-stop-daemon --quiet --signal HUP \
-#               --pidfile $PID_DIR/$PROGRAM.$PID
-#       eend $?
-#}

Reply via email to