1 |
commit: dc976b4dcc5422f9291b9680f7b394981c76f970 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 9 09:29:24 2018 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 9 12:16:59 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc976b4d |
7 |
|
8 |
app-metrics/mysqld_exporter: bump to v0.11.0 |
9 |
|
10 |
Note: The format of the mysqld_exporter command line flags has |
11 |
changed. Instead of a single dash, all flags now use a double dash. |
12 |
|
13 |
Package-Manager: Portage-2.3.50, Repoman-2.3.11 |
14 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
15 |
|
16 |
app-metrics/mysqld_exporter/Manifest | 1 + |
17 |
.../mysqld_exporter/files/mysqld_exporter-r1.confd | 26 ++++++++ |
18 |
.../mysqld_exporter/mysqld_exporter-0.11.0.ebuild | 71 ++++++++++++++++++++++ |
19 |
3 files changed, 98 insertions(+) |
20 |
|
21 |
diff --git a/app-metrics/mysqld_exporter/Manifest b/app-metrics/mysqld_exporter/Manifest |
22 |
index e55c4730f1b..e9ac6d5ab2d 100644 |
23 |
--- a/app-metrics/mysqld_exporter/Manifest |
24 |
+++ b/app-metrics/mysqld_exporter/Manifest |
25 |
@@ -1 +1,2 @@ |
26 |
DIST mysqld_exporter-0.10.0.tar.gz 971604 BLAKE2B ec077b7b6a15f6173e5cc04e741c51c4d26a214601da8eb1aede49ee325f52bea2140b8e5b3bdbc2a1e527e40c95099dca2a57501d44a26e787cdc330f4aa8b8 SHA512 0a7b0ff537ad59a9b64aa18dfe1d1eb9253b12ae566d5c151555fbd4457b7e65890b6569632b452ae317b3acbfa94c12d96f6fb6e4f982b9b2161fc4747330f5 |
27 |
+DIST mysqld_exporter-0.11.0.tar.gz 1393809 BLAKE2B ac6b04d2ad24f1c083c411f10bbb6724c2458be357ff60e1950aa624955497432295726e7f739dff03aa1ed8290d852a9511e01893f5a2b293e79b3214270578 SHA512 69f39ecc1b17bfcfd3acdad9d92a70c1daf3f0c9690770fa390a818bd29f43a98bfe4856f22b48e9d2d9945ce98ded0ea54c95010755a85ebc3ebfdc353d0c24 |
28 |
|
29 |
diff --git a/app-metrics/mysqld_exporter/files/mysqld_exporter-r1.confd b/app-metrics/mysqld_exporter/files/mysqld_exporter-r1.confd |
30 |
new file mode 100644 |
31 |
index 00000000000..2b7f9bf17a3 |
32 |
--- /dev/null |
33 |
+++ b/app-metrics/mysqld_exporter/files/mysqld_exporter-r1.confd |
34 |
@@ -0,0 +1,26 @@ |
35 |
+# /etc/conf.d/mysqld_exporter |
36 |
+ |
37 |
+# PID file |
38 |
+#EXPORTER_PIDFILE="/run/${RC_SVCNAME}.pid" |
39 |
+ |
40 |
+# The termination timeout (start-stop-daemon parameter "retry") ensures |
41 |
+# that the service will be terminated within a given time (60 + 5 seconds |
42 |
+# per default) when you are stopping the service. |
43 |
+#EXPORTER_TERMTIMEOUT="TERM/60/KILL/5" |
44 |
+ |
45 |
+# User to run exporter as |
46 |
+#EXPORTER_USER="mysqld_exporter" |
47 |
+ |
48 |
+# User group to run exporter as |
49 |
+#EXPORTER_GROUP="mysqld_exporter" |
50 |
+ |
51 |
+# You can use this configuration option to pass additional options to the |
52 |
+# start-stop-daemon, see start-stop-daemon(8) for more details. |
53 |
+# Per default we wait 1000ms after we have started the service to ensure |
54 |
+# that the daemon is really up and running. |
55 |
+#EXPORTER_SSDARGS="--wait 1000" |
56 |
+ |
57 |
+# Exporter flags |
58 |
+# See `mysqld_exporter --help` for more details |
59 |
+EXPORTER_FLAGS="--log.level=info" |
60 |
+#EXPORTER_FLAGS="${EXPORTER_FLAGS} --yourAdditionalFlag" |
61 |
|
62 |
diff --git a/app-metrics/mysqld_exporter/mysqld_exporter-0.11.0.ebuild b/app-metrics/mysqld_exporter/mysqld_exporter-0.11.0.ebuild |
63 |
new file mode 100644 |
64 |
index 00000000000..3571c885d16 |
65 |
--- /dev/null |
66 |
+++ b/app-metrics/mysqld_exporter/mysqld_exporter-0.11.0.ebuild |
67 |
@@ -0,0 +1,71 @@ |
68 |
+# Copyright 1999-2018 Gentoo Authors |
69 |
+# Distributed under the terms of the GNU General Public License v2 |
70 |
+ |
71 |
+EAPI="6" |
72 |
+inherit eapi7-ver user golang-build golang-vcs-snapshot |
73 |
+ |
74 |
+EGO_PN="github.com/prometheus/mysqld_exporter" |
75 |
+EGIT_COMMIT="v${PV/_rc/-rc.}" |
76 |
+MYSQLD_EXPORTER_COMMIT="8068006" |
77 |
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" |
78 |
+KEYWORDS="~amd64" |
79 |
+ |
80 |
+DESCRIPTION="Prometheus exporter for MySQL server metrics" |
81 |
+HOMEPAGE="https://github.com/prometheus/mysqld_exporter" |
82 |
+SRC_URI="${ARCHIVE_URI}" |
83 |
+LICENSE="Apache-2.0" |
84 |
+SLOT="0" |
85 |
+IUSE="" |
86 |
+ |
87 |
+DEPEND="dev-util/promu" |
88 |
+ |
89 |
+pkg_setup() { |
90 |
+ enewgroup ${PN} |
91 |
+ enewuser ${PN} -1 -1 /var/lib/mysqld_exporter ${PN} |
92 |
+} |
93 |
+ |
94 |
+src_prepare() { |
95 |
+ default |
96 |
+ sed -i -e "s/{{.Revision}}/${MYSQLD_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die |
97 |
+} |
98 |
+ |
99 |
+src_compile() { |
100 |
+ pushd src/${EGO_PN} || die |
101 |
+ mkdir -p bin || die |
102 |
+ GOPATH="${S}" promu build -v --prefix bin || die |
103 |
+ popd || die |
104 |
+} |
105 |
+ |
106 |
+src_install() { |
107 |
+ pushd src/${EGO_PN} || die |
108 |
+ dobin bin/mysqld_exporter |
109 |
+ dodoc {README,CHANGELOG,CONTRIBUTING}.md |
110 |
+ popd || die |
111 |
+ |
112 |
+ keepdir /var/lib/mysqld_exporter /var/log/mysqld_exporter |
113 |
+ fowners ${PN}:${PN} /var/lib/mysqld_exporter /var/log/mysqld_exporter |
114 |
+ fperms 0770 /var/lib/mysqld_exporter |
115 |
+ |
116 |
+ newinitd "${FILESDIR}"/${PN}-r1.initd ${PN} |
117 |
+ newconfd "${FILESDIR}"/${PN}-r1.confd ${PN} |
118 |
+ |
119 |
+ insinto /etc/logrotate.d/ |
120 |
+ newins "${FILESDIR}"/${PN}.logrotate ${PN} |
121 |
+} |
122 |
+ |
123 |
+pkg_postinst() { |
124 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
125 |
+ # This is a new installation |
126 |
+ elog "Create \"${EROOT%/}/var/lib/mysqld_exporter/.my.cnf\" to read MySQL credentials from file." |
127 |
+ else |
128 |
+ local _replacing_version= |
129 |
+ for _replacing_version in ${REPLACING_VERSIONS}; do |
130 |
+ if ! ver_test "${_replacing_version}" -ge "0.11.0"; then |
131 |
+ elog "Starting with ${PN}-0.11.0, command-line flags will require double dashes (--)." |
132 |
+ elog "You must update your configuration or ${PN} won't start." |
133 |
+ |
134 |
+ break |
135 |
+ fi |
136 |
+ done |
137 |
+ fi |
138 |
+} |