# $FreeBSD: head/www/grafana6/Makefile 539365 2020-06-16 16:31:31Z mikael $ PORTNAME= grafana PORTVERSION= 6.7.4 DISTVERSIONPREFIX= v CATEGORIES= www MASTER_SITES+= https://dl.grafana.com/oss/release/:public PKGNAMESUFFIX= ${PORTVERSION:C/([0-9]).*/\1/1} DISTFILES= grafana-${PORTVERSION}.linux-amd64${EXTRACT_SUFX}:public EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= hiyorin@gmail.com COMMENT= Dashboard and graph editor for multiple data stores LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= aarch64 amd64 i386 USES= go:modules USE_RC_SUBR= grafana USE_GITHUB= yes TAG= 5c11bbd GO_TARGET= ./pkg/cmd/grafana-server \ ./pkg/cmd/grafana-cli GO_BUILDFLAGS= -ldflags="-w -X main.version=${PORTVERSION} -X main.commit=${TAG}" GRAFANA_USER?= grafana GRAFANA_GROUP?= grafana USERS= ${GRAFANA_USER} GROUPS= ${GRAFANA_GROUP} GRAFANAHOMEDIR= ${PREFIX}/share/grafana GRAFANADATADIR= /var/db/${PORTNAME}/ GRAFANALOGDIR= /var/log/${PORTNAME}/ GRAFANAPIDDIR= /var/run/${PORTNAME}/ GRAFANAPLUGINDIR= /var/db/${PORTNAME}/plugins GRAFANAPROVISIONINGDIR= /var/db/${PORTNAME}/provisioning SUB_FILES= grafana grafana.conf SUB_LIST+= GRAFANA_USER=${GRAFANA_USER} \ GRAFANA_GROUP=${GRAFANA_GROUP} \ GRAFANADATADIR=${GRAFANADATADIR} \ GRAFANALOGDIR=${GRAFANALOGDIR} \ GRAFANAPIDDIR=${GRAFANAPIDDIR} \ GRAFANAHOMEDIR=${GRAFANAHOMEDIR} \ GRAFANAPLUGINDIR=${GRAFANAPLUGINDIR} \ GRAFANAPROVISIONINGDIR=${GRAFANAPROVISIONINGDIR} PLIST_SUB+= ${SUB_LIST} post-extract: @${RM} -r ${WRKSRC}/public @(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/grafana-${PORTVERSION}.linux-amd64${EXTRACT_SUFX} ${EXTRACT_AFTER_ARGS} grafana-${PORTVERSION}/public) post-install: cd ${WRKSRC} && \ ${COPYTREE_SHARE} public ${STAGEDIR}${PREFIX}/share/grafana ${MKDIR} ${STAGEDIR}${GRAFANAPIDDIR} ${MKDIR} ${STAGEDIR}${GRAFANALOGDIR} ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR} ${MKDIR} ${STAGEDIR}${GRAFANADATADIR} ${MKDIR} ${STAGEDIR}${GRAFANAPLUGINDIR} ${MKDIR} ${STAGEDIR}${GRAFANAPROVISIONINGDIR} ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR}/conf ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR}/data ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR}/data/log ${INSTALL_DATA} ${WRKSRC}/conf/defaults.ini \ ${STAGEDIR}${GRAFANAHOMEDIR}/conf/defaults.ini ${INSTALL_DATA} ${WRKDIR}/grafana.conf ${STAGEDIR}${PREFIX}/etc/grafana.conf.sample .include