app-emulation/docker: sync live ebuild
authorWilliam Hubbs <williamh@gentoo.org>
Wed, 20 Apr 2016 16:58:46 +0000 (11:58 -0500)
committerWilliam Hubbs <williamh@gentoo.org>
Wed, 20 Apr 2016 17:00:13 +0000 (12:00 -0500)
Package-Manager: portage-2.2.26

app-emulation/docker/docker-9999.ebuild

index 02a19fec8092c08bf642b55ed532799f5ace6e19..eabd8d83dbbc9d065b04c4633f30373d99c726cf 100644 (file)
@@ -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$
 
@@ -10,23 +10,23 @@ if [[ ${PV} = *9999* ]]; then
        # Docker cannot be fetched via "go get", thanks to autogenerated code
        EGIT_REPO_URI="https://${EGO_PN}.git"
        EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
-       inherit git-r3
+       inherit golang-base git-r3
 else
        MY_PV="${PV/_/-}"
-       DOCKER_GITCOMMIT="d12ea79"
+       DOCKER_GITCOMMIT="4dc5990"
        EGIT_COMMIT="v${MY_PV}"
        SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
        KEYWORDS="~amd64"
        [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
        inherit golang-vcs-snapshot
 fi
-inherit bash-completion-r1 eutils linux-info multilib systemd udev user
+inherit bash-completion-r1 linux-info multilib systemd udev user
 
 DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
 HOMEPAGE="https://dockerproject.org"
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE="apparmor aufs btrfs +device-mapper experimental lxc overlay"
+IUSE="apparmor aufs btrfs +device-mapper experimental overlay seccomp"
 
 # https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies
 CDEPEND="
@@ -34,6 +34,9 @@ CDEPEND="
        device-mapper? (
                >=sys-fs/lvm2-2.02.89[thin]
        )
+       seccomp? (
+               >=sys-libs/libseccomp-2.2.1[static-libs]
+       )
 "
 
 DEPEND="
@@ -57,9 +60,8 @@ RDEPEND="
        >=dev-vcs/git-1.7
        >=app-arch/xz-utils-4.9
 
-       lxc? (
-               >=app-emulation/lxc-1.0.7
-       )
+       >=app-emulation/containerd-0.2.0
+       >=app-emulation/runc-0.1.0
 
        apparmor? (
                sys-libs/libapparmor[static-libs]
@@ -170,13 +172,14 @@ pkg_setup() {
 
 src_prepare() {
        cd "src/${EGO_PN}" || die
+       epatch "${FILESDIR}/docker-containerd.patch"
        # allow user patches (use sparingly - upstream won't support them)
        epatch_user
 }
 
 src_compile() {
        cd "src/${EGO_PN}" || die
-       export GOPATH="${WORKDIR}/${P}:${PWD}/vendor:$(get_golibdir_gopath)"
+       export GOPATH="${WORKDIR}/${P}:${PWD}/vendor"
 
        # setup CFLAGS and LDFLAGS for separate build target
        # see https://github.com/tianon/docker-overlay/pull/10
@@ -187,10 +190,11 @@ src_compile() {
        [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
 
        if gcc-specs-pie; then
-               sed -i "s/EXTLDFLAGS_STATIC='/EXTLDFLAGS_STATIC='-fno-PIC /" hack/make.sh || die
+               sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
                grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
 
-               sed -i "s/LDFLAGS_STATIC_DOCKER='/LDFLAGS_STATIC_DOCKER='-extldflags -fno-PIC /" hack/make/dynbinary || die
+               sed  "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
+                       -i hack/make/dynbinary || die
                grep -q -- '-fno-PIC' hack/make/dynbinary || die 'hardened sed failed'
        fi
 
@@ -202,9 +206,11 @@ src_compile() {
                fi
        done
 
-       if use apparmor; then
-               DOCKER_BUILDTAGS+=' apparmor'
-       fi
+       for tag in apparmor seccomp; do
+               if use $tag; then
+                       DOCKER_BUILDTAGS+=" $tag"
+               fi
+       done
 
        # https://github.com/docker/docker/pull/13338
        if use experimental; then
@@ -224,8 +230,8 @@ src_install() {
        cd "src/${EGO_PN}" || die
        VERSION="$(cat VERSION)"
        newbin "bundles/$VERSION/dynbinary/docker-$VERSION" docker
-       exeinto /usr/libexec/docker
-       newexe "bundles/$VERSION/dynbinary/dockerinit-$VERSION" dockerinit
+       #exeinto /usr/libexec/docker
+       #newexe "bundles/$VERSION/dynbinary/dockerinit-$VERSION" dockerinit
 
        newinitd contrib/init/openrc/docker.initd docker
        newconfd contrib/init/openrc/docker.confd docker
@@ -247,8 +253,9 @@ src_install() {
        doins -r contrib/syntax/vim/ftdetect
        doins -r contrib/syntax/vim/syntax
 
-       insinto "/usr/share/${PN}/contrib"
-       doins -r contrib/*
+       # note: intentionally not using "doins" so that we preserve +x bits
+       mkdir -p "${D}/usr/share/${PN}/contrib"
+       cp -R contrib/* "${D}/usr/share/${PN}/contrib"
 }
 
 pkg_postinst() {