aboutsummaryrefslogtreecommitdiff
path: root/www/carbonapi
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2018-03-21 16:49:20 +0000
committerKurt Jaeger <pi@FreeBSD.org>2018-03-21 16:49:20 +0000
commit950de38ee4162adb8adc957c41a4450a1769fb02 (patch)
tree4326018141ab9282c7d123a021bb3204b666bbf5 /www/carbonapi
parent54b81244351297062d9297c86633b1f3fd44b6b7 (diff)
downloadports-950de38ee4162adb8adc957c41a4450a1769fb02.tar.gz
ports-950de38ee4162adb8adc957c41a4450a1769fb02.zip
Notes
Diffstat (limited to 'www/carbonapi')
-rw-r--r--www/carbonapi/Makefile46
-rw-r--r--www/carbonapi/distinfo3
-rw-r--r--www/carbonapi/files/carbonapi.in42
-rw-r--r--www/carbonapi/files/patch-carbonapi.example.toml19
-rw-r--r--www/carbonapi/files/patch-carbonapi.example.yaml19
-rw-r--r--www/carbonapi/pkg-descr3
-rw-r--r--www/carbonapi/pkg-message4
-rw-r--r--www/carbonapi/pkg-plist6
8 files changed, 142 insertions, 0 deletions
diff --git a/www/carbonapi/Makefile b/www/carbonapi/Makefile
new file mode 100644
index 000000000000..3de10a311a79
--- /dev/null
+++ b/www/carbonapi/Makefile
@@ -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>
diff --git a/www/carbonapi/distinfo b/www/carbonapi/distinfo
new file mode 100644
index 000000000000..1a513864fc8f
--- /dev/null
+++ b/www/carbonapi/distinfo
@@ -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
diff --git a/www/carbonapi/files/carbonapi.in b/www/carbonapi/files/carbonapi.in
new file mode 100644
index 000000000000..80191a080d7b
--- /dev/null
+++ b/www/carbonapi/files/carbonapi.in
@@ -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"
diff --git a/www/carbonapi/files/patch-carbonapi.example.toml b/www/carbonapi/files/patch-carbonapi.example.toml
new file mode 100644
index 000000000000..ab3b9eda510e
--- /dev/null
+++ b/www/carbonapi/files/patch-carbonapi.example.toml
@@ -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 = ""
diff --git a/www/carbonapi/files/patch-carbonapi.example.yaml b/www/carbonapi/files/patch-carbonapi.example.yaml
new file mode 100644
index 000000000000..5319261d3958
--- /dev/null
+++ b/www/carbonapi/files/patch-carbonapi.example.yaml
@@ -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"
diff --git a/www/carbonapi/pkg-descr b/www/carbonapi/pkg-descr
new file mode 100644
index 000000000000..4b1f9c79c59a
--- /dev/null
+++ b/www/carbonapi/pkg-descr
@@ -0,0 +1,3 @@
+carbonapi is a frontend for carbonzipper and can partially replace graphiteweb.
+
+WWW: https://github.com/go-graphite/carbonapi
diff --git a/www/carbonapi/pkg-message b/www/carbonapi/pkg-message
new file mode 100644
index 000000000000..f7565c2e22e6
--- /dev/null
+++ b/www/carbonapi/pkg-message
@@ -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.
diff --git a/www/carbonapi/pkg-plist b/www/carbonapi/pkg-plist
new file mode 100644
index 000000000000..e6bdb76c9d7f
--- /dev/null
+++ b/www/carbonapi/pkg-plist
@@ -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