diff options
author | pi <pi@FreeBSD.org> | 2018-03-20 04:22:29 +0800 |
---|---|---|
committer | pi <pi@FreeBSD.org> | 2018-03-20 04:22:29 +0800 |
commit | ca1dce583559649f1fb68bc0a7f996578ab1d7b9 (patch) | |
tree | 049c1180ce4689941b226e9db4a37b3dabf92926 | |
parent | a24a95c34af59a76186b36bac2bfa720074d4395 (diff) | |
download | freebsd-ports-gnome-ca1dce583559649f1fb68bc0a7f996578ab1d7b9.tar.gz freebsd-ports-gnome-ca1dce583559649f1fb68bc0a7f996578ab1d7b9.tar.zst freebsd-ports-gnome-ca1dce583559649f1fb68bc0a7f996578ab1d7b9.zip |
New port: databases/go-carbon
go-carbon is a go implementation of the carbon component of the graphite
project. It has support for multiple cpu's and can achieve higher concurrency.
WWW: https://github.com/lomik/go-carbon
PR: 226732
Submitted by: Andreas Andersson <a.andersson.thn@gmail.com>
-rw-r--r-- | GIDs | 2 | ||||
-rw-r--r-- | UIDs | 2 | ||||
-rw-r--r-- | databases/Makefile | 1 | ||||
-rw-r--r-- | databases/go-carbon/Makefile | 38 | ||||
-rw-r--r-- | databases/go-carbon/distinfo | 3 | ||||
-rw-r--r-- | databases/go-carbon/files/go-carbon.in | 55 | ||||
-rw-r--r-- | databases/go-carbon/files/patch-deploy_go-carbon.conf | 17 | ||||
-rw-r--r-- | databases/go-carbon/pkg-descr | 4 | ||||
-rw-r--r-- | databases/go-carbon/pkg-plist | 6 |
9 files changed, 126 insertions, 2 deletions
@@ -170,7 +170,7 @@ sqlgrey:*:226: _hfm:*:227: osrm:*:228: kismet:*:229: -# free: 230 +carbon:*:230: # free: 231 # free: 232 # free: 233 @@ -175,7 +175,7 @@ sqlgrey:*:226:226::0:0:SQLgrey Owner:/nonexistent:/usr/sbin/nologin _hfm:*:227:227::0:0:hfm daemon:/nonexistent:/usr/sbin/nologin osrm:*:228:228::0:0:osrm:/nonexistent:/usr/sbin/nologin # free: 229 -# free: 230 +carbon:*:230:230::0:0:osrm:/nonexistent:/usr/sbin/nologin # free: 231 # free: 232 # free: 233 diff --git a/databases/Makefile b/databases/Makefile index 075d34989590..15269175afbf 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -94,6 +94,7 @@ SUBDIR += gigabase SUBDIR += gnats4 SUBDIR += gnatsweb4 + SUBDIR += go-carbon SUBDIR += gomdb SUBDIR += gosqlite3 SUBDIR += gqlplus diff --git a/databases/go-carbon/Makefile b/databases/go-carbon/Makefile new file mode 100644 index 000000000000..d8f9a9a38560 --- /dev/null +++ b/databases/go-carbon/Makefile @@ -0,0 +1,38 @@ +# $FreeBSD$ + +PORTNAME= go-carbon +DISTVERSIONPREFIX= v +DISTVERSION= 0.12.0 +CATEGORIES= databases + +MAINTAINER= a.andersson.thn@gmail.com +COMMENT= Go implementation of carbon + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE.md + +BUILD_DEPENDS= go>=1.8:lang/go + +USES= go + +USE_GITHUB= yes +GH_ACCOUNT= lomik +USE_RC_SUBR= ${PORTNAME} + +USERS= carbon +GROUPS= carbon + +do-build: + @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC}/_vendor \ + go build --ldflags '-X main.BuildVersion=${DISTVERSION}' github.com/lomik/go-carbon + +do-install: + @${MKDIR} ${STAGEDIR}/var/db/go-carbon + @${MKDIR} ${STAGEDIR}/var/log/go-carbon + @${MKDIR} ${STAGEDIR}/${PREFIX}/etc/go-carbon + ${INSTALL_PROGRAM} ${WRKSRC}/go-carbon ${STAGEDIR}${PREFIX}/bin/ + ${INSTALL} ${WRKSRC}/deploy/go-carbon.conf ${STAGEDIR}${PREFIX}/etc/go-carbon/ + ${INSTALL} ${WRKSRC}/deploy/storage-aggregation.conf ${STAGEDIR}${PREFIX}/etc/go-carbon/ + ${INSTALL} ${WRKSRC}/deploy/storage-schemas.conf ${STAGEDIR}${PREFIX}/etc/go-carbon/ + +.include <bsd.port.mk> diff --git a/databases/go-carbon/distinfo b/databases/go-carbon/distinfo new file mode 100644 index 000000000000..cec23d0d030a --- /dev/null +++ b/databases/go-carbon/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1521477973 +SHA256 (lomik-go-carbon-v0.12.0_GH0.tar.gz) = 2661492a9b0209977548ef86340f606e29630ab9d5d971bdf745d4b30495875c +SIZE (lomik-go-carbon-v0.12.0_GH0.tar.gz) = 3035132 diff --git a/databases/go-carbon/files/go-carbon.in b/databases/go-carbon/files/go-carbon.in new file mode 100644 index 000000000000..c2d5032e6e13 --- /dev/null +++ b/databases/go-carbon/files/go-carbon.in @@ -0,0 +1,55 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: go-carbon +# REQUIRE: LOGIN +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `go-carbon': +# +# go_carbon_enable="YES" +# +# optional: +# +# go_carbon_conf (flags): Set extra flags here. More options in go-carbon(1) +# Default is empty "". +# go_carbon_user (user): Set user to run go-carbon. +# Default is "carbon". + +. /etc/rc.subr + +name="go-carbon" +rcvar="go_carbon_enable" + +: ${go_carbon_enable:="NO"} +: ${go_carbon_user:="carbon"} +: ${go_carbon_config:="/usr/local/etc/go-carbon/go-carbon.conf"} + +start_cmd="go_carbon_start" +stop_cmd="go_carbon_stop" +status_cmd="go_carbon_status" +procname="/usr/local/bin/go-carbon" +pidfile="/var/run/$name.pid" + +# read configuration and set defaults +load_rc_config "$name" + +go_carbon_start() +{ + ${procname} -config ${go_carbon_config} -daemon -pidfile ${pidfile} +} + +go_carbon_stop() +{ + kill -TERM `cat /var/run/go-carbon.pid` +} + +go_carbon_status() +{ + echo "go-carbon is running as pid" `cat /var/run/go-carbon.pid` +} + +run_rc_command "$1" diff --git a/databases/go-carbon/files/patch-deploy_go-carbon.conf b/databases/go-carbon/files/patch-deploy_go-carbon.conf new file mode 100644 index 000000000000..4560647a4597 --- /dev/null +++ b/databases/go-carbon/files/patch-deploy_go-carbon.conf @@ -0,0 +1,17 @@ +--- deploy/go-carbon.conf.orig 2018-03-19 13:53:13 UTC ++++ deploy/go-carbon.conf +@@ -11,11 +11,11 @@ metric-interval = "1m0s" + max-cpu = 4 + + [whisper] +-data-dir = "/var/lib/graphite/whisper" ++data-dir = "/var/db/go-carbon/whisper" + # http://graphite.readthedocs.org/en/latest/config-carbon.html#storage-schemas-conf. Required +-schemas-file = "/etc/go-carbon/storage-schemas.conf" ++schemas-file = "/usr/local/etc/go-carbon/storage-schemas.conf" + # http://graphite.readthedocs.org/en/latest/config-carbon.html#storage-aggregation-conf. Optional +-aggregation-file = "/etc/go-carbon/storage-aggregation.conf" ++aggregation-file = "/usr/local/etc/go-carbon/storage-aggregation.conf" + # Worker threads count. Metrics sharded by "crc32(metricName) % workers" + workers = 8 + # Limits the number of whisper update_many() calls per second. 0 - no limit diff --git a/databases/go-carbon/pkg-descr b/databases/go-carbon/pkg-descr new file mode 100644 index 000000000000..09a40112866f --- /dev/null +++ b/databases/go-carbon/pkg-descr @@ -0,0 +1,4 @@ +go-carbon is a go implementation of the carbon component of the graphite +project. It has support for multiple cpu's and can achieve higher concurrency. + +WWW: https://github.com/lomik/go-carbon diff --git a/databases/go-carbon/pkg-plist b/databases/go-carbon/pkg-plist new file mode 100644 index 000000000000..b45fc346f036 --- /dev/null +++ b/databases/go-carbon/pkg-plist @@ -0,0 +1,6 @@ +bin/%%GO_PKGNAME%% +%%ETCDIR%%/%%GO_PKGNAME%%.conf +%%ETCDIR%%/storage-aggregation.conf +%%ETCDIR%%/storage-schemas.conf +@dir(carbon,carbon,0750) /var/db/%%GO_PKGNAME%% +@dir(carbon,carbon,0750) /var/log/%%GO_PKGNAME%% |