blob: 5aa85977a54532cc76b6a95ef1447e3a9da25919 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module linux-info
# update on bump, look for commit ID on release tag.
# https://github.com/opencontainers/runc
RUNC_COMMIT=0d37cfd4b557771e555a184d5a78d0ed4bdb79a5
CONFIG_CHECK="~USER_NS"
DESCRIPTION="runc container cli tools"
HOMEPAGE="https://github.com/opencontainers/runc/"
MY_PV="${PV/_/-}"
SRC_URI="https://github.com/opencontainers/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${MY_PV}"
LICENSE="Apache-2.0 BSD-2 BSD MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
IUSE="apparmor hardened +kmem +seccomp selinux test"
COMMON_DEPEND="
apparmor? ( sys-libs/libapparmor )
seccomp? ( sys-libs/libseccomp )"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}
!app-emulation/docker-runc
selinux? ( sec-policy/selinux-container )"
BDEPEND="
dev-go/go-md2man
test? ( "${RDEPEND}" )"
# 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-containers/docker-1.7.0-r1
CGO_CFLAGS+=" -I${ESYSROOT}/usr/include"
CGO_LDFLAGS+=" $(usex hardened '-fno-PIC ' '')
-L${ESYSROOT}/usr/$(get_libdir)"
# build up optional flags
local options=(
$(usev apparmor)
$(usev seccomp)
$(usex kmem '' 'nokmem')
)
myemakeargs=(
BUILDTAGS="${options[*]}"
COMMIT="${RUNC_COMMIT}"
)
emake "${myemakeargs[@]}" runc man
}
src_install() {
myemakeargs+=(
PREFIX="${ED}/usr"
BINDIR="${ED}/usr/bin"
MANDIR="${ED}/usr/share/man"
)
emake "${myemakeargs[@]}" install install-man install-bash
local DOCS=( README.md PRINCIPLES.md docs/. )
einstalldocs
}
src_test() {
emake "${myemakeargs[@]}" localunittest
}
|