summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9aad137f374e3420a6160eb68b91e50ccd5cfb61 (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
# Maintainer: 7Ji <pugokughin@gmail.com>

_pkgbase=wireguard-deployer
_srcname="${_pkgbase}"
pkgname=${_pkgbase}-git
pkgver=0.1.0.r23.5b5d4f8
pkgrel=1
pkgdesc="WireGuard configs and keys generaor for systemd-networkd and OpenWrt "
arch=('x86_64' 'aarch64')
url="https://github.com/7Ji/${_srcname}"
license=('AGPL-3.0-or-later')
depends=('gcc-libs' 'glibc')
makedepends=('cargo')
conflicts=("${_pkgbase}")
provides=("${_pkgbase}=${pkgver}")
source=(
  "${_srcname}::git+https://github.com/7Ji/${_pkgbase}.git"
)
sha256sums=(
  'SKIP'
)
prepare() {
  cd "${_srcname}"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"
}

pkgver() {
  printf "%s" "$(git --git-dir "${_srcname}/.git" describe --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
}

build() {
  cd "${_srcname}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features
}

package() {
  install -Dm755 "${_srcname}/target/release/${_pkgbase}" -t "${pkgdir}"/usr/bin/
}