# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=checksec-rs
pkgver=0.0.9
pkgrel=3
pkgdesc="Fast multi-platform (ELF/PE/MachO) binary checksec"
url="https://github.com/etke/checksec.rs"
arch="all"
license="Apache-2.0"
makedepends="cargo cargo-auditable"
source="$pkgname-$pkgver.tar.gz::https://github.com/etke/checksec.rs/archive/refs/tags/v$pkgver.tar.gz
	update-rust-libc.patch
	"
builddir="$srcdir/checksec.rs-$pkgver"
options="net"

prepare() {
	default_prepare

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

build() {
	cargo auditable build --frozen --release \
		--no-default-features --features="elf,color"
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/checksec -t "$pkgdir"/usr/bin/
}

sha512sums="
fbc8382abadf39108eca5d879e709f26c4f8cfb8813161279f71140052b9f5992e93a7188755d18f3815abe85fe3dcbb1c6cc64c64d1b983f7a3258c8e29ae16  checksec-rs-0.0.9.tar.gz
a4e9da5ab63e5ed21af334e950dd2a66550616673863440234c244f8b125fa247e2fc335fa50bf58715967568219ccdb46c76a63db4f835761545322c5385aa2  update-rust-libc.patch
"
