# Maintainer: David Runge <dave@sleepmap.de>
# Contributor: Dan McGee <dan@archlinux.org>
# Contributor: Florian Zeitz <florob at babelmonkeys dot de>

pkgname=numactl
pkgver=2.0.13
pkgrel=1
pkgdesc="Simple NUMA policy support"
arch=('x86_64')
url="http://oss.sgi.com/projects/libnuma/"
license=('LGPL2.1' 'GPL2')
depends=('perl')
provides=('libnuma.so')
source=("https://github.com/numactl/numactl/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('f7b747eb8f3ded9f3661cb0fc7b65b5ed490677f881f8fe6a000baf714747515853b4e5c8781b014241180bf16e9f0bfdf2c6f758725e34b4938696ba496b72a')

prepare(){
  cd "${pkgname}-${pkgver}"
  autoreconf -vfi
}

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

check() {
  cd "${pkgname}-${pkgver}"
  make -k test || msg "Tests known to fail depending on system load."
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="$pkgdir" install
  # move_pages(2) is provided by man-pages and is more up-to-date there anyway
  rm -rf "$pkgdir/usr/share/man/man2"
  install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
