# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Christian Heusel <gromit@archlinux.org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Jim Ferguson <ferguson@ncsa.uiuc.edu>
# Contributor: Xi0N <jonandermonleon@gmail.com>
# Contributor: goll <adrian.goll+aur[at]gmail>

pkgname=iperf3
pkgver=3.20
pkgrel=1
pkgdesc='TCP, UDP, and SCTP network bandwidth measurement tool'
url='https://github.com/esnet/iperf'
arch=(x86_64 aarch64)
license=(BSD-3-Clause)
depends=(
  glibc
  openssl
  lksctp-tools
)
provides=(
  libiperf.so
)
source=("${url}/archive/refs/tags/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('2a52d27388e2585327f92b9cd33335345706371533f1e8da9aa5fb66d11cca70d8690f12c24bf31d7fa231e41225faa2f93b7b31fd869cbd2f34ab5401e3f5ff')
b2sums=('2a6d77498028375177275452d0bbce7af12fb477b70ed275cc2dc092a02a96f3b9389e584e9e89628042bcadadcafba121b3bd84598a7781e8e6c4bd49d7e843')

build() {
  cd iperf-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd iperf-${pkgver}
  make check
}

package() {
  cd iperf-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 examples/*{.am,.in,.c} -t "${pkgdir}/usr/share/doc/${pkgname}/examples"
  install -Dm 644 contrib/iperf3.service -t "${pkgdir}/usr/lib/systemd/system"
}

# vim: ts=2 sw=2 et:
