summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ea1faed276fea149572826da5596196cc6750cb0 (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
# Maintainer: Ben Song <bensongsyz@gmail.com>
# Contributor: Simon Legner <Simon.Legner@gmail.com>
# Contributor: Ndoskrnl <lollipop.studio.cn@gmail.com>
pkgname=coredns-wgsd-git
_pkgname='wgsd'
pkgver=1.11.1
pkgrel=2
pkgdesc="A DNS server that chains plugins - with module wgsd"
makedepends=('go')
conflicts=('coredns-bin')
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
url="https://github.com/jwhited/wgsd"
license=('Apache')
provides=('coredns')
conflicts=('coredns')
source=($_pkgname::git+https://github.com/jwhited/wgsd.git
coredns.service
coredns-sysusers.conf)

sha256sums=('SKIP'
            'bbacde21632be9d7a9a758103775c768f9688372539b1b342ccf5c5db6746b4f'
            '536d03f8b20b0d2d6e8f96edd7e4e4dd7f6fef39ab0e952522d8725f3cc186b7')

pkgver() {
    cd $srcdir/$_pkgname
    cat go.mod | grep -o --color=never -P '(?<=coredns v)[.\d]+'
}

build() {
  export GOPATH="$srcdir/build"
  export PATH="$GOPATH"/bin:"$PATH"

  cd $srcdir/$_pkgname/cmd/coredns
  go build

  cd $srcdir/$_pkgname/cmd/wgsd-client
  go build

  chmod -R u+w "${GOPATH:?}"
}

package() {
  install -Dm755 "$srcdir/$_pkgname/cmd/coredns/coredns" "$pkgdir/usr/bin/coredns"
  install -Dm755 "$srcdir/$_pkgname/cmd/wgsd-client/wgsd-client" "$pkgdir/usr/bin/wgsd-client"
  install -Dm644 "$srcdir/coredns.service" "$pkgdir/usr/lib/systemd/system/coredns.service"
  install -Dm644 "$srcdir/coredns-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/coredns.conf"
  install -d "${pkgdir}/etc/coredns"
}