# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=apk-inspect
pkgver=0.1.0_pre2
_pkgver=${pkgver/_pre/-pre.}
pkgrel=0
pkgdesc="CLI tool for reading Alpine's apk package format and APKBUILD"
url="https://github.com/jirutka/alpkit"
# loongarch64: blocked by libc crate
arch="all !loongarch64"
license="MIT"
depends="/bin/sh"
makedepends="
	cargo
	cargo-auditable
	zlib-ng-dev
	"
source="https://github.com/jirutka/alpkit/archive//v$_pkgver/apk-inspect-$_pkgver.tar.gz"
builddir="$srcdir/alpkit-$_pkgver"

_cargo_opts="--frozen --no-default-features --features flate2-zlib-ng"

prepare() {
	default_prepare

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

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
427b1e157683422e5ec176ba21408c7693e4aae7a4f28da5d12e76a8d2f1e1d531340ba47abbcc28cbc4461e94d885eda1efc45c579a981c028d52dadae24ccf  apk-inspect-0.1.0-pre.2.tar.gz
"
