# Template file for 'lsof'
pkgname=lsof
version=4.99.7
revision=1
build_style=gnu-configure
configure_args="--enable-security --disable-liblsof"
hostmakedepends="automake groff"
checkdepends="util-linux procps-ng"
short_desc="LiSt Open Files"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="lsof"
homepage="https://github.com/lsof-org/lsof"
changelog="https://raw.githubusercontent.com/lsof-org/lsof/master/00DIST"
distfiles="https://github.com/lsof-org/lsof/releases/download/${version}/lsof-${version}.tar.gz"
checksum=4a10391aab0b8ce1f539e82a1966693b2a6cf225972a6504ebb7ec4fa71675de

post_extract() {
	# Ensure tests always run
	ln -sf /bin/true tests/CkTestDB

	# Skip tests/LTsock on GitHub CI
	# hostname/IP resolution fails in CI container
	if [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
		vsed -i Makefile.am -e '/^TESTS +=/s:tests/LTsock::g'
	fi
}

post_install() {
	vlicense COPYING
}
