1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 AUTOTOOLS_AUTORECONF=yes
8 AUTOTOOLS_IN_SOURCE_BUILD=yes
10 inherit autotools-utils flag-o-matic systemd toolchain-funcs
15 PXE_URI="http://alpha.release.core-os.net/amd64-usr/${PXE_VERSION}/coreos_production_pxe_image.cpio.gz"
16 PXE_FILE="${PN}-pxe-${PXE_VERSION}.img"
18 SRC_URI="https://github.com/coreos/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
19 rkt_stage1_coreos? ( $PXE_URI -> $PXE_FILE )"
21 DESCRIPTION="A CLI for running app containers, and an implementation of the App
23 HOMEPAGE="https://github.com/coreos/rkt"
27 IUSE="doc examples +rkt_stage1_coreos rkt_stage1_src +actool systemd"
28 REQUIRED_USE="^^ ( rkt_stage1_coreos rkt_stage1_src )"
30 DEPEND=">=dev-lang/go-1.4.1
35 >=sys-apps/systemd-222
38 RDEPEND="!app-emulation/rocket"
44 --with-stage1-image-path="/usr/share/rkt/stage1.aci"
47 if use rkt_stage1_src; then
48 myeconfargs+=( --with-stage1="src" )
49 elif use rkt_stage1_coreos; then
50 myeconfargs+=( --with-stage1="coreos" )
51 mkdir -p "${BUILDDIR}/tmp/usr_from_coreos/" || die
52 cp "${DISTDIR}/${PXE_FILE}" "${BUILDDIR}/tmp/usr_from_coreos/pxe.img" || die
55 # Go's 6l linker does not support PIE, disable so cgo binaries
56 # which use 6l+gcc for linking can be built correctly.
57 if gcc-specs-pie; then
63 export CGO_CFLAGS="${CFLAGS}"
64 export CGO_CPPFLAGS="${CPPFLAGS}"
65 export CGO_CXXFLAGS="${CXXFLAGS}"
66 export CGO_LDFLAGS="${LDFLAGS}"
69 autotools-utils_src_configure
74 use doc && dodoc -r Documentation
75 use examples && dodoc -r examples
76 use actool && dobin "${S}/${BUILDDIR}/bin/actool"
78 dobin "${S}/${BUILDDIR}/bin/rkt"
80 insinto /usr/share/rkt/
81 doins "${S}/${BUILDDIR}/bin/stage1.aci"
83 systemd_dounit "${S}"/dist/init/systemd/${PN}-gc.service
84 systemd_dounit "${S}"/dist/init/systemd/${PN}-gc.timer
85 systemd_dounit "${S}"/dist/init/systemd/${PN}-metadata.service
86 systemd_dounit "${S}"/dist/init/systemd/${PN}-metadata.socket