dev-qt/qtopengl: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / app-metrics / grok_exporter / grok_exporter-0.2.6.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 EGO_PN=github.com/fstab/grok_exporter
7 EGO_REVISION=81c0afe
8 EGO_VENDOR=(
9         "github.com/prometheus/client_model 56726106282f1985ea77d5305743db7231b0c0a8"
10         "github.com/prometheus/common 2998b132700a7d019ff618c06a234b47c1f3f681"
11         "github.com/prometheus/client_golang 18d13eacc9cce330610a70daf4ed0fef2e846589"
12         "github.com/prometheus/procfs b1a0a9a36d7453ba0f62578b99712f3a6c5f82d1"
13         "github.com/matttproud/golang_protobuf_extensions c182affec369e30f25d3eb8cd8a478dee585ae7d"
14         "github.com/golang/protobuf 347cf4a86c1cb8d262994d8ef5924d4576c5b331"
15         "github.com/beorn7/perks 3a771d992973f24aa725d07868b467d1ddfceafb"
16         "gopkg.in/yaml.v2 51d6538a90f86fe93ac480b35f37b2be17fef232 github.com/go-yaml/yaml" # branch v2.2.2
17 )
18
19 inherit user golang-build golang-vcs-snapshot
20
21 DESCRIPTION="Unstructured log data exporter for Prometheus"
22 HOMEPAGE="https://github.com/fstab/Grok_exporter"
23 SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
24         ${EGO_VENDOR_URI}"
25 LICENSE="Apache-2.0 BSD MIT"
26 SLOT="0"
27 KEYWORDS="~amd64"
28
29 DEPEND=">=dev-libs/oniguruma-6.9.0"
30 RDEPEND=">=dev-libs/oniguruma-6.9.0:="
31
32 RESTRICT="strip"
33
34 pkg_setup() {
35         enewgroup ${PN}
36         enewuser ${PN} -1 -1 -1 ${PN}
37 }
38
39 src_compile() {
40         cd src/${EGO_PN} || die
41         GOPATH="${S}" go build -ldflags="
42                 -X ${EGO_PN}/exporter.Version=${PV}
43                 -X ${EGO_PN}/exporter.BuildDate=$(date +%Y-%m-%d)
44                 -X ${EGO_PN}/exporter.Branch=master
45                 -X ${EGO_PN}/exporter.Revision=${EGO_REVISION}" || die "compile failed"
46 }
47
48 src_install() {
49         cd src/${EGO_PN} || die
50         dobin ${PN}
51         dodoc -r *.md example
52         keepdir /var/log/${PN}
53         fowners ${PN}:${PN} /var/log/${PN}
54         newconfd "${FILESDIR}"/${PN}.confd ${PN}
55         newinitd "${FILESDIR}"/${PN}.initd ${PN}
56 keepdir /etc/"${PN}"
57 }
58
59 pkg_postinst() {
60         if [[ -z "${REPLACING_VERSIONS}" ]]; then
61         elog "You need to create /etc/${PN}/${PN}.yml"
62         elog "Please see /usr/share/doc/${PVR} for examples"
63         fi
64 }