# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=iputils
# Commit date + git rev-parse --short origin/master
_rev=84cdf26
pkgver=20240905
pkgrel=1
pkgdesc="Network monitoring tools, including ping"
arch=('x86_64')
license=('BSD-3-Clause' 'GPL-2.0-or-later')
url="https://github.com/iputils/iputils"
depends=(
  libcap
  libidn2
)
makedepends=(
  docbook-xsl
  git
  iproute
  meson
  perl-sgmls
  systemd
)
conflicts=(
  arping
  netkit-base
)
replaces=('netkit-base')
source=("git+https://github.com/iputils/iputils.git#tag=${pkgver}?signed")
validpgpkeys=('2016FEA4858B1C36B32E833AC0DEC2EE72F33A5F') # Petr Vorel
b2sums=('73a8810a1ea62bb58a3898a7f0dd0cd4b315bad0f0798ebd074f5f93a5e0efeb54ac99cc00e7035c398d6a55d66a3db615c86b1c7a47745e2127ef1d05f23f6c')

build() {
  mkdir -p build
  cd build
  arch-meson ../$pkgname 
  ninja
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
  install -vDm 644 "../$pkgname/Documentation/LICENSE.BSD3" -t "$pkgdir/usr/share/licenses/$pkgname"
}
