2018-03-07 02:04:48 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= grafana
|
2019-01-17 16:10:25 +00:00
|
|
|
PORTVERSION= 5.4.3
|
2018-03-07 02:04:48 +00:00
|
|
|
DISTVERSIONPREFIX= v
|
|
|
|
CATEGORIES= www
|
|
|
|
MASTER_SITES+= https://s3-us-west-2.amazonaws.com/grafana-releases/release/:public
|
|
|
|
PKGNAMESUFFIX= ${PORTVERSION:C/([0-9]).*/\1/1}
|
2018-07-10 21:10:20 +00:00
|
|
|
DISTFILES= grafana-${PORTVERSION}.linux-amd64${EXTRACT_SUFX}:public
|
2018-03-07 02:04:48 +00:00
|
|
|
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
|
|
|
|
MAINTAINER= swills@FreeBSD.org
|
|
|
|
COMMENT= Dashboard and graph editor for multiple data stores
|
|
|
|
|
2018-09-21 01:49:09 +00:00
|
|
|
LICENSE= APACHE20
|
2018-03-07 02:04:48 +00:00
|
|
|
LICENSE_FILE= ${WRKSRC}/LICENSE.md
|
|
|
|
|
2020-04-08 08:18:49 +00:00
|
|
|
ONLY_FOR_ARCHS= aarch64 amd64 i386
|
2018-03-07 02:04:48 +00:00
|
|
|
|
2019-09-29 22:34:31 +00:00
|
|
|
USES= go
|
2018-03-07 02:04:48 +00:00
|
|
|
USE_RC_SUBR= grafana
|
|
|
|
|
|
|
|
USE_GITHUB= yes
|
|
|
|
GH_SUBDIR= src/github.com/${PORTNAME}/${PORTNAME}
|
2018-12-04 18:45:21 +00:00
|
|
|
TAG= 69c5191
|
2018-03-07 02:04:48 +00:00
|
|
|
|
2019-09-29 22:34:31 +00:00
|
|
|
GO_BUILDFLAGS= -ldflags "-w -X main.version=${PORTVERSION} -X main.commit=${TAG}"
|
|
|
|
GO_TARGET= ./pkg/cmd/grafana-server \
|
|
|
|
./pkg/cmd/grafana-cli
|
|
|
|
|
2018-03-07 02:04:48 +00:00
|
|
|
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+= GRAFANAHOMEDIR=${GRAFANAHOMEDIR}
|
|
|
|
|
2019-09-29 22:34:31 +00:00
|
|
|
post-patch:
|
|
|
|
@${RM} -r ${WRKSRC}/public
|
2018-07-10 21:10:20 +00:00
|
|
|
@(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/grafana-${PORTVERSION}.linux-amd64${EXTRACT_SUFX} ${EXTRACT_AFTER_ARGS} grafana-${PORTVERSION}/public)
|
2018-03-07 02:04:48 +00:00
|
|
|
|
2019-09-29 22:34:31 +00:00
|
|
|
post-install:
|
|
|
|
cd ${WRKSRC} && ${COPYTREE_SHARE} public ${STAGEDIR}${PREFIX}/share/grafana
|
2018-03-07 02:04:48 +00:00
|
|
|
${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
|
2019-09-29 22:34:31 +00:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/conf/defaults.ini ${STAGEDIR}${GRAFANAHOMEDIR}/conf/defaults.ini
|
2018-03-07 02:04:48 +00:00
|
|
|
${INSTALL_DATA} ${WRKDIR}/grafana.conf ${STAGEDIR}${PREFIX}/etc/grafana.conf.sample
|
|
|
|
|
2019-09-29 22:34:31 +00:00
|
|
|
.include <bsd.port.mk>
|