# Template file for 'criu'
pkgname=criu
version=3.13
revision=2
# i686 unsupported upstream: https://criu.org/32bit_tasks_C/R#Compatible_applications
# ppc64 big endian not supported upstream
archs="x86_64* aarch64* ppc64le* armv7l*"
build_style=gnu-makefile
make_use_env=compliant
make_build_args="WERROR=0"
hostmakedepends="asciidoc pkg-config xmlto protobuf"
makedepends="libcap-devel libnet-devel libnl3-devel protobuf-c-devel
 protobuf-devel"
short_desc="Utility to checkpoint/restore a process tree"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-only"
homepage="http://criu.org/"
distfiles="https://download.openvz.org/criu/criu-${version}.tar.bz2"
checksum=ea027f2acb55c62d47aec0c7776c723e5a877978e60d3574961b6f4c538fc9fa
nocross="fails to run protobuf internals"

do_install() {
	make DESTDIR=${DESTDIR} PREFIX=/usr LOGROTATEDIR=/etc/logrotate.d \
		LIBDIR=/usr/lib SBINDIR=/usr/bin install
	rm -rf ${DESTDIR}/usr/lib/systemd
	vsv criu
}

criu-devel_package() {
	short_desc+=" - development files"
	depends="criu-${version}_${revision}"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.so"
		vmove usr/lib/pkgconfig
	}
}

criu-python_package() {
	archs=noarch
	pycompile_module="pycriu"
	depends="python-protobuf python-ipaddr criu-${version}_${revision}"
	short_desc="Python2 bindings for criu and crit cli util"
	pkg_install() {
		vmove usr/bin/crit
		vmove usr/share/man/man1/crit.1
		vmove usr/lib/python2.7
	}
}
