archrelease: copy trunk to community-any
[ArchLinux/community.git] / dns-over-https / repos / community-x86_64 / PKGBUILD
blobf0ce31fbaa427cfe2176937eff523f1443fdf6e7
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Maintainer: Morten Linderud <foxboron@archlinux.org>
3 # Contributor: Sherlock Holo <sherlockya(at)gmail.com>
4 # Contributor: Ariel AxionL <i [at] axionl [dot] me>
6 pkgname=dns-over-https
7 pkgver=2.3.3
8 pkgrel=1
9 pkgdesc="Client and server software to query DNS over HTTPS, using Google DNS-over-HTTPS protocol"
10 url="https://github.com/m13253/dns-over-https"
11 arch=('x86_64')
12 license=('MIT')
13 backup=('etc/dns-over-https/doh-client.conf'
14         'etc/dns-over-https/doh-server.conf')
15 provides=('dns-over-https-client' 'dns-over-https-server')
16 makedepends=('go' 'git')
17 options=('!lto')
18 source=("$pkgname-$pkgver.tar.gz::https://github.com/m13253/dns-over-https/archive/v$pkgver.tar.gz")
19 sha256sums=('cd95bf9594bacc2c97463bf745b072bd88523f0cd67e951002a3444f15dc59c4')
21 prepare(){
22   cd "$pkgname-$pkgver"
23   sed -i 's/\/local//g' systemd/doh-{client,server}.service
26 build() {
27   cd "$pkgname-$pkgver"
28   export GOFLAGS="-buildmode=pie -trimpath"
29   export CGO_LDFLAGS="${LDFLAGS}"
30   export CGO_CFLAGS="${CFLAGS}"
31   export CGO_CPPFLAGS="${CPPFLAGS}"
32   go build -v -o client ./doh-client
33   go build -v -o server ./doh-server
36 check(){
37   cd "$pkgname-$pkgver"
38   go test -v ./...
41 package() {
42   cd $pkgname-$pkgver
43   install -Dm755 client "$pkgdir"/usr/bin/doh-client
44   install -Dm644 doh-client/doh-client.conf -t "$pkgdir"/etc/dns-over-https/
45   install -Dm644 systemd/doh-client.service -t "$pkgdir"/usr/lib/systemd/system/
46   install -Dm755 NetworkManager/dispatcher.d/doh-client -t "$pkgdir"/etc/NetworkManager/dispatcher.d/
48   install -Dm755 server "$pkgdir"/usr/bin/doh-server
49   install -Dm644 doh-server/doh-server.conf -t "$pkgdir"/etc/dns-over-https/
50   install -Dm644 systemd/doh-server.service -t "$pkgdir"/usr/lib/systemd/system/
51   install -Dm755 NetworkManager/dispatcher.d/doh-server -t "$pkgdir"/etc/NetworkManager/dispatcher.d/
53   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/