# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Devin Cofer <ranguvar[at]ranguvar[dot]io>
# Contributor: DriverX
# Contributor: Nicolas Quiénot <niQo @ aur>
# Contributor: Martin Schrodt <martin@schrodt.org>

pkgname=nvme-cli
pkgver=1.15
pkgrel=1
pkgdesc="NVM-Express user space tooling for Linux"
arch=('i686' 'x86_64')
url="https://github.com/linux-nvme/nvme-cli"
license=('GPL')
makedepends=('systemd')
depends=('util-linux' 'libsystemd')
install=nvme-cli.install
# checkdepends=('python2-nose' 'python-nose')
source=("$pkgname-$pkgver.tar.gz::https://github.com/linux-nvme/${pkgname}/archive/v${pkgver}.tar.gz")
sha256sums=('4c681d1a98fc139c0c81f0c878d052c475679a2aca28221050b3be7e5b996528')

build() {
	cd "${pkgname}-${pkgver}"
	make PREFIX=/usr
}

# Tests require a working NVME disk.
# check() {
# 	cd "${pkgname}-${pkgver}"
# 	make test
# }

package() {
	cd "${pkgname}-${pkgver}"
	make DESTDIR="$pkgdir" UDEVDIR=/usr/lib/udev PREFIX=/usr SBINDIR=/usr/bin install-spec

	# This is done because we don't want the hostnqn and hostid files tracked.
	# they are supposed to be unique
	rm $pkgdir/etc/nvme/host{nqn,id}
}
