From 211003ea2f1d7bb7c253a209261f9868f2a219bb Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 22 Jul 2015 02:18:53 +0200 Subject: [PATCH] app-emulation/rkt: version bumps - Adapt 0.7 release and live ebuild to autotools buildsystem - Add use flags for stage1 flavor selecction --- .../coreos-overlay/app-emulation/rkt/Manifest | 2 + .../app-emulation/rkt/metadata.xml | 16 +++ .../app-emulation/rkt/rkt-0.5.5-r1.ebuild | 58 +++++++++- .../app-emulation/rkt/rkt-0.7.0.ebuild | 1 + .../app-emulation/rkt/rkt-9999.ebuild | 107 +++++++++++++----- 5 files changed, 154 insertions(+), 30 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/metadata.xml mode change 120000 => 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.5.5-r1.ebuild create mode 120000 sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.7.0.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/Manifest b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/Manifest index 34dc8dba8a..c33b969113 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/Manifest @@ -1 +1,3 @@ DIST pxe-444.5.0.img 114147963 SHA256 26aaee080c50e8ccb0aca81e22f7b64307e31ca0f5b4d8aa989a2381bb56879c SHA512 aad9983e90fc1c0924df505c91a2a9912cec8083fa3ec7b9b67d6de82daf4b420de638d7bde5f129770815d6fbac53913c6a80e254b3777981787730bafb4e08 WHIRLPOOL 1e373a8728a01bf6e53b2760d24187a19aec9d32f05f04de8557f6fec01f652d577781f447463188a50070aaf31f48b2c67317989d89d9c114920b0e0cd8edaf +DIST rkt-pxe-709.0.0.img 148919232 SHA256 d0df52bee7134fdeb6bc4d973e7ff651979894c0895423e2e9a0dd35279e7c3b SHA512 dc2f70eb29ebfe32b66201fc7fe3a343eee66feb2ad5fa1635bb4a979252440e378d28496f567e8a7761942a9e42e1f846626626e81ec9be38f4980cd4a8db99 WHIRLPOOL 72960971ad2e97e13305b0c21496b306c43185aee94c369d2ce3aad522701926a9cb0fbbd250b789f4beadbda3f872ea1a007943545279c0d904c673cc32fd93 +DIST rkt-pxe-738.1.0.img 151780780 SHA256 805a4c491281553c8927f3dd1a7bec50cca29209d0a7264870e7155d794ecbe6 SHA512 7774cc64dfa874f08f48cba0c15103e9eca86ffd87dcb24f765a9b56074e72f6862a663a4007a0a7dd296740ae91bf4edf7290fa35659b0b1572fe2f5dad3256 WHIRLPOOL 5973a6036d650c576bb0bd365c8c9ea35776501c1fd2baf1d7c00d06496fab35e9c796096ef89b095e7a922e2062dce6c0d1c85cd3101022e0aca84277d18cb9 diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/metadata.xml b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/metadata.xml new file mode 100644 index 0000000000..015faef012 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/metadata.xml @@ -0,0 +1,16 @@ + + + + + rkt is a new container runtime, designed for composability, security, + and speed. Today we are releasing a prototype version on GitHub to begin + gathering feedback from our community and explain why we are building + rkt. + + + Install the actool for ACI manipulation + Download and use a prebuilt stage1.aci from CoreOS + Build the stage1.aci from source + Assemble stage1.aci from host binaries + + diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.5.5-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.5.5-r1.ebuild deleted file mode 120000 index e476440198..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.5.5-r1.ebuild +++ /dev/null @@ -1 +0,0 @@ -rkt-9999.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.5.5-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.5.5-r1.ebuild new file mode 100644 index 0000000000..519396628f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.5.5-r1.ebuild @@ -0,0 +1,57 @@ +# Copyright (c) 2015 CoreOS, Inc. +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +CROS_WORKON_PROJECT="coreos/rkt" +CROS_WORKON_LOCALNAME="rkt" +CROS_WORKON_REPO="git://github.com" +inherit cros-workon systemd + +if [[ "${PV}" == 9999 ]]; then + KEYWORDS="~amd64" +else + CROS_WORKON_COMMIT="40ced98c320c056e343fe9c3eaeb90a4ff248936" # v0.5.5 + KEYWORDS="amd64" +fi + +# Must be in sync with stage1/rootfs/usr_from_coreos/cache.sh +IMG_RELEASE="444.5.0" +IMG_URL="http://stable.release.core-os.net/amd64-usr/${IMG_RELEASE}/coreos_production_pxe_image.cpio.gz" + +DESCRIPTION="App Container runtime" +HOMEPAGE="https://github.com/coreos/rkt" +SRC_URI="${IMG_URL} -> pxe-${IMG_RELEASE}.img" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +DEPEND=">=dev-lang/go-1.3 + app-arch/cpio + sys-fs/squashfs-tools" +RDEPEND="!app-emulation/rocket" + +src_unpack() { + local cache="${S}/stage1/rootfs/usr_from_coreos/cache" + + cros-workon_src_unpack + + mkdir -p "${cache}" || die + cp "${DISTDIR}/pxe-${IMG_RELEASE}.img" "${cache}/pxe.img" || die +} + +# TODO: Use or adapt coreos-go.eclass so we have half a chance of +# cross-compiling builds working +src_compile() { + RKT_STAGE1_IMAGE=/usr/share/rkt/stage1.aci CGO_ENABLED=0 ./build || die +} + +src_install() { + dobin "${S}/bin/rkt" + + insinto /usr/share/rkt + doins "${S}/bin/stage1.aci" + + systemd_dounit "${FILESDIR}"/${PN}-gc.service + systemd_dounit "${FILESDIR}"/${PN}-gc.timer +} diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.7.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.7.0.ebuild new file mode 120000 index 0000000000..e476440198 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-0.7.0.ebuild @@ -0,0 +1 @@ +rkt-9999.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-9999.ebuild index 519396628f..77f51e483f 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/rkt/rkt-9999.ebuild @@ -1,57 +1,106 @@ -# Copyright (c) 2015 CoreOS, Inc. +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +# $Header: $ EAPI=5 + +AUTOTOOLS_AUTORECONF=yes +AUTOTOOLS_IN_SOURCE_BUILD=yes + +inherit autotools-utils flag-o-matic systemd toolchain-funcs +inherit cros-workon + CROS_WORKON_PROJECT="coreos/rkt" CROS_WORKON_LOCALNAME="rkt" CROS_WORKON_REPO="git://github.com" -inherit cros-workon systemd -if [[ "${PV}" == 9999 ]]; then - KEYWORDS="~amd64" -else - CROS_WORKON_COMMIT="40ced98c320c056e343fe9c3eaeb90a4ff248936" # v0.5.5 - KEYWORDS="amd64" +if [[ "${PV}" == "9999" ]]; then + KEYWORDS="~amd64" + PXE_VERSION="738.1.0" + +elif [[ "${PV}" == "0.7.0" ]]; then + KEYWORDS="amd64" + PXE_VERSION="709.0.0" + CROS_WORKON_COMMIT="9579f4bf57851a1a326c81ec2ab0ed2fdfab8d24" fi -# Must be in sync with stage1/rootfs/usr_from_coreos/cache.sh -IMG_RELEASE="444.5.0" -IMG_URL="http://stable.release.core-os.net/amd64-usr/${IMG_RELEASE}/coreos_production_pxe_image.cpio.gz" +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" -DESCRIPTION="App Container runtime" +SRC_URI="rkt_stage1_coreos? ( $PXE_URI -> $PXE_FILE )" + +DESCRIPTION="A CLI for running app containers, and an implementation of the App +Container Spec." HOMEPAGE="https://github.com/coreos/rkt" -SRC_URI="${IMG_URL} -> pxe-${IMG_RELEASE}.img" LICENSE="Apache-2.0" SLOT="0" -IUSE="" +IUSE="doc examples +rkt_stage1_coreos rkt_stage1_host rkt_stage1_src +actool" +REQUIRED_USE="^^ ( rkt_stage1_coreos rkt_stage1_host rkt_stage1_src )" -DEPEND=">=dev-lang/go-1.3 +DEPEND=">=dev-lang/go-1.4.1 app-arch/cpio - sys-fs/squashfs-tools" -RDEPEND="!app-emulation/rocket" + sys-fs/squashfs-tools + dev-perl/Capture-Tiny + rkt_stage1_src? ( + >=sys-apps/systemd-220 + app-shells/bash + )" +RDEPEND="!app-emulation/rocket + rkt_stage1_host? ( + >=sys-apps/systemd-220 + app-shells/bash + )" -src_unpack() { - local cache="${S}/stage1/rootfs/usr_from_coreos/cache" +BUILDDIR="build-${P}" - cros-workon_src_unpack +src_configure() { + local myeconfargs=( + --with-stage1-image-path="/usr/share/rkt/stage1.aci" + ) - mkdir -p "${cache}" || die - cp "${DISTDIR}/pxe-${IMG_RELEASE}.img" "${cache}/pxe.img" || die -} + if use rkt_stage1_host; then + myeconfargs+=( --with-stage1="host" ) + fi + if use rkt_stage1_src; then + myeconfargs+=( --with-stage1="src" ) + fi + if 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 + fi -# TODO: Use or adapt coreos-go.eclass so we have half a chance of -# cross-compiling builds working -src_compile() { - RKT_STAGE1_IMAGE=/usr/share/rkt/stage1.aci CGO_ENABLED=0 ./build || die + # Go's 6l linker does not support PIE, disable so cgo binaries + # which use 6l+gcc for linking can be built correctly. + if gcc-specs-pie; then + append-ldflags -nopie + fi + + export CC=$(tc-getCC) + export CGO_ENABLED=1 + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export BUILDDIR + + autotools-utils_src_configure } src_install() { - dobin "${S}/bin/rkt" + dodoc README.md + use doc && dodoc -r Documentation + use examples && dodoc -r examples + use actool && dobin "${S}/${BUILDDIR}/bin/actool" - insinto /usr/share/rkt - doins "${S}/bin/stage1.aci" + dobin "${S}/${BUILDDIR}/bin/rkt" + + insinto /usr/share/rkt/ + doins "${S}/${BUILDDIR}/bin/stage1.aci" systemd_dounit "${FILESDIR}"/${PN}-gc.service systemd_dounit "${FILESDIR}"/${PN}-gc.timer + systemd_dounit "${S}"/dist/init/systemd/${PN}-metadata.service + systemd_dounit "${S}"/dist/init/systemd/${PN}-metadata.socket }