#!/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=ndctl
pkgver=76.1
pkgrel=01
pkgdesc='Utility library for managing the libnvdimm (non-volatile memory device) sub-system in the Linux kernel w/o systemd'
url="https://github.com/pmem/ndctl"
depends=('iniparser' 'json-c' 'keyutils' 'kmod' 'util-linux-libs' 'eudev' 'libtraceevent' 'libtracefs' )
makedepends=('asciidoctor' 'bash-completion' 'cmake' 'meson' 'xmlto')
source=("https://github.com/pmem/ndctl/archive/v$pkgver/$pkgname-$pkgver.tar.gz")

prepare() {
  # fix location of modprobe.d conf
  sed -i "s|^modprobedatadir =.*|modprobedatadir = '/usr/lib/modprobe.d/'|" $pkgname-$pkgver/contrib/meson.build
}

build() {
  arch-meson $pkgname-$pkgver build -D systemd=disabled
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {

  meson install -C build --destdir "$pkgdir"
#    cd $pkgname-$pkgver
#    make DESTDIR="$pkgdir" install
}

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=('LGPL')
 
sha256sums=(05e9737c3775241617a0cb51c559e60f66ccf6144175a5649f422403dc758656) ##  ndctl-76.1.tar.gz

##   ae95aa594b07fc0f1c1979ff6afb2fff14183b06f72dd169dd0b88f0f1d6637c  ndctl-76.1-01-x86_64.pkg.tar.lz
