# Template file for 'libcap-ng'
pkgname=libcap-ng
version=0.9.3
revision=1
build_style=gnu-configure
# --enable-cap-audit would be nice but introduces cycle with libaudit
configure_args="--with-python3"
hostmakedepends="automake autoconf libtool pkg-config swig python3-setuptools"
makedepends="libbpf-devel python3-devel"
short_desc="Alternate POSIX capabilities library"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://people.redhat.com/sgrubb/libcap-ng/"
changelog="https://raw.githubusercontent.com/stevegrubb/libcap-ng/refs/heads/master/ChangeLog"
distfiles="https://github.com/stevegrubb/libcap-ng/archive/refs/tags/v${version}.tar.gz"
checksum=fe11ebbb55904763b3532f19069f13ec319042634620180a03bd4653d301563e

pre_configure() {
	./autogen.sh
}

libcap-ng-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
		vmove usr/share/man/man3
		vmove usr/share/aclocal
	}
}

libcap-ng-progs_package() {
	short_desc+=" - utilities"
	license="GPL-2.0-or-later"
	pkg_install() {
		vmove usr/bin
		vmove usr/share
	}
}

libcap-ng-python3_package() {
	lib32disabled=yes
	short_desc+=" - Python3 bindings"
	depends="python3"
	pkg_install() {
		vmove ${py3_sitelib}
	}
}

libcap-ng-python_package() {
	metapackage=yes
	short_desc+=" - transitional dummy pkg"
	depends="libcap-ng-python3-${version}_${revision}"
}
