gentoo-overlay/app-metrics/postfix_exporter/postfix_exporter-0.3.0-r1.ebuild
Manuel Friedli 9eb79d94db
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Fix pkgcheck style issues.
Signed-off-by: Manuel Friedli <manuel@fritteli.ch>
2024-06-12 00:56:18 +02:00

41 lines
1 KiB
Bash

# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module systemd
DESCRIPTION="Prometheus Exporter for Postfix"
HOMEPAGE="https://github.com/kumina/postfix_exporter"
SRC_URI="https://github.com/kumina/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://manuel.friedli.info/gentoo-overlay/${P}-vendor.tar.xz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="systemd"
DEPEND="systemd? ( sys-apps/systemd )"
RDEPEND="acct-user/postfix_exporter"
RESTRICT="test"
src_compile() {
ego build -tags "$(usex systemd '' 'nosystemd')" -v -o bin/${PN} || die
}
src_install() {
dobin "bin/${PN}"
dodoc {CHANGELOG,README}.md
local dir
for dir in /var/{lib,log}/${PN}; do
keepdir "${dir}"
fowners postfix_exporter:postfix_exporter "${dir}"
done
newinitd "${FILESDIR}"/${PN}.initd ${PN}
newconfd "${FILESDIR}"/${PN}-1.confd ${PN}
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotated" "${PN}"
systemd_dounit "${FILESDIR}"/"${PN}".service
}