summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bce4a4b6108ea37e2adc588555b2edff743cf188 (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: bgme <i@bgme.me>

pkgname=zdns-git
pkgdesc='A command-line utility that provides high-speed DNS lookups.'
pkgver=1.1.0.569.937e22c
pkgrel=2
url='https://github.com/zmap/zdns'
arch=('x86_64')
license=('Apache-2.0')
depends=('glibc')
makedepends=('git' 'go')
provides=('zdns')
source=(${pkgname}::git+https://github.com/zmap/zdns.git#branch=main)
sha512sums=('SKIP')

pkgver() {
  cd ${pkgname}
  printf "%s.%s.%s" \
    "$(git tag -l | cut -d- -f1 | sort -V -r | head -n1 | cut -dv -f2)" \
    "$(git rev-list --count HEAD)" \
    "$(git rev-parse --short HEAD)"
}

build() {
  cd ${pkgname}
  export CGO_LDFLAGS="${LDFLAGS}"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  go build -o zdns

  #for i in zsh bash fish; do
  #  ./zdns completion $i >zdns.$i
  #done
}

package() {
  cd ${pkgname}

  install -Dm 755 zdns "${pkgdir}/usr/bin/zdns"

  install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/zdns/LICENSE"

  #install -Dm 644 zdns.zsh "${pkgdir}/usr/share/zsh/site-functions/_zdns"
  #install -Dm 644 zdns.bash "${pkgdir}/usr/share/bash-completion/completions/zdns"
  #install -Dm 644 zdns.fish "${pkgdir}/usr/share/fish/vendor_completions.d/zdns.fish"
}