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 systemd
7 EGO_PN="github.com/timonwong/uwsgi_exporter"
8 EGIT_COMMIT="v${PV/_rc/-rc.}"
9 UWSGI_EXPORTER_COMMIT="20e35a9"
10 ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
13 DESCRIPTION="uWSGI metrics exporter for prometheus.io"
14 HOMEPAGE="https://github.com/timonwong/uwsgi_exporter"
15 SRC_URI="${ARCHIVE_URI}"
16 LICENSE="Apache-2.0 BSD ISC MIT"
20 DEPEND="dev-util/promu"
24 enewuser ${PN} -1 -1 -1 ${PN}
29 sed -i -e "s/{{.Revision}}/${UWSGI_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
33 pushd src/${EGO_PN} || die
35 GOPATH="${S}" promu build -v --prefix bin || die
40 pushd src/${EGO_PN} || die
41 dobin bin/uwsgi_exporter
45 for dir in /var/{lib,log}/${PN}; do
47 fowners ${PN}:${PN} "${dir}"
49 newinitd "${FILESDIR}"/${PN}.initd ${PN}
50 newconfd "${FILESDIR}"/${PN}.confd ${PN}
51 insinto /etc/logrotate.d
52 newins "${FILESDIR}/${PN}.logrotated" "${PN}"
53 systemd_dounit "${FILESDIR}/${PN}.service"