# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer:
pkgname=thin-provisioning-tools
pkgver=1.1.0
pkgrel=0
pkgdesc="suite of tools for manipulating the metadata of the dm-thin device-mapper target"
url="https://github.com/jthornber/thin-provisioning-tools"
# ucontext libc fs_type_t
arch="all"
license="GPL-3.0-only"
makedepends="
	cargo
	cargo-auditable
	clang-libclang
	eudev-dev
	gawk
	lvm2-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jthornber/thin-provisioning-tools/archive/v$pkgver.tar.gz"
# tests do a ton of disk i/o for a while..
# they pass on x86_64, but a bit too destructive to constantly run
options="net !check"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --locked
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
8cf3953743334b5a34504695757fa2de5a5fb5bdb8c7aed859995154fc004f52c3ef041558d307a2309c2de8dcdcbd8a0537bd3408fd78c7ff2f641f28944c1e  thin-provisioning-tools-1.1.0.tar.gz
"
