Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Mar 2018 16:49:21 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r465192 - in head/www: . carbonapi carbonapi/files
Message-ID:  <201803211649.w2LGnLgw053530@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Wed Mar 21 16:49:20 2018
New Revision: 465192
URL: https://svnweb.freebsd.org/changeset/ports/465192

Log:
  New port: www/carbonapi
  
  carbonapi is a frontend for carbonzipper and can partially replace graphiteweb.
  
  WWW: https://github.com/go-graphite/carbonapi
  
  PR:		226808
  Submitted by:	Andreas Andersson <a.andersson.thn@gmail.com>

Added:
  head/www/carbonapi/
  head/www/carbonapi/Makefile   (contents, props changed)
  head/www/carbonapi/distinfo   (contents, props changed)
  head/www/carbonapi/files/
  head/www/carbonapi/files/carbonapi.in   (contents, props changed)
  head/www/carbonapi/files/patch-carbonapi.example.toml   (contents, props changed)
  head/www/carbonapi/files/patch-carbonapi.example.yaml   (contents, props changed)
  head/www/carbonapi/pkg-descr   (contents, props changed)
  head/www/carbonapi/pkg-message   (contents, props changed)
  head/www/carbonapi/pkg-plist   (contents, props changed)
Modified:
  head/www/Makefile

Modified: head/www/Makefile
==============================================================================
--- head/www/Makefile	Wed Mar 21 16:28:01 2018	(r465191)
+++ head/www/Makefile	Wed Mar 21 16:49:20 2018	(r465192)
@@ -62,6 +62,7 @@
     SUBDIR += calamaris-devel
     SUBDIR += caldavzap
     SUBDIR += calendarserver
+    SUBDIR += carbonapi
     SUBDIR += castget
     SUBDIR += cblog
     SUBDIR += cgi-lib

Added: head/www/carbonapi/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/Makefile	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,46 @@
+# $FreeBSD$
+
+PORTNAME=		carbonapi
+DISTVERSION=		0.10.0.1
+CATEGORIES=		www
+
+MAINTAINER=		a.andersson.thn@gmail.com
+COMMENT=		Go implementation of carbonapi
+
+LICENSE=		BSD2CLAUSE
+LICENSE_FILE=		${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=		go>=1.8:lang/go
+
+USES=			gmake
+
+USE_GITHUB=		yes
+GH_ACCOUNT=		go-graphite
+GH_SUBDIR=		src/github.com/${GH_ACCOUNT}/${PORTNAME}
+USE_RC_SUBR=		${PORTNAME}
+
+USERS=			carbon
+GROUPS=			carbon
+
+OPTIONS_DEFINE=		CAIRO
+
+CAIRO_USES=		pkgconfig
+CAIRO_VARS=		CARBON_API_ARGS=${PORTNAME}
+CAIRO_VARS_OFF=		CARBON_API_ARGS=nocairo
+CAIRO_LIB_DEPENDS=	libcairo.so:graphics/cairo
+
+do-build:
+	@cd ${WRKSRC}/${GH_SUBDIR} && \
+		${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} VERSION=${DISTVERSION} \
+		${MAKE_CMD} ${CARBON_API_ARGS}
+
+do-install:
+	@${MKDIR} ${STAGEDIR}/${PREFIX}/etc/carbonapi
+	@${MKDIR} ${STAGEDIR}/var/log/carbonapi
+	${INSTALL_PROGRAM} ${WRKSRC}/carbonapi ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${WRKSRC}/carbonapi.example.toml ${STAGEDIR}${PREFIX}/etc/carbonapi
+	${INSTALL_DATA} ${WRKSRC}/carbonapi.example.yaml ${STAGEDIR}${PREFIX}/etc/carbonapi
+	${INSTALL_DATA} ${WRKSRC}/graphTemplates.example.toml ${STAGEDIR}${PREFIX}/etc/carbonapi
+	${INSTALL_DATA} ${WRKSRC}/graphTemplates.example.yaml ${STAGEDIR}${PREFIX}/etc/carbonapi
+
+.include <bsd.port.mk>

Added: head/www/carbonapi/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/distinfo	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1521573171
+SHA256 (go-graphite-carbonapi-0.10.0.1_GH0.tar.gz) = c8d701c23d75fd709aeb59168f04c356a22e0d8b2911f43712d36699b8a3e868
+SIZE (go-graphite-carbonapi-0.10.0.1_GH0.tar.gz) = 1884119

Added: head/www/carbonapi/files/carbonapi.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/files/carbonapi.in	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,42 @@
+# $FreeBSD$
+#
+# PROVIDE: carbonapi
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable carbonapi
+# carbonapi_enable="YES"
+#
+# carbonapi_enable (bool): 	Set to YES to enable carbonapi
+#				Default: NO
+# carbonapi_conf (str):		carbonapi configration file
+#				Default: empty
+# carbonapi_user (str):		carbonapi daemon user
+#				Default: carbon
+# carbonapi_group (str):		carbonapi daemon group
+#				Default: carbon
+
+. /etc/rc.subr
+
+name="carbonapi"
+rcvar=carbonapi_enable
+load_rc_config $name
+
+: ${carbonapi_enable:="NO"}
+: ${carbonapi_user:="carbon"}
+: ${carbonapi_group:="carbon"}
+: ${carbonapi_conf:=""}
+: ${carbonapi_options:="-config ${carbonapi_conf}"} 
+
+pidfile="/var/run/${name}.pid"
+procname="%%PREFIX%%/bin/carbonapi"
+command=/usr/sbin/daemon
+command_args="-f -c -p ${pidfile} ${procname} ${carbonapi_options}"
+start_precmd="carbonapi_precmd"
+
+carbonapi_precmd()
+{
+    install -o ${carbonapi_user} /dev/null ${pidfile}
+}
+
+run_rc_command "$1"

Added: head/www/carbonapi/files/patch-carbonapi.example.toml
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/files/patch-carbonapi.example.toml	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,19 @@
+--- carbonapi.example.toml.orig	2018-03-20 21:03:28 UTC
++++ carbonapi.example.toml
+@@ -11,7 +11,7 @@ maxBatchSize = 100
+ pidFile = ""
+ sendGlobsAsIs = false
+ tz = ""
+-graphTemplates = "graphTemplates.example.toml"
++graphTemplates = "/usr/local/etc/carbonapi/graphTemplates.example.toml"
+ 
+ [cache]
+ defaultTimeoutSec = 60
+@@ -35,7 +35,7 @@ logger = ""
+ 
+ [[logger]]
+ encoding = "json"
+-file = "carbonapi.log"
++file = "/var/log/carbonapi/carbonapi.log"
+ level = "info"
+ logger = ""

Added: head/www/carbonapi/files/patch-carbonapi.example.yaml
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/files/patch-carbonapi.example.yaml	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,19 @@
+--- carbonapi.example.yaml.orig	2018-03-20 21:04:44 UTC
++++ carbonapi.example.yaml
+@@ -106,7 +106,7 @@ upstreams:
+ # If not zero, enabled cache for find requests
+ # This parameter controls when it will expire (in seconds)
+ # Default: 600 (10 minutes)
+-graphTemplates: graphTemplates.example.yaml
++graphTemplates: /usr/local/etc/carbonapi/graphTemplates.example.yaml
+ expireDelaySec: 10
+ # Uncomment this to get the behavior of graphite-web as proposed in https://github.com/graphite-project/graphite-web/pull/2239
+ # Beware this will make darkbackground graphs less readable
+@@ -125,6 +125,6 @@ logger:
+       encodingTime: "iso8601"
+       encodingDuration: "seconds"
+     - logger: ""
+-      file: "carbonapi.log"
++      file: "/var/log/carbonapi/carbonapi.log"
+       level: "info"
+       encoding: "json"

Added: head/www/carbonapi/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/pkg-descr	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,3 @@
+carbonapi is a frontend for carbonzipper and can partially replace graphiteweb.
+
+WWW: https://github.com/go-graphite/carbonapi

Added: head/www/carbonapi/pkg-message
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/pkg-message	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,4 @@
+NOTE ABOUT CARBONAPI:
+
+This daemon can be configured with both yaml and toml. Choose one and specify 
+it's path in carbonapi_conf in /etc/rc.conf or with sysrc.

Added: head/www/carbonapi/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/carbonapi/pkg-plist	Wed Mar 21 16:49:20 2018	(r465192)
@@ -0,0 +1,6 @@
+bin/carbonapi
+%%ETCDIR%%/carbonapi.example.toml
+%%ETCDIR%%/carbonapi.example.yaml
+%%ETCDIR%%/graphTemplates.example.toml
+%%ETCDIR%%/graphTemplates.example.yaml
+@dir(carbon,carbon,0750) /var/log/carbonapi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803211649.w2LGnLgw053530>