Merge pull request #2403 from euank/1298-runc-userns

app-emulation/runc: workaround userns issue
This commit is contained in:
Euan Kemp 2017-01-31 19:38:24 -08:00 committed by GitHub
commit 85cd5d0426

View File

@ -0,0 +1,57 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
GITHUB_URI="github.com/opencontainers/runc"
COREOS_GO_PACKAGE="${GITHUB_URI}"
COREOS_GO_VERSION="go1.6"
# the commit of runc that docker uses.
# see https://github.com/docker/docker/blob/v1.12.6/Dockerfile#L245
# Note: this commit is only really present in `docker/runc` in the 'docker/1.12.x' branch
COMMIT_ID="50a19c6ff828c58e5dab13830bd3dacde268afe5"
inherit eutils flag-o-matic coreos-go-depend vcs-snapshot
DESCRIPTION="runc container cli tools"
HOMEPAGE="http://runc.io"
SRC_URI="https://${GITHUB_URI}/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
KEYWORDS="amd64 arm64"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="apparmor selinux +seccomp"
DEPEND=""
RDEPEND="
apparmor? ( sys-libs/libapparmor )
seccomp? ( sys-libs/libseccomp )
"
src_prepare() {
epatch "${FILESDIR}/0001-Makefile-do-not-install-dependencies-of-target.patch"
epatch "${FILESDIR}/0002-Dont-set-label-for-mqueue-under-userns.patch"
# Work around https://github.com/golang/go/issues/14669
# Remove after updating to go1.7
filter-flags -O*
go_export
}
src_compile() {
# build up optional flags
local options=(
$(usev apparmor)
$(usev seccomp)
$(usev selinux)
)
emake BUILDTAGS="${options[*]}"
}
src_install() {
dobin runc
}