Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/cri-o/files/, app-emulation/cri-o/
Date: Mon, 04 Jun 2018 06:29:07
Message-Id: 1528093722.43081b4c1a5db43271206f712a11d68f814d0bc0.zmedico@gentoo
1 commit: 43081b4c1a5db43271206f712a11d68f814d0bc0
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 4 05:04:17 2018 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 4 06:28:42 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43081b4c
7
8 app-emulation/cri-o: new package
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 app-emulation/cri-o/Manifest | 1 +
13 app-emulation/cri-o/cri-o-1.10.1.ebuild | 104 +++++++++++++++++++++++++++++
14 app-emulation/cri-o/files/cri-o.logrotated | 7 ++
15 app-emulation/cri-o/files/crio.initd | 34 ++++++++++
16 app-emulation/cri-o/metadata.xml | 31 +++++++++
17 5 files changed, 177 insertions(+)
18
19 diff --git a/app-emulation/cri-o/Manifest b/app-emulation/cri-o/Manifest
20 new file mode 100644
21 index 00000000000..326f71beaf2
22 --- /dev/null
23 +++ b/app-emulation/cri-o/Manifest
24 @@ -0,0 +1 @@
25 +DIST cri-o-1.10.1.tar.gz 5159128 BLAKE2B bd6727bedb1f1ca99771995817897721b340331a28dc00646fe6b13765328bbba363aeba4490c12c8d38f9e204e6c744c38f43b4fbbd39d2b44c95be0681475b SHA512 dc85a94cf980ba11a2213e7cec73eeb78460a6a14c50f02f8772ac0d0fe179374d88de01c72f24506a9f1a61db6bf6738114c8944631f76906f6e42f9cf35bde
26
27 diff --git a/app-emulation/cri-o/cri-o-1.10.1.ebuild b/app-emulation/cri-o/cri-o-1.10.1.ebuild
28 new file mode 100644
29 index 00000000000..675ac651d89
30 --- /dev/null
31 +++ b/app-emulation/cri-o/cri-o-1.10.1.ebuild
32 @@ -0,0 +1,104 @@
33 +# Copyright 1999-2018 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +EGIT_COMMIT="728df92d3e4b77c5a1d3b8e2a5c3c8f3c5bc4f00"
39 +EGO_PN="github.com/kubernetes-incubator/${PN}"
40 +
41 +inherit golang-vcs-snapshot systemd
42 +
43 +DESCRIPTION="OCI-based implementation of Kubernetes Container Runtime Interface"
44 +HOMEPAGE="http://cri-o.io/"
45 +SRC_URI="https://github.com/kubernetes-incubator/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
46 +
47 +LICENSE="Apache-2.0"
48 +SLOT="0"
49 +KEYWORDS="~amd64"
50 +IUSE="btrfs +device-mapper ostree seccomp selinux"
51 +
52 +COMMON_DEPEND="
53 + app-crypt/gpgme:=
54 + app-emulation/runc
55 + dev-libs/glib:=
56 + dev-libs/libassuan:=
57 + net-firewall/conntrack-tools
58 + net-firewall/iptables
59 + net-misc/cni-plugins
60 + net-misc/socat
61 + sys-apps/iproute2
62 + btrfs? ( sys-fs/btrfs-progs )
63 + device-mapper? ( sys-fs/lvm2:= )
64 + ostree? ( dev-util/ostree )
65 + seccomp? ( sys-libs/libseccomp:= )
66 + selinux? ( sys-libs/libselinux:= )"
67 +DEPEND="
68 + ${COMMON_DEPEND}
69 + dev-go/go-md2man"
70 +RDEPEND="${COMMON_DEPEND}"
71 +S="${WORKDIR}/${P}/src/${EGO_PN}"
72 +
73 +src_prepare() {
74 + default
75 +
76 + sed -e '/^GIT_.*/d' \
77 + -e 's/$(GO) build/$(GO) build -v -work -x/' \
78 + -e 's/\${GIT_COMMIT}/'${EGIT_COMMIT}'/' \
79 + -i Makefile || die
80 +
81 + sed -e 's:/usr/local/bin:/usr/bin:' \
82 + -i contrib/systemd/* || die
83 +}
84 +
85 +src_compile() {
86 + [[ -f hack/btrfs_installed_tag.sh ]] || die
87 + use btrfs || { echo -e "#!/bin/sh\necho exclude_graphdriver_btrfs" > \
88 + hack/btrfs_installed_tag.sh || die; }
89 +
90 + [[ -f hack/libdm_installed.sh ]] || die
91 + use device-mapper || { echo -e "#!/bin/sh\necho exclude_graphdriver_devicemapper" > \
92 + hack/libdm_installed.sh || die; }
93 +
94 + [[ -f hack/ostree_tag.sh ]] || die
95 + use ostree || { echo -e "#!/bin/sh\necho containers_image_ostree_stub" > \
96 + hack/ostree_tag.sh || die; }
97 +
98 + [[ -f hack/seccomp_tag.sh ]] || die
99 + use seccomp || { echo -e "#!/bin/sh\ntrue" > \
100 + hack/seccomp_tag.sh || die; }
101 +
102 + [[ -f hack/selinux_tag.sh ]] || die
103 + use selinux || { echo -e "#!/bin/sh\ntrue" > \
104 + hack/selinux_tag.sh || die; }
105 +
106 + mkdir -p bin || die
107 + GOPATH="${WORKDIR}/${P}" GOBIN="${WORKDIR}/${P}/bin" \
108 + emake binaries docs
109 +}
110 +
111 +src_install() {
112 + emake DESTDIR="${D}" PREFIX="${D}${EPREFIX}/usr" install.bin install.man
113 +
114 + keepdir /etc/crio
115 + insinto /etc/crio
116 + use seccomp && doins seccomp.json
117 +
118 + "${ED}"/usr/bin/crio --config="" config --default > "${T}"/crio.conf.example || die
119 + doins "${T}/crio.conf.example"
120 +
121 + newinitd "${FILESDIR}/crio.initd" crio
122 +
123 + insinto /etc/logrotate.d
124 + newins "${FILESDIR}/${PN}.logrotated" "${PN}"
125 +
126 + # Suppress crio log error messages triggered if these don't exist.
127 + keepdir /etc/containers/oci/hooks.d
128 + keepdir /usr/share/containers/oci/hooks.d
129 +
130 + # Suppress crio "Missing CNI default network" log message.
131 + keepdir /etc/cni/net.d
132 + insinto /etc/cni/net.d
133 + doins contrib/cni/99-loopback.conf
134 +
135 + systemd_dounit contrib/systemd/*
136 +}
137
138 diff --git a/app-emulation/cri-o/files/cri-o.logrotated b/app-emulation/cri-o/files/cri-o.logrotated
139 new file mode 100644
140 index 00000000000..fb0b8b14a8a
141 --- /dev/null
142 +++ b/app-emulation/cri-o/files/cri-o.logrotated
143 @@ -0,0 +1,7 @@
144 +/var/log/crio/crio.log {
145 + missingok
146 + size 5M
147 + rotate 3
148 + compress
149 + copytruncate
150 +}
151
152 diff --git a/app-emulation/cri-o/files/crio.initd b/app-emulation/cri-o/files/crio.initd
153 new file mode 100644
154 index 00000000000..723773033f7
155 --- /dev/null
156 +++ b/app-emulation/cri-o/files/crio.initd
157 @@ -0,0 +1,34 @@
158 +#!/sbin/openrc-run
159 +# Copyright 2015-2018 Gentoo Foundation
160 +# Distributed under the terms of the GNU General Public License v2
161 +
162 +description="OCI Kubernetes Container Runtime daemon"
163 +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
164 +extra_started_commands="reload"
165 +command="/usr/bin/${RC_SVCNAME}"
166 +command_args="${command_args}"
167 +command_background="true"
168 +start_stop_daemon_args=" \
169 + --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
170 + --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
171 +
172 +depend() {
173 + need net
174 +}
175 +
176 +checkconfig() {
177 + checkpath --directory --owner root:root --mode 0775 \
178 + /var/log/${RC_SVCNAME}
179 + checkpath --file --owner root:root --mode 0644 \
180 + /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log
181 +}
182 +
183 +start_pre() {
184 + checkconfig
185 +}
186 +
187 +reload() {
188 + ebegin "Reloading ${RC_SVCNAME}"
189 + start-stop-daemon --signal HUP --pidfile "${pidfile}"
190 + eend $?
191 +}
192
193 diff --git a/app-emulation/cri-o/metadata.xml b/app-emulation/cri-o/metadata.xml
194 new file mode 100644
195 index 00000000000..a18ec9b7d29
196 --- /dev/null
197 +++ b/app-emulation/cri-o/metadata.xml
198 @@ -0,0 +1,31 @@
199 +<?xml version="1.0" encoding="UTF-8"?>
200 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
201 +<pkgmetadata>
202 + <maintainer type="person">
203 + <email>zmedico@g.o</email>
204 + <name>Zac Medico</name>
205 + </maintainer>
206 + <longdescription lang="en">
207 + CRI-O is meant to provide an integration path between
208 + OCI conformant runtimes and the kubelet. Specifically, it
209 + implements the Kubelet Container Runtime Interface (CRI)
210 + using OCI conformant runtimes. The scope of CRI-O is tied to
211 + the scope of the CRI.
212 + </longdescription>
213 + <use>
214 + <flag name="btrfs">
215 + Enables dependencies for the "btrfs" graph driver, including
216 + necessary kernel flags.
217 + </flag>
218 + <flag name="device-mapper">
219 + Enables dependencies for the "devicemapper" graph driver, including
220 + necessary kernel flags.
221 + </flag>
222 + <flag name="ostree">
223 + Enables dependencies for handling of OSTree images.
224 + </flag>
225 + </use>
226 + <upstream>
227 + <remote-id type="github">kubernetes-incubator/cri-o</remote-id>
228 + </upstream>
229 +</pkgmetadata>