commit:     4c752843f78af5bd77ac243704b5b63140a92dff
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 12 20:21:21 2018 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Apr 12 20:21:21 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c752843

app-metrics/postgres_exporter: Initial version

Package-Manager: Portage-2.3.28, Repoman-2.3.9

 app-metrics/postgres_exporter/Manifest             |  1 +
 .../files/postgres_exporter.confd                  |  2 ++
 .../files/postgres_exporter.initd                  | 19 ++++++++++
 app-metrics/postgres_exporter/metadata.xml         | 11 ++++++
 .../postgres_exporter-0.4.5.ebuild                 | 40 ++++++++++++++++++++++
 5 files changed, 73 insertions(+)

diff --git a/app-metrics/postgres_exporter/Manifest 
b/app-metrics/postgres_exporter/Manifest
new file mode 100644
index 00000000000..7856a09f86a
--- /dev/null
+++ b/app-metrics/postgres_exporter/Manifest
@@ -0,0 +1 @@
+DIST postgres_exporter-0.4.5.tar.gz 3698713 BLAKE2B 
fd15605d59f2f78ad380b24018dc7d9d789af58be248d0b0492a720a368ca1802719467091f9e4cd9aec57318ed5948d1e725bff63fcd47a13447b64d71da7ca
 SHA512 
82da737389ab0abcc336cb9bd32b4af8165e101c1b09543847d1cbf93a1465fe537985b9b24b5518898b81e3614d6986389a99e38c82f613525983543ec99cb4

diff --git a/app-metrics/postgres_exporter/files/postgres_exporter.confd 
b/app-metrics/postgres_exporter/files/postgres_exporter.confd
new file mode 100644
index 00000000000..88fa9e35088
--- /dev/null
+++ b/app-metrics/postgres_exporter/files/postgres_exporter.confd
@@ -0,0 +1,2 @@
+# arguments for prometheus postgres exporter
+command_args=""

diff --git a/app-metrics/postgres_exporter/files/postgres_exporter.initd 
b/app-metrics/postgres_exporter/files/postgres_exporter.initd
new file mode 100644
index 00000000000..83bff202951
--- /dev/null
+++ b/app-metrics/postgres_exporter/files/postgres_exporter.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 2016-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Prometheus PostgreSQL exporter"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/postgres_exporter"
+command_args="${command_args:-}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+       --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
+       --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
+
+depend() {
+       after net
+}

diff --git a/app-metrics/postgres_exporter/metadata.xml 
b/app-metrics/postgres_exporter/metadata.xml
new file mode 100644
index 00000000000..201fed5c729
--- /dev/null
+++ b/app-metrics/postgres_exporter/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>mr...@gentoo.org</email>
+               <name>Manuel Rüger</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">wrouesnel/postgres_exporter</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/app-metrics/postgres_exporter/postgres_exporter-0.4.5.ebuild 
b/app-metrics/postgres_exporter/postgres_exporter-0.4.5.ebuild
new file mode 100644
index 00000000000..8aa5a0f5e8d
--- /dev/null
+++ b/app-metrics/postgres_exporter/postgres_exporter-0.4.5.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="github.com/wrouesnel/postgres_exporter"
+ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="PostgreSQL stats exporter for Prometheus"
+HOMEPAGE="https://github.com/wrouesnel/postgres_exporter";
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+RESTRICT="test"
+
+pkg_setup() {
+       enewgroup ${PN}
+       enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_compile() {
+       pushd src/${EGO_PN} || die
+       VERSION_SHORT="${PV}" VERSION="${PV}" GOPATH="${S}" go run mage.go 
binary || die
+       popd || die
+}
+
+src_install() {
+       pushd src/${EGO_PN} || die
+       dobin ${PN}
+       dodoc README.md queries.yaml
+       popd || die
+       keepdir /var/log/${PN}
+       fowners ${PN}:${PN} /var/log/${PN}
+       newinitd "${FILESDIR}"/${PN}.initd ${PN}
+       newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}

Reply via email to