#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=numactl
pkgver=2.0.16
pkgrel=01
pkgdesc="Simple NUMA policy support"
arch=(x86_64)
groups=( jobbot )
url="https://github.com/numactl/numactl"
depends=(glibc)
provides=(libnuma.so)
#options=(!debug)  # uncomment this to produce the debug pkg
#source=("https://github.com/numactl/numactl/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
source=($pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz)

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

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

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

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

#---- license gpg-key sha256sums ----

license=('LGPL2.1' 'GPL2')

sha256sums=(a35c3bdb3efab5c65927e0de5703227760b1101f5e27ab741d8f32b3d5f0a44c) # numactl-2.0.16.tar.gz

