summaryrefslogtreecommitdiffstats
path: root/testing/dbmail
diff options
context:
space:
mode:
Diffstat (limited to 'testing/dbmail')
-rw-r--r--testing/dbmail/APKBUILD74
-rw-r--r--testing/dbmail/code-cleanups.patch64
-rw-r--r--testing/dbmail/dbmail-httpd.initd40
-rw-r--r--testing/dbmail/dbmail-imapd.initd40
-rw-r--r--testing/dbmail/dbmail-lmtpd.initd40
-rw-r--r--testing/dbmail/dbmail-pop3d.initd40
-rw-r--r--testing/dbmail/dbmail-timsieved.initd39
7 files changed, 337 insertions, 0 deletions
diff --git a/testing/dbmail/APKBUILD b/testing/dbmail/APKBUILD
new file mode 100644
index 000000000..4c90f9608
--- /dev/null
+++ b/testing/dbmail/APKBUILD
@@ -0,0 +1,74 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=dbmail
+pkgver=3.0.0_rc2
+_realpkgver=3.0.0-rc2
+pkgrel=1
+pkgdesc="Fast and scalable sql based mail services"
+url="http://dbmail.org"
+arch="all"
+license="GPL"
+depends=
+depends_dev="openldap-dev libsieve-dev glib-dev gmime-dev
+ mhash-dev libevent-dev libzdb-dev"
+makedepends="$depends_dev asciidoc xmlto"
+install=""
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://www.dbmail.org/download/3.0/dbmail-3.0.0-rc2.tar.gz
+ code-cleanups.patch
+ $pkgname-imapd.initd
+ $pkgname-lmtpd.initd
+ $pkgname-pop3d.initd
+ $pkgname-httpd.initd
+ $pkgname-timsieved.initd
+ "
+
+_builddir="$srcdir/${pkgname}_${_realpkgver}"
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --with-sieve \
+ --with-ldap
+ make || return 1
+ #make man pages
+ cd "$_builddir/man"
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ install -Dm644 "$pkgname.conf" "$pkgdir/etc/$pkgname.conf.sample"
+ mkdir -p "$pkgdir/usr/share/$pkgname"
+ mv sql/* "$pkgdir/usr/share/$pkgname/"
+ mv "$pkgname.schema" "$pkgdir/usr/share/$pkgname/"
+ for i in imapd lmtpd pop3d httpd timsieved; do
+ install -Dm755 "$srcdir/$pkgname-$i.initd" \
+ "$pkgdir/etc/init.d/dbmail-$i" || return 1
+ done
+ #install man pages
+ cd "$_builddir/man"
+ make DESTDIR="$pkgdir" install || return 1
+}
+
+md5sums="c4fda2da173ddeda25bcf9e2e57abd1e dbmail-3.0.0-rc2.tar.gz
+b482ba661bb4b1b6fe50e303f37b2336 code-cleanups.patch
+76a0f8f96ca70a4af14c81716134cc5d dbmail-imapd.initd
+a6d79d7f0cf0fb80ef2ada71c25d9350 dbmail-lmtpd.initd
+504dd74912daeea4268f8c25ddf6de0f dbmail-pop3d.initd
+42ac86844fedf5d1afec764170e6a5de dbmail-httpd.initd
+4253a7580d82e026ecbaf45ea863e9e7 dbmail-timsieved.initd"
diff --git a/testing/dbmail/code-cleanups.patch b/testing/dbmail/code-cleanups.patch
new file mode 100644
index 000000000..83e8f7ea6
--- /dev/null
+++ b/testing/dbmail/code-cleanups.patch
@@ -0,0 +1,64 @@
+From 6af21775b8c560dd9d65cb2465299a9feae34649 Mon Sep 17 00:00:00 2001
+From: Paul J Stevens <paul@nfg.nl>
+Date: Thu, 14 Apr 2011 14:01:32 +0000
+Subject: cleanups
+
+---
+diff --git a/debian/rules b/debian/rules
+index 7804a1b..f459149 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -12,7 +12,7 @@ export SHARED=--enable-static=no
+ export MANPAGES=--enable-manpages=yes
+ export REAL_CLEAN=
+
+-CFLAGS = -Wall -O1
++CFLAGS = -Wall -std=gnu99 -O1
+ LDFLAGS = -lcrypt
+
+ # These are used for cross-compiling and for saving the configure script
+@@ -27,10 +27,9 @@ ifneq (,$(findstring devel,$(DEB_BUILD_OPTIONS)))
+ export MANPAGES=
+ export SHARED=--enable-shared=no
+ export STATIC=--enable-static=yes
+- export REAL_CLEAN=mrproper
+ export WITH_LDAP=
+ export WITH_SIEVE=
+- CFLAGS = -g -std=gnu99
++ CFLAGS = -Wall -std=gnu99 -g
+ endif
+ ifneq (,$(findstring ldap,$(DEB_BUILD_OPTIONS)))
+ export WITH_LDAP=--with-ldap
+diff --git a/src/dm_http.c b/src/dm_http.c
+index 4b7d2a6..797e63b 100644
+--- a/src/dm_http.c
++++ b/src/dm_http.c
+@@ -193,7 +193,7 @@ void Http_getUsers(T R)
+ evbuffer_add_printf(buf, "\n}}\n");
+ }
+
+- if (buf->totallen)
++ if (EVBUFFER_LENGTH(buf))
+ Request_send(R, HTTP_OK, "OK", buf);
+ else
+ Request_error(R, HTTP_SERVUNAVAIL, "Server error");
+@@ -279,7 +279,7 @@ void Http_getMailboxes(T R)
+ MailboxState_free(&b);
+ }
+
+- if (buf->totallen)
++ if (EVBUFFER_LENGTH(buf))
+ Request_send(R, HTTP_OK, "OK", buf);
+ else
+ Request_error(R, HTTP_SERVUNAVAIL, "Server error");
+@@ -375,7 +375,7 @@ void Http_getMessages(T R)
+ }
+ }
+
+- if (buf->totallen)
++ if (EVBUFFER_LENGTH(buf))
+ Request_send(R, HTTP_OK, "OK", buf);
+ else
+ Request_error(R, HTTP_SERVUNAVAIL, "Server error");
+--
+cgit v0.8.3.4
diff --git a/testing/dbmail/dbmail-httpd.initd b/testing/dbmail/dbmail-httpd.initd
new file mode 100644
index 000000000..832e64046
--- /dev/null
+++ b/testing/dbmail/dbmail-httpd.initd
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+#
+
+PIDFILE="/var/run/dbmail-httpd.pid"
+
+depend() {
+ need net
+ use mysql
+ use pgsql
+ after mta
+}
+
+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() {
+ checkconfig && \
+ ebegin "Starting DBMail HTTP daemon"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/dbmail-httpd \
+ --name dbmail-httpd \
+ -- -p ${PIDFILE} -f /etc/dbmail/dbmail.conf 2>&1
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping DBMail HTTP daemon"
+ start-stop-daemon --stop --quiet --retry 5 \
+ --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/testing/dbmail/dbmail-imapd.initd b/testing/dbmail/dbmail-imapd.initd
new file mode 100644
index 000000000..8f6984feb
--- /dev/null
+++ b/testing/dbmail/dbmail-imapd.initd
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+#
+
+PIDFILE="/var/run/dbmail-imapd.pid"
+
+depend() {
+ need net
+ use mysql
+ use pgsql
+ after mta
+}
+
+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() {
+ 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"
+ start-stop-daemon --stop --quiet --retry 5 \
+ --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/testing/dbmail/dbmail-lmtpd.initd b/testing/dbmail/dbmail-lmtpd.initd
new file mode 100644
index 000000000..cea3da6dd
--- /dev/null
+++ b/testing/dbmail/dbmail-lmtpd.initd
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+#
+
+PIDFILE="/var/run/dbmail-lmtpd.pid"
+
+depend() {
+ need net
+ use mysql
+ use pgsql
+ after mta
+}
+
+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() {
+ 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"
+ start-stop-daemon --stop --quiet --retry 5 \
+ --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/testing/dbmail/dbmail-pop3d.initd b/testing/dbmail/dbmail-pop3d.initd
new file mode 100644
index 000000000..8c9e7b874
--- /dev/null
+++ b/testing/dbmail/dbmail-pop3d.initd
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+#
+
+PIDFILE="/var/run/dbmail-pop3d.pid"
+
+depend() {
+ need net
+ use mysql
+ use pgsql
+ after mta
+}
+
+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() {
+ 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"
+ start-stop-daemon --stop --quiet --retry 5 \
+ --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/testing/dbmail/dbmail-timsieved.initd b/testing/dbmail/dbmail-timsieved.initd
new file mode 100644
index 000000000..325badb29
--- /dev/null
+++ b/testing/dbmail/dbmail-timsieved.initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+#
+
+PIDFILE="/var/run/dbmail-timsieved.pid"
+
+depend() {
+ need net
+ use mysql
+ use pgsql
+ after mta
+}
+
+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() {
+ 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"
+ start-stop-daemon --stop --quiet --retry 5 \
+ --pidfile ${PIDFILE}
+ eend $?
+}
+