1 |
commit: 7642d0254415e907b5a4098133a1870b6301781e |
2 |
Author: William Hubbs <william.hubbs <AT> sony <DOT> com> |
3 |
AuthorDate: Mon Jan 27 22:34:52 2020 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 27 22:39:47 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7642d025 |
7 |
|
8 |
app-metrics/prometheus-bin: new package, binary version of prometheus |
9 |
|
10 |
This is needed because prometheus now includes nodejs and the build |
11 |
system uses yarn. |
12 |
|
13 |
Signed-off-by: William Hubbs <williamh <AT> gentoo.org> |
14 |
|
15 |
app-metrics/prometheus-bin/Manifest | 1 + |
16 |
app-metrics/prometheus-bin/files/prometheus.confd | 2 + |
17 |
app-metrics/prometheus-bin/files/prometheus.initd | 34 +++++++++++++++ |
18 |
app-metrics/prometheus-bin/metadata.xml | 8 ++++ |
19 |
.../prometheus-bin/prometheus-bin-2.15.2.ebuild | 48 ++++++++++++++++++++++ |
20 |
app-metrics/prometheus/prometheus-2.13.1.ebuild | 1 + |
21 |
6 files changed, 94 insertions(+) |
22 |
|
23 |
diff --git a/app-metrics/prometheus-bin/Manifest b/app-metrics/prometheus-bin/Manifest |
24 |
new file mode 100644 |
25 |
index 00000000000..3c1cd89217c |
26 |
--- /dev/null |
27 |
+++ b/app-metrics/prometheus-bin/Manifest |
28 |
@@ -0,0 +1 @@ |
29 |
+DIST prometheus-2.15.2.linux-amd64.tar.gz 59204993 BLAKE2B 700d61063cddea02ca4445257b11b782c3b6fc84ed3d48f8d196c5602819f0d44b218d15b870281293bf0661929b02930b937e66fec34918b81cd3d010a6fa21 SHA512 a3b95fe6101d5587329d84adb18c0c261babe5a909e62ab1a39f42df28c058d311b0b2ea9ecbdad9227789ed83c0fae4a12776348999cda3a70cdc457f6d3611 |
30 |
|
31 |
diff --git a/app-metrics/prometheus-bin/files/prometheus.confd b/app-metrics/prometheus-bin/files/prometheus.confd |
32 |
new file mode 100644 |
33 |
index 00000000000..93b41b31624 |
34 |
--- /dev/null |
35 |
+++ b/app-metrics/prometheus-bin/files/prometheus.confd |
36 |
@@ -0,0 +1,2 @@ |
37 |
+# arguments for Prometheus |
38 |
+command_args="" |
39 |
|
40 |
diff --git a/app-metrics/prometheus-bin/files/prometheus.initd b/app-metrics/prometheus-bin/files/prometheus.initd |
41 |
new file mode 100644 |
42 |
index 00000000000..f7371f8ca06 |
43 |
--- /dev/null |
44 |
+++ b/app-metrics/prometheus-bin/files/prometheus.initd |
45 |
@@ -0,0 +1,34 @@ |
46 |
+#!/sbin/openrc-run |
47 |
+# Copyright 2016-2019 Gentoo Authors |
48 |
+# Distributed under the terms of the GNU General Public License v2 |
49 |
+ |
50 |
+description="Prometheus monitoring system and time series database" |
51 |
+pidfile=/var/run/${RC_SVCNAME}.pid |
52 |
+user=${user:-${RC_SVCNAME}} |
53 |
+group=${group:-${RC_SVCNAME}} |
54 |
+command_user=${user}:${group} |
55 |
+ |
56 |
+command="/usr/bin/prometheus" |
57 |
+command_args="${command_args:---config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data}" |
58 |
+command_background="true" |
59 |
+error_log=/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log |
60 |
+output_log=/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log |
61 |
+ |
62 |
+extra_started_commands="reload" |
63 |
+ |
64 |
+depend() { |
65 |
+ after net |
66 |
+} |
67 |
+ |
68 |
+reload() { |
69 |
+ ebegin "Reloading configuration for ${RC_SVCNAME}" |
70 |
+ case "$supervisor" in |
71 |
+ supervise-daemon) |
72 |
+ supervise-daemon ${RC_SVCNAME} --signal HUP |
73 |
+ ;; |
74 |
+ *) |
75 |
+ start-stop-daemon --signal HUP --pidfile "${pidfile}" |
76 |
+ ;; |
77 |
+ esac |
78 |
+ eend $? "Failed to reload ${RC_SVCNAME}" |
79 |
+} |
80 |
|
81 |
diff --git a/app-metrics/prometheus-bin/metadata.xml b/app-metrics/prometheus-bin/metadata.xml |
82 |
new file mode 100644 |
83 |
index 00000000000..c36c37139fa |
84 |
--- /dev/null |
85 |
+++ b/app-metrics/prometheus-bin/metadata.xml |
86 |
@@ -0,0 +1,8 @@ |
87 |
+<?xml version="1.0" encoding="UTF-8"?> |
88 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
89 |
+<pkgmetadata> |
90 |
+ <maintainer type="person"> |
91 |
+ <email>williamh@g.o</email> |
92 |
+ <name>William Hubbs</name> |
93 |
+ </maintainer> |
94 |
+</pkgmetadata> |
95 |
|
96 |
diff --git a/app-metrics/prometheus-bin/prometheus-bin-2.15.2.ebuild b/app-metrics/prometheus-bin/prometheus-bin-2.15.2.ebuild |
97 |
new file mode 100644 |
98 |
index 00000000000..89e508d0cf5 |
99 |
--- /dev/null |
100 |
+++ b/app-metrics/prometheus-bin/prometheus-bin-2.15.2.ebuild |
101 |
@@ -0,0 +1,48 @@ |
102 |
+# Copyright 2020 Gentoo Authors |
103 |
+# Distributed under the terms of the GNU General Public License v2 |
104 |
+ |
105 |
+EAPI=7 |
106 |
+ |
107 |
+DESCRIPTION="prometheus monitoring system and time series database" |
108 |
+HOMEPAGE="http://prometheus.io" |
109 |
+MY_PN=${PN%%-bin} |
110 |
+MY_P=${MY_PN}-${PV} |
111 |
+SRC_URI="https://github.com/prometheus/prometheus/releases/download/v${PV}/${MY_P}.linux-amd64.tar.gz" |
112 |
+ |
113 |
+LICENSE="Apache-2.0" |
114 |
+SLOT="0" |
115 |
+KEYWORDS="~amd64" |
116 |
+ |
117 |
+QA_PREBUILT=".*" |
118 |
+RESTRICT="strip" |
119 |
+ |
120 |
+DEPEND="acct-group/prometheus |
121 |
+ acct-user/prometheus |
122 |
+ !app-metrics/prometheus" |
123 |
+RDEPEND="${DEPEND}" |
124 |
+ |
125 |
+S="${WORKDIR}/${MY_P}.linux-amd64" |
126 |
+ |
127 |
+src_install() { |
128 |
+ dobin prometheus promtool tsdb |
129 |
+ insinto /usr/share/prometheus |
130 |
+ doins -r console_libraries consoles |
131 |
+ insinto /etc/prometheus |
132 |
+ doins prometheus.yml |
133 |
+ dosym ../../usr/share/prometheus/console_libraries /etc/prometheus/console_libraries |
134 |
+ dosym ../../usr/share/prometheus/consoles /etc/prometheus/consoles |
135 |
+ |
136 |
+ newinitd "${FILESDIR}"/prometheus.initd prometheus |
137 |
+ newconfd "${FILESDIR}"/prometheus.confd prometheus |
138 |
+ keepdir /var/log/prometheus /var/lib/prometheus |
139 |
+ fowners prometheus:prometheus /var/log/prometheus /var/lib/prometheus |
140 |
+} |
141 |
+ |
142 |
+pkg_postinst() { |
143 |
+ if has_version '<net-analyzer/prometheus-2.0.0_rc0'; then |
144 |
+ ewarn "Old prometheus 1.x TSDB won't be converted to the new prometheus 2.0 format" |
145 |
+ ewarn "Be aware that the old data currently cannot be accessed with prometheus 2.0" |
146 |
+ ewarn "This release requires a clean storage directory and is not compatible with" |
147 |
+ ewarn "files created by previous beta releases" |
148 |
+ fi |
149 |
+} |
150 |
|
151 |
diff --git a/app-metrics/prometheus/prometheus-2.13.1.ebuild b/app-metrics/prometheus/prometheus-2.13.1.ebuild |
152 |
index d9614ddc2a6..35f3c3c87b5 100644 |
153 |
--- a/app-metrics/prometheus/prometheus-2.13.1.ebuild |
154 |
+++ b/app-metrics/prometheus/prometheus-2.13.1.ebuild |
155 |
@@ -17,6 +17,7 @@ SLOT="0" |
156 |
IUSE="" |
157 |
|
158 |
DEPEND=" |
159 |
+ !app-metrics/prometheus-bin |
160 |
>=dev-lang/go-1.12 |
161 |
>=dev-util/promu-0.3.0" |