summaryrefslogtreecommitdiffstats
path: root/testing/dbmail/APKBUILD
blob: bc5c0cad1175a95290c90c285bc65f62c1f23998 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=dbmail
_realpkgver=3.0.0-rc3
pkgver=${_realpkgver/-/_}
pkgrel=1
pkgdesc="Fast and scalable sql based mail services"
url="http://dbmail.org"
arch="all"
license="GPL"
pkgusers="dbmail"
pkggroups="dbmail"
depends=
depends_dev="openldap-dev libsieve-dev glib-dev gmime-dev
	mhash-dev libevent-dev libzdb-dev"
makedepends="$depends_dev asciidoc xmlto automake autoconf"
install=""
subpackages="$pkgname-doc $pkgname-auth-ldap:auth_ldap"
source="http://www.dbmail.org/download/3.0/dbmail-${_realpkgver}.tar.gz
	$pkgname-imapd.initd
	$pkgname-lmtpd.initd
	$pkgname-pop3d.initd
	$pkgname-httpd.initd
	$pkgname-timsieved.initd
	$pkgname.pre-install
	post-rc3.patch
	dbmail.conf
	"

_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
	# we need support for gmine 2.6
	sed -i 's/gmime-2.4/gmime-2.6/g' configure
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-sieve \
		--with-ldap \
		--disable-static
	make || return 1
	# make man pages
	cd "$_builddir/man"
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm "$pkgdir"/usr/lib/dbmail/*.la || return 1
	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
	install -m644 -D "$srcdir"/$pkgname.conf \
		"$pkgdir"/etc/$pkgname.conf || return 1
	install -dDo dbmail "$pkgdir"/var/run/dbmail || return 1
	install -dDo dbmail "$pkgdir"/var/lib/dbmail || return 1
}

auth_ldap() {
	pkgdesc="$pkgname ldap authentication"
	mkdir -p "$subpkgdir"/usr/lib/dbmail
	mv "$pkgdir"/usr/lib/dbmail/libauth_ldap* \
		"$subpkgdir"/usr/lib/dbmail/ || return 1
}

md5sums="52c3b9aad310efc90a6a2fff0552f73e  dbmail-3.0.0-rc3.tar.gz
2f77092fade3b10123a47a5cce5b6a4a  dbmail-imapd.initd
f3a84b58ba878375ca088a0b544922cc  dbmail-lmtpd.initd
4273524211baefd9f32ea40ce9cb7dd1  dbmail-pop3d.initd
1bf891189a6daf14254738d28f3c654f  dbmail-httpd.initd
4cd701bf1a8d292848fffe208afbe182  dbmail-timsieved.initd
f146703e0c8c9badc92de152ac6f1e5b  dbmail.pre-install
f609d4cd01dbef95c6a1c498133a2065  post-rc3.patch
549f2073f1c6ac902f783b493c0667d4  dbmail.conf"