From f505cbddd99e8674cc3463b8f78aaf2d86e356c2 Mon Sep 17 00:00:00 2001 From: pi Date: Wed, 21 Mar 2018 16:54:24 +0000 Subject: New port: net-mgmt/carbon-relay-ng carbon-relay-ng is a middleware that sit's between graphite capable metrics collectors and and carbon instances such as databases/go-carbon and databases/py-carbon. It can do sharding and replication to any carbon storage. WWW: https://github.com/graphite-ng/carbon-relay-ng PR: 226824 Submitted by: Andreas Andersson --- net-mgmt/Makefile | 1 + net-mgmt/carbon-relay-ng/Makefile | 39 ++++++++++++++++++++ net-mgmt/carbon-relay-ng/distinfo | 3 ++ net-mgmt/carbon-relay-ng/files/carbon-relay-ng.in | 43 ++++++++++++++++++++++ net-mgmt/carbon-relay-ng/files/patch-Makefile | 8 ++++ .../files/patch-examples_carbon-relay-ng.ini | 14 +++++++ net-mgmt/carbon-relay-ng/pkg-descr | 6 +++ net-mgmt/carbon-relay-ng/pkg-plist | 4 ++ 8 files changed, 118 insertions(+) create mode 100644 net-mgmt/carbon-relay-ng/Makefile create mode 100644 net-mgmt/carbon-relay-ng/distinfo create mode 100644 net-mgmt/carbon-relay-ng/files/carbon-relay-ng.in create mode 100644 net-mgmt/carbon-relay-ng/files/patch-Makefile create mode 100644 net-mgmt/carbon-relay-ng/files/patch-examples_carbon-relay-ng.ini create mode 100644 net-mgmt/carbon-relay-ng/pkg-descr create mode 100644 net-mgmt/carbon-relay-ng/pkg-plist (limited to 'net-mgmt') diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index ed35f49a482e..f63d24b9bf62 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -31,6 +31,7 @@ SUBDIR += cacti-spine SUBDIR += cacti88 SUBDIR += cacti88-spine + SUBDIR += carbon-relay-ng SUBDIR += carbonzipper SUBDIR += ccnet-client SUBDIR += ccnet-server diff --git a/net-mgmt/carbon-relay-ng/Makefile b/net-mgmt/carbon-relay-ng/Makefile new file mode 100644 index 000000000000..89e839ab418d --- /dev/null +++ b/net-mgmt/carbon-relay-ng/Makefile @@ -0,0 +1,39 @@ +# $FreeBSD$ + +PORTNAME= carbon-relay-ng +DISTVERSIONPREFIX= v +DISTVERSION= 0.9.4 +CATEGORIES= net-mgmt + +MAINTAINER= a.andersson.thn@gmail.com +COMMENT= Go implementation of carbonapi + +LICENSE= BSD2CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= go>=1.8:lang/go \ + go-bindata:devel/go-bindata + +USES= gmake + +USE_GITHUB= yes +GH_ACCOUNT= graphite-ng +GH_SUBDIR= src/github.com/${GH_ACCOUNT}/${PORTNAME} +USE_RC_SUBR= ${PORTNAME} + +USERS= carbon +GROUPS= carbon + +do-build: + @cd ${WRKSRC}/${GH_SUBDIR} && \ + ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} VERSION=${DISTVERSION} \ + ${MAKE_CMD} build + +do-install: + @${MKDIR} ${STAGEDIR}/${PREFIX}/etc/carbon-relay-ng + @${MKDIR} ${STAGEDIR}/var/run/carbon-relay-ng + @${MKDIR} ${STAGEDIR}/var/run/carbon-relay-ng/spool + ${INSTALL_PROGRAM} ${WRKSRC}/carbon-relay-ng ${STAGEDIR}${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/examples/carbon-relay-ng.ini ${STAGEDIR}${PREFIX}/etc/carbon-relay-ng/carbon-relay-ng.ini.sample + +.include diff --git a/net-mgmt/carbon-relay-ng/distinfo b/net-mgmt/carbon-relay-ng/distinfo new file mode 100644 index 000000000000..c02b23bb5f50 --- /dev/null +++ b/net-mgmt/carbon-relay-ng/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1521631625 +SHA256 (graphite-ng-carbon-relay-ng-v0.9.4_GH0.tar.gz) = 7097d77eb40397565571b7a5d982831e9aa8e90bc2f9321e217115d1e9757745 +SIZE (graphite-ng-carbon-relay-ng-v0.9.4_GH0.tar.gz) = 6409643 diff --git a/net-mgmt/carbon-relay-ng/files/carbon-relay-ng.in b/net-mgmt/carbon-relay-ng/files/carbon-relay-ng.in new file mode 100644 index 000000000000..ff203b8aaa3d --- /dev/null +++ b/net-mgmt/carbon-relay-ng/files/carbon-relay-ng.in @@ -0,0 +1,43 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: carbon_relay_ng +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable carbon_relay_ng +# carbon_relay_ng_enable="YES" +# +# carbon_relay_ng_enable (bool): Set to YES to enable carbon_relay_ng +# Default: NO +# carbon_relay_ng_conf (str): carbon_relay_ng configration file +# Default: empty +# carbon_relay_ng_user (str): carbon_relay_ng daemon user +# Default: carbon +# carbon_relay_ng_group (str): carbon_relay_ng daemon group +# Default: carbon + +. /etc/rc.subr + +name="carbon_relay_ng" +rcvar=carbon_relay_ng_enable +load_rc_config $name + +: ${carbon_relay_ng_enable:="NO"} +: ${carbon_relay_ng_user:="carbon"} +: ${carbon_relay_ng_group:="carbon"} +: ${carbon_relay_ng_conf:=""} + +pidfile="/var/run/carbon-relay-ng/${name}.pid" +procname="%%PREFIX%%/bin/carbon-relay-ng" +command=/usr/sbin/daemon +command_args="-f -c -p ${pidfile} ${procname} ${carbon_relay_ng_conf}" +start_precmd="carbon_relay_ng_precmd" + +carbon_relay_ng_precmd() +{ + install -o ${carbon_relay_ng_user} /dev/null ${pidfile} +} + +run_rc_command "$1" diff --git a/net-mgmt/carbon-relay-ng/files/patch-Makefile b/net-mgmt/carbon-relay-ng/files/patch-Makefile new file mode 100644 index 000000000000..dd7c197eaa14 --- /dev/null +++ b/net-mgmt/carbon-relay-ng/files/patch-Makefile @@ -0,0 +1,8 @@ +--- Makefile.orig 2018-03-21 11:37:45 UTC ++++ Makefile +@@ -1,4 +1,4 @@ +-VERSION=$(shell git describe --tags --always | sed 's/^v//') ++VERSION?=$(shell git describe --tags --always | sed 's/^v//') + + + build: diff --git a/net-mgmt/carbon-relay-ng/files/patch-examples_carbon-relay-ng.ini b/net-mgmt/carbon-relay-ng/files/patch-examples_carbon-relay-ng.ini new file mode 100644 index 000000000000..5e9a636f3309 --- /dev/null +++ b/net-mgmt/carbon-relay-ng/files/patch-examples_carbon-relay-ng.ini @@ -0,0 +1,14 @@ +--- examples/carbon-relay-ng.ini.orig 2018-03-21 13:32:07 UTC ++++ examples/carbon-relay-ng.ini +@@ -10,9 +10,9 @@ max_procs = 2 + admin_addr = "0.0.0.0:2004" + http_addr = "0.0.0.0:8081" + #spool_dir = "/var/spool/carbon-relay-ng" +-spool_dir = "spool" ++spool_dir = "/var/run/carbon-relay-ng/spool" + #pid_file = "/var/run/carbon-relay-ng.pid" +-pid_file = "carbon-relay-ng.pid" ++#pid_file = "carbon-relay-ng.pid" + + ## Logging ## + # one of critical error warning notice info debug diff --git a/net-mgmt/carbon-relay-ng/pkg-descr b/net-mgmt/carbon-relay-ng/pkg-descr new file mode 100644 index 000000000000..f54e4443c87d --- /dev/null +++ b/net-mgmt/carbon-relay-ng/pkg-descr @@ -0,0 +1,6 @@ +carbon-relay-ng is a middleware that sit's between graphite capable metrics +collectors and and carbon instances such as databases/go-carbon and +databases/py-carbon. It can do sharding and replication to any carbon +storage. + +WWW: https://github.com/graphite-ng/carbon-relay-ng diff --git a/net-mgmt/carbon-relay-ng/pkg-plist b/net-mgmt/carbon-relay-ng/pkg-plist new file mode 100644 index 000000000000..d86ca7d284dd --- /dev/null +++ b/net-mgmt/carbon-relay-ng/pkg-plist @@ -0,0 +1,4 @@ +bin/carbon-relay-ng +@sample %%ETCDIR%%/carbon-relay-ng.ini.sample +@dir(carbon,carbon,0755) /var/run/carbon-relay-ng/spool +@dir(carbon,carbon,0755) /var/run/carbon-relay-ng -- cgit