Gentoo Archives: gentoo-commits

From: "Manuel Rüger" <mrueg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/cadvisor/files/, app-emulation/cadvisor/
Date: Wed, 03 Apr 2019 13:37:48
Message-Id: 1554298638.e5d4449034a59cf3286d457e31a6c1b253fce2ee.mrueg@gentoo
1 commit: e5d4449034a59cf3286d457e31a6c1b253fce2ee
2 Author: iamdenchik <bazukajo <AT> gmail <DOT> com>
3 AuthorDate: Wed Apr 3 05:26:00 2019 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 3 13:37:18 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5d44490
7
8 app-emulation/cadvisor: depend use docker
9
10 Signed-off-by: Denis Pershin <bazukajo <AT> gmail.com>
11 Signed-off-by: Manuel Rüger <mrueg <AT> gentoo.org>
12
13 app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild | 43 ++++++++++++++++++++++++
14 app-emulation/cadvisor/files/cadvisor.initd-r1 | 19 +++++++++++
15 2 files changed, 62 insertions(+)
16
17 diff --git a/app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild b/app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild
18 new file mode 100644
19 index 00000000000..2e4b131c1b4
20 --- /dev/null
21 +++ b/app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild
22 @@ -0,0 +1,43 @@
23 +# Copyright 1999-2019 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +EGO_PN="github.com/google/cadvisor"
28 +
29 +inherit user golang-build golang-vcs-snapshot
30 +SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
31 +COMMIT="511ec9e"
32 +KEYWORDS="~amd64"
33 +
34 +DESCRIPTION="Analyzes resource usage and performance characteristics of running containers"
35 +HOMEPAGE="https://github.com/google/cadvisor"
36 +
37 +LICENSE="Apache-2.0"
38 +SLOT="0"
39 +IUSE=""
40 +
41 +pkg_setup() {
42 + enewgroup ${PN}
43 + enewuser ${PN} -1 -1 /dev/null ${PN}
44 +}
45 +
46 +src_prepare() {
47 + sed -i -e "/go get/d" src/${EGO_PN}/build/assets.sh || die
48 + sed -i -e "s/git describe.*/echo ${PV} )/"\
49 + -e "s/git rev-parse --short HEAD.*/echo ${COMMIT} )/"\
50 + src/${EGO_PN}/build/build.sh || die
51 + default
52 +}
53 +
54 +src_compile() {
55 + pushd "src/${EGO_PN}"
56 + GO_FLAGS="-v -work -x" VERBOSE="true" GOPATH="${S}:$(get_golibdir_gopath)" emake build
57 + popd || die
58 +}
59 +
60 +src_install() {
61 + newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
62 + dobin src/${EGO_PN}/${PN}
63 + keepdir /var/log/${PN}
64 + fowners ${PN}:${PN} /var/log/${PN}
65 +}
66
67 diff --git a/app-emulation/cadvisor/files/cadvisor.initd-r1 b/app-emulation/cadvisor/files/cadvisor.initd-r1
68 new file mode 100644
69 index 00000000000..37fc16c8f63
70 --- /dev/null
71 +++ b/app-emulation/cadvisor/files/cadvisor.initd-r1
72 @@ -0,0 +1,19 @@
73 +#!/sbin/openrc-run
74 +# Copyright 2016-2017 Gentoo Foundation
75 +# Distributed under the terms of the GNU General Public License v2
76 +
77 +description="cAdvisor - Analyzes resource usage and performance characteristics of running containers"
78 +pidfile=${pidfile:-"/run/${SVCNAME}.pid"}
79 +user=${user:-${SVCNAME}}
80 +group=${group:-${SVCNAME}}
81 +
82 +command="/usr/bin/cadvisor"
83 +command_background="true"
84 +start_stop_daemon_args="--user ${user} --group ${group} \
85 + --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
86 + --stderr /var/log/${SVCNAME}/${SVCNAME}.log"
87 +
88 +depend() {
89 + after net
90 + use docker
91 +}