summaryrefslogtreecommitdiff
path: root/www/grafana2/Makefile
diff options
context:
space:
mode:
authorCharlie Root <root@db.2.localnet.cc>2015-05-03 19:59:03 +0000
committerCharlie Root <root@db.2.localnet.cc>2015-05-03 19:59:03 +0000
commitbf985688beeed2958d059c99935af10f84374810 (patch)
tree8a6176c003c16dce3a26eabdfa600be649b9573e /www/grafana2/Makefile
downloadfreebsd-ports-grafana-bf985688beeed2958d059c99935af10f84374810.tar.gz
freebsd-ports-grafana-bf985688beeed2958d059c99935af10f84374810.zip
grafana
Diffstat (limited to 'www/grafana2/Makefile')
-rw-r--r--www/grafana2/Makefile85
1 files changed, 85 insertions, 0 deletions
diff --git a/www/grafana2/Makefile b/www/grafana2/Makefile
new file mode 100644
index 0000000..157dbea
--- /dev/null
+++ b/www/grafana2/Makefile
@@ -0,0 +1,85 @@
+# $FreeBSD$
+
+PORTNAME= grafana2
+PORTVERSION= 2.0.2
+CATEGORIES= www
+MASTER_SITES= GITHUB:github
+DISTFILES= ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}:github
+MAINTAINER= yvesf+freebsd@xapek.org
+COMMENT= A Graphite & InfluxDB Dashboard and Graph Editor
+LICENSE= APACHE20
+
+BUILD_DEPENDS= go>=1.4.0:${PORTSDIR}/lang/go \
+ hg:${PORTSDIR}/devel/mercurial \
+ git:${PORTSDIR}/devel/git \
+ npm:${PORTSDIR}/www/npm
+ONLY_FOR_ARCHS= i386 amd64
+
+USE_RC_SUBR= grafana2
+
+USE_GITHUB= yes
+GH_ACCOUNT= grafana
+GH_PROJECT= grafana
+# b51a8f11d5 was master at 2015-05-02
+GH_COMMIT= b51a8f11d5
+GH_TAGNAME= ${GH_COMMIT}
+
+SUB_FILES= grafana2
+SUB_LIST+= GRAFANA_HOMEDIR=${GRAFANA_HOMEDIR} \
+ GRAFANA_PIDFILE=${GRAFANA_PIDFILE} \
+ GRAFANA_USER=${GRAFANA_USER} \
+ GRAFANA_GROUP=${GRAFANA_GROUP}
+
+PLIST_SUB= GRAFANA_USER=${GRAFANA_USER} \
+ GRAFANA_GROUP=${GRAFANA_GROUP}
+
+GRAFANA_USER?= grafana
+GRAFANA_GROUP?= grafana
+
+GRAFANA_HOMEDIR=${PREFIX}/share/grafana2
+GRAFANA_PIDFILE=/var/run/${PORTNAME}.pid
+
+USERS= ${INFLUXD_USER}
+GROUPS= ${INFLUXD_GROUP}
+
+STRIP= # stripping can break go binaries
+
+pre-patch:
+ @${MV} ${WRKDIR}/${GH_PROJECT}-${GH_COMMIT} ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT}
+
+post-patch:
+ @$(MKDIR) -p ${WRKDIR}/src/github.com/${GH_ACCOUNT}
+ @ln -s ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT} ${WRKDIR}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}
+
+do-build:
+ @${ECHO_MSG} "Installing godep"
+ @${SETENV} ${GO_ENV} go get github.com/tools/godep
+ @cd ${WRKDIR}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT} && \
+ ${ECHO_MSG} "Running godep restore" && \
+ ${SETENV} ${GO_ENV} ${WRKDIR}/bin/godep restore && \
+ ${ECHO_MSG} "Running go build" && \
+ ${SETENV} ${GO_ENV} CC=clang go build . && \
+ ${ECHO_MSG} "Running npm" && \
+ npm --cache ${WRKDIR}/npm-cache install && \
+ npm --cache ${WRKDIR}/npm-cache install grunt-cli && \
+ ${ECHO_MSG} "Running grunt" && \
+ node_modules/.bin/grunt
+
+#do-install:
+
+post-install:
+ ${INSTALL_PROGRAM} ${WRKDIR}/src/github.com/grafana/grafana/grafana ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+ (cd ${WRKDIR}/src/github.com/grafana/grafana && \
+ ${COPYTREE_SHARE} public \
+ ${STAGEDIR}${GRAFANA_HOMEDIR} )
+ $(MKDIR) ${STAGEDIR}${GRAFANA_HOMEDIR}/conf
+ ${INSTALL_DATA} \
+ ${WRKDIR}/src/github.com/grafana/grafana/conf/defaults.ini \
+ ${STAGEDIR}${GRAFANA_HOMEDIR}/conf/defaults.ini
+ ${INSTALL_DATA} \
+ ${WRKDIR}/src/github.com/grafana/grafana/conf/sample.ini \
+ ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.ini
+
+.include <bsd.port.pre.mk>
+.include "${.CURDIR}/../../lang/go/files/bsd.go.mk"
+.include <bsd.port.post.mk>