# Contributor: qaqland <qaq@qaq.land>
# Maintainer: qaqland <qaq@qaq.land>
pkgname=shellharden
pkgver=4.3.1
pkgrel=0
pkgdesc="The corrective bash syntax highlighter"
url="https://github.com/anordal/shellharden"
arch="all"
license="MPL-2.0"
makedepends="cargo cargo-auditable"
checkdepends="bash"
subpackages="$pkgname-doc"
source="https://github.com/anordal/shellharden/archive/v$pkgver/shellharden-$pkgver.tar.gz"
options="net" # cargo fetch

prepare() {
	default_prepare

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

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

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/shellharden "$pkgdir"/usr/bin/shellharden

	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	install -Dm644 README.md how_to_do_things_safely_in_bash.md \
		-t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
57bb3998d9739e5dc8fa83fa65182de14630b100c54fd16681fe4b64dc8fa8f48e970cba587366c034dc65ed02760e7452946f60d999ab0282f8e9bb479d5c15  shellharden-4.3.1.tar.gz
"
