1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 EGIT_COMMIT="56d7d9a0750d7deb06182361837b690683f13dfe"
7 EGO_PN="github.com/kubernetes-incubator/${PN}"
9 inherit golang-vcs-snapshot systemd
11 DESCRIPTION="OCI-based implementation of Kubernetes Container Runtime Interface"
12 HOMEPAGE="https://cri-o.io/"
13 SRC_URI="https://github.com/kubernetes-incubator/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15 LICENSE="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0"
18 IUSE="btrfs +device-mapper ostree seccomp selinux"
25 dev-libs/libgpg-error:=
26 net-firewall/conntrack-tools
31 btrfs? ( sys-fs/btrfs-progs )
32 device-mapper? ( sys-fs/lvm2:= )
33 ostree? ( dev-util/ostree )
34 seccomp? ( sys-libs/libseccomp:= )
35 selinux? ( sys-libs/libselinux:= )"
39 RDEPEND="${COMMON_DEPEND}"
40 S="${WORKDIR}/${P}/src/${EGO_PN}"
46 -e 's/$(GO) build -i/$(GO) build -v -work -x/' \
47 -e 's/\${GIT_COMMIT}/'${EGIT_COMMIT}'/' \
50 sed -e 's:/usr/local/bin:/usr/bin:' \
51 -i contrib/systemd/* || die
55 [[ -f hack/btrfs_installed_tag.sh ]] || die
56 use btrfs || { echo -e "#!/bin/sh\necho exclude_graphdriver_btrfs" > \
57 hack/btrfs_installed_tag.sh || die; }
59 [[ -f hack/libdm_installed.sh ]] || die
60 use device-mapper || { echo -e "#!/bin/sh\necho exclude_graphdriver_devicemapper" > \
61 hack/libdm_installed.sh || die; }
63 [[ -f hack/ostree_tag.sh ]] || die
64 use ostree || { echo -e "#!/bin/sh\necho containers_image_ostree_stub" > \
65 hack/ostree_tag.sh || die; }
67 [[ -f hack/seccomp_tag.sh ]] || die
68 use seccomp || { echo -e "#!/bin/sh\ntrue" > \
69 hack/seccomp_tag.sh || die; }
71 [[ -f hack/selinux_tag.sh ]] || die
72 use selinux || { echo -e "#!/bin/sh\ntrue" > \
73 hack/selinux_tag.sh || die; }
76 GOPATH="${WORKDIR}/${P}" GOBIN="${WORKDIR}/${P}/bin" \
81 emake DESTDIR="${D}" PREFIX="${D}${EPREFIX}/usr" install.bin install.man
85 use seccomp && doins seccomp.json
87 "${ED}"/usr/bin/crio --config="" config --default > "${T}"/crio.conf.example || die
88 doins "${T}/crio.conf.example"
90 newinitd "${FILESDIR}/crio.initd" crio
92 insinto /etc/logrotate.d
93 newins "${FILESDIR}/${PN}.logrotated" "${PN}"
95 # Suppress crio log error messages triggered if these don't exist.
96 keepdir /etc/containers/oci/hooks.d
97 keepdir /usr/share/containers/oci/hooks.d
99 # Suppress crio "Missing CNI default network" log message.
100 keepdir /etc/cni/net.d
101 insinto /etc/cni/net.d
102 doins contrib/cni/99-loopback.conf
104 systemd_dounit contrib/systemd/*