aboutsummaryrefslogtreecommitdiffstats
path: root/main/pdnsd/APKBUILD
blob: a8e976929c723b15873b2eb54ed145065461203e (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer:  Matt Smith <mcs@darkregion.net>
pkgname=pdnsd
pkgver=1.2.9a
_realver=$pkgver-par
pkgrel=0
pkgdesc="A proxy DNS server with permanent caching"
url="http://members.home.nl/p.a.rombouts/pdnsd/"
arch="all"
license="GPL"
depends=
depends_dev=
makedepends="$depends_dev"
install="$pkgname.pre-install $pkgname.post-deinstall"
subpackages="$pkgname-doc"
pkgusers="pdnsd"
pkggroups="pdnsd"
source="http://members.home.nl/p.a.rombouts/pdnsd/releases/pdnsd-$pkgver-par.tar.gz
	pdnsd.initd
	pdnsd.confd
	pdnsd.conf
	"

_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 --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-ipv6 \
		--with-random-device=/dev/urandom \
		--enable-tcp-subseq \
		|| return 1
	make || return 1
}

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

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

	chown -R pdnsd "$pkgdir"/var/cache/pdnsd || return 1
	sed -ri 's/([    ]*run_as=)"nobody";/\1"pdnsd";/' \
		"$pkgdir"/etc/pdnsd.conf.sample || return 1
	sed -ri '/pid_file/d' "$pkgdir"/etc/pdnsd.conf.sample || return 1
	sed -ri '/query_method/d' "$pkgdir"/etc/pdnsd.conf.sample || return 1
}

doc() {
	arch="noarch"

	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/html || return 1
	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/txt || return 1
	mkdir -p "$subpkgdir"/usr/share/$pkgname/contrib || return 1

	# /usr/share/{man,doc/$pkgname}
	cp -a "$pkgdir"/usr/share/ "$subpkgdir"/usr/ || return 1
	rm -rf "$pkgdir"/usr/share/ || return 1
	_docs="AUTHORS COPYING COPYING.BSD ChangeLog ChangeLog.old \
		NEWS README README.par README.par.old THANKS TODO"
	for _doc in $_docs; do
		cp "$_builddir"/$_doc "$subpkgdir"/usr/share/doc/$pkgname/ \
			|| return 1
	done
	cp -R "$_builddir"/doc/html/* \
		"$subpkgdir"/usr/share/doc/$pkgname/html/ || return 1
	cp -R "$_builddir"/doc/txt/* \
		"$subpkgdir"/usr/share/doc/$pkgname/txt/ || return 1

	# /usr/share/$pkgname
	mv "$pkgdir"/etc/pdnsd.conf.sample \
		"$subpkgdir"/usr/share/$pkgname/ || return 1
	_contribs="README change_pdnsd_server_ip.pl dhcp2pdnsd pdnsd_dhcp.pl"
	for _contrib in $_contribs; do
		cp -a "$_builddir"/contrib/$_contrib \
			"$subpkgdir"/usr/share/$pkgname/contrib/ || return 1
	done
}

md5sums="2f3e705d59a0f9308ad9504b24400769  pdnsd-1.2.9a-par.tar.gz
14d6c0a1e9e552999cc4efb2c1251d98  pdnsd.initd
4bced9066febfe33b4a527f28cfb6a48  pdnsd.confd
f7cf4b9391b67ee421485a0c24aa8a5c  pdnsd.conf"