dev-python/kiwisolver: arm64 keyworded (bug #721130)
[gentoo.git] / app-emulation / cri-o / cri-o-1.17.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 EGIT_COMMIT=ee2de87bd8e2a7a84799476cb4fc4ce8a78fdf6d
7
8 inherit go-module
9
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"
13
14 LICENSE="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64"
17 IUSE="btrfs +device-mapper selinux systemd"
18
19 COMMON_DEPEND="
20         app-crypt/gpgme:=
21         app-emulation/conmon
22         app-emulation/runc
23         dev-libs/glib:=
24         dev-libs/libassuan:=
25         dev-libs/libgpg-error:=
26         net-firewall/conntrack-tools
27         net-firewall/iptables
28         net-misc/cni-plugins
29         net-misc/socat
30         sys-apps/iproute2
31         sys-libs/libseccomp:=
32         btrfs? ( sys-fs/btrfs-progs )
33         device-mapper? ( sys-fs/lvm2:= )
34         selinux? ( sys-libs/libselinux:= )
35         systemd? ( sys-apps/systemd:= )"
36 DEPEND="
37         ${COMMON_DEPEND}"
38 RDEPEND="${COMMON_DEPEND}
39         !<app-emulation/libpod-1.3.2-r1"
40
41 src_prepare() {
42         default
43
44         sed -e '/^GIT_.*/d' \
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}|" \
50                 -i Makefile || die
51
52         echo ".NOTPARALLEL: binaries docs" >> Makefile || die
53
54         sed -e 's:/usr/local/bin:/usr/bin:' \
55                 -i contrib/systemd/* || die
56 }
57
58 src_compile() {
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; }
62
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; }
66
67         [[ -f hack/selinux_tag.sh ]] || die
68         use selinux || { echo -e "#!/bin/sh\ntrue" > \
69                 hack/selinux_tag.sh || die; }
70
71         mkdir -p bin || die
72         GOBIN="${S}/bin" \
73                 emake all
74 }
75
76 src_install() {
77         emake DESTDIR="${D}" PREFIX="${D}${EPREFIX}/usr" install install.config install.systemd
78
79         keepdir /etc/crio
80         mv "${ED}/etc/crio/crio.conf"{,.example} || die
81
82         newinitd "${FILESDIR}/crio.initd" crio
83
84         insinto /etc/logrotate.d
85         newins "${FILESDIR}/${PN}.logrotated" "${PN}"
86
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
90
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
95 }