# 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.21
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=('6418c5521ab4e7ab9a18ecf07b3c0b9460d0015314bf6fdea9b3a748b1deb8c47a6ed1e5fd86cc0a99e0f6877e943f44488387f1fc2c3c17e091014fb9ad003c')
b2sums=('7ac39edca583485ef4943850df79ccfd834439a042caa4cc4c2c8a436a4057f8846738c43dcdc92e32a318a4d0f354cc2449677b2cf94286b05556762a118081')

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:
