1 |
commit: e4ec071de04483f6fdc6d1803a6fd5c0cead4b6f |
2 |
Author: William Hubbs <william.hubbs <AT> sony <DOT> com> |
3 |
AuthorDate: Mon Apr 15 20:23:18 2019 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 15 20:26:22 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4ec071d |
7 |
|
8 |
app-metrics/consul_exporter: Prometheus exporter for consul metrics |
9 |
|
10 |
Copyright: Sony Interactive Entertainment Inc. |
11 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
12 |
Signed-off-by: William Hubbs <williamh <AT> gentoo.org> |
13 |
|
14 |
app-metrics/consul_exporter/Manifest | 1 + |
15 |
.../consul_exporter/consul_exporter-0.4.0.ebuild | 52 ++++++++++++++++++++++ |
16 |
.../consul_exporter/files/consul_exporter.confd | 3 ++ |
17 |
.../consul_exporter/files/consul_exporter.initd | 15 +++++++ |
18 |
app-metrics/consul_exporter/metadata.xml | 8 ++++ |
19 |
5 files changed, 79 insertions(+) |
20 |
|
21 |
diff --git a/app-metrics/consul_exporter/Manifest b/app-metrics/consul_exporter/Manifest |
22 |
new file mode 100644 |
23 |
index 00000000000..1cf6b3f6f0c |
24 |
--- /dev/null |
25 |
+++ b/app-metrics/consul_exporter/Manifest |
26 |
@@ -0,0 +1 @@ |
27 |
+DIST consul_exporter-0.4.0.tar.gz 1107092 BLAKE2B 7f3d6ce797252e5895387d3bbd2a3ad41777bf4d98a4a7a4efc3e8caa0c71fd29be91675ae6fe304016f1cbf87ecf4ee3442b49d3bc08939d471326d4e5d4cd4 SHA512 faac0dfeec5b6fadf73ef68c0d24c059c89891918e498e145a50512b8c961764a02388b2bcce305e12ecf703fa76afdf5634b35aecbee0ac37926d78ce0b1e93 |
28 |
|
29 |
diff --git a/app-metrics/consul_exporter/consul_exporter-0.4.0.ebuild b/app-metrics/consul_exporter/consul_exporter-0.4.0.ebuild |
30 |
new file mode 100644 |
31 |
index 00000000000..12823ba01c9 |
32 |
--- /dev/null |
33 |
+++ b/app-metrics/consul_exporter/consul_exporter-0.4.0.ebuild |
34 |
@@ -0,0 +1,52 @@ |
35 |
+# Copyright 1999-2019 Gentoo Authors |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+EAPI=7 |
39 |
+inherit user golang-build golang-vcs-snapshot |
40 |
+ |
41 |
+EGO_PN="github.com/prometheus/consul_exporter" |
42 |
+EGIT_COMMIT="v${PV/_rc/-rc.}" |
43 |
+CONSUL_EXPORTER_COMMIT=75f02d8 |
44 |
+ |
45 |
+DESCRIPTION="Prometheus exporter for consul metrics" |
46 |
+HOMEPAGE="https://github.com/prometheus/consul_exporter" |
47 |
+SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" |
48 |
+ |
49 |
+LICENSE="Apache-2.0" |
50 |
+SLOT="0" |
51 |
+KEYWORDS="~amd64" |
52 |
+ |
53 |
+DEPEND=">=dev-lang/go-1.11 |
54 |
+ dev-util/promu" |
55 |
+ |
56 |
+RESTRICT="strip test" |
57 |
+ |
58 |
+pkg_setup() { |
59 |
+ enewgroup ${PN} |
60 |
+ enewuser ${PN} -1 -1 -1 ${PN} |
61 |
+} |
62 |
+ |
63 |
+src_prepare() { |
64 |
+ default |
65 |
+ sed -i -e "s/{{.Revision}}/${CONSUL_EXPORTER_COMMIT}/" \ |
66 |
+ -e "s/{{.Version}}/${PV}/" \ |
67 |
+ -e "s/-tags netgo/-mod vendor -tags netgo/" \ |
68 |
+ src/${EGO_PN}/.promu.yml || die "Sed failed" |
69 |
+} |
70 |
+ |
71 |
+src_compile() { |
72 |
+ pushd src/${EGO_PN} || die |
73 |
+ GO111MODULE=on GOCACHE="${T}/go-cache" promu build -v || die |
74 |
+ popd || die |
75 |
+} |
76 |
+ |
77 |
+src_install() { |
78 |
+ pushd src/${EGO_PN} || die |
79 |
+ dobin consul_exporter |
80 |
+ dodoc {README,CONTRIBUTING}.md |
81 |
+ popd || die |
82 |
+ keepdir /var/log/consul_exporter |
83 |
+ fowners ${PN}:${PN} /var/log/consul_exporter |
84 |
+ newinitd "${FILESDIR}"/${PN}.initd ${PN} |
85 |
+ newconfd "${FILESDIR}"/${PN}.confd ${PN} |
86 |
+} |
87 |
|
88 |
diff --git a/app-metrics/consul_exporter/files/consul_exporter.confd b/app-metrics/consul_exporter/files/consul_exporter.confd |
89 |
new file mode 100644 |
90 |
index 00000000000..eb5fbdeb0cd |
91 |
--- /dev/null |
92 |
+++ b/app-metrics/consul_exporter/files/consul_exporter.confd |
93 |
@@ -0,0 +1,3 @@ |
94 |
+# Please set the flags you wish to pass to consul_exporter in |
95 |
+# command_args |
96 |
+# command_args="" |
97 |
|
98 |
diff --git a/app-metrics/consul_exporter/files/consul_exporter.initd b/app-metrics/consul_exporter/files/consul_exporter.initd |
99 |
new file mode 100644 |
100 |
index 00000000000..dbbbfa9c247 |
101 |
--- /dev/null |
102 |
+++ b/app-metrics/consul_exporter/files/consul_exporter.initd |
103 |
@@ -0,0 +1,15 @@ |
104 |
+#!/sbin/openrc-run |
105 |
+# Copyright 2016-2019 Gentoo Authors |
106 |
+# Distributed under the terms of the GNU General Public License v2 |
107 |
+ |
108 |
+description="Consul Exporter for Prometheus" |
109 |
+command="/usr/bin/consul_exporter" |
110 |
+command_background=true |
111 |
+command_user="${RC_SVCNAME}:${RC_SVCNAME}" |
112 |
+error_log=/var/log/consul_exporter/${RC_SVCNAME}.log |
113 |
+output_log=/var/log/consul_exporter/${RC_SVCNAME}.log |
114 |
+pidfile=/var/run/${RC_SVCNAME}.pid |
115 |
+ |
116 |
+depend() { |
117 |
+ after consul net |
118 |
+} |
119 |
|
120 |
diff --git a/app-metrics/consul_exporter/metadata.xml b/app-metrics/consul_exporter/metadata.xml |
121 |
new file mode 100644 |
122 |
index 00000000000..c36c37139fa |
123 |
--- /dev/null |
124 |
+++ b/app-metrics/consul_exporter/metadata.xml |
125 |
@@ -0,0 +1,8 @@ |
126 |
+<?xml version="1.0" encoding="UTF-8"?> |
127 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
128 |
+<pkgmetadata> |
129 |
+ <maintainer type="person"> |
130 |
+ <email>williamh@g.o</email> |
131 |
+ <name>William Hubbs</name> |
132 |
+ </maintainer> |
133 |
+</pkgmetadata> |