Diff runc-1.0.0_rc6_p20181203-r1 with a runc-9999

/usr/portage/app-emulation/runc/runc-9999.ebuild 2017-02-28 22:50:00.000000000 +0000
1
# Copyright 1999-2019 Gentoo Authors
1
# Copyright 1999-2017 Gentoo Foundation
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=6
5
EGO_PN="github.com/opencontainers/${PN}"
6 5

  
7
if [[ ${PV} == *9999 ]]; then
8
	inherit golang-build golang-vcs
9
else
10
	MY_PV="${PV/_/-}"
11
	RUNC_COMMIT="96ec2177ae841256168fcf76954f7177af9446eb" # Change this when you update the ebuild
12
	SRC_URI="https://${EGO_PN}/archive/${RUNC_COMMIT}.tar.gz -> ${P}.tar.gz"
13
	KEYWORDS="amd64 ~arm ~arm64 ~ppc64"
14
	inherit golang-build golang-vcs-snapshot
15
fi
6
inherit eutils multilib
16 7

  
17 8
DESCRIPTION="runc container cli tools"
18 9
HOMEPAGE="http://runc.io"
19 10

  
11
GITHUB_URI="github.com/opencontainers/runc"
12

  
13
if [[ ${PV} == *9999* ]]; then
14
	EGIT_REPO_URI="git://${GITHUB_URI}.git"
15
	inherit git-r3
16
else
17
	SRC_URI="https://${GITHUB_URI}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
18
	KEYWORDS="~amd64 ~ppc64"
19
fi
20

  
20 21
LICENSE="Apache-2.0"
21 22
SLOT="0"
22
IUSE="+ambient apparmor hardened +kmem +seccomp"
23
IUSE="+seccomp"
23 24

  
24
RDEPEND="
25
	apparmor? ( sys-libs/libapparmor )
26
	seccomp? ( sys-libs/libseccomp )
27
	!app-emulation/docker-runc
28
"
29

  
30
PATCHES=( "${FILESDIR}/${PN}-fix-cve.patch" )
31

  
32
src_prepare() {
33
	pushd src/${EGO_PN}
34
	default
35
	sed -i -e "/^GIT_BRANCH/d"\
36
		-e "/^GIT_BRANCH_CLEAN/d"\
37
		-e "/^COMMIT_NO/d"\
38
		-e "s/COMMIT :=.*/COMMIT := ${RUNC_COMMIT}/"\
39
		Makefile || die
40
	popd || die
41
}
25
DEPEND=">=dev-lang/go-1.4:="
26
RDEPEND="seccomp? ( sys-libs/libseccomp )
27
	!app-emulation/docker-runc"
42 28

  
43 29
src_compile() {
44 30
	# Taken from app-emulation/docker-1.7.0-r1
45 31
	export CGO_CFLAGS="-I${ROOT}/usr/include"
46
	export CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')
47
		-L${ROOT}/usr/$(get_libdir)"
32
	export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
33

  
34
	# Setup GOPATH so things build
35
	rm -rf .gopath
36
	mkdir -p .gopath/src/"$(dirname "${GITHUB_URI}")"
37
	ln -sf ../../../.. .gopath/src/"${GITHUB_URI}"
38
	export GOPATH="${PWD}/.gopath:${PWD}/vendor"
48 39

  
49 40
	# build up optional flags
50
	local options=(
51
		$(usex ambient 'ambient' '')
52
		$(usex apparmor 'apparmor' '')
53
		$(usex seccomp 'seccomp' '')
54
		$(usex kmem '' 'nokmem')
55
	)
41
	local options=( $(usex seccomp "seccomp") )
56 42

  
57
	GOPATH="${S}" emake BUILDTAGS="${options[*]}" -C src/${EGO_PN}
43
	emake BUILDTAGS="${options[@]}"
58 44
}
59 45

  
60 46
src_install() {
61
	pushd src/${EGO_PN} || die
62 47
	dobin runc
63
	dodoc README.md PRINCIPLES.md
64
	popd || die
65 48
}
Thank you!