# Maintainer: David Runge <dave@sleepmap.de>
# Contributor: Joakim Hernberg <jhernberg at alchemy dot lu>

pkgname=rt-tests
pkgver=1.5
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=('python' 'numactl')
source=("https://git.kernel.org/pub/scm/utils/${pkgname}/${pkgname}.git/snapshot/${pkgname}-${pkgver}.tar.gz")
sha512sums=('4ff4350f4480b4a71afbbe0273fc91c3b20cb82ba09dd18bc8eee97395872c2fbe1ae735610c683d9861ac10c70818447cbfed47379b710bf602886f9915b682')

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}"
  # removing stale directories
  rmdir -v "${pkgdir}/usr/"{src,share/man/man4}
}
