summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0a67ca7fe3195db83e633b65ab10382987680b3d (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
# Maintainer: Sherlock-Holo <sherlockya@gmail.com>

pkgname=dns-over-https-git
_pkgname=dns-over-https
pkgver=f4e27c9
pkgrel=1
pkgdesc="Client and server software to query DNS over HTTPS, using Google DNS-over-HTTPS protocol"
url="https://github.com/m13253/dns-over-https"
arch=('x86_64' 'i686')
license=('MIT')
depends=('glibc')
makedepends=('go' 'git')
source=("git+https://github.com/m13253/dns-over-https")
backup=('etc/dns-over-https/doh-client.conf'
        'etc/dns-over-https/doh-server.conf')
md5sums=('SKIP')

pkgver(){
        cd $srcdir/$_pkgname
        printf "${_pkgver}%s"  "$(git rev-parse --short HEAD)"
}

prepare(){
        #mkdir -p $srcdir/gopath
        #export GOPATH=$srcdir/gopath
        cd $srcdir/dns-over-https
        sed -i 's/\/usr\/local/${pkgdir}\/usr/g' Makefile
        sed -i 's/\/local//g' systemd/doh-client.service
        sed -i 's/\/local//g' systemd/doh-server.service
}

build(){
        cd $srcdir/$_pkgname
        make
}

package(){
        cd $srcdir/$_pkgname
        install -Dm755 doh-client/doh-client $pkgdir/usr/bin/doh-client
        install -Dm755 doh-server/doh-server $pkgdir/usr/bin/doh-server

        install -Dm644 doh-client/doh-client.conf $pkgdir/etc/dns-over-https/doh-client.conf
        install -Dm644 doh-server/doh-server.conf $pkgdir/etc/dns-over-https/doh-server.conf

        install -Dm644 systemd/doh-client.service $pkgdir/usr/lib/systemd/system/doh-client.service
        install -Dm644 systemd/doh-server.service $pkgdir/usr/lib/systemd/system/doh-server.service

        install -Dm755 NetworkManager/dispatcher.d/doh-client $pkgdir/etc/NetworkManager/dispatcher.d/doh-client
        install -Dm755 NetworkManager/dispatcher.d/doh-server $pkgdir/etc/NetworkManager/dispatcher.d/doh-server

        install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}