aboutsummaryrefslogtreecommitdiffstats
path: root/main/nsd/APKBUILD
blob: fcda2fe9dc01f68bf84f785aaaea9870c2d47bab (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>
# Maintainer:  Matt Smith <mcs@darkregion.net>
pkgname=nsd
pkgver=3.2.10
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"
install="$pkgname.pre-install $pkgname.post-deinstall"
subpackages="$pkgname-doc"
pkgusers="nsd"
pkggroups="nsd"
source="http://www.nlnetlabs.nl/downloads/$pkgname/$pkgname-$pkgver.tar.gz
	0010-stop-unlink-pid-error.patch
	nsdc
	nsd.initd
	nsd.confd
	"

_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 \
		--sbindir=/usr/sbin \
		--mandir=/usr/share/man \
		--with-user=nsd \
		|| return 1
	make || return 1
}

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

	install -m755 -D "$srcdir"/nsdc \
		"$pkgdir"/usr/sbin/nsdc || return 1
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/nsd || return 1
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/nsd || return 1

	chown nsd "$pkgdir"/var/db/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="befbacb3d57b7aac5b6af477c8ee75e3  nsd-3.2.10.tar.gz
cc592572846b978a6f52130a8e518ab3  0010-stop-unlink-pid-error.patch
3aa94004a39319db89a329e9f24fb9da  nsdc
4c0eef07caac9083aeeb9b15602d014d  nsd.initd
37bd648259fdd919c79aaa0168b4423c  nsd.confd"