From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4AFFB59CA3 for ; Sun, 6 Mar 2016 12:04:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D4CD521C026 for ; Sun, 6 Mar 2016 12:04:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5A7EAE03EC for ; Sun, 6 Mar 2016 07:02:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2039340A42 for ; Sun, 6 Mar 2016 07:02:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0F9A68F5 for ; Sun, 6 Mar 2016 07:01:58 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1457247633.ec70b783f02d4c9ca7f21d87c0c400137ac9d3b2.zmedico@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/rkt/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-emulation/rkt/rkt-9999.ebuild X-VCS-Directories: app-emulation/rkt/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: ec70b783f02d4c9ca7f21d87c0c400137ac9d3b2 X-VCS-Branch: master Date: Sun, 6 Mar 2016 07:01:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3f77eabb-06dc-4425-b978-fb72ecbca7e3 X-Archives-Hash: 8bef68967758fe8f1444ef23d6d402e8 commit: ec70b783f02d4c9ca7f21d87c0c400137ac9d3b2 Author: Zac Medico gentoo org> AuthorDate: Sun Mar 6 07:00:33 2016 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Mar 6 07:00:33 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec70b783 app-emulation/rkt: update 9999 ebuild Package-Manager: portage-2.2.27 app-emulation/rkt/rkt-9999.ebuild | 153 ++++++++++++++++++++++++++++++-------- 1 file changed, 124 insertions(+), 29 deletions(-) diff --git a/app-emulation/rkt/rkt-9999.ebuild b/app-emulation/rkt/rkt-9999.ebuild index 72c10a9..89add2f 100644 --- a/app-emulation/rkt/rkt-9999.ebuild +++ b/app-emulation/rkt/rkt-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -7,19 +7,27 @@ EAPI=5 AUTOTOOLS_AUTORECONF=yes AUTOTOOLS_IN_SOURCE_BUILD=yes -inherit autotools-utils flag-o-matic systemd toolchain-funcs -inherit git-r3 - -EGIT_REPO_URI="https://github.com/coreos/rkt.git" +inherit git-r3 autotools-utils flag-o-matic systemd toolchain-funcs KEYWORDS="" -PXE_VERSION="738.1.0" -EGIT_BRANCH="master" +EGIT_REPO_URI="https://github.com/coreos/rkt.git" +PXE_VERSION="794.1.0" +PXE_SYSTEMD_VERSION="v222" +KVM_LINUX_VERSION="4.3.1" +KVMTOOL_VERSION="3c8aec9e2b5066412390559629dabeb7816ee8f2" PXE_URI="http://alpha.release.core-os.net/amd64-usr/${PXE_VERSION}/coreos_production_pxe_image.cpio.gz" PXE_FILE="${PN}-pxe-${PXE_VERSION}.img" -SRC_URI="rkt_stage1_coreos? ( $PXE_URI -> $PXE_FILE )" +[[ ${PV} == *9999* ]] || SRC_URI+=" https://github.com/coreos/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" +rkt_stage1_coreos? ( $PXE_URI -> $PXE_FILE ) +rkt_stage1_kvm? ( + https://kernel.googlesource.com/pub/scm/linux/kernel/git/will/kvmtool/+archive/${KVMTOOL_VERSION}.tar.gz -> kvmtool-${KVMTOOL_VERSION}.tar.gz + mirror://kernel/linux/kernel/v4.x/linux-${KVM_LINUX_VERSION}.tar.xz + ${PXE_URI} -> ${PXE_FILE} +) +rkt_stage1_src? ( https://github.com/systemd/systemd/archive/${PXE_SYSTEMD_VERSION}.tar.gz -> systemd-${PXE_SYSTEMD_VERSION#v}.tar.gz )" DESCRIPTION="A CLI for running app containers, and an implementation of the App Container Spec." @@ -27,39 +35,105 @@ HOMEPAGE="https://github.com/coreos/rkt" LICENSE="Apache-2.0" SLOT="0" -IUSE="doc examples +rkt_stage1_coreos rkt_stage1_host rkt_stage1_src +actool systemd" -REQUIRED_USE="^^ ( rkt_stage1_coreos rkt_stage1_host rkt_stage1_src )" +IUSE="doc examples +rkt_stage1_coreos +rkt_stage1_fly rkt_stage1_host rkt_stage1_kvm rkt_stage1_src +actool systemd" +REQUIRED_USE="|| ( rkt_stage1_coreos rkt_stage1_fly rkt_stage1_host rkt_stage1_kvm rkt_stage1_src ) rkt_stage1_host? ( systemd )" DEPEND=">=dev-lang/go-1.4.1 app-arch/cpio app-crypt/trousers sys-fs/squashfs-tools - dev-perl/Capture-Tiny - rkt_stage1_src? ( - >=sys-apps/systemd-222 - app-shells/bash:0 - )" + dev-perl/Capture-Tiny" + RDEPEND="!app-emulation/rocket - rkt_stage1_host? ( + rkt_stage1_host? ( systemd? ( >=sys-apps/systemd-222 app-shells/bash:0 - )" + ) )" BUILDDIR="build-${P}" +STAGE1_DEFAULT_LOCATION="/usr/share/rkt/stage1.aci" + +src_unpack() { + [[ ${PV} == *9999* ]] && git-r3_src_unpack + local x + for x in ${A}; do + case ${x} in + *.img|linux-*) continue ;; + kvmtool-*) + mkdir kvmtool || die + pushd kvmtool >/dev/null || die + unpack ${x} + popd >/dev/null || die + ;; + *) + unpack ${x} + esac + done +} + +src_prepare() { + # disable git fetch of systemd + sed -e 's~^include makelib/git.mk$~'\ +'ifneq ($(wildcard $(RKT_STAGE1_SYSTEMD_SRC)),)\n\n'\ +'get_systemd_sources: | $(UFS_SYSTEMDDIR)\n'\ +'\tmv "$(RKT_STAGE1_SYSTEMD_SRC)" "$(UFS_SYSTEMD_SRCDIR)"\n\n'\ +'$(UFS_SYSTEMD_CONFIGURE): get_systemd_sources\n\n'\ +'else ifneq ($(wildcard $(UFS_SYSTEMD_SRCDIR)),)\n\n'\ +'else\n'\ +'\t\0\n'\ +'endif~' -i stage1/usr_from_src/usr_from_src.mk || die + + # disable git fetch of kvmtool + sed -e 's~^include makelib/git.mk$~'\ +'ifneq ($(wildcard $(shell echo "$${WORKDIR}/kvmtool")),)\n\n'\ +'$(call forward-vars, get_lkvm_sources, LKVM_SRCDIR)\n'\ +'get_lkvm_sources: | $(LKVM_TMPDIR)\n'\ +'\tmv "$${WORKDIR}/kvmtool" "$(LKVM_SRCDIR)"\n\n'\ +'$(LKVM_PATCH_STAMP): get_lkvm_sources\n\n'\ +'else ifneq ($(wildcard $(LKVM_SRCDIR)),)\n\n'\ +'else\n'\ +'\t\0\n'\ +'endif~' -i stage1/usr_from_kvm/lkvm.mk || die + + # disable fetch of kernel sources + sed -e 's|wget .*|ln -s "$${DISTDIR}/linux-'${KVM_LINUX_VERSION}'.tar.xz" "$@"|' \ + -i stage1/usr_from_kvm/kernel.mk || die + + if use rkt_stage1_host; then + # Make systemdUnitsPath consistent with host + sed -e 's|\(systemdUnitsPath := \).*|\1"'$(systemd_get_systemunitdir)'"|' \ + -i stage1/init/init.go || die + fi + + autotools-utils_src_prepare +} src_configure() { - local myeconfargs=( - --with-stage1-image-path="/usr/share/rkt/stage1.aci" + local flavors myeconfargs=( + --with-stage1-default-images-directory="/usr/share/rkt" + --with-stage1-default-location="${STAGE1_DEFAULT_LOCATION}" ) - if use rkt_stage1_host; then - myeconfargs+=( --with-stage1="host" ) - elif use rkt_stage1_src; then - myeconfargs+=( --with-stage1="src" ) - elif use rkt_stage1_coreos; then - myeconfargs+=( --with-stage1="coreos" ) - mkdir -p "${BUILDDIR}/tmp/usr_from_coreos/" || die - cp "${DISTDIR}/${PXE_FILE}" "${BUILDDIR}/tmp/usr_from_coreos/pxe.img" || die + # enable flavors (first is default) + use rkt_stage1_host && flavors+=",host" + use rkt_stage1_src && flavors+=",src" + use rkt_stage1_coreos && flavors+=",coreos" + use rkt_stage1_fly && flavors+=",fly" + use rkt_stage1_kvm && flavors+=",kvm" + myeconfargs+=( --with-stage1-flavors="${flavors#,}" ) + + if use rkt_stage1_src; then + myeconfargs+=( + --with-stage1-systemd-version=${PXE_SYSTEMD_VERSION} + --with-stage1-systemd-src="${WORKDIR}/systemd-${PXE_SYSTEMD_VERSION#v}" + ) + fi + + if use rkt_stage1_coreos || use rkt_stage1_kvm; then + myeconfargs+=( + --with-coreos-local-pxe-image-path="${DISTDIR}/${PXE_FILE}" + --with-coreos-local-pxe-image-systemd-version="${PXE_SYSTEMD_VERSION}" + ) fi # Go's 6l linker does not support PIE, disable so cgo binaries @@ -79,6 +153,14 @@ src_configure() { autotools-utils_src_configure } +src_compile() { + local arch=${ARCH} + case ${arch} in + amd64) arch=x86_64;; + esac + ARCH=${arch} autotools-utils_src_compile +} + src_install() { dodoc README.md use doc && dodoc -r Documentation @@ -87,8 +169,21 @@ src_install() { dobin "${S}/${BUILDDIR}/bin/rkt" - insinto /usr/share/rkt/ - doins "${S}/${BUILDDIR}/bin/stage1.aci" + insinto /usr/share/rkt + doins "${S}/${BUILDDIR}/bin/"*.aci + + # create symlink for default stage1 image path + if use rkt_stage1_host; then + dosym stage1-host.aci "${STAGE1_DEFAULT_LOCATION}" + elif use rkt_stage1_src; then + dosym stage1-src.aci "${STAGE1_DEFAULT_LOCATION}" + elif use rkt_stage1_coreos; then + dosym stage1-coreos.aci "${STAGE1_DEFAULT_LOCATION}" + elif use rkt_stage1_fly; then + dosym stage1-fly.aci "${STAGE1_DEFAULT_LOCATION}" + elif use rkt_stage1_kvm; then + dosym stage1-kvm.aci "${STAGE1_DEFAULT_LOCATION}" + fi systemd_dounit "${S}"/dist/init/systemd/${PN}-gc.service systemd_dounit "${S}"/dist/init/systemd/${PN}-gc.timer