# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Joakim Hernberg <jhernberg at alchemy dot lu>

pkgname=rt-tests
pkgver=2.2
pkgrel=1
pkgdesc="A collection of latency testing tools for the linux(-rt) kernel"
arch=('x86_64')
url="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/about/"
license=('GPL2')
groups=('realtime')
depends=('glibc')
makedepends=('numactl' 'python')
optdepends=('bash: for determine_maximum_mpps.sh'
            'numactl: for cyclictest, oslat and signaltest'
            'python: for get_cyclictest_snapshot and hwlatdetect')
source=("https://git.kernel.org/pub/scm/utils/${pkgname}/${pkgname}.git/snapshot/${pkgname}-${pkgver}.tar.gz")
sha512sums=('40a481651c24d05b8f283b370ec4330147600f9b82b43151481a47c4dfeef256ac4979f31f46cf6a18106d29fcd7df8ad909df9d4369d6b69ddb5395b2e5add8')
b2sums=('835e1e755dfaab088475038379e58eb4064f781807bb92d60791196a67782a69ca59434ae6f9c00e2dada246b6179a65019044951ff97ea105fb1f21c28b2515')

build() {
  cd "${pkgname}-${pkgver}"
  export PYLIB=$(python -c 'import distutils.sysconfig;  print(distutils.sysconfig.get_python_lib())')
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make prefix=/usr DESTDIR="${pkgdir}" install
  install -vDm 644 {MAINTAINERS,README.markdown} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}
