# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 # Change this when you update the ebuild RUNC_COMMIT=dc9208a3303feef5b3839f4323d9beb36df0a9dd inherit go-module linux-info CONFIG_CHECK="~USER_NS" MY_PV="${PV/_/-}" SRC_URI="https://github.com/opencontainers/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" DESCRIPTION="runc container cli tools" HOMEPAGE="http://runc.io" LICENSE="Apache-2.0 BSD-2 BSD MIT" SLOT="0" IUSE="apparmor hardened +kmem +seccomp selinux test" DEPEND="seccomp? ( sys-libs/libseccomp )" RDEPEND=" ${DEPEND} !app-emulation/docker-runc apparmor? ( sys-libs/libapparmor ) " BDEPEND=" dev-go/go-md2man test? ( "${RDEPEND}" ) " S="${WORKDIR}/${PN}-${MY_PV}" # tests need busybox binary, and portage namespace # sandboxing disabled: mount-sandbox pid-sandbox ipc-sandbox # majority of tests pass RESTRICT+=" test" src_compile() { # Taken from app-emulation/docker-1.7.0-r1 export CGO_CFLAGS="-I${ROOT}/usr/include" export CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '') -L${ROOT}/usr/$(get_libdir)" # build up optional flags local options=( $(usev apparmor) $(usev seccomp) $(usev selinux) $(usex kmem '' 'nokmem') ) myemakeargs=( BUILDTAGS="${options[*]}" COMMIT=${RUNC_COMMIT} DESTDIR="${ED}" PREFIX="${ED}/usr" ) # prevent double manpage generation sed -i 's/^install-man: man/install-man:/' Makefile || die emake "${myemakeargs[@]}" runc man } src_install() { emake "${myemakeargs[@]}" install install-man install-bash local DOCS=( README.md PRINCIPLES.md docs/. ) einstalldocs } src_test() { emake "${myemakeargs[@]}" localunittest }