# Template file for 'miniserve'
pkgname=miniserve
version=0.22.0
revision=1
build_style=cargo
build_helper=qemu
checkdepends="curl"
short_desc="CLI tool to serve files and dirs over HTTP"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://github.com/svenstaro/miniserve"
changelog="https://raw.githubusercontent.com/svenstaro/miniserve/master/CHANGELOG.md"
distfiles="https://github.com/svenstaro/miniserve/archive/refs/tags/v${version}.tar.gz"
checksum=325f6cde391c468000b1bdcc8455ec2c6950b3c930029187671c536507b185ba
make_check=ci-skip  # port binding succeeds locally but fails in CI

case "$XBPS_TARGET_MACHINE" in
	x86_64*|i686*|arm*|aarch64*) ;;
	*) broken="ftbfs in ring" ;;
esac

post_install() {
	MINISERVE="${DESTDIR}/usr/bin/miniserve"
	for shell in bash fish zsh; do
		vtargetrun ${MINISERVE} --print-completions ${shell} > miniserve.${shell}
		vcompletion miniserve.${shell} ${shell}
	done

	vtargetrun ${MINISERVE} --print-manpage > miniserve.1
	vman miniserve.1

	vlicense LICENSE
}
