summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-03-15 15:10:47 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-03-15 15:12:54 +0200
commit3d84a864ef4e5a710af13644940844767bcdf701 (patch)
treede3082835f5e2e5e13c58d0ff97fe058ee69ab1d /app-metrics/prometheus-lvm-exporter
parentapp-office/homebank: drop 5.7.3 (diff)
downloadgentoo-3d84a864ef4e5a710af13644940844767bcdf701.tar.gz
gentoo-3d84a864ef4e5a710af13644940844767bcdf701.tar.bz2
gentoo-3d84a864ef4e5a710af13644940844767bcdf701.zip
app-metrics/prometheus-lvm-exporter: add 0.3.3, systemd, cleanup
- EAPI=8 - simplify the ebuild a lot - fix order of phase funcitons - install systemd service Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'app-metrics/prometheus-lvm-exporter')
-rw-r--r--app-metrics/prometheus-lvm-exporter/Manifest2
-rw-r--r--app-metrics/prometheus-lvm-exporter/prometheus-lvm-exporter-0.3.3.ebuild49
2 files changed, 51 insertions, 0 deletions
diff --git a/app-metrics/prometheus-lvm-exporter/Manifest b/app-metrics/prometheus-lvm-exporter/Manifest
index d4c18baa4f35..b944cddb2233 100644
--- a/app-metrics/prometheus-lvm-exporter/Manifest
+++ b/app-metrics/prometheus-lvm-exporter/Manifest
@@ -1,2 +1,4 @@
DIST prometheus-lvm-exporter-0.3.2-vendor.tar.xz 1390560 BLAKE2B ab6fe8febeb972bf2a65dd05c6060bb584638dc4250f221353b7fcc3714cd5f56b8ef69c36fae67103bf57d66ca8000c70212fa3f82ed54ad7bcf0eaae63c822 SHA512 e320cdbe27841f69fad201e52a6b5a9acdd919b57c7e067506e6829e3cf11936a0ab21e817dedc6fa0c277ddae891412a10565d6dac8f859669e1a37cc760e86
DIST prometheus-lvm-exporter-0.3.2.tar.gz 60790 BLAKE2B f6b79627e9114140cab72d34744e5667e1174dd2bc720866d398d48be03067a29e03305e8a22ef4d706b2261083ec6f108e6c8578b9e717bf7915f2412b3da41 SHA512 75f3cc65fc9196faff0796e9df85ea8f7e5d15a97e7e46d635802049ad11e499bc5f0fd0b6833d1028dc23435fb8d0c2523e7333fb76e291f3ff16e297c37973
+DIST prometheus-lvm-exporter-0.3.3-deps.tar.xz 8813080 BLAKE2B 3fad55a4a57bd34ca29b27d2a3812f5e3f1bb4b2315bd9a10d4cb264cbacb13e3aa0385da117bc193cea12c9ea1245aa80e74a49339d25c7ed277cd681ff38ad SHA512 df93b13bc389d87d9d33bb637ca13af13cff02c411e4ba16159dd9be560e15b1f107c593a95ecb72f0d92ce5124439c42673562e5da5016b726512e5cd32c7f4
+DIST prometheus-lvm-exporter-0.3.3.tar.gz 47239 BLAKE2B 5e91e9a06090843f1637624bcde9dcf5af771fb03467d3c09affed20ccc7f8f565bcbd4b7cf97df3be5d06dbfaaeacf76af43b635b5e887cfaa4cfe7a601fc78 SHA512 84315d248310c4cd2e2a51e57026561beb813d4cdc621f545b8b285804ecc6faba28644e19fb2435fefe77552385f04fc1e604d543675ccc002f1984d92c8c21
diff --git a/app-metrics/prometheus-lvm-exporter/prometheus-lvm-exporter-0.3.3.ebuild b/app-metrics/prometheus-lvm-exporter/prometheus-lvm-exporter-0.3.3.ebuild
new file mode 100644
index 000000000000..28809292d70e
--- /dev/null
+++ b/app-metrics/prometheus-lvm-exporter/prometheus-lvm-exporter-0.3.3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module systemd
+
+DESCRIPTION="Prometheus exporter for LVM metrics"
+HOMEPAGE="https://github.com/hansmi/prometheus-lvm-exporter"
+SRC_URI="
+ https://github.com/hansmi/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~arthurzam/distfiles/app-metrics/${PN}/${P}-deps.tar.xz
+"
+
+LICENSE="Apache-2.0 BSD MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# lvm is explicitly not included here; this could be installed before it safely.
+# RDEPEND=""
+
+src_prepare() {
+ default
+ sed -i -e '/kingpin.Flag.*\<command\>.*/s,/usr/sbin/lvm,/sbin/lvm,g' "${S}"/main.go || die
+}
+
+src_compile() {
+ default
+ ego build .
+}
+
+src_test() {
+ ego test .
+}
+
+src_install() {
+ default
+ dobin ${PN}
+ dodoc README.md
+
+ systemd_dounit contrib/systemd/${PN}.service
+ insinto /etc/default
+ newins contrib/systemd/${PN}.default ${PN}
+
+ # TODO: more secure config would be a dedicated user AND a sudo command, so
+ # the daemon can run 'sudo lvm ...'.
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}