# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=dnscrypt-proxy pkgver=2.0.9b2 pkgrel=4 pkgdesc="A tool for securing communications between a client and a DNS resolver" url="https://dnscrypt.info" arch="all" license="custom" depends="ca-certificates" makedepends="libsodium-dev ldns-dev go" install="$pkgname.pre-install" options="!check" #upstream does not provide check/test pkgusers=dnscrypt pkggroups=dnscrypt subpackages="$pkgname-doc $pkgname-setup::noarch" source="$pkgname-$pkgver.tar.gz::https://github.com/jedisct1/$pkgname/archive/$pkgver.tar.gz $pkgname.initd $pkgname.confd $pkgname.setup " builddir="$srcdir"/$pkgname-$pkgver prepare() { default_prepare cd "$builddir" export GOPATH=$(pwd) ln -sfv vendor src } build() { cd "$builddir"/$pkgname go build -ldflags="-s -w" -v } package() { cd "$builddir"/$pkgname mkdir -p "$pkgdir"/var/log/$pkgname mkdir -p "$pkgdir"/var/empty mkdir -p $pkgdir/usr/share/licenses/$pkgname install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname install -m755 -D $pkgname "$pkgdir"/usr/bin/$pkgname install -vDm 644 "example-${pkgname}.toml" \ "${pkgdir}/etc/${pkgname}/${pkgname}.toml" install -vDm 644 "example-blacklist.txt" \ "${pkgdir}/etc/${pkgname}/example-blacklist.txt" install -vDm 644 "example-cloaking-rules.txt" \ "${pkgdir}/etc/${pkgname}/example-cloaking-rules.txt" install -vDm 644 "example-forwarding-rules.txt" \ "${pkgdir}/etc/${pkgname}/example-forwarding-rules.txt" install -vDm 644 "example-whitelist.txt" \ "${pkgdir}/etc/${pkgname}/example-whitelist.txt" chown dnscrypt "$pkgdir"/var/log/$pkgname chown dnscrypt "$pkgdir"/var/empty chown dnscrypt "$pkgdir"/etc/$pkgname install -m 644 ../LICENSE $pkgdir/usr/share/licenses/$pkgname } setup() { pkgdesc="Script for setting up DNSCrypt Proxy" depends="sed wget $pkgname" mkdir -p "$subpkgdir"/sbin install -m755 -D "$srcdir"/$pkgname.setup "$subpkgdir"/sbin/setup-dnscrypt } sha512sums="d64cc8e0b61e1e548b63531dc4c733af1605ccda89a9f905227e97cb966a3488104ac9af229521909ca88bde283dce224e712326b4d1717af70be2d04821c6c2 dnscrypt-proxy-2.0.9b2.tar.gz 219fbd61ef75d6ef2cf5ac71b1a7090fb8620136d6c97f67318eb8daf72fa68449c37a3e4a88638e49a0c6193c31d2e69bf1a42e78529375d546d1f210f98e4d dnscrypt-proxy.initd 44a2d792aa80a048ea6bdb4a79c1e436bcad3610a28a963ebed5c0e77a8b2a733c45311a66268fc4026d1c4c9b1f222813aeeea9c619832bbcb7c227542b65a8 dnscrypt-proxy.confd 66dd43d84117a0151ae41f34d82b716760382a5a491424bf6418228ffd21f0dfbc88e34cc5074e11f97f006335d97b85367bb9ab1d96747a48e893c022ad52d0 dnscrypt-proxy.setup"