commit:     8dd2bb159250fa9197f6f477f18644750f48b17d
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 28 20:53:54 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 28 20:53:54 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8dd2bb15

app-metrics/mysqld_exporter: add 0.18.0

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 app-metrics/mysqld_exporter/Manifest               |  2 +
 .../mysqld_exporter/mysqld_exporter-0.18.0.ebuild  | 63 ++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/app-metrics/mysqld_exporter/Manifest 
b/app-metrics/mysqld_exporter/Manifest
index 5c1bf9192763..b25183562738 100644
--- a/app-metrics/mysqld_exporter/Manifest
+++ b/app-metrics/mysqld_exporter/Manifest
@@ -2,5 +2,7 @@ DIST mysqld_exporter-0.14.0-vendor.tar.xz 1434948 BLAKE2B 
9bf1c9dc728aeae678ed42
 DIST mysqld_exporter-0.14.0.tar.gz 100413 BLAKE2B 
7c995fd538c217964f4d7537961c3d16cb1d9250808832a90eaec251f20f52b5704f38a64b338067cbae2824ea07099a62e5c5083d76bceb9d3c00fed670e7e3
 SHA512 
91728055fd66d3ba2d8c6f48eac24dcdbe710e627cb3c28af100fec1656064aafedbcfcfcb8c2f164dab9c3870c1867728e33afd57889644b27ceaadf0c59629
 DIST mysqld_exporter-0.14.0_p20221209.tar.gz 103942 BLAKE2B 
c4184aea6aa3b750dfbba594725d82af6580bfe1424d1e8f9da19cbbec8c1e35f114da562a3c29799df9329df5a248bcf6788df2bdab9d0cc474eac187a395a4
 SHA512 
8ef068367259e643aba2295d1f087f09b0c61f1534421bfb8400d46c865750d6f115031b445f1f32864e3fb87c80462d4d755f657d289b9144dc7a030ff81b0a
 DIST mysqld_exporter-0.14.0_p20230328.tar.gz 92865 BLAKE2B 
490219444b14006a356fa423b21c851693cf97f9aa6a9d20e8ee732ae8af5aed07aeda04a3419aebe26051f00c60f5655c3479c4ec3d5a2c9c18b44218cdc3b4
 SHA512 
a12aeb676ba81732310599344292f8cd5680abd14d8b380ae2d57198530de1969a5712619eca195e5d7b65abf518de7877789f494a9a4fbcebf42e3c8e35dac8
+DIST mysqld_exporter-0.18.0-vendor.tar.xz 1500844 BLAKE2B 
74cf392db3b01cba734e048442875125ea9da46c449fc7959fd384ae78e6e0b79697d612402b1bb178e93f0af624e52de27e2260e1b380d3b27c783aa65b649d
 SHA512 
d8067591598eda3862ecb4fef35feb86f49c50c8de4436a272a0ef8c267f5b9fa652f4d4095d43547be918fd5378742adfe1d8f99bb4a0d3205a18a706a9b134
+DIST mysqld_exporter-0.18.0.tar.gz 99246 BLAKE2B 
fa5822330cf52e4a97c30cd9ccc075440b9414d183d98d47620aa0c12661b04ae639f2edd2b4122f5139a446123f690511ad6f912f41a915d2b033108f171431
 SHA512 
ecd63f7375ed0f8b77e6b5a3248e56a8901e0539484923a14b80b8c12e6265a59029a326b06c880e3f4ff7a263e399131bbadb33aec19b2887a2312005d05ab7
 DIST mysqld_exporter-530e351d293dd632f31b80947f5ca420ef17adaf-vendor.tar.xz 
1441316 BLAKE2B 
8d023ff291c47f30dc6216a255f050591ea585e0c58ca484a8cdb2e0be125f7daabe570b93d786936b6ea59d3996e45210c3ef41932758d05c302bfef2656e81
 SHA512 
6224d96223b4e38e35626f627c2de1b8ac08294d127556d0c6e73978648296f9a99f21a1aa323053ab07d17642af54ab2d8243bb3d3a9c06919612256fdc32dc
 DIST mysqld_exporter-fad2c0ccd8c0df8fed91a81463e930e4485fdfee-vendor.tar.xz 
1473744 BLAKE2B 
64f4f9dfee04522dbebdc9682c2619cc0f5c63b0835cfca50a37d0cce542e6a926968e23fe94a13d2e76cfbf931026cdcff74823c6c464b1b2f551bf0c70a5cf
 SHA512 
aa10101fd5bc5a2fdef367c855f85d10ebb38b8a92969c5ebf786f011a287f9992559805b8ed24ea39da4db8aedbaf12893a2c6049ea7e90e989adf1ed13d79f

diff --git a/app-metrics/mysqld_exporter/mysqld_exporter-0.18.0.ebuild 
b/app-metrics/mysqld_exporter/mysqld_exporter-0.18.0.ebuild
new file mode 100644
index 000000000000..1222f85ca6fa
--- /dev/null
+++ b/app-metrics/mysqld_exporter/mysqld_exporter-0.18.0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit eapi9-ver go-module
+
+DESCRIPTION="Prometheus exporter for MySQL server metrics"
+HOMEPAGE="https://github.com/prometheus/mysqld_exporter";
+SRC_URI="https://github.com/prometheus/mysqld_exporter/archive/v${PV}.tar.gz 
-> ${P}.tar.gz"
+SRC_URI+=" 
https://github.com/gentoo-golang-dist/${PN}/releases/download/v${PV}/${P}-vendor.tar.xz";
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="
+       acct-group/mysqld_exporter
+       acct-user/mysqld_exporter
+"
+RDEPEND="${DEPEND}"
+
+src_compile() {
+       mkdir -p bin || die
+
+       local go_ldflags=(
+               -X github.com/prometheus/common/version.Version=${PV}
+               -X github.com/prometheus/common/version.Revision=${GIT_COMMIT}
+               -X github.com/prometheus/common/version.Branch=master
+               -X github.com/prometheus/common/version.BuildUser=gentoo
+               -X github.com/prometheus/common/version.BuildDate="$(date 
+%F-%T)"
+       )
+       ego build -mod=vendor -ldflags "${go_ldflags[*]}" -o bin/${PN} .
+}
+
+src_test() {
+       emake test-flags= test
+}
+
+src_install() {
+       dobin bin/*
+       dodoc {README,CHANGELOG,CONTRIBUTING}.md
+
+       keepdir /var/lib/mysqld_exporter /var/log/mysqld_exporter
+       fowners ${PN}:${PN} /var/lib/mysqld_exporter /var/log/mysqld_exporter
+       fperms 0770 /var/lib/mysqld_exporter
+
+       newinitd "${FILESDIR}"/${PN}-r1.initd ${PN}
+       newconfd "${FILESDIR}"/${PN}-r1.confd ${PN}
+
+       insinto /etc/logrotate.d/
+       newins "${FILESDIR}"/${PN}.logrotate ${PN}
+}
+
+pkg_postinst() {
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               # This is a new installation
+               elog "Create \"${EROOT}/var/lib/mysqld_exporter/.my.cnf\" to 
read MySQL credentials from file."
+       elif ver_replacing -lt "0.11.0"; then
+               elog "Starting with ${PN}-0.11.0, command-line flags will 
require double dashes (--)."
+               elog "You must update your configuration or ${PN} won't start."
+       fi
+}

Reply via email to