aboutsummaryrefslogtreecommitdiffstats
path: root/community/pdns/APKBUILD
blob: e95cb630278fef5b9b92ba6212bab7fdab316e20 (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
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Matt Smith <mcs@darkregion.net>
# Contributor: Olivier Mauras <olivier@mauras.ch>
# Maintainer:  Matt Smith <mcs@darkregion.net>
pkgname=pdns
pkgver=4.0.4
pkgrel=0
pkgdesc="PowerDNS Authoritative Server"
url="http://www.powerdns.com/"
arch="all"
license="GPL"
depends=""
depends_dev=""
makedepends="$depends_dev boost-dev lua-dev openldap-dev mariadb-dev
	postgresql-dev sqlite-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-doc
	$pkgname-backend-bind:backend_bind
	$pkgname-backend-ldap:backend_ldap
	$pkgname-backend-mysql:backend_mysql
	$pkgname-backend-pgsql:backend_pgsql
	$pkgname-backend-pipe:backend_pipe
	$pkgname-backend-sqlite3:backend_sqlite3"
pkgusers="pdns"
pkggroups="pdns"
source="http://downloads.powerdns.com/releases/pdns-$pkgver.tar.bz2
	pdns.initd
	pdns.conf"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc/$pkgname \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--libdir=/usr/lib/pdns \
		--with-modules="" \
		--with-dynmodules="bind ldap gmysql gpgsql pipe gsqlite3" \
		--disable-static
	make
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	rm "$pkgdir"/etc/$pkgname/$pkgname.conf-dist
	install -m600 -D "$srcdir"/$pkgname.conf \
		"$pkgdir"/etc/$pkgname/$pkgname.conf
	chown pdns:pdns "$pkgdir"/etc/$pkgname/$pkgname.conf
}

backend_bind()		{ _mv_backend bind; }
backend_ldap()		{ _mv_backend ldap; }
backend_mysql()		{ _mv_backend gmysql; }
backend_pgsql()		{ _mv_backend gpgsql; }
backend_pipe()		{ _mv_backend pipe; }
backend_sqlite3()	{ _mv_backend gsqlite3 sqlite; }

_mv_backend() {
	local backend=$1
	pkgdesc="${backend} backend module for PowerDNS"
	depends="$pkgname ${2:-}"

	mkdir -p "$subpkgdir"/usr/lib/pdns/pdns
	mv "$pkgdir"/usr/lib/pdns/pdns/lib${backend}backend.so \
		"$subpkgdir"/usr/lib/pdns/pdns/
}

sha512sums="4ef4705cd990b03976775167c7c37850d45907e198549feda5f5701172e008e3f1f74a35a9bebdb24b63dec15ff63cb2cc9dfc8f92e4e1012e0539c5a88b845b  pdns-4.0.4.tar.bz2
4e729120af0f5e6ce8f13fdb97af2e8471300df3c1e2e250f855861214a0bf733b5dc77f0e414f2969d81c13423cf29d0bfb7cb4938075ef763fd14877a54a79  pdns.initd
acde76a5a51232dbd2b1b9fed95328f5bb59e33718338ffaa47618806588a9c3c8691c7e7270944d9e2f40b1fb69fc33e204e2fdfbc9546ab723fc428d2a7955  pdns.conf"