forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexabgp_exporter-1.0.0_p20200718.ebuild
36 lines (30 loc) · 1.18 KB
/
exabgp_exporter-1.0.0_p20200718.ebuild
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
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit go-module systemd
DESCRIPTION="Prometheus exporter for exabgp"
HOMEPAGE="https://github.com/lusis/exabgp_exporter"
EGIT_COMMIT="6fe8ef056a87881c8d7568cba83b3c18f7165d3a"
SRC_URI="https://github.com/lusis/exabgp_exporter/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
https://dev.gentoo.org/~zmedico/dist/${P}-deps.tar.xz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
S=${WORKDIR}/${PN}-${EGIT_COMMIT}
src_compile() {
CGO_ENABLED=0 go build \
-ldflags "-X github.com/prometheus/common/version.Version=${PV%_*}
-X github.com/prometheus/common/version.Revision=${EGIT_COMMIT} \
-X github.com/prometheus/common/version.Branch=master \
-X github.com/prometheus/common/version.BuildUser=$(whoami)
-X github.com/prometheus/common/version.BuildDate=$(date -u +'%FT%T%z')" \
-o ./bin/${PN} ./cmd/exabgp_exporter/main.go || die
}
src_install() {
dobin ./bin/${PN}
dodoc README.md
systemd_dounit "${FILESDIR}/${PN}.service"
systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
newinitd "${FILESDIR}/${PN}.initd" "${PN}"
newconfd "${FILESDIR}/${PN}.confd" "${PN}"
}