View | Details | Raw Unified | Return to bug 226808 | Differences between
and this patch

Collapse All | Expand All

(-)www/carbonapi/Makefile (+46 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=		carbonapi
4
DISTVERSION=		0.10.0.1
5
CATEGORIES=		www
6
7
MAINTAINER=		a.andersson.thn@gmail.com
8
COMMENT=		Go implementation of carbonapi
9
10
LICENSE=		BSD2CLAUSE
11
LICENSE_FILE=		${WRKSRC}/LICENSE
12
13
BUILD_DEPENDS=		go>=1.8:lang/go
14
15
USES=			gmake
16
17
USE_GITHUB=		yes
18
GH_ACCOUNT=		go-graphite
19
GH_SUBDIR=		src/github.com/${GH_ACCOUNT}/${PORTNAME}
20
USE_RC_SUBR=		${PORTNAME}
21
22
USERS=			carbon
23
GROUPS=			carbon
24
25
OPTIONS_DEFINE=		CAIRO
26
27
CAIRO_USES=		pkgconfig
28
CAIRO_VARS=		CARBON_API_ARGS=${PORTNAME}
29
CAIRO_VARS_OFF=		CARBON_API_ARGS=nocairo
30
CAIRO_LIB_DEPENDS=	libcairo.so:graphics/cairo
31
32
do-build:
33
	@cd ${WRKSRC}/${GH_SUBDIR} && \
34
		${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} VERSION=${DISTVERSION} \
35
		${MAKE_CMD} ${CARBON_API_ARGS}
36
37
do-install:
38
	@${MKDIR} ${STAGEDIR}/${PREFIX}/etc/carbonapi
39
	@${MKDIR} ${STAGEDIR}/var/log/carbonapi
40
	${INSTALL_PROGRAM} ${WRKSRC}/carbonapi ${STAGEDIR}${PREFIX}/bin
41
	${INSTALL_DATA} ${WRKSRC}/carbonapi.example.toml ${STAGEDIR}${PREFIX}/etc/carbonapi
42
	${INSTALL_DATA} ${WRKSRC}/carbonapi.example.yaml ${STAGEDIR}${PREFIX}/etc/carbonapi
43
	${INSTALL_DATA} ${WRKSRC}/graphTemplates.example.toml ${STAGEDIR}${PREFIX}/etc/carbonapi
44
	${INSTALL_DATA} ${WRKSRC}/graphTemplates.example.yaml ${STAGEDIR}${PREFIX}/etc/carbonapi
45
46
.include <bsd.port.mk>
(-)www/carbonapi/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1521573171
2
SHA256 (go-graphite-carbonapi-0.10.0.1_GH0.tar.gz) = c8d701c23d75fd709aeb59168f04c356a22e0d8b2911f43712d36699b8a3e868
3
SIZE (go-graphite-carbonapi-0.10.0.1_GH0.tar.gz) = 1884119
(-)www/carbonapi/files/carbonapi.in (+42 lines)
Line 0 Link Here
1
# $FreeBSD$
2
#
3
# PROVIDE: carbonapi
4
# REQUIRE: LOGIN
5
# KEYWORD: shutdown
6
7
# Add the following lines to /etc/rc.conf to enable carbonapi
8
# carbonapi_enable="YES"
9
#
10
# carbonapi_enable (bool): 	Set to YES to enable carbonapi
11
#				Default: NO
12
# carbonapi_conf (str):		carbonapi configration file
13
#				Default: empty
14
# carbonapi_user (str):		carbonapi daemon user
15
#				Default: carbon
16
# carbonapi_group (str):		carbonapi daemon group
17
#				Default: carbon
18
19
. /etc/rc.subr
20
21
name="carbonapi"
22
rcvar=carbonapi_enable
23
load_rc_config $name
24
25
: ${carbonapi_enable:="NO"}
26
: ${carbonapi_user:="carbon"}
27
: ${carbonapi_group:="carbon"}
28
: ${carbonapi_conf:=""}
29
: ${carbonapi_options:="-config ${carbonapi_conf}"} 
30
31
pidfile="/var/run/${name}.pid"
32
procname="%%PREFIX%%/bin/carbonapi"
33
command=/usr/sbin/daemon
34
command_args="-f -c -p ${pidfile} ${procname} ${carbonapi_options}"
35
start_precmd="carbonapi_precmd"
36
37
carbonapi_precmd()
38
{
39
    install -o ${carbonapi_user} /dev/null ${pidfile}
40
}
41
42
run_rc_command "$1"
(-)www/carbonapi/files/patch-carbonapi.example.toml (+19 lines)
Line 0 Link Here
1
--- carbonapi.example.toml.orig	2018-03-20 21:03:28 UTC
2
+++ carbonapi.example.toml
3
@@ -11,7 +11,7 @@ maxBatchSize = 100
4
 pidFile = ""
5
 sendGlobsAsIs = false
6
 tz = ""
7
-graphTemplates = "graphTemplates.example.toml"
8
+graphTemplates = "/usr/local/etc/carbonapi/graphTemplates.example.toml"
9
 
10
 [cache]
11
 defaultTimeoutSec = 60
12
@@ -35,7 +35,7 @@ logger = ""
13
 
14
 [[logger]]
15
 encoding = "json"
16
-file = "carbonapi.log"
17
+file = "/var/log/carbonapi/carbonapi.log"
18
 level = "info"
19
 logger = ""
(-)www/carbonapi/files/patch-carbonapi.example.yaml (+19 lines)
Line 0 Link Here
1
--- carbonapi.example.yaml.orig	2018-03-20 21:04:44 UTC
2
+++ carbonapi.example.yaml
3
@@ -106,7 +106,7 @@ upstreams:
4
 # If not zero, enabled cache for find requests
5
 # This parameter controls when it will expire (in seconds)
6
 # Default: 600 (10 minutes)
7
-graphTemplates: graphTemplates.example.yaml
8
+graphTemplates: /usr/local/etc/carbonapi/graphTemplates.example.yaml
9
 expireDelaySec: 10
10
 # Uncomment this to get the behavior of graphite-web as proposed in https://github.com/graphite-project/graphite-web/pull/2239
11
 # Beware this will make darkbackground graphs less readable
12
@@ -125,6 +125,6 @@ logger:
13
       encodingTime: "iso8601"
14
       encodingDuration: "seconds"
15
     - logger: ""
16
-      file: "carbonapi.log"
17
+      file: "/var/log/carbonapi/carbonapi.log"
18
       level: "info"
19
       encoding: "json"
(-)www/carbonapi/pkg-descr (+3 lines)
Line 0 Link Here
1
carbonapi is a frontend for carbonzipper and can partially replace graphiteweb.
2
3
WWW: https://github.com/go-graphite/carbonapi
(-)www/carbonapi/pkg-message (+4 lines)
Line 0 Link Here
1
NOTE ABOUT CARBONAPI:
2
3
This daemon can be configured with both yaml and toml. Choose one and specify 
4
it's path in carbonapi_conf in /etc/rc.conf or with sysrc.
(-)www/carbonapi/pkg-plist (+6 lines)
Line 0 Link Here
1
bin/carbonapi
2
%%ETCDIR%%/carbonapi.example.toml
3
%%ETCDIR%%/carbonapi.example.yaml
4
%%ETCDIR%%/graphTemplates.example.toml
5
%%ETCDIR%%/graphTemplates.example.yaml
6
@dir(carbon,carbon,0750) /var/log/carbonapi

Return to bug 226808