summaryrefslogtreecommitdiff
path: root/app-metrics/nftables-exporter/nftables-exporter-0.3.1.ebuild
blob: 5c64528b9900b1e0bf09c32a4fb1d36bc0b413f2 (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
# Copyright 2023-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module systemd

# make sure these are updated based on the Makefile in every bump.
SHA=a8497830
GITVERSION=tags/v0.3.1-0-ga849783

DESCRIPTION="prometheus exporter for nftables metrics"
HOMEPAGE="https://github.com/metal-stack/nftables-exporter"
SRC_URI="https://github.com/metal-stack/nftables-exporter/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="net-firewall/nftables"

src_prepare() {
	default
	sed -i -e '/strip bin\//d' -e '/sha256sum/d' Makefile
}

src_compile() {
	emake \
		SHA=${SHA} \
		GITVERSION=${GITVERSION} \
		VERSION=v${PV} \
		build
}

src_install() {
	newbin bin/${P}-* ${PN}
	insinto etc
	doins nftables_exporter.yaml
	systemd_dounit systemd/nftables-exporter.service
	newinitd "${FILESDIR}"/${PN}.initd ${PN}
	keepdir /var/log/${PN}
}