1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 EGIT_COMMIT=ee2de87bd8e2a7a84799476cb4fc4ce8a78fdf6d
10 DESCRIPTION="OCI-based implementation of Kubernetes Container Runtime Interface"
11 HOMEPAGE="https://cri-o.io/"
12 SRC_URI="https://github.com/cri-o/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
14 LICENSE="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0"
17 IUSE="btrfs +device-mapper selinux systemd"
25 dev-libs/libgpg-error:=
26 net-firewall/conntrack-tools
32 btrfs? ( sys-fs/btrfs-progs )
33 device-mapper? ( sys-fs/lvm2:= )
34 selinux? ( sys-libs/libselinux:= )
35 systemd? ( sys-apps/systemd:= )"
38 RDEPEND="${COMMON_DEPEND}
39 !<app-emulation/libpod-1.3.2-r1"
45 -e '/ git diff --exit-code/d' \
46 -e 's/$(GO) build -i/$(GO) build -v -work -x/' \
47 -e 's/\${GIT_COMMIT}/'${EGIT_COMMIT}'/' \
48 -e "s|^GIT_COMMIT := .*|GIT_COMMIT := ${EGIT_COMMIT}|" \
49 -e "s|^COMMIT_NO := .*|COMMIT_NO := ${EGIT_COMMIT}|" \
52 echo ".NOTPARALLEL: binaries docs" >> Makefile || die
54 sed -e 's:/usr/local/bin:/usr/bin:' \
55 -i contrib/systemd/* || die
59 [[ -f hack/btrfs_installed_tag.sh ]] || die
60 use btrfs || { echo -e "#!/bin/sh\necho exclude_graphdriver_btrfs" > \
61 hack/btrfs_installed_tag.sh || die; }
63 [[ -f hack/libdm_installed.sh ]] || die
64 use device-mapper || { echo -e "#!/bin/sh\necho exclude_graphdriver_devicemapper" > \
65 hack/libdm_installed.sh || die; }
67 [[ -f hack/selinux_tag.sh ]] || die
68 use selinux || { echo -e "#!/bin/sh\ntrue" > \
69 hack/selinux_tag.sh || die; }
77 emake DESTDIR="${D}" PREFIX="${D}${EPREFIX}/usr" install install.config install.systemd
80 mv "${ED}/etc/crio/crio.conf"{,.example} || die
82 newinitd "${FILESDIR}/crio.initd" crio
84 insinto /etc/logrotate.d
85 newins "${FILESDIR}/${PN}.logrotated" "${PN}"
87 # Suppress crio log error messages triggered if these don't exist.
88 keepdir /etc/containers/oci/hooks.d
89 keepdir /usr/share/containers/oci/hooks.d
91 # Suppress crio "Missing CNI default network" log message.
92 keepdir /etc/cni/net.d
93 insinto /etc/cni/net.d
94 doins contrib/cni/99-loopback.conf