Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/rkt/
Date: Sun, 06 Mar 2016 12:04:30
Message-Id: 1457247633.ec70b783f02d4c9ca7f21d87c0c400137ac9d3b2.zmedico@gentoo
1 commit: ec70b783f02d4c9ca7f21d87c0c400137ac9d3b2
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 6 07:00:33 2016 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 6 07:00:33 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec70b783
7
8 app-emulation/rkt: update 9999 ebuild
9
10 Package-Manager: portage-2.2.27
11
12 app-emulation/rkt/rkt-9999.ebuild | 153 ++++++++++++++++++++++++++++++--------
13 1 file changed, 124 insertions(+), 29 deletions(-)
14
15 diff --git a/app-emulation/rkt/rkt-9999.ebuild b/app-emulation/rkt/rkt-9999.ebuild
16 index 72c10a9..89add2f 100644
17 --- a/app-emulation/rkt/rkt-9999.ebuild
18 +++ b/app-emulation/rkt/rkt-9999.ebuild
19 @@ -1,4 +1,4 @@
20 -# Copyright 1999-2015 Gentoo Foundation
21 +# Copyright 1999-2016 Gentoo Foundation
22 # Distributed under the terms of the GNU General Public License v2
23 # $Id$
24
25 @@ -7,19 +7,27 @@ EAPI=5
26 AUTOTOOLS_AUTORECONF=yes
27 AUTOTOOLS_IN_SOURCE_BUILD=yes
28
29 -inherit autotools-utils flag-o-matic systemd toolchain-funcs
30 -inherit git-r3
31 -
32 -EGIT_REPO_URI="https://github.com/coreos/rkt.git"
33 +inherit git-r3 autotools-utils flag-o-matic systemd toolchain-funcs
34
35 KEYWORDS=""
36 -PXE_VERSION="738.1.0"
37 -EGIT_BRANCH="master"
38
39 +EGIT_REPO_URI="https://github.com/coreos/rkt.git"
40 +PXE_VERSION="794.1.0"
41 +PXE_SYSTEMD_VERSION="v222"
42 +KVM_LINUX_VERSION="4.3.1"
43 +KVMTOOL_VERSION="3c8aec9e2b5066412390559629dabeb7816ee8f2"
44 PXE_URI="http://alpha.release.core-os.net/amd64-usr/${PXE_VERSION}/coreos_production_pxe_image.cpio.gz"
45 PXE_FILE="${PN}-pxe-${PXE_VERSION}.img"
46
47 -SRC_URI="rkt_stage1_coreos? ( $PXE_URI -> $PXE_FILE )"
48 +[[ ${PV} == *9999* ]] || SRC_URI+=" https://github.com/coreos/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
49 +SRC_URI+="
50 +rkt_stage1_coreos? ( $PXE_URI -> $PXE_FILE )
51 +rkt_stage1_kvm? (
52 + https://kernel.googlesource.com/pub/scm/linux/kernel/git/will/kvmtool/+archive/${KVMTOOL_VERSION}.tar.gz -> kvmtool-${KVMTOOL_VERSION}.tar.gz
53 + mirror://kernel/linux/kernel/v4.x/linux-${KVM_LINUX_VERSION}.tar.xz
54 + ${PXE_URI} -> ${PXE_FILE}
55 +)
56 +rkt_stage1_src? ( https://github.com/systemd/systemd/archive/${PXE_SYSTEMD_VERSION}.tar.gz -> systemd-${PXE_SYSTEMD_VERSION#v}.tar.gz )"
57
58 DESCRIPTION="A CLI for running app containers, and an implementation of the App
59 Container Spec."
60 @@ -27,39 +35,105 @@ HOMEPAGE="https://github.com/coreos/rkt"
61
62 LICENSE="Apache-2.0"
63 SLOT="0"
64 -IUSE="doc examples +rkt_stage1_coreos rkt_stage1_host rkt_stage1_src +actool systemd"
65 -REQUIRED_USE="^^ ( rkt_stage1_coreos rkt_stage1_host rkt_stage1_src )"
66 +IUSE="doc examples +rkt_stage1_coreos +rkt_stage1_fly rkt_stage1_host rkt_stage1_kvm rkt_stage1_src +actool systemd"
67 +REQUIRED_USE="|| ( rkt_stage1_coreos rkt_stage1_fly rkt_stage1_host rkt_stage1_kvm rkt_stage1_src ) rkt_stage1_host? ( systemd )"
68
69 DEPEND=">=dev-lang/go-1.4.1
70 app-arch/cpio
71 app-crypt/trousers
72 sys-fs/squashfs-tools
73 - dev-perl/Capture-Tiny
74 - rkt_stage1_src? (
75 - >=sys-apps/systemd-222
76 - app-shells/bash:0
77 - )"
78 + dev-perl/Capture-Tiny"
79 +
80 RDEPEND="!app-emulation/rocket
81 - rkt_stage1_host? (
82 + rkt_stage1_host? ( systemd? (
83 >=sys-apps/systemd-222
84 app-shells/bash:0
85 - )"
86 + ) )"
87
88 BUILDDIR="build-${P}"
89 +STAGE1_DEFAULT_LOCATION="/usr/share/rkt/stage1.aci"
90 +
91 +src_unpack() {
92 + [[ ${PV} == *9999* ]] && git-r3_src_unpack
93 + local x
94 + for x in ${A}; do
95 + case ${x} in
96 + *.img|linux-*) continue ;;
97 + kvmtool-*)
98 + mkdir kvmtool || die
99 + pushd kvmtool >/dev/null || die
100 + unpack ${x}
101 + popd >/dev/null || die
102 + ;;
103 + *)
104 + unpack ${x}
105 + esac
106 + done
107 +}
108 +
109 +src_prepare() {
110 + # disable git fetch of systemd
111 + sed -e 's~^include makelib/git.mk$~'\
112 +'ifneq ($(wildcard $(RKT_STAGE1_SYSTEMD_SRC)),)\n\n'\
113 +'get_systemd_sources: | $(UFS_SYSTEMDDIR)\n'\
114 +'\tmv "$(RKT_STAGE1_SYSTEMD_SRC)" "$(UFS_SYSTEMD_SRCDIR)"\n\n'\
115 +'$(UFS_SYSTEMD_CONFIGURE): get_systemd_sources\n\n'\
116 +'else ifneq ($(wildcard $(UFS_SYSTEMD_SRCDIR)),)\n\n'\
117 +'else\n'\
118 +'\t\0\n'\
119 +'endif~' -i stage1/usr_from_src/usr_from_src.mk || die
120 +
121 + # disable git fetch of kvmtool
122 + sed -e 's~^include makelib/git.mk$~'\
123 +'ifneq ($(wildcard $(shell echo "$${WORKDIR}/kvmtool")),)\n\n'\
124 +'$(call forward-vars, get_lkvm_sources, LKVM_SRCDIR)\n'\
125 +'get_lkvm_sources: | $(LKVM_TMPDIR)\n'\
126 +'\tmv "$${WORKDIR}/kvmtool" "$(LKVM_SRCDIR)"\n\n'\
127 +'$(LKVM_PATCH_STAMP): get_lkvm_sources\n\n'\
128 +'else ifneq ($(wildcard $(LKVM_SRCDIR)),)\n\n'\
129 +'else\n'\
130 +'\t\0\n'\
131 +'endif~' -i stage1/usr_from_kvm/lkvm.mk || die
132 +
133 + # disable fetch of kernel sources
134 + sed -e 's|wget .*|ln -s "$${DISTDIR}/linux-'${KVM_LINUX_VERSION}'.tar.xz" "$@"|' \
135 + -i stage1/usr_from_kvm/kernel.mk || die
136 +
137 + if use rkt_stage1_host; then
138 + # Make systemdUnitsPath consistent with host
139 + sed -e 's|\(systemdUnitsPath := \).*|\1"'$(systemd_get_systemunitdir)'"|' \
140 + -i stage1/init/init.go || die
141 + fi
142 +
143 + autotools-utils_src_prepare
144 +}
145
146 src_configure() {
147 - local myeconfargs=(
148 - --with-stage1-image-path="/usr/share/rkt/stage1.aci"
149 + local flavors myeconfargs=(
150 + --with-stage1-default-images-directory="/usr/share/rkt"
151 + --with-stage1-default-location="${STAGE1_DEFAULT_LOCATION}"
152 )
153
154 - if use rkt_stage1_host; then
155 - myeconfargs+=( --with-stage1="host" )
156 - elif use rkt_stage1_src; then
157 - myeconfargs+=( --with-stage1="src" )
158 - elif use rkt_stage1_coreos; then
159 - myeconfargs+=( --with-stage1="coreos" )
160 - mkdir -p "${BUILDDIR}/tmp/usr_from_coreos/" || die
161 - cp "${DISTDIR}/${PXE_FILE}" "${BUILDDIR}/tmp/usr_from_coreos/pxe.img" || die
162 + # enable flavors (first is default)
163 + use rkt_stage1_host && flavors+=",host"
164 + use rkt_stage1_src && flavors+=",src"
165 + use rkt_stage1_coreos && flavors+=",coreos"
166 + use rkt_stage1_fly && flavors+=",fly"
167 + use rkt_stage1_kvm && flavors+=",kvm"
168 + myeconfargs+=( --with-stage1-flavors="${flavors#,}" )
169 +
170 + if use rkt_stage1_src; then
171 + myeconfargs+=(
172 + --with-stage1-systemd-version=${PXE_SYSTEMD_VERSION}
173 + --with-stage1-systemd-src="${WORKDIR}/systemd-${PXE_SYSTEMD_VERSION#v}"
174 + )
175 + fi
176 +
177 + if use rkt_stage1_coreos || use rkt_stage1_kvm; then
178 + myeconfargs+=(
179 + --with-coreos-local-pxe-image-path="${DISTDIR}/${PXE_FILE}"
180 + --with-coreos-local-pxe-image-systemd-version="${PXE_SYSTEMD_VERSION}"
181 + )
182 fi
183
184 # Go's 6l linker does not support PIE, disable so cgo binaries
185 @@ -79,6 +153,14 @@ src_configure() {
186 autotools-utils_src_configure
187 }
188
189 +src_compile() {
190 + local arch=${ARCH}
191 + case ${arch} in
192 + amd64) arch=x86_64;;
193 + esac
194 + ARCH=${arch} autotools-utils_src_compile
195 +}
196 +
197 src_install() {
198 dodoc README.md
199 use doc && dodoc -r Documentation
200 @@ -87,8 +169,21 @@ src_install() {
201
202 dobin "${S}/${BUILDDIR}/bin/rkt"
203
204 - insinto /usr/share/rkt/
205 - doins "${S}/${BUILDDIR}/bin/stage1.aci"
206 + insinto /usr/share/rkt
207 + doins "${S}/${BUILDDIR}/bin/"*.aci
208 +
209 + # create symlink for default stage1 image path
210 + if use rkt_stage1_host; then
211 + dosym stage1-host.aci "${STAGE1_DEFAULT_LOCATION}"
212 + elif use rkt_stage1_src; then
213 + dosym stage1-src.aci "${STAGE1_DEFAULT_LOCATION}"
214 + elif use rkt_stage1_coreos; then
215 + dosym stage1-coreos.aci "${STAGE1_DEFAULT_LOCATION}"
216 + elif use rkt_stage1_fly; then
217 + dosym stage1-fly.aci "${STAGE1_DEFAULT_LOCATION}"
218 + elif use rkt_stage1_kvm; then
219 + dosym stage1-kvm.aci "${STAGE1_DEFAULT_LOCATION}"
220 + fi
221
222 systemd_dounit "${S}"/dist/init/systemd/${PN}-gc.service
223 systemd_dounit "${S}"/dist/init/systemd/${PN}-gc.timer