summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cbd7dd518dcdf838eac3f0680cf7520fb119d054 (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
# Maintainer: devvick <root@devvick.eu>

pkgname=zeronsd-git
pkgver=r452.856a30c
pkgrel=1
pkgdesc="Unicast DNS resolver for ZeroTier networks"
url="https://github.com/zerotier/zeronsd"
license=("BSD-3-Clause")
arch=("any")
depends=("zerotier-one")
makedepends=("rustup" "git")
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}" "${pkgname/-git/-bin}")
source=("git+${url}")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${srcdir}/${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --release --locked --all-features
}

check() {
  cd "${srcdir}/${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --release --locked --lib
}

package() {
  cd "${srcdir}/${pkgname%-git}"
  _output="${srcdir}/${pkgname%-git}"
  install -Dm755 target/release/${pkgname%-git} -t "${pkgdir}/usr/bin"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}