aboutsummaryrefslogtreecommitdiffstats
path: root/main/pdnsd/APKBUILD
blob: 2f95b7290f7a944f5b7fc2ff23b21f8e37e87dfb (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
102
103
104
105
106
107
108
109
110
111
112
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer:  Matt Smith <mcs@darkregion.net>
pkgname=pdnsd
pkgver=1.2.9a
_realver=$pkgver-par
pkgrel=1
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 \
		--build=$CBUILD \
		--host=$CHOST \
		--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"
sha256sums="bb5835d0caa8c4b31679d6fd6a1a090b71bdf70950db3b1d0cea9cf9cb7e2a7b  pdnsd-1.2.9a-par.tar.gz
f799da8f894690385cb99250fd5610a585431dc0d43f3529ea5f8ad0e80227c6  pdnsd.initd
9a31f529af0520a744cdcce647e964e719d811977867dbaa67caf5ceaff48683  pdnsd.confd
d8420631195d35887a511a6eac6faf05e3c4174dbe0ee5f3c85e090ce127ced3  pdnsd.conf"
sha512sums="4fde296642306aa986ddb7cad0b5991bcd397656d93ef4962706276848c7fa62c664a40198e807d029637f116e8000c237d98b91cbbfec5c08b134d8bb3adf81  pdnsd-1.2.9a-par.tar.gz
960e73f222f5ba3ade251212c3a7869a5c5ff58d83bdf291365fb12c20341d237bd3fa4710cd070919f3f273b7d21e05cf2527040f323c794eacce04beb2041e  pdnsd.initd
e8fc0667dd58a4bf6a685b9a6590fd5141e116ca7e769aa14180c642908fc214f3c3a6c45c7a3bb17f241bcb06ff6972ca46d1ab58e139ac9b68049fc137eadc  pdnsd.confd
ad023777f3d1f8eb5b9e296f42511c56aae4b5785b42a256c6f61d0b619657929622aced7034feabf321833e739a70c109610df0fc08e133557a7cf51c2fafd4  pdnsd.conf"