diff options
Diffstat (limited to 'app-misc/carbon-c-relay')
-rw-r--r-- | app-misc/carbon-c-relay/Manifest | 2 | ||||
-rw-r--r-- | app-misc/carbon-c-relay/carbon-c-relay-3.1.ebuild (renamed from app-misc/carbon-c-relay/carbon-c-relay-2.6.ebuild) | 17 | ||||
-rw-r--r-- | app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 | 18 | ||||
-rw-r--r-- | app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 | 70 |
4 files changed, 96 insertions, 11 deletions
diff --git a/app-misc/carbon-c-relay/Manifest b/app-misc/carbon-c-relay/Manifest index e6ee5a0930e6..f99336178c85 100644 --- a/app-misc/carbon-c-relay/Manifest +++ b/app-misc/carbon-c-relay/Manifest @@ -1,3 +1,3 @@ DIST carbon-c-relay-2.5.tar.gz 102119 SHA256 6d3c538aacd08e9798e294d56b98854fdafe1b3a1d0d8118a406a2d8fe6aad5b SHA512 0b3b04003cda761816ea4bbe9d441366438c8507702f157504b21b66c9ef9b1e135239e6627d3dd3d371c023d71f2cd97ba45bc2ff6296a4998e06bdda219ea3 WHIRLPOOL dc73f9e001217ebbc84bc603fe94bdbf34a8039c65f3d1612c31a2e5de0fe8cb6a5c9db5bb7e79681daf567033b5ee2534a844f9e6d3315ca50f2ab0f1d5befa -DIST carbon-c-relay-2.6.tar.gz 103576 SHA256 580ec4629ab63288ba73259a8b98300d649e253ac940c0343e009ed5c454053f SHA512 652cde8b70118af43d90f053cfc54d458abcacbe63a8f1fffe97df76d3ce956c6903132bc39a6d0bda10406e929bcaed49f8c6285e4de7b4c047b5420b7ec446 WHIRLPOOL faf2d936acfb7a7eddb9fcf50d62ad32560bbca7e998dd327c5473a38faaba5c55713d2c3c243f121a790a5dd001169e38bffc9be8c25a1c292082c3bf176b8b DIST carbon-c-relay-3.0.tar.gz 153479 SHA256 5ae673ed0091a814bc8d6081ff14cfbbda7582fa0c8ccf1a5cf438ba84c2b585 SHA512 046dd19be1791eaf2b50bd7029f0bbe8ad0805113faf9a80b37571c42d76c0f7661a9273876de8cd5bf1d13fdc8133a8eaf9def28dd8077bf667225726797fdc WHIRLPOOL f349475179f762a226c87c87fe12e5b43be4fbff36ed12292c5461e65cbf1a814108daa4e0bd6946b077c230656372e6190fc657136cf6e4fa541e4636dc9b8d +DIST carbon-c-relay-3.1.tar.gz 271011 SHA256 d21203a63fefa7c226f8170da204832d8e519001004f0f6fb44546c5eb147389 SHA512 8c8062e4fa9ec22281b1848923dc73b39c4617b0c6297f57f69080a7aedf07ef8d5c6e0bebbd5ef0faf3a1255ab155475bc40aeee582838d604da1cc2e43ca4e WHIRLPOOL bdc4d238398ac6b981e432bef3c1f4c9d181d1540a0af1e573bb6e8bb0a42deb0e4b504b6b727019e4667aa8188d476e261e0bdbe5b469345f7b17a39b966b6c diff --git a/app-misc/carbon-c-relay/carbon-c-relay-2.6.ebuild b/app-misc/carbon-c-relay/carbon-c-relay-3.1.ebuild index 963456421ce6..c017ee525eb4 100644 --- a/app-misc/carbon-c-relay/carbon-c-relay-2.6.ebuild +++ b/app-misc/carbon-c-relay/carbon-c-relay-3.1.ebuild @@ -3,11 +3,11 @@ EAPI=6 -inherit toolchain-funcs user +inherit user 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/archive/v${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI="https://github.com/grobian/carbon-c-relay/releases/download/v${PV}/${P}.tar.gz" LICENSE="Apache-2.0" SLOT="0" @@ -22,15 +22,12 @@ pkg_preinst() { enewuser carbon -1 -1 -1 carbon } -src_configure() { - tc-export CC -} - src_install() { - newbin relay ${PN} + default + # rename too generic name + mv "${ED}"/usr/bin/{relay,${PN}} || die dodoc ChangeLog.md - doman ${PN}.1 - newinitd "${FILESDIR}"/${PN}.initd ${PN} - newconfd "${FILESDIR}"/${PN}.confd ${PN} + newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN} + newconfd "${FILESDIR}"/${PN}.confd-r1 ${PN} } diff --git a/app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 b/app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 new file mode 100644 index 000000000000..64e4ab5c832e --- /dev/null +++ b/app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 @@ -0,0 +1,18 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# routing file to read +#ROUTES_FILE=/etc/carbon-c-relay.conf + +# where to store the PID-file +#PIDFILE=/run/carbon-c-relay.pid + +# where to store the logfile +#LOGFILE=/var/log/carbon-c-relay.log + +# user and group to run carbon-c-relay as +#USER=carbon +#GROUP=carbon + +# any options to use when starting the relay +#EXTRA_OPTS= diff --git a/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 b/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 new file mode 100644 index 000000000000..104a7e0878e9 --- /dev/null +++ b/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 @@ -0,0 +1,70 @@ +#!/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=${PIDFILE:-/run/${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}" + chown ${user}:${group} "${logfile}" +} + +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}" + start-stop-daemon --stop --exec ${command} --pidfile "${pidfile}" + eend $? +} + +reload() { + configtest || return 1 + ebegin "Refreshing ${SVCNAME}'s configuration" + kill -HUP $(< "${pidfile}") &>/dev/null + 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" +} |