APKBUILD 1.83 KB
Newer Older
Matt Smith's avatar
Matt Smith committed
1 2
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer:  Matt Smith <mcs@darkregion.net>
Matt Smith's avatar
Matt Smith committed
3
pkgname=nsd
Matt Smith's avatar
Matt Smith committed
4 5
pkgver=3.2.8
pkgrel=0
Matt Smith's avatar
Matt Smith committed
6 7 8 9 10 11 12 13 14 15 16
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"
Matt Smith's avatar
Matt Smith committed
17
source="http://www.nlnetlabs.nl/downloads/$pkgname/$pkgname-$pkgver.tar.gz
Matt Smith's avatar
Matt Smith committed
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
	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

Matt Smith's avatar
Matt Smith committed
57
	chown nsd "$pkgdir"/var/db/nsd || return 1
Matt Smith's avatar
Matt Smith committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71
}

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
}

Matt Smith's avatar
Matt Smith committed
72
md5sums="963c2123853e7759ffb772da40c68838  nsd-3.2.8.tar.gz
Matt Smith's avatar
Matt Smith committed
73 74 75 76
cc592572846b978a6f52130a8e518ab3  0010-stop-unlink-pid-error.patch
3aa94004a39319db89a329e9f24fb9da  nsdc
4c0eef07caac9083aeeb9b15602d014d  nsd.initd
37bd648259fdd919c79aaa0168b4423c  nsd.confd"