APKBUILD 4.13 KB
Newer Older
1
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
Matt Smith's avatar
Matt Smith committed
2
# Contributor: Matt Smith <mcs@darkregion.net>
Olivier Mauras's avatar
Olivier Mauras committed
3
# Contributor: Olivier Mauras <olivier@mauras.ch>
4
# Contributor: Daniel Isaksen <d@duniel.no>
5
# Contributor: Fabian Zoske <fabian@zoske.it>
Matt Smith's avatar
Matt Smith committed
6 7
# Maintainer:  Matt Smith <mcs@darkregion.net>
pkgname=pdns
tcely's avatar
tcely committed
8 9
pkgver=4.1.2
pkgrel=0
Matt Smith's avatar
Matt Smith committed
10
pkgdesc="PowerDNS Authoritative Server"
11
url="https://www.powerdns.com/"
Matt Smith's avatar
Matt Smith committed
12
arch="all"
tcely's avatar
tcely committed
13
license="GPL-2.0-or-later"
Matt Smith's avatar
Matt Smith committed
14 15
depends=""
depends_dev=""
tcely's avatar
tcely committed
16 17
makedepends="$depends_dev
	boost-dev curl file geoip-dev krb5-dev libressl-dev
18
	libsodium-dev lua-dev mariadb-connector-c-dev openldap-dev
tcely's avatar
tcely committed
19 20
	postgresql-dev protobuf-dev sqlite-dev unixodbc-dev
	yaml-cpp-dev"
Jakub Jirutka's avatar
Jakub Jirutka committed
21
install="$pkgname.pre-install"
tcely's avatar
tcely committed
22
subpackages="$pkgname-doc $pkgname-tools
23
	$pkgname-backend-bind:backend_bind
tcely's avatar
tcely committed
24
	$pkgname-backend-geoip:backend_geoip
Matt Smith's avatar
Matt Smith committed
25
	$pkgname-backend-ldap:backend_ldap
tcely's avatar
tcely committed
26 27
	$pkgname-backend-lua:backend_lua
	$pkgname-backend-mydns:backend_mydns
Matt Smith's avatar
Matt Smith committed
28
	$pkgname-backend-mysql:backend_mysql
tcely's avatar
tcely committed
29
	$pkgname-backend-odbc:backend_odbc
Matt Smith's avatar
Matt Smith committed
30
	$pkgname-backend-pipe:backend_pipe
tcely's avatar
tcely committed
31 32 33 34
	$pkgname-backend-pgsql:backend_pgsql
	$pkgname-backend-random:backend_random
	$pkgname-backend-remote:backend_remote
	$pkgname-backend-sqlite3:backend_sqlite3"
Matt Smith's avatar
Matt Smith committed
35 36
pkgusers="pdns"
pkggroups="pdns"
tcely's avatar
tcely committed
37
source="http://downloads.powerdns.com/releases/$pkgname-$pkgver.tar.bz2
38
	libressl-2.7.patch
tcely's avatar
tcely committed
39 40
	$pkgname.initd
	$pkgname.conf"
Jakub Jirutka's avatar
Jakub Jirutka committed
41
builddir="$srcdir/$pkgname-$pkgver"
Matt Smith's avatar
Matt Smith committed
42

43 44 45 46
# secfixes:
#   4.0.5-r0:
#     - CVE-2017-15091

Matt Smith's avatar
Matt Smith committed
47
build() {
Jakub Jirutka's avatar
Jakub Jirutka committed
48
	cd "$builddir"
49

Matt Smith's avatar
Matt Smith committed
50
	./configure --prefix=/usr \
tcely's avatar
tcely committed
51
		--sysconfdir="/etc/$pkgname" \
Matt Smith's avatar
Matt Smith committed
52 53 54
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
tcely's avatar
tcely committed
55
		--libdir="/usr/lib/$pkgname" \
Matt Smith's avatar
Matt Smith committed
56
		--with-modules="" \
tcely's avatar
tcely committed
57 58 59
		--with-dynmodules="bind geoip ldap lua mydns gmysql godbc pipe gpgsql random remote gsqlite3" \
		--enable-tools \
		--enable-unit-tests \
tmpfile's avatar
tmpfile committed
60 61
		--disable-static
	make
Matt Smith's avatar
Matt Smith committed
62 63
}

tcely's avatar
tcely committed
64 65 66 67 68
check() {
	cd "$builddir"
	PDNS_TEST_NO_IPV6=1 make check
}

Matt Smith's avatar
Matt Smith committed
69
package() {
Jakub Jirutka's avatar
Jakub Jirutka committed
70 71
	cd "$builddir"

tmpfile's avatar
tmpfile committed
72
	make DESTDIR="$pkgdir" install
Matt Smith's avatar
Matt Smith committed
73

tcely's avatar
tcely committed
74 75 76 77 78 79
	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"
Matt Smith's avatar
Matt Smith committed
80 81
}

tcely's avatar
tcely committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95
tools() {
	_tool_names="zone2ldap zone2sql zone2json
		dnsgram dnsreplay dnsscan dnsscope dnswasher dumresp
		pdns_notify nproxy nsec3dig saxfr stubquery ixplore
		sdig calidns dnsbulktest dnstcpbench dnspcap2protobuf"

	mkdir -p "$subpkgdir"
	cd "$subpkgdir"

	mkdir -p "$subpkgdir/usr/bin"
	for _tool in $_tool_names; do
		mv "$pkgdir/usr/bin/$_tool" "$subpkgdir/usr/bin/"
	done; unset -v _tool
}
Matt Smith's avatar
Matt Smith committed
96 97 98

_mv_backend() {
	local backend=$1
tcely's avatar
tcely committed
99
	shift
Matt Smith's avatar
Matt Smith committed
100

tcely's avatar
tcely committed
101 102 103 104 105 106
	pkgdesc="$backend backend module for PowerDNS"
	depends="$pkgname $*"

	mkdir -p "$subpkgdir/usr/lib/pdns/pdns"
	mv "$pkgdir/usr/lib/pdns/pdns/lib${backend}backend.so" \
		"$subpkgdir/usr/lib/pdns/pdns/"
Matt Smith's avatar
Matt Smith committed
107 108
}

tcely's avatar
tcely committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
backend_bind()          { _mv_backend bind; }
backend_geoip()         { _mv_backend geoip geoip; }
backend_ldap()          { _mv_backend ldap; }
backend_lua()           { _mv_backend lua lua; }
backend_mydns()         { _mv_backend mydns; }
backend_mysql()         { _mv_backend gmysql mariadb-client; }
backend_odbc()          { _mv_backend godbc unixodbc; }
#backend_opendbx()       { _mv_backend opendbx; }
#backend_oracle()        { _mv_backend goracle; }
backend_pipe()          { _mv_backend pipe; }
backend_pgsql()         { _mv_backend gpgsql postgresql-client; }
backend_random()        { _mv_backend random; }
backend_remote()        { _mv_backend remote; }
backend_sqlite3()       { _mv_backend gsqlite3 sqlite; }
#backend_tinydns()       { _mv_backend tinydns; }

tcely's avatar
tcely committed
125
sha512sums="3fe9f5d8d87bfc77e98915d9019000b6bc0b91ed7ed363ba00a64321cc534290e23627f18a6ba87797a954f7c82b777f746f4f45eb70efb30fa2aa1a80c67a68  pdns-4.1.2.tar.bz2
126 127 128
705fad6a9e7bd342d7f9665c5b3c21d3b919c4a43c5d03fa0d2bf3e25126f1f036edcb0ec66aa0168f6b2e5225c7ac684538cd29bc998245fbb25a57a3c84946  libressl-2.7.patch
3f5b202c56408168ddbf81b47f5c48ca65de91ada88751213a06a1096334b89176c5a6a58f3c6a893a2d15b51ece9f2a64d7d2ea836220a3e45fe362969c6cfa  pdns.initd
3f809f3257680c3e496fa6a4c86c8a636db5d9d5b92aef96fe54c29b8266ee590deb792d13205cc171e27307fa73295dd3b101b09102fd66a2393a7cdbf9dd27  pdns.conf"