summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-metrics/go-carbon/Manifest1
-rw-r--r--app-metrics/go-carbon/files/go-carbon.confd8
-rw-r--r--app-metrics/go-carbon/files/go-carbon.initd44
-rw-r--r--app-metrics/go-carbon/go-carbon-0.17.1.ebuild28
-rw-r--r--app-metrics/go-carbon/metadata.xml11
5 files changed, 92 insertions, 0 deletions
diff --git a/app-metrics/go-carbon/Manifest b/app-metrics/go-carbon/Manifest
new file mode 100644
index 000000000000..db8bef38af66
--- /dev/null
+++ b/app-metrics/go-carbon/Manifest
@@ -0,0 +1 @@
+DIST go-carbon-0.17.1.tar.gz 5074817 BLAKE2B 59b708ee2eeea486e3f4612efbe94e0592f920de3a194f7d89b4c92df88c65027373871a1503f9ce1027bc1695f19d86503de6da4789b7277780a08871f1c893 SHA512 d18e5768fa8942d3ad8039f2c8304797c488d892aae2d3bca64e2659d7bd432e9c8db14dae22eae86be9e6217b0ea567e2f40b4395c7123a7871f75afed82fc0
diff --git a/app-metrics/go-carbon/files/go-carbon.confd b/app-metrics/go-carbon/files/go-carbon.confd
new file mode 100644
index 000000000000..41e5838dd249
--- /dev/null
+++ b/app-metrics/go-carbon/files/go-carbon.confd
@@ -0,0 +1,8 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+#CONFIG_FILE=/etc/go-carbon/go-carbon.conf
+
+# user and group to run go-carbon as
+#USER=carbon
+#GROUP=carbon
diff --git a/app-metrics/go-carbon/files/go-carbon.initd b/app-metrics/go-carbon/files/go-carbon.initd
new file mode 100644
index 000000000000..b45a1a5a5d17
--- /dev/null
+++ b/app-metrics/go-carbon/files/go-carbon.initd
@@ -0,0 +1,44 @@
+#!/sbin/openrc-run
+# Copyright 1999-2023 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Graphite whisper metrics storage and retrieval server."
+
+carbonapi_config=${CONFIG_FILE:-/etc/go-carbon/${SVCNAME}.conf}
+
+command="/usr/bin/go-carbon"
+command_args="-config ${carbonapi_config}"
+pidfile="/run/go-carbon/${SVCNAME}.pid"
+user=${USER:-carbon}
+group=${GROUP:-carbon}
+
+depend() {
+ need net
+ use dns
+}
+
+start_pre() {
+ mkdir -p "${pidfile%/*}"
+ mkdir -p /var/log/go-carbon
+ chown ${user}:${group} "${pidfile%/*}" /var/log/go-carbon
+}
+
+stop_post() {
+ rm -f "${pidfile}"
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --pidfile "${pidfile}" \
+ --make-pidfile --background \
+ --user ${user} --group ${group} \
+ --exec ${command} -- \
+ ${command_args}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec ${command} --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/app-metrics/go-carbon/go-carbon-0.17.1.ebuild b/app-metrics/go-carbon/go-carbon-0.17.1.ebuild
new file mode 100644
index 000000000000..5b808efaa023
--- /dev/null
+++ b/app-metrics/go-carbon/go-carbon-0.17.1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit go-module
+
+DESCRIPTION="Golang implementation of Graphite/Carbon server"
+HOMEPAGE="https://github.com/go-graphite/go-carbon"
+SRC_URI="https://github.com/go-graphite/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ acct-group/carbon
+ acct-user/carbon"
+BDEPEND=""
+
+src_install() {
+ insinto /etc/go-carbon
+ doins "${S}"/go-carbon.conf.example
+ dobin go-carbon
+
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}
diff --git a/app-metrics/go-carbon/metadata.xml b/app-metrics/go-carbon/metadata.xml
new file mode 100644
index 000000000000..2a184bd0de98
--- /dev/null
+++ b/app-metrics/go-carbon/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grobian@gentoo.org</email>
+ <name>Fabian Groffen</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">go-graphite/go-carbon</remote-id>
+ </upstream>
+</pkgmetadata>