Gentoo Archives: gentoo-commits

From: "Manuel Rüger" <mrueg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/prometheus/files/, net-analyzer/prometheus/
Date: Sat, 12 Aug 2017 10:19:15
Message-Id: 1502533086.d8fdcd98d43630a6a3f60b7dadfcb3c847456f20.mrueg@gentoo
1 commit: d8fdcd98d43630a6a3f60b7dadfcb3c847456f20
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 12 10:18:06 2017 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 12 10:18:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8fdcd98
7
8 net-analyzer/prometheus: Version bump to 2.0.0_beta1
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.3
11
12 net-analyzer/prometheus/Manifest | 1 +
13 net-analyzer/prometheus/files/prometheus-2.initd | 24 ++++++++
14 net-analyzer/prometheus/files/prometheus.confd | 4 +-
15 .../prometheus/prometheus-2.0.0_beta1.ebuild | 67 ++++++++++++++++++++++
16 4 files changed, 94 insertions(+), 2 deletions(-)
17
18 diff --git a/net-analyzer/prometheus/Manifest b/net-analyzer/prometheus/Manifest
19 index 3ce346c0e6b..2622b5e8141 100644
20 --- a/net-analyzer/prometheus/Manifest
21 +++ b/net-analyzer/prometheus/Manifest
22 @@ -1,2 +1,3 @@
23 DIST prometheus-1.7.1.tar.gz 5122747 SHA256 209832310f5bef99faef3beaaa95263612a4d0126ca512c4a4c23a8543d3ccf5 SHA512 98a42e95978477530082d7549c29f17b133043d7c233ba3c90b183f06a3f24ee578f8fed75cba476d3c93a22abcccfdbccc94488beb8450a02f260d24165ba26 WHIRLPOOL 8ab473430752336e09b4a0c38fd1117abe21196478d7f2f7e813c27f07c950cc3525d9e9ba32309711c73a1032f3cff27ddc1582d0c4b6c66fe82d5b58675550
24 DIST prometheus-2.0.0_beta0.tar.gz 5475399 SHA256 7463ff35335ff7fee05018234aa1d100ef78e10f8c549e23675a7552b0429f77 SHA512 f9da91cbe4e7d5510088e09c8457b08bcfe6a4e0ef781e33a848bbd78045f46042e9a55c4329b71dec4cb11143566de2d077fa34361da3eb66af19f8261baab8 WHIRLPOOL 854010b6d9c86688311c992f644cb51c3b0d50523702fc4d82814f92400a141e9557fe367e47aafd2ae2628a73b6533627fab49b1a7f69bbe36081e2c8193f0e
25 +DIST prometheus-2.0.0_beta1.tar.gz 5521455 SHA256 25eee3f884ddb577f308d174c8eaf31718602afcffc1aef4c574fa9fe54687e6 SHA512 12b2e0ea0279526fd87c915b8ca2bdc2f29bd6041a7c6ad66bc3a7832e914275ba9bfa9d48db54e86dde3c0c1d347a7051fa92fcf33cfebe5b03f200845ef0d1 WHIRLPOOL ba5ff82e8b578c4b94ca539075c834138d2f2af6bea50c45861ea9ff3e592e4cbb32bb3e1ef9c0a3e9ff4e27c4e3025c22b3feb5cc93c33cbd6b8a17803da465
26
27 diff --git a/net-analyzer/prometheus/files/prometheus-2.initd b/net-analyzer/prometheus/files/prometheus-2.initd
28 new file mode 100644
29 index 00000000000..04f22f10fda
30 --- /dev/null
31 +++ b/net-analyzer/prometheus/files/prometheus-2.initd
32 @@ -0,0 +1,24 @@
33 +#!/sbin/openrc-run
34 +# Copyright 2016-2017 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +description="Prometheus monitoring system and time series database"
38 +pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
39 +user=${user:-${SVCNAME}}
40 +group=${group:-${SVCNAME}}
41 +
42 +command="/usr/bin/prometheus"
43 +command_args="${command_args:---config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data}"
44 +command_background="true"
45 +start_stop_daemon_args="--user ${user} --group ${group} \
46 + --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
47 + --stderr /var/log/${SVCNAME}/${SVCNAME}.log"
48 +
49 +depend() {
50 + need net
51 + after net
52 +}
53 +
54 +start_pre() {
55 + checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
56 +}
57
58 diff --git a/net-analyzer/prometheus/files/prometheus.confd b/net-analyzer/prometheus/files/prometheus.confd
59 index 95de2eccf09..93b41b31624 100644
60 --- a/net-analyzer/prometheus/files/prometheus.confd
61 +++ b/net-analyzer/prometheus/files/prometheus.confd
62 @@ -1,2 +1,2 @@
63 -# arguments for docker-registry
64 -command_args="-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/var/lib/prometheus/data"
65 +# arguments for Prometheus
66 +command_args=""
67
68 diff --git a/net-analyzer/prometheus/prometheus-2.0.0_beta1.ebuild b/net-analyzer/prometheus/prometheus-2.0.0_beta1.ebuild
69 new file mode 100644
70 index 00000000000..24e83e245bc
71 --- /dev/null
72 +++ b/net-analyzer/prometheus/prometheus-2.0.0_beta1.ebuild
73 @@ -0,0 +1,67 @@
74 +# Copyright 1999-2017 Gentoo Foundation
75 +# Distributed under the terms of the GNU General Public License v2
76 +
77 +EAPI=6
78 +inherit user golang-build golang-vcs-snapshot
79 +
80 +EGO_PN="github.com/prometheus/prometheus"
81 +MY_PV=${PV/_beta/-beta.}
82 +EGIT_COMMIT="v${MY_PV}"
83 +PROMETHEUS_COMMIT="4dcb465"
84 +ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
85 +KEYWORDS="~amd64"
86 +
87 +DESCRIPTION="Prometheus monitoring system and time series database"
88 +HOMEPAGE="https://github.com/prometheus/prometheus"
89 +SRC_URI="${ARCHIVE_URI}"
90 +LICENSE="Apache-2.0"
91 +SLOT="0"
92 +IUSE=""
93 +
94 +DEPEND="dev-util/promu"
95 +
96 +PROMETHEUS_HOME="/var/lib/prometheus"
97 +
98 +RESTRICT="test"
99 +
100 +pkg_setup() {
101 + enewgroup prometheus
102 + enewuser prometheus -1 -1 "${PROMETHEUS_HOME}" prometheus
103 +}
104 +
105 +src_prepare() {
106 + default
107 + sed -i -e "s/{{.Revision}}/${PROMETHEUS_COMMIT}/" src/${EGO_PN}/.promu.yml || die
108 +}
109 +
110 +src_compile() {
111 + pushd src/${EGO_PN} || die
112 + GOPATH="${S}" promu build -v || die
113 + popd || die
114 +}
115 +
116 +src_install() {
117 + pushd src/${EGO_PN} || die
118 + dobin promtool prometheus
119 + dodoc -r {documentation,{README,CHANGELOG,CONTRIBUTING}.md}
120 + insinto /etc/prometheus
121 + doins documentation/examples/prometheus.yml
122 + insinto /usr/share/prometheus
123 + doins -r console_libraries consoles
124 + dosym ../../usr/share/prometheus/console_libraries /etc/prometheus/console_libraries
125 + dosym ../../usr/share/prometheus/consoles /etc/prometheus/consoles
126 + popd || die
127 +
128 + newinitd "${FILESDIR}"/prometheus-2.initd prometheus
129 + newconfd "${FILESDIR}"/prometheus.confd prometheus
130 + keepdir /var/log/prometheus /var/lib/prometheus
131 + fowners prometheus:prometheus /var/log/prometheus /var/lib/prometheus
132 +}
133 +
134 +pkg_postinst() {
135 + if has_version '<net-analyzer/prometheus-2.0.0_beta1'; then
136 + ewarn "Old prometheus 1.x TSDB won't be converted to the new prometheus 2.0 format"
137 + ewarn "Be aware that the old data currently cannot be accessed with prometheus 2.0"
138 + ewarn "It's generally advised to start with a clean storage directory"
139 + fi
140 +}