# $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= ${GRAFANA_USER} GROUPS= ${GRAFANA_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: ${MKDIR} ${STAGEDIR}/var/lib/${PORTNAME}/ ${MKDIR} ${STAGEDIR}/var/log/${PORTNAME}/ ${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 .include "${.CURDIR}/../../lang/go/files/bsd.go.mk" .include