aboutsummaryrefslogtreecommitdiffstats
path: root/testing/geodns/APKBUILD
blob: 8f9b46dcb733731361fd2880c219fc2ea14f4ef7 (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
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname="geodns"
pkgver="3.0.1"
pkgrel=2
pkgdesc="DNS server with per-client targeted responses"
url="https://github.com/abh/geodns"
arch="all"
license="Apache-2.0"
makedepends="go"
subpackages="$pkgname-openrc $pkgname-logs"
source="$pkgname-$pkgver.tar.gz::https://github.com/abh/geodns/archive/v$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	"
builddir="$srcdir/src/github.com/abh/geodns"

prepare() {
	mkdir -p ${builddir%/*}
	ln -sfT "$srcdir"/$pkgname-$pkgver "$builddir"
	default_prepare
}

build() {
	export GOPATH="$srcdir"
	go build -v

	cd geodns-logs
	go build -v
}

check() {
	go test
}

package() {
	install -Dm0755 "$builddir"/geodns "$pkgdir/usr/bin/geodns"

	install -Dm0644 "$builddir"/dns/geodns.conf.sample "$pkgdir"/etc/geodns/geodns.conf

	install -Dm0644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname"
	install -Dm0755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
}

logs() {
	install -Dm0755 "$builddir"/geodns-logs/geodns-logs "$subpkgdir"/usr/bin/geodns-logs
}

sha512sums="a8ed916f6203e31cd44f55ab5f150dbee5518f6cf0dc335687b11f7dd2012d33edb71aa7cf84113cbd440ba9246224e36430bb1b5381f21e5265e02cc56345f2  geodns-3.0.1.tar.gz
dc315782eb77627e2cd23a78ebef2f85a0a37a9129f6e16c817d7b9540c8b02987d35fc46882d7752c09caca825c5a77d2d3a27ae19ccccf2bba2e04bc74940c  geodns.initd
ce2c7f51151313fa35f132f05cb59458eabb0a74208a79d585d579ce88d0ab168eab389fd59e931b4b19da7fcbca202bf495af345156e47dccb187b746b3ee15  geodns.confd"