commit:     e5d4449034a59cf3286d457e31a6c1b253fce2ee
Author:     iamdenchik <bazukajo <AT> gmail <DOT> com>
AuthorDate: Wed Apr  3 05:26:00 2019 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Wed Apr  3 13:37:18 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5d44490

app-emulation/cadvisor: depend use docker

Signed-off-by: Denis Pershin <bazukajo <AT> gmail.com>
Signed-off-by: Manuel Rüger <mrueg <AT> gentoo.org>

 app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild | 43 ++++++++++++++++++++++++
 app-emulation/cadvisor/files/cadvisor.initd-r1   | 19 +++++++++++
 2 files changed, 62 insertions(+)

diff --git a/app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild 
b/app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild
new file mode 100644
index 00000000000..2e4b131c1b4
--- /dev/null
+++ b/app-emulation/cadvisor/cadvisor-0.33.0-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+EGO_PN="github.com/google/cadvisor"
+
+inherit user golang-build golang-vcs-snapshot
+SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+COMMIT="511ec9e"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Analyzes resource usage and performance characteristics of 
running containers"
+HOMEPAGE="https://github.com/google/cadvisor";
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+pkg_setup() {
+       enewgroup ${PN}
+       enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_prepare() {
+       sed -i -e "/go get/d" src/${EGO_PN}/build/assets.sh || die
+       sed -i -e "s/git describe.*/echo ${PV} )/"\
+               -e "s/git rev-parse --short HEAD.*/echo ${COMMIT} )/"\
+               src/${EGO_PN}/build/build.sh || die
+       default
+}
+
+src_compile() {
+       pushd "src/${EGO_PN}"
+       GO_FLAGS="-v -work -x" VERBOSE="true" 
GOPATH="${S}:$(get_golibdir_gopath)" emake build
+       popd || die
+}
+
+src_install() {
+       newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
+       dobin src/${EGO_PN}/${PN}
+       keepdir /var/log/${PN}
+       fowners ${PN}:${PN} /var/log/${PN}
+}

diff --git a/app-emulation/cadvisor/files/cadvisor.initd-r1 
b/app-emulation/cadvisor/files/cadvisor.initd-r1
new file mode 100644
index 00000000000..37fc16c8f63
--- /dev/null
+++ b/app-emulation/cadvisor/files/cadvisor.initd-r1
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 2016-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="cAdvisor - Analyzes resource usage and performance 
characteristics of running containers"
+pidfile=${pidfile:-"/run/${SVCNAME}.pid"}
+user=${user:-${SVCNAME}}
+group=${group:-${SVCNAME}}
+
+command="/usr/bin/cadvisor"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+       --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
+       --stderr /var/log/${SVCNAME}/${SVCNAME}.log"
+
+depend() {
+       after net
+       use docker
+}

Reply via email to