archrelease: copy trunk to community-any
[ArchLinux/community.git] / dns-over-https / repos / extra-x86_64 / PKGBUILD
blob9ea06770decac884a631b29b487fd61beda773b5
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.2.4
8 pkgrel=2
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 source=("$pkgname-$pkgver.tar.gz::https://github.com/m13253/dns-over-https/archive/v$pkgver.tar.gz")
18 sha256sums=('59f651da7353745c4d95160b705c4d4f8381483ad39bba49c484bd085fdc0e2a')
20 prepare(){
21   cd "$pkgname-$pkgver"
22   sed -i 's/\/local//g' systemd/doh-{client,server}.service
25 build() {
26   cd "$pkgname-$pkgver"
27   export GOFLAGS="-buildmode=pie -trimpath"
28   export CGO_LDFLAGS="${LDFLAGS}"
29   export CGO_CFLAGS="${CFLAGS}"
30   export CGO_CPPFLAGS="${CPPFLAGS}"
31   go build -v -o client ./doh-client
32   go build -v -o server ./doh-server
35 check(){
36   cd "$pkgname-$pkgver"
37   go test -v ./...
40 package() {
41   cd $pkgname-$pkgver
42   install -Dm755 client "$pkgdir"/usr/bin/doh-client
43   install -Dm644 doh-client/doh-client.conf "$pkgdir"/etc/dns-over-https/doh-client.conf
44   install -Dm644 systemd/doh-client.service "$pkgdir"/usr/lib/systemd/system/doh-client.service
45   install -Dm755 NetworkManager/dispatcher.d/doh-client "$pkgdir"/etc/NetworkManager/dispatcher.d/doh-client
47   install -Dm755 server "$pkgdir"/usr/bin/doh-server
48   install -Dm644 doh-server/doh-server.conf "$pkgdir"/etc/dns-over-https/doh-server.conf
49   install -Dm644 systemd/doh-server.service "$pkgdir"/usr/lib/systemd/system/doh-server.service
50   install -Dm755 NetworkManager/dispatcher.d/doh-server "$pkgdir"/etc/NetworkManager/dispatcher.d/doh-server
52   install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE