aboutsummaryrefslogtreecommitdiffstats
path: root/main/nsd/APKBUILD
blob: 889c2bcfd25bfdf8305e0aaee518d43df4ee247b (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
# Contributor: Matt Smith <mcs@darkregion.net>
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org
pkgname=nsd
pkgver=4.1.0
pkgrel=0
pkgdesc="NSD is an authoritative only, high performance, simple and open source name server."
url="http://www.nlnetlabs.nl/projects/nsd/"
arch="all"
license="BSD"
depends=
depends_dev=
makedepends="$depends_dev openssl-dev libevent-dev"
install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-deinstall"
subpackages="$pkgname-doc $pkgname-dbg"
pkgusers="nsd"
pkggroups="nsd"
source="http://www.nlnetlabs.nl/downloads/$pkgname/$pkgname-$pkgver.tar.gz
	nsd.initd
	"

_builddir="$srcdir/$pkgname-$pkgver"
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 \
		--build=$CBUILD \
		--host=$CHOST \
		--sbindir=/usr/sbin \
		--mandir=/usr/share/man \
		--with-user=nsd \
		--with-pidfile=/var/run/nsd/nsd.pid \
		--with-xfrdir=/var/db/nsd \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/nsd || return 1

	chown nsd.nsd "$pkgdir"/var/db/nsd || return 1
	chown nsd.nsd "$pkgdir"/var/run/nsd || return 1
}

doc() {
	arch="noarch"

	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname || return 1
	cp -a "$_builddir"/doc/* \
		"$subpkgdir"/usr/share/doc/$pkgname/ || return 1
	cp -a "$_builddir"/contrib/ \
		"$subpkgdir"/usr/share/doc/$pkgname/ || return 1
	mv "$pkgdir"/usr/share/man \
		"$subpkgdir"/usr/share/man || return 1
}

md5sums="6597b3240c7f28c8861beb3cd9a38df3  nsd-4.1.0.tar.gz
86c343e8d2976dd120e7436e8d1d1717  nsd.initd"
sha256sums="ec3f6902f6f26a6b9248dcd7e9f42472fa52755740b4ba6b9d3bd08910b39b62  nsd-4.1.0.tar.gz
947ef0ebeaa6ed97de6cb5bca0be95facffbc8d382366c583de06015d33b8157  nsd.initd"
sha512sums="1e49c14108b201ff8f14f58a9aae8ee4a69fba2e9494bdffc20ac079bff437ce91b069852d0aac639ec860a258b0b222b72269e62ad7b433c3df8d06afea8f03  nsd-4.1.0.tar.gz
b2f2e0d4c6e1f3bcca0f46021ca71d19e924e576c6dd4390b1c15329a00e9249b9c001fed49ebe8aafa9428a671edb7664addf3e382a9bf5bdd05c82f3b5e54a  nsd.initd"