# Template file for 'sbctl'
pkgname=sbctl
version=0.18
revision=1
build_style=go
build_helper=qemu
go_import_path="github.com/foxboron/sbctl"
go_package="${go_import_path}/cmd/sbctl"
go_ldflags="-X ${go_import_path}.Version=${version}"
hostmakedepends="asciidoc pkg-config"
makedepends="pcsclite-devel"
checkdepends="openssl-devel"
short_desc="Secure Boot key manager"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="https://github.com/Foxboron/sbctl"
distfiles="https://github.com/Foxboron/sbctl/archive/${version}.tar.gz"
checksum=7aa2af7b50d42abe39eb4875069ae5cd3fb8406d067d7a58b029c8270bacd14d
make_dirs="/var/lib/sbctl 0700 root root"
export GOFLAGS="-buildmode=pie"

post_install() {
	make man
	vman docs/sbctl.8
	vman docs/sbctl.conf.5
	vlicense LICENSE

	local SBCTL="${DESTDIR}/usr/bin/sbctl"
	for shell in bash fish zsh; do
		vtargetrun ${SBCTL} completion ${shell} > sbctl.${shell}
		vcompletion sbctl.${shell} ${shell}
	done
}
