summaryrefslogtreecommitdiff
path: root/app-misc/carbon-c-relay
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-18 23:20:40 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-18 23:20:40 +0100
commitf39c6dab71f5188f95650d367ece1df4f263e474 (patch)
tree9c30c203b3f09174814c41e6a63aa3522c7b7610 /app-misc/carbon-c-relay
parent1b295861f983d29f9bd5d5906c7ca3cee4cf1f9a (diff)
gentoo auto-resync : 18:09:2022 - 23:20:40
Diffstat (limited to 'app-misc/carbon-c-relay')
-rw-r--r--app-misc/carbon-c-relay/Manifest2
-rw-r--r--app-misc/carbon-c-relay/carbon-c-relay-3.7.4-r1.ebuild58
-rw-r--r--app-misc/carbon-c-relay/files/carbon-c-relay.initd-r274
3 files changed, 134 insertions, 0 deletions
diff --git a/app-misc/carbon-c-relay/Manifest b/app-misc/carbon-c-relay/Manifest
index 73a9cfa1cc6e..4c2f76ee642a 100644
--- a/app-misc/carbon-c-relay/Manifest
+++ b/app-misc/carbon-c-relay/Manifest
@@ -1,9 +1,11 @@
AUX carbon-c-relay.confd-r1 365 BLAKE2B 10a531055296877bb027f5dc6546b054da7e5b84950bbcf8de8d4af552e61fcd9bbebeea3bc432a25f14103c4f2f30db4885259f855182e6923b79649e63fb60 SHA512 a432cf28c86ec45c807eeb5a7b506e7dcc6155c138aea5dc60eb8bcf5036ac0efc3a81fbc044af34dab5f05f250635892c5e706dfd69cc1087f0c283c3aa9393
AUX carbon-c-relay.initd-r1 1801 BLAKE2B 4627b6e0d9a44d5c544ccff0c33557c73dd971929fbb442be79f3913752f39b1d534d4e4e936ebe94ebd5883d56e3f04314b9033c0a5ef7a3cbe7e05e1aeeb42 SHA512 5cf3c424a8be6bb55a80b58ce590838fec8ed26f8f407e8561c1e3ea094e80ad4021d153b3d816ab6d4e6589494d9ce621fe14196e223ef3a092d0aa26a63399
+AUX carbon-c-relay.initd-r2 1805 BLAKE2B 4e45257b74319b06e3e4092d803ea967436dfedd3da10406dc398e9fe2a2fbd1cdc2020e47d1864209ed16adb8b4bfb77eabe41b304d9cc262da528e95935fbb SHA512 0842fa097c7a441907210b30ed1a75b9137d41f4c885f273d5d3b2eedd2403bb55bd7c443be10f8a4f3645d19ae1c466404a7b30c06d09810f7895fa64bb23f7
DIST carbon-c-relay-3.7.2.tar.gz 561080 BLAKE2B 55674699b2afcffa911954a52e3c51b92380c81083db0330e7e6eab495e72938b7761a8c7bc17ac65ea56db1c11f4c360bab3b7442ca13f3466170d6bb3f6fd6 SHA512 dab2eaf2da07afd429012b93f0c826e2fe6e43371afa07d34793dd212820790af2487f5710524deac52c3ed18b874ce8ff54d90b3872e269dc570b7ad30c1826
DIST carbon-c-relay-3.7.3.tar.gz 575680 BLAKE2B d2d07c7f1ec356a16bb375bd740ffa018a0d256ef1ce97ae0555001411a05e28173c2009f3980b0d711977068392b5a0baca68f9dda3a677c7c3d245cad70a0e SHA512 ba3e4b7173abe5e3b018413a8d46d91c3f433e785dcf3d7643836b91f9a6ff993b22c3db51192476c75d45486d1e2541ad73056671b4bdbfd1447dcfc3f26ff3
DIST carbon-c-relay-3.7.4.tar.gz 584098 BLAKE2B 27fe6d7b785129aa6edd81e0a92880eee3530249900662e63f1ad7a9c1b4c8f9ff98635989311de964e4c42d4bb98f3ce1956ed170b8eceeea558ec3c191f45e SHA512 a9bcaa699e071e57e0a9092b97d1ead6781af4e00ef19f289a986c5baf56dec2c747961dfc2622285de034c17ce7ed2f5a7c856d617b26488dbdea58c4d72754
EBUILD carbon-c-relay-3.7.2-r1.ebuild 1567 BLAKE2B 13280b7bde34cd94b238fc0d95bdf78d5727c7535891a9b0382caeb4ced930dabcdef57a34de586b90b2c1c6b586e4120ebd2fbe7dbc4d53c34a4aceb46088e5 SHA512 73039e2207eb62431fc06ce0bd9216d8f0f337abe686d290ed3e3e84fb3130a45be437ca035d9fb35a4ac381ef1fef63d7e6eb409f735945631357e5e0ca2b95
EBUILD carbon-c-relay-3.7.3.ebuild 1567 BLAKE2B 13280b7bde34cd94b238fc0d95bdf78d5727c7535891a9b0382caeb4ced930dabcdef57a34de586b90b2c1c6b586e4120ebd2fbe7dbc4d53c34a4aceb46088e5 SHA512 73039e2207eb62431fc06ce0bd9216d8f0f337abe686d290ed3e3e84fb3130a45be437ca035d9fb35a4ac381ef1fef63d7e6eb409f735945631357e5e0ca2b95
+EBUILD carbon-c-relay-3.7.4-r1.ebuild 1574 BLAKE2B d262ce31744c36c7c290e7ea6af90e23623800f1138560997eb17c2b44ef00c926765cdb658545a556b0a974cfbf4190dd98d63a2de1267685eb1a543faf8129 SHA512 eac70773fdf5764b54026be4ff0cee01e8e968eadecf05b95a982547977651f8ca70c68a5906004d7bb8d67e2c7d129de7b283e5a26e8cf43910fc6007e6fe34
EBUILD carbon-c-relay-3.7.4.ebuild 1574 BLAKE2B b7329b23b4811211ca680ea46d4214a1426953531606042dfcfa81b0d24c9ddaa042de895909f2120f5f41464011c155ca5215220c063615d9a9045f4f64b730 SHA512 8897e50aaed1b72b4b5f8eaf0f0c53dcafbce81fecd3c6a3e642f225a6d1643b33f2578b2c9a5c3b7bae93e974001bb4d81766c37c6007447ecdb48e87aa3b9c
MISC metadata.xml 654 BLAKE2B 9cf6ce108100d80ba05644a782876997280ae4523b07366b3a88942fad4392fed358b134e8f33597fdc98540698531e3e7b0155e63194b4030de227f4a4c75e1 SHA512 954f00ed3ccde9cc651e9de24bcc2339deca58b2cc27f923801862fdc5298771ce5c0e729fa03c2d4d5b03624dbcbd3a17295b7e4e31fbb57221da861747d545
diff --git a/app-misc/carbon-c-relay/carbon-c-relay-3.7.4-r1.ebuild b/app-misc/carbon-c-relay/carbon-c-relay-3.7.4-r1.ebuild
new file mode 100644
index 000000000000..d34fed5a74de
--- /dev/null
+++ b/app-misc/carbon-c-relay/carbon-c-relay-3.7.4-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="Enhanced C version of Carbon relay, aggregator and rewriter"
+HOMEPAGE="https://github.com/grobian/carbon-c-relay"
+SRC_URI="https://github.com/grobian/carbon-c-relay/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x64-macos ~x64-solaris ~x86-solaris"
+IUSE="lz4 snappy zlib ssl pcre pcre2 +oniguruma"
+
+# ensure only one of pcre, pcre2 and oniguruma is set, or none (libc)
+# unforunately pcre is in global USE, so we have to exclude that here
+REQUIRED_USE="
+ pcre2? ( !oniguruma )
+ oniguruma? ( !pcre2 )
+"
+RDEPEND="lz4? ( app-arch/lz4 )
+ snappy? ( app-arch/snappy )
+ zlib? ( app-arch/gzip )
+ ssl? ( dev-libs/openssl:0= )
+ !oniguruma? ( !pcre2? ( pcre? ( dev-libs/libpcre ) ) )
+ pcre2? ( dev-libs/libpcre2 )
+ oniguruma? ( dev-libs/oniguruma )
+ acct-group/carbon
+ acct-user/carbon"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local pcrecfg
+ if use !pcre2 && use !oniguruma ; then
+ pcrecfg=$(use_with pcre)
+ else
+ pcrecfg="--without-pcre"
+ fi
+
+ econf $(use_with lz4) $(use_with snappy) \
+ $(use_with ssl) $(use_with zlib gzip) \
+ "${pcrecfg}" $(use_with pcre2) $(use_with oniguruma)
+}
+
+src_install() {
+ default
+
+ # rename too generic name
+ mv "${ED}"/usr/bin/{relay,${PN}} || die
+
+ # remove libfaketime, necessary for testing only
+ rm -f "${ED}"/usr/$(get_libdir)/libfaketime.*
+
+ dodoc ChangeLog.md
+
+ newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd-r1 ${PN}
+}
diff --git a/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r2 b/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r2
new file mode 100644
index 000000000000..fa0781dcddc8
--- /dev/null
+++ b/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r2
@@ -0,0 +1,74 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="configtest"
+extra_started_commands="reload"
+
+description="Lightweight graphite metrics router and aggregator."
+description_configtest="Run carbon-c-relay's internal config check."
+description_reload="Reload the carbon-c-relay configuration without losing connections."
+
+routes_config=${ROUTES_FILE:-/etc/${SVCNAME}.conf}
+
+command="/usr/bin/carbon-c-relay"
+command_args="-f ${routes_config} ${EXTRA_OPTS}"
+pidfile="/run/carbon-c-relay/${SVCNAME}.pid"
+logfile=${LOGFILE:-/var/log/${SVCNAME}.log}
+user=${USER:-carbon}
+group=${GROUP:-carbon}
+
+depend() {
+ need net
+ use dns
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ fi
+ touch "${logfile}"
+ mkdir -p "${pidfile%/*}"
+ chown ${user}:${group} "${logfile}" "${pidfile%/*}"
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_post() {
+ rm -f "${pidfile}"
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --pidfile "${pidfile}" \
+ --user ${user} --group ${group} \
+ --exec ${command} -- -D -P "${pidfile}" -l "${logfile}" \
+ ${command_args}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ # migration path
+ local pfile=${pidfile}
+ [ -e /run/carbon-c-relay.pid ] && pfile="/run/carbon-c-relay.pid"
+ start-stop-daemon --stop --exec ${command} --pidfile "${pfile}"
+ eend $?
+}
+
+reload() {
+ configtest || return 1
+ ebegin "Refreshing ${SVCNAME}'s configuration"
+ kill -HUP $(cat "${pidfile}") >/dev/null 2>&1
+ eend $? "Failed to reload ${SVCNAME}"
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME}'s configuration"
+ ${command} -f "${routes_config}" -t < /dev/null > /dev/null
+ eend $? "failed, please correct errors above"
+}