aboutsummaryrefslogtreecommitdiffstats
path: root/community/dnscrypt-proxy/APKBUILD
blob: 4450f4e72081be98c0078a50e46c22d0781cf17b (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
# Contributor: Ian Bashford <ianbashford@gmail.com>
# Maintainer: Ian Bashford <ianbashford@gmail.com>
pkgname=dnscrypt-proxy
pkgver=2.0.31
pkgrel=1
pkgdesc="A tool for securing communications between a client and a DNS resolver"
url="https://dnscrypt.info"
arch="all"
license="ISC"
depends="ca-certificates"
makedepends="libcap go"
install="$pkgname.pre-install"
pkgusers=dnscrypt
pkggroups=dnscrypt
subpackages="$pkgname-setup::noarch $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/DNSCrypt/$pkgname/archive/$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	$pkgname.setup
	config-full-paths.patch
	"
builddir="$srcdir"/$pkgname-$pkgver
options="!check"

prepare() {
	default_prepare
	cd "$builddir"
	ln -sf vendor src
}

build() {
	cd "$builddir"/"$pkgname"
	go build -ldflags="-s -w" -v
}

package() {
	cd "$builddir"/"$pkgname"
	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
	install -m755 -D dnscrypt-proxy "$pkgdir"/usr/bin/dnscrypt-proxy
	setcap cap_net_bind_service=+ep "$pkgdir"/usr/bin/dnscrypt-proxy
	install -vDm 644 "dnscrypt-proxy.toml" "${pkgdir}/etc/${pkgname}/dnscrypt-proxy.toml"
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
	for i in example-*;do install -m644 -D "$i" "$pkgdir"/usr/share/"$pkgname"/"$i"; done
}

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

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

sha512sums="500c800213b94bf8ecbea7493716de5fe41afd584c70844519f1f50827b94a28ec982f2c2b85f7a281dca58273ba968113beed6a965c62bb3dc47ab83d7a1629  dnscrypt-proxy-2.0.31.tar.gz
e0a72d39d47dc24b889d08beedbd9fdf21615f42fbab79980debdfd2c3feaa83dc3f776351f7dd13533cc85905ce4e01812e4ff8a80a9ccc0b21e9db7d6cb232  dnscrypt-proxy.initd
c001ae39da1b2db71764cab568f9ed18e4de0cea3d1a4e7bd6dd01a5668b81a888ea9eef99de6beac08857ad7f8eb1a32d730e946ac3563e4dcfa27147e35052  dnscrypt-proxy.confd
66dd43d84117a0151ae41f34d82b716760382a5a491424bf6418228ffd21f0dfbc88e34cc5074e11f97f006335d97b85367bb9ab1d96747a48e893c022ad52d0  dnscrypt-proxy.setup
1352d05e5862a11ad7e751a188aab153e916889b8134e8c09b2e8db7e9a2e04b7f3de609b04a195ce67a9b77aedfb11feef4717af4cbc5b4d3ac61d39410922a  config-full-paths.patch"