1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit user golang-build golang-vcs-snapshot
7 EGO_PN="github.com/digitalocean/bind_exporter"
8 EXPORTER_COMMIT="9289b40af62a455ebd587ed4701dd543f4cc5877"
9 ARCHIVE_URI="https://${EGO_PN}/archive/${EXPORTER_COMMIT}.tar.gz -> ${P}.tar.gz"
12 DESCRIPTION="Prometheus exporter for BIND"
13 HOMEPAGE="https://github.com/digitalocean/bind_exporter"
14 SRC_URI="${ARCHIVE_URI}"
15 LICENSE="Apache-2.0 BSD MIT"
19 DEPEND="dev-util/promu"
23 enewuser ${PN} -1 -1 -1 ${PN}
28 sed -i -e "/-s$/d" -e "s/{{.Revision}}/${EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
32 pushd src/${EGO_PN} || die
34 GOPATH="${S}" promu build -v --prefix bin || die
39 pushd src/${EGO_PN} || die
41 dodoc {README,CHANGELOG}.md
43 keepdir /var/log/${PN}
44 fowners ${PN}:${PN} /var/log/${PN}
45 newinitd "${FILESDIR}"/${PN}.initd ${PN}
46 newconfd "${FILESDIR}"/${PN}.confd ${PN}
50 elog "Make sure BIND was built with libxml2 support. You can check with the"
51 elog "following command: named -V | grep libxml2."
52 elog "Configure BIND to open a statistics channel. It's recommended to run"
53 elog "the bind_exporter next to BIND, so it's only necessary to open a port"
56 elog "statistics-channels {"
57 elog "inet 127.0.0.1 port 8053 allow { 127.0.0.1; };"