# Template file for 'cargo-update'
pkgname=cargo-update
version=16.0.0
revision=1
build_style=cargo
hostmakedepends="pkg-config go-md2man"
makedepends="libcurl-devel libgit2-1.8-devel libssh2-devel openssl-devel"
short_desc="Cargo subcommand for updates to installed executables"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="https://github.com/nabijaczleweli/cargo-update"
changelog="https://github.com/nabijaczleweli/cargo-update/releases"
distfiles="https://github.com/nabijaczleweli/cargo-update/archive/refs/tags/v${version}.tar.gz"
checksum=50ab6c2f4c66057cdb337fe1bbb5df5b018acca88b059db0db58aa1664b44285

post_extract() {
	# Upstream does not ship a lockfile and is very vocal about that being
	# the right way:
	# https://github.com/nabijaczleweli/cargo-update/issues/50
	cp ${FILESDIR}/Cargo.lock .
}

post_install() {
	vlicense LICENSE
	vdoc README.md

	cd man
	for page in *.md; do
		go-md2man -in ${page} -out ${page%.md}.1
		vman ${page%.md}.1
	done
}
