commit:     734bdefbd486419d1cf49e57220ae48357c5b84b
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 20 20:52:55 2018 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Tue Feb 20 20:52:55 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=734bdefb

app-admin/elasticsearch_exporter: Initial version

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 app-admin/elasticsearch_exporter/Manifest          |  1 +
 .../elasticsearch_exporter-1.0.2.ebuild            | 47 ++++++++++++++++++++++
 .../files/elasticsearch_exporter.confd             |  2 +
 .../files/elasticsearch_exporter.initd             | 19 +++++++++
 app-admin/elasticsearch_exporter/metadata.xml      | 11 +++++
 5 files changed, 80 insertions(+)

diff --git a/app-admin/elasticsearch_exporter/Manifest 
b/app-admin/elasticsearch_exporter/Manifest
new file mode 100644
index 00000000000..7d1be4133d9
--- /dev/null
+++ b/app-admin/elasticsearch_exporter/Manifest
@@ -0,0 +1 @@
+DIST elasticsearch_exporter-1.0.2.tar.gz 207764 BLAKE2B 
f626c53d04e05912d1db480d6078b44fb6a05e42ec1751bfc2ddd45ff2f0bc0550517e16b10064adcf8c2ab2db175011543a2953fff1624cd575318e6fad943b
 SHA512 
f610660761d761a26b840a969008763ecb19bdc07ab4a076cec7fc40f7d00a68e863fb72b0ea3b56446621a99fa31384ab79789a2e6526fc5b12dcc20df3c684

diff --git 
a/app-admin/elasticsearch_exporter/elasticsearch_exporter-1.0.2.ebuild 
b/app-admin/elasticsearch_exporter/elasticsearch_exporter-1.0.2.ebuild
new file mode 100644
index 00000000000..20be32d6cf4
--- /dev/null
+++ b/app-admin/elasticsearch_exporter/elasticsearch_exporter-1.0.2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="github.com/justwatchcom/elasticsearch_exporter"
+EXPORTER_COMMIT="92dcbf3"
+ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Elasticsearch stats exporter for Prometheus"
+HOMEPAGE="https://github.com/justwatchcom/elasticsearch_exporter";
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-util/promu"
+
+pkg_setup() {
+       enewgroup ${PN}
+       enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+       default
+       sed -i -e "/-s$/d" -e "s/{{.Revision}}/${EXPORTER_COMMIT}/" 
src/${EGO_PN}/.promu.yml || die
+}
+
+src_compile() {
+       pushd src/${EGO_PN} || die
+       mkdir -p bin || die
+       GOPATH="${S}" promu build -v --prefix bin || die
+       popd || die
+}
+
+src_install() {
+       pushd src/${EGO_PN} || die
+       dobin bin/elasticsearch_exporter
+       dodoc {README,CHANGELOG}.md
+       popd || die
+       keepdir /var/log/elasticsearch_exporter
+       fowners ${PN}:${PN} /var/log/elasticsearch_exporter
+       newinitd "${FILESDIR}"/${PN}.initd ${PN}
+       newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}

diff --git 
a/app-admin/elasticsearch_exporter/files/elasticsearch_exporter.confd 
b/app-admin/elasticsearch_exporter/files/elasticsearch_exporter.confd
new file mode 100644
index 00000000000..9a4dcce5b4b
--- /dev/null
+++ b/app-admin/elasticsearch_exporter/files/elasticsearch_exporter.confd
@@ -0,0 +1,2 @@
+# arguments for prometheus elasticsearch exporter
+command_args="--es.uri=http://localhost:9200";

diff --git 
a/app-admin/elasticsearch_exporter/files/elasticsearch_exporter.initd 
b/app-admin/elasticsearch_exporter/files/elasticsearch_exporter.initd
new file mode 100644
index 00000000000..fe932b923d1
--- /dev/null
+++ b/app-admin/elasticsearch_exporter/files/elasticsearch_exporter.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 2016-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Prometheus elasticsearch exporter"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/elasticsearch_exporter"
+command_args="${command_args:---es.uri=http://localhost:9200}";
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+       --stdout /var/log/elasticsearch_exporter/${RC_SVCNAME}.log \
+       --stderr /var/log/elasticsearch_exporter/${RC_SVCNAME}.log"
+
+depend() {
+       after net
+}

diff --git a/app-admin/elasticsearch_exporter/metadata.xml 
b/app-admin/elasticsearch_exporter/metadata.xml
new file mode 100644
index 00000000000..2e5a147e290
--- /dev/null
+++ b/app-admin/elasticsearch_exporter/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>mr...@gentoo.org</email>
+               <name>Manuel Rüger</name>
+       </maintainer>
+       <upstream>
+               <remote-id 
type="github">justwatchcom/elasticsearch_exporter</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to