#!/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=73
pkgrel=01
pkgdesc='Utility library for managing the libnvdimm (non-volatile memory device) sub-system in the Linux kernel w/o systemd'
arch=('x86_64')
url="https://github.com/pmem/ndctl"
makedepends=('asciidoctor' 'bash-completion' 'xmlto') # 'meson') 
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() {
  jobo-meson $pkgname-$pkgver build
#    cd $pkgname-$pkgver
#   ./autogen.sh
#    ./configure --prefix=/usr --sysconfdir=/etc --without-systemd
  make
  meson compile -C build
}

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

package() {
  depends=('iniparser' 'json-c' 'keyutils' 'kmod' 'util-linux-libs' 'eudev')
  meson install -C build --destdir "$pkgdir"
#    cd $pkgname-$pkgver
#    make DESTDIR="$pkgdir" install
}


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

license=('LGPL')

sha256sums=(97f85b897378d293da75f91c2f238c0a45e1626dc2c2367e7a8d78378ee0f73b) #  ndctl-73.tar.gz
