# Template file for 'minijail'
pkgname=minijail
version=2025.07.02
revision=1
build_style=gnu-makefile
makedepends="libcap-devel"
checkdepends="wget tar gzip"
short_desc="Sandboxing and containment tool used in Chrome OS and Android"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause"
homepage="https://android.googlesource.com/platform/external/minijail"
distfiles="https://github.com/google/minijail/archive/linux-v${version}.tar.gz"
checksum=2fb5a44ea2ffcdeb2f7ce0d7471e0f5d3069595954267a012f5dd0a41ffd2e4c

if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then
	broken="bpf.h:110:2: error: #error Unsupported endianness"
fi

do_check() {
	chmod +x ./get_googletest.sh
	./get_googletest.sh
	make test
}

do_install() {
	vbin minijail0
	vmkdir usr/lib
	vcopy libminijail.so usr/lib
	vcopy libminijailpreload.so usr/lib
	vman minijail0.1
	vman minijail0.5
	vlicense LICENSE
}
