diff options
5 files changed, 94 insertions, 0 deletions
diff --git a/app-metrics/carbonapi-booking/Manifest b/app-metrics/carbonapi-booking/Manifest new file mode 100644 index 000000000000..b7df71a38195 --- /dev/null +++ b/app-metrics/carbonapi-booking/Manifest @@ -0,0 +1 @@ +DIST carbonapi-booking-0.3.0.tar.gz 1395080 BLAKE2B e5ebe20a4833f17919f0a14e091b06b5270d7dd8880fa87600454ac33b7df7600d1428f0b2e06c65a1a36796e2eb026e8c47b98444dce168cec0e965ebee9d69 SHA512 327af89fd86661ccca9d7250e70b66f03089841b20e3c51128bcbb835a91d553d952928d991424f9bbe1fea235cd9e6242784d8cbd828725ba5b2cfb64328487 diff --git a/app-metrics/carbonapi-booking/carbonapi-booking-0.3.0.ebuild b/app-metrics/carbonapi-booking/carbonapi-booking-0.3.0.ebuild new file mode 100644 index 000000000000..1e309c4d679b --- /dev/null +++ b/app-metrics/carbonapi-booking/carbonapi-booking-0.3.0.ebuild @@ -0,0 +1,31 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit go-module + +MY_PN=${PN%-booking} +DESCRIPTION="High-performance Graphite front-end, Booking.com fork" +HOMEPAGE="https://github.com/bookingcom/carbonapi" +SRC_URI="https://github.com/bookingcom/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +S="${WORKDIR}/${MY_PN}-${PV}" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND="" +RDEPEND="${DEPEND} + acct-group/carbon + acct-user/carbon" +BDEPEND="" + +src_install() { + insinto /etc/carbonapi + doins -r "${S}"/config/* + dobin carbonapi carbonzipper + + newinitd "${FILESDIR}"/${PN}.initd carbonapi + newconfd "${FILESDIR}"/${PN}.confd carbonapi +} diff --git a/app-metrics/carbonapi-booking/files/carbonapi-booking.confd b/app-metrics/carbonapi-booking/files/carbonapi-booking.confd new file mode 100644 index 000000000000..2f9ca1ba6bd5 --- /dev/null +++ b/app-metrics/carbonapi-booking/files/carbonapi-booking.confd @@ -0,0 +1,8 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +#CONFIG_FILE=/etc/carbonapi/carbonapi.yaml + +# user and group to run carbonapi as +#USER=carbon +#GROUP=carbon diff --git a/app-metrics/carbonapi-booking/files/carbonapi-booking.initd b/app-metrics/carbonapi-booking/files/carbonapi-booking.initd new file mode 100644 index 000000000000..c52069a77666 --- /dev/null +++ b/app-metrics/carbonapi-booking/files/carbonapi-booking.initd @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Graphite whisper metrics renderer." + +carbonapi_config=${CONFIG_FILE:-/etc/carbonapi/${SVCNAME}.yaml} + +command="/usr/bin/carbonapi" +command_args="-config ${carbonapi_config}" +pidfile="/run/carbonapi/${SVCNAME}.pid" +user=${USER:-carbon} +group=${GROUP:-carbon} + +depend() { + need net + use dns +} + +start_pre() { + mkdir -p "${pidfile%/*}" + chown ${user}:${group} "${pidfile%/*}" +} + +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/carbonapi-booking/metadata.xml b/app-metrics/carbonapi-booking/metadata.xml new file mode 100644 index 000000000000..054109ad0a1e --- /dev/null +++ b/app-metrics/carbonapi-booking/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">bookingcom/carbonapi</remote-id> + </upstream> +</pkgmetadata> |