Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepalived_exporter: add packaging for github.com/gen2brain/keepalived_exporter #907

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions acct-group/keepalived_exporter/keepalived_exporter-0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit acct-group

ACCT_GROUP_ID=-1
7 changes: 7 additions & 0 deletions acct-group/keepalived_exporter/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
</maintainer>
</pkgmetadata>
13 changes: 13 additions & 0 deletions acct-user/keepalived_exporter/keepalived_exporter-0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit acct-user

DESCRIPTION="Keepalived Exporter for Prometheus"

ACCT_USER_ID=-1
ACCT_USER_GROUPS=( ${PN} )

acct-user_add_deps
7 changes: 7 additions & 0 deletions acct-user/keepalived_exporter/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
</maintainer>
</pkgmetadata>
2 changes: 2 additions & 0 deletions app-metrics/keepalived_exporter/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DIST keepalived_exporter-0.7.1-deps.tar.xz 6875888 BLAKE2B 1b54e84226bdd611d19bb9fb45d93427f58190e63cd41a680ee9cfba679406769d7bfdd83c63f410267674aaa1fb3a68ac95bd427431b4a12f10ca704ec19e7c SHA512 3fcccf5a3614da5c4696a6be49d2a21901e4d71727975ebc8438965ece48953848fdc79c946b338e108488a389831378f583db79e3cbf6a7890341d78a4494d4
DIST keepalived_exporter-0.7.1.tar.gz 11327 BLAKE2B 9c32d24eadede8cf63efbac52278e2cc970753e91c03b50b63f73dd5eace170abff69b341b37098a16c32eb202729c1240b9af8db844a368f03010ce393b23c6 SHA512 2c6e8ccc1fe7dba44871f003e91aa31b85993d99cbcb85a3e8d2af1eff0211906e18e41de2685feb244407162fe8409e7273789e56d846dd0768bbf28a4883b9
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# arguments for prometheus keepalived exporter
command_args='-web.listen-address=":9650" -web.telemetry-path="/metrics"'
14 changes: 14 additions & 0 deletions app-metrics/keepalived_exporter/files/keepalived_exporter.initd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/sbin/openrc-run
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

name="keepalive_exporter daemon"
description="Prometheus exporter for Keepalived metrics."
command="/usr/bin/keepalived_exporter"
output_log="/var/log/keepalived_exporter/keepalived_exporter.log"
error_log="/var/log/keepalived_exporter/keepalived_exporter.err.log"
start_stop_daemon_args="--background --user keepalived_exporter"

depend() {
need net
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module
# Project name and version
DESCRIPTION="Keepalived Exporter for Prometheus"
HOMEPAGE="https://github.com/gen2brain/keepalived_exporter"
SRC_URI="
https://github.com/gen2brain/keepalived_exporter/archive/v${PV}.tar.gz -> ${P}.tar.gz
https://files.adjust.com/${P}.tar.xz -> ${P}-deps.tar.xz
"

LICENSE="MIT"
KEYWORDS="~amd64 ~x86"
SLOT="0"

# Go module dependencies
COMMON_DEPEND="
>=dev-lang/go-1.21
acct-group/keepalived_exporter
acct-user/keepalived_exporter
"
RDEPEND="${COMMON_DEPEND}"
SRC_DIR="${WORKDIR}/${P}"

src_unpack() {
default
}

src_prepare() {
default
}

src_compile() {
export GOPATH="${SRC_DIR}"
cd "${SRC_DIR}"
ego build
}

src_install() {
dobin "${PN}"
newinitd "${FILESDIR}"/"${PN}".initd keepalived_exporter
newconfd "${FILESDIR}"/"${PN}".confd keepalived_exporter
keepdir /var/log/${PN}
# fowners ${PN}:${PN} /var/log/${PN}
}

src_test() {
true
}

Loading