# Description: Tools for configuring WireGuard
# URL: https://git.zx2c4.com/wireguard-tools/
# Maintainer: Tim Biermann, tbier at posteo dot de

name=wireguard-tools
version=1.0.20210914
release=1
source=(https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-$version.tar.xz)

build() {
  cd $name-$version

  prt-get isinst bash-completions && PKGMK_WGTOOLS+=' WITH_BASHCOMPLETION=yes' || PKGMK_WGTOOLS+=' WITH_BASHCOMPLETION=NO'

  cd src
  make
  make install $PKGMK_WGTOOLS \
    DESTDIR=$PKG \
    PREFIX=/usr \
    RUNSTATEDIR=/run \
    WITH_WGQUICK=yes \
    WITH_SYSTEMDUNITS=no
}
