commit:     2f538c275cc9670a15d2c03070cfe9b5e491115b
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 13 19:33:08 2016 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 12:51:20 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f538c27

net-analyzer/prometheus: Initial version

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 net-analyzer/prometheus/Manifest                   |  1 +
 net-analyzer/prometheus/files/prometheus.confd     |  2 +
 net-analyzer/prometheus/files/prometheus.initd     | 25 ++++++++++
 net-analyzer/prometheus/metadata.xml               | 13 +++++
 .../prometheus/prometheus-1.4.1_p20161213.ebuild   | 56 ++++++++++++++++++++++
 5 files changed, 97 insertions(+)

diff --git a/net-analyzer/prometheus/Manifest b/net-analyzer/prometheus/Manifest
new file mode 100644
index 00000000..136c37f
--- /dev/null
+++ b/net-analyzer/prometheus/Manifest
@@ -0,0 +1 @@
+DIST prometheus-1.4.1_p20161213.tar.gz 5151828 SHA256 
23dde2d12004f596fa6a7292ef12f111d00cd3164eb12296c5d43a242c692fc5 SHA512 
a24405a31e0e312331e05ee91b797039141ca6d5e2a9adfb508592432f18a2ff8a2357e40de5d66c5d0e52ba81d71e325c8f90ba0c0674b32f2254212d3b3e9f
 WHIRLPOOL 
0c1fa151c7d373ff63d6e374e1f67e9b71dc4f15053d5993a9a1231d31e751592029fd4d74077cbe4a7955dd19e71411fa25b09a4490e7925668303e40e6f291

diff --git a/net-analyzer/prometheus/files/prometheus.confd 
b/net-analyzer/prometheus/files/prometheus.confd
new file mode 100644
index 00000000..95de2ec
--- /dev/null
+++ b/net-analyzer/prometheus/files/prometheus.confd
@@ -0,0 +1,2 @@
+# arguments for docker-registry
+command_args="-config.file=/etc/prometheus/prometheus.yml 
-storage.local.path=/var/lib/prometheus/data"

diff --git a/net-analyzer/prometheus/files/prometheus.initd 
b/net-analyzer/prometheus/files/prometheus.initd
new file mode 100644
index 00000000..b024f3b
--- /dev/null
+++ b/net-analyzer/prometheus/files/prometheus.initd
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Prometheus monitoring system and time series database"
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
+user=${user:-${SVCNAME}}
+group=${group:-${SVCNAME}}
+
+command="/usr/bin/prometheus"
+command_args="${command_args:-config.file=/etc/prometheus/prometheus.yml 
-storage.local.path=/var/lib/prometheus/data}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+       --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
+       --stderr /var/log/${SVCNAME}/${SVCNAME}.log"
+
+depend() {
+       need net
+       after net
+}
+
+start_pre() {
+       checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
+}

diff --git a/net-analyzer/prometheus/metadata.xml 
b/net-analyzer/prometheus/metadata.xml
new file mode 100644
index 00000000..2a1986a
--- /dev/null
+++ b/net-analyzer/prometheus/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <longdescription>
+       </longdescription>
+       <maintainer type="person">
+               <email>mr...@gentoo.org</email>
+               <name>Manuel Rüger</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">prometheus/prometheus</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/net-analyzer/prometheus/prometheus-1.4.1_p20161213.ebuild 
b/net-analyzer/prometheus/prometheus-1.4.1_p20161213.ebuild
new file mode 100644
index 00000000..47edcf4
--- /dev/null
+++ b/net-analyzer/prometheus/prometheus-1.4.1_p20161213.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="github.com/prometheus/prometheus/..."
+EGIT_COMMIT="253be23c00eba5592e1673845a38f4fd08efff83"
+ARCHIVE_URI="https://${EGO_PN%/*}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Prometheus monitoring system and time series database"
+HOMEPAGE="https://github.com/prometheus/prometheus";
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-util/promu"
+
+PROMETHEUS_HOME="/var/lib/prometheus"
+
+pkg_setup() {
+       enewgroup prometheus
+       enewuser prometheus -1 -1 "${PROMETHEUS_HOME}" prometheus
+}
+
+src_prepare() {
+       default
+       sed -i -e "s/{{.Revision}}/${EGIT_COMMIT:0:7}/" 
src/${EGO_PN%/*}/.promu.yml || die
+}
+
+src_compile() {
+       pushd src/${EGO_PN%/*} || die
+       GOPATH="${S}" promu build -v --prefix ${PWD} || die
+       popd || die
+}
+
+src_install() {
+       pushd src/${EGO_PN%/*} || die
+       dobin promtool prometheus
+       dodoc -r {documentation,{README,CHANGELOG,CONTRIBUTING}.md}
+       insinto /etc/prometheus
+       doins documentation/examples/prometheus.yml
+       insinto /usr/share/prometheus
+       doins -r console_libraries consoles
+       dosym ../../usr/share/prometheus/console_libraries 
/etc/prometheus/console_libraries
+       dosym ../../usr/share/prometheus/consoles /etc/prometheus/consoles
+       popd || die
+
+       newinitd "${FILESDIR}"/prometheus.initd prometheus
+       newconfd "${FILESDIR}"/prometheus.confd prometheus
+       keepdir /var/log/prometheus /var/lib/prometheus
+       fowners prometheus:prometheus /var/log/prometheus /var/lib/prometheus
+}

Reply via email to