aboutsummaryrefslogtreecommitdiffstats
path: root/main/dnsmasq/APKBUILD
blob: e97806aa4bf9667fbf81f63270b86fa59b49c640 (plain) (blame)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
#
# secfixes:
#   2.80-r5:
#     - CVE-2019-14834
#   2.79-r0:
#     - CVE-2017-15107
#   2.78-r0:
#     - CVE-2017-13704
#     - CVE-2017-14491
#     - CVE-2017-14492
#     - CVE-2017-14493
#     - CVE-2017-14494
#     - CVE-2017-14495
#     - CVE-2017-14496
#
pkgname=dnsmasq
pkgver=2.81
pkgrel=1
pkgdesc="A lightweight DNS, DHCP, RA, TFTP and PXE server"
url="http://www.thekelleys.org.uk/dnsmasq/"
arch="all"
license="GPL-2.0-only OR GPL-3.0-only"
depends="!$pkgname-dnssec"
makedepends="linux-headers nettle-dev"
install="$pkgname.pre-install $pkgname.pre-upgrade
	$pkgname-dnssec.pre-install $pkgname-dnssec.pre-upgrade"
subpackages="$pkgname-doc $pkgname-dnssec"
source="http://www.thekelleys.org.uk/dnsmasq/dnsmasq-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	uncomment-conf-dir.patch
	"

build() {
	make CFLAGS="$CFLAGS" COPTS="-DHAVE_DNSSEC" all
	mv src/dnsmasq src/dnsmasq~dnssec

	make CFLAGS="$CFLAGS" clean all
}

# dnsmasq doesn't provide any test suite (shame on them!), so just check that
# the binary isn't totally broken...
check() {
	./src/dnsmasq --help >/dev/null
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install

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

	install -m644 dnsmasq.conf.example "$pkgdir"/etc/dnsmasq.conf
	install -d -m755 "$pkgdir"/etc/dnsmasq.d
}

dnssec() {
	pkgdesc="$pkgdesc with DNSSEC support"
	depends="!$pkgname"

	cd "$builddir"

	install -D -m 755 src/dnsmasq~dnssec "$subpkgdir"/usr/sbin/dnsmasq
	install -D -m 644 trust-anchors.conf \
		"$subpkgdir"/usr/share/$pkgname/trust-anchors.conf

	cp -r "$pkgdir"/etc "$subpkgdir"/etc
}

sha512sums="70194f273d1e760d1f33635f4df2fb55ef846189d0c56582534e73e296cd8580959f7675623a0d67ca2438fa81655c8d51afdd2e42bb489aa78861314fc1bd7f  dnsmasq-2.81.tar.gz
a7d64a838d10f4f69e0f2178cf66f0b3725901696e30df9e8e3e09f2afd7c86e9d95af64d2b63ef66f18b8a637397b7015573938df9ad961e2b36c391c3ac579  dnsmasq.initd
9a401bfc408bf1638645c61b8ca734bea0a09ef79fb36648ec7ef21666257234254bbe6c73c82cc23aa1779ddcdda0e6baa2c041866f16dfb9c4e0ba9133eab8  dnsmasq.confd
01e9e235e667abda07675009fb1947547863e0bb0256393c5a415978e2a49c1007585c7f0b51e8decce79c05e6f2ced3f400b11343feaa4de9b2e524f74a1ee3  uncomment-conf-dir.patch"