dev-python/csv23: arm64 keyworded (bug #719700)
[gentoo.git] / app-metrics / postfix_exporter / postfix_exporter-0.1.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 EGO_VENDOR=( "github.com/coreos/go-systemd bebb2b01b0473b183e4624aaf8e23ae6f4b22417"
7         "github.com/coreos/pkg 97fdf19511ea361ae1c100dd393cc47f8dcfa1e1"
8         "github.com/prometheus/client_golang f504d69affe11ec1ccb2e5948127f86878c9fd57"
9         "github.com/beorn7/perks 3a771d992973f24aa725d07868b467d1ddfceafb"
10         "github.com/golang/protobuf e09c5db296004fbe3f74490e84dcd62c3c5ddb1b"
11         "github.com/prometheus/client_model 99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"
12         "github.com/prometheus/common 38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a"
13         "github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c"
14         "github.com/prometheus/procfs 780932d4fbbe0e69b84c34c20f5c8d0981e109ea" )
15
16 inherit user golang-build golang-vcs-snapshot
17
18 EGO_PN="github.com/kumina/postfix_exporter"
19 ARCHIVE_URI="https://${EGO_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
20 KEYWORDS="~amd64"
21
22 DESCRIPTION="Prometheus Exporter for Postfix"
23 HOMEPAGE="https://github.com/kumina/postfix_exporter"
24 SRC_URI="${ARCHIVE_URI}
25         ${EGO_VENDOR_URI}"
26 LICENSE="Apache-2.0 BSD MIT"
27 SLOT="0"
28 IUSE="systemd"
29
30 DEPEND="systemd? ( sys-apps/systemd )"
31
32 RESTRICT="test"
33
34 pkg_setup() {
35         enewgroup ${PN}
36         enewuser ${PN} -1 -1 -1 ${PN}
37 }
38
39 src_compile() {
40         pushd src/${EGO_PN} || die
41         GOPATH="${S}" \
42                 go build -tags "$(usex systemd '' 'nosystemd')" -v -o bin/${PN} || die
43         popd || die
44 }
45
46 src_install() {
47         dobin src/${EGO_PN}/bin/${PN}
48         dodoc src/${EGO_PN}/{CHANGELOG,README}.md
49         local dir
50         for dir in /var/{lib,log}/${PN}; do
51                 keepdir "${dir}"
52                 fowners ${PN}:${PN} "${dir}"
53         done
54         newinitd "${FILESDIR}"/${PN}.initd ${PN}
55         newconfd "${FILESDIR}"/${PN}.confd ${PN}
56         insinto /etc/logrotate.d
57         newins "${FILESDIR}/${PN}.logrotated" "${PN}"
58 }