blob: 28809292d70efe80d1a7e9f6f312e75c72a344f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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}
}
|