APKBUILD 2.44 KB
Newer Older
1 2
# Contributor: Ian Bashford <ianbashford@gmail.com>
# Maintainer: Ian Bashford <ianbashford@gmail.com>
3
pkgname=dnscrypt-proxy
4
pkgver=2.0.42
5
pkgrel=0
6
pkgdesc="Tool for securing communications between a client and a DNS resolver"
7
url="https://dnscrypt.info"
8
arch="all"
9
license="ISC"
10
depends="ca-certificates"
11
makedepends="libcap go"
12
install="$pkgname.pre-install"
13 14
pkgusers=dnscrypt
pkggroups=dnscrypt
15
subpackages="$pkgname-setup::noarch $pkgname-openrc"
16
source="$pkgname-$pkgver.tar.gz::https://github.com/DNSCrypt/dnscrypt-proxy/archive/$pkgver.tar.gz
17 18
	$pkgname.initd
	$pkgname.confd
19
	$pkgname.setup
20
	config-full-paths.patch
21
	"
22
options="!check"
23

24
prepare() {
25
	default_prepare
26
	ln -sf vendor src
27 28
}

29
build() {
30
	cd "$builddir"/"$pkgname"
31
	go build -ldflags="-s -w" -v
32 33
}

34
package() {
35
	cd "$builddir"/"$pkgname"
36 37 38 39
	install -d -o $pkgusers -g $pkggroups -m 755 "$pkgdir"/etc/$pkgname
	install -d -o $pkgusers -g $pkggroups -m 755 "$pkgdir"/usr/share/$pkgname
	install -d -o $pkgusers -g $pkggroups -m 755 "$pkgdir"/var/cache/$pkgname
	install -d -o $pkgusers -g $pkggroups -m 755 "$pkgdir"/var/log/$pkgname
40 41
	install -m755 -D dnscrypt-proxy "$pkgdir"/usr/bin/dnscrypt-proxy
	setcap cap_net_bind_service=+ep "$pkgdir"/usr/bin/dnscrypt-proxy
42
	install -vDm 644 "dnscrypt-proxy.toml" "$pkgdir/etc/$pkgname/dnscrypt-proxy.toml"
43
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
44
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
45
	for i in example-*;do install -m644 -D "$i" "$pkgdir"/usr/share/"$pkgname"/"$i"; done
46 47 48
}

setup() {
49
	pkgdesc="Script for setting up dnscrypt proxy"
50
	depends="sed wget $pkgname"
51

52
	install -m755 -D "$srcdir"/$pkgname.setup "$subpkgdir"/usr/sbin/setup-dnscrypt
53 54
}

55
sha512sums="093b07ee8eb44c1264e6ea4b60ad32e0221b1b02c1d61f142b1fbf37dc5181533cc3c5d6e7468d0f7488611de4620947684269da9f08f21da0aa501ba70be711  dnscrypt-proxy-2.0.42.tar.gz
56 57 58
e0a72d39d47dc24b889d08beedbd9fdf21615f42fbab79980debdfd2c3feaa83dc3f776351f7dd13533cc85905ce4e01812e4ff8a80a9ccc0b21e9db7d6cb232  dnscrypt-proxy.initd
c001ae39da1b2db71764cab568f9ed18e4de0cea3d1a4e7bd6dd01a5668b81a888ea9eef99de6beac08857ad7f8eb1a32d730e946ac3563e4dcfa27147e35052  dnscrypt-proxy.confd
66dd43d84117a0151ae41f34d82b716760382a5a491424bf6418228ffd21f0dfbc88e34cc5074e11f97f006335d97b85367bb9ab1d96747a48e893c022ad52d0  dnscrypt-proxy.setup
59
cdcfd90e33b8efca6b967f485af529cbd1a6866cdbf83c2dbf7c8056accc115af23722101136a6dfa42c179c2343d1f1c0f34d06f8bec56fc2e2ed0b4d8efc85  config-full-paths.patch"