aboutsummaryrefslogtreecommitdiffstats
path: root/main/nsd/APKBUILD
blob: 647536e57d4b46b448ee4492a154a79216617811 (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
# Contributor: Matt Smith <mcs@darkregion.net>
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nsd
pkgver=4.1.4
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"
	default_doc || return 1
	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
}

md5sums="08e826a0498926941bf478450e95ceb2  nsd-4.1.4.tar.gz
62301a021d2b2e1972625e56ea8138d1  nsd.initd"
sha256sums="d6e0e9cd1f637a3b4bfa48dba47b1564408eb531c57f6a3dda1a2d529df800f0  nsd-4.1.4.tar.gz
8f9ca311a60e2a3db3fcc64b66cce2d6ff84b5600f47d5ece349d90926e90f27  nsd.initd"
sha512sums="b13e6db5afa6998d62ec8be0b34bd11b71c9dbb9917964cd33a801ac29d1f31a3c862113687f959b218060b41d425a0765ba1e6877c4f8b2b549ba08f79bdebc  nsd-4.1.4.tar.gz
402142ad1bb422a9a29ee8c7606bd513defa41563d47fb547812d4682862da5646022aa8c4577ed2d2a151388a12ec2f7b472e6a6091406859c0eb1f7f00c5b6  nsd.initd"