1 |
commit: 7b47a7384b30d6800ffa80426e3d698a289ecd69 |
2 |
Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 27 19:17:32 2018 +0000 |
4 |
Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 27 19:17:32 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b47a738 |
7 |
|
8 |
app-admin/mongodb_exporter: Initial version |
9 |
|
10 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
11 |
|
12 |
app-admin/mongodb_exporter/Manifest | 1 + |
13 |
.../mongodb_exporter/files/mongodb_exporter.confd | 2 + |
14 |
.../mongodb_exporter/files/mongodb_exporter.initd | 19 +++++++++ |
15 |
app-admin/mongodb_exporter/metadata.xml | 11 +++++ |
16 |
.../mongodb_exporter/mongodb_exporter-0.4.0.ebuild | 47 ++++++++++++++++++++++ |
17 |
5 files changed, 80 insertions(+) |
18 |
|
19 |
diff --git a/app-admin/mongodb_exporter/Manifest b/app-admin/mongodb_exporter/Manifest |
20 |
new file mode 100644 |
21 |
index 00000000000..ef9522c2183 |
22 |
--- /dev/null |
23 |
+++ b/app-admin/mongodb_exporter/Manifest |
24 |
@@ -0,0 +1 @@ |
25 |
+DIST mongodb_exporter-0.4.0.tar.gz 3386266 BLAKE2B a6bebada2792e620b2107b72b3ab8b2a4e7a08fc53747f266b30a3cf2fe42ed7e09e3be9aa36332cba2df124947064f545821f355726e09649509c671a56c30b SHA512 0db1abd8c7439239cf59b24968ef33f83c6609a9deaed250315dd7fcb6844ef3d0d0c1f50b979f931beb539038a13eb7b88c03c899333d981112695be2e031b3 |
26 |
|
27 |
diff --git a/app-admin/mongodb_exporter/files/mongodb_exporter.confd b/app-admin/mongodb_exporter/files/mongodb_exporter.confd |
28 |
new file mode 100644 |
29 |
index 00000000000..bd85fa28830 |
30 |
--- /dev/null |
31 |
+++ b/app-admin/mongodb_exporter/files/mongodb_exporter.confd |
32 |
@@ -0,0 +1,2 @@ |
33 |
+# arguments for prometheus mongodb exporter |
34 |
+command_args="-mongodb.uri=http://localhost:9200" |
35 |
|
36 |
diff --git a/app-admin/mongodb_exporter/files/mongodb_exporter.initd b/app-admin/mongodb_exporter/files/mongodb_exporter.initd |
37 |
new file mode 100644 |
38 |
index 00000000000..2a2c985c4f6 |
39 |
--- /dev/null |
40 |
+++ b/app-admin/mongodb_exporter/files/mongodb_exporter.initd |
41 |
@@ -0,0 +1,19 @@ |
42 |
+#!/sbin/openrc-run |
43 |
+# Copyright 2016-2018 Gentoo Foundation |
44 |
+# Distributed under the terms of the GNU General Public License v2 |
45 |
+ |
46 |
+description="Prometheus MongoDB exporter" |
47 |
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} |
48 |
+user=${user:-${RC_SVCNAME}} |
49 |
+group=${group:-${RC_SVCNAME}} |
50 |
+ |
51 |
+command="/usr/bin/mongodb_exporter" |
52 |
+command_args="${command_args:--mongodb.uri=http://localhost:27017}" |
53 |
+command_background="true" |
54 |
+start_stop_daemon_args="--user ${user} --group ${group} \ |
55 |
+ --stdout /var/log/elasticsearch_exporter/${RC_SVCNAME}.log \ |
56 |
+ --stderr /var/log/elasticsearch_exporter/${RC_SVCNAME}.log" |
57 |
+ |
58 |
+depend() { |
59 |
+ after net |
60 |
+} |
61 |
|
62 |
diff --git a/app-admin/mongodb_exporter/metadata.xml b/app-admin/mongodb_exporter/metadata.xml |
63 |
new file mode 100644 |
64 |
index 00000000000..b54031048cb |
65 |
--- /dev/null |
66 |
+++ b/app-admin/mongodb_exporter/metadata.xml |
67 |
@@ -0,0 +1,11 @@ |
68 |
+<?xml version="1.0" encoding="UTF-8"?> |
69 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
70 |
+<pkgmetadata> |
71 |
+ <maintainer type="person"> |
72 |
+ <email>mrueg@g.o</email> |
73 |
+ <name>Manuel Rüger</name> |
74 |
+ </maintainer> |
75 |
+ <upstream> |
76 |
+ <remote-id type="github">percona/mongodb_exporter</remote-id> |
77 |
+ </upstream> |
78 |
+</pkgmetadata> |
79 |
|
80 |
diff --git a/app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild b/app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild |
81 |
new file mode 100644 |
82 |
index 00000000000..5ea07ecd61c |
83 |
--- /dev/null |
84 |
+++ b/app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild |
85 |
@@ -0,0 +1,47 @@ |
86 |
+# Copyright 1999-2018 Gentoo Foundation |
87 |
+# Distributed under the terms of the GNU General Public License v2 |
88 |
+ |
89 |
+EAPI=6 |
90 |
+inherit user golang-build golang-vcs-snapshot |
91 |
+ |
92 |
+EGO_PN="github.com/percona/mongodb_exporter" |
93 |
+EXPORTER_COMMIT="01f0ef9" |
94 |
+ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
95 |
+KEYWORDS="~amd64" |
96 |
+ |
97 |
+DESCRIPTION="Prometheus exporter for MongoDB" |
98 |
+HOMEPAGE="https://github.com/percona/mongodb_exporter" |
99 |
+SRC_URI="${ARCHIVE_URI}" |
100 |
+LICENSE="Apache-2.0" |
101 |
+SLOT="0" |
102 |
+IUSE="" |
103 |
+ |
104 |
+DEPEND="dev-util/promu" |
105 |
+ |
106 |
+pkg_setup() { |
107 |
+ enewgroup ${PN} |
108 |
+ enewuser ${PN} -1 -1 -1 ${PN} |
109 |
+} |
110 |
+ |
111 |
+src_prepare() { |
112 |
+ default |
113 |
+ sed -i -e "/-s$/d" -e "s/{{.Revision}}/${EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die |
114 |
+} |
115 |
+ |
116 |
+src_compile() { |
117 |
+ pushd src/${EGO_PN} || die |
118 |
+ mkdir -p bin || die |
119 |
+ GOPATH="${S}" promu build -v --prefix bin || die |
120 |
+ popd || die |
121 |
+} |
122 |
+ |
123 |
+src_install() { |
124 |
+ pushd src/${EGO_PN} || die |
125 |
+ dobin bin/mongodb_exporter |
126 |
+ dodoc {README,CHANGELOG}.md |
127 |
+ popd || die |
128 |
+ keepdir /var/log/mongodb_exporter |
129 |
+ fowners ${PN}:${PN} /var/log/mongodb_exporter |
130 |
+ newinitd "${FILESDIR}"/${PN}.initd ${PN} |
131 |
+ newconfd "${FILESDIR}"/${PN}.confd ${PN} |
132 |
+} |