1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00
freebsd-ports/www/grafana4/Makefile
Dmitri Goutnik fc95b3f0cf Go ports: cleanup, finish transition to USES=go started with r505321 (cat. sysutils-x11)
- Remove custom build/install targets left in place after r505321
- Switch to the new GO_TARGET tuple syntax introduced in r512001

Reviewed by:	tobik
Approved by:	araujo (mentor), portmgr (adamw)
Differential Revision:	https://reviews.freebsd.org/D21744
2019-09-29 22:34:31 +00:00

75 lines
2.3 KiB
Makefile

# $FreeBSD$
PORTNAME= grafana
PORTVERSION= 4.6.5
DISTVERSIONPREFIX= v
CATEGORIES= www
MASTER_SITES+= https://s3-us-west-2.amazonaws.com/grafana-releases/release/:public
PKGNAMESUFFIX= ${PORTVERSION:C/([0-9]).*/\1/1}
DISTFILES= grafana-${PORTVERSION}.linux-x64${EXTRACT_SUFX}:public
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= swills@FreeBSD.org
COMMENT= Dashboard and graph editor for Graphite, InfluxDB & OpenTSDB
LICENSE= APACHE20
ONLY_FOR_ARCHS= i386 amd64
USE_RC_SUBR= grafana
USES= go
USE_GITHUB= yes
GH_SUBDIR= src/github.com/${PORTNAME}/${PORTNAME}
TAG= fdb5b1f
GO_BUILDFLAGS= -ldflags "-w -X main.version=${PORTVERSION} -X main.commit=${TAG}"
GO_TARGET= ./pkg/cmd/grafana-server \
./pkg/cmd/grafana-cli
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
GRAFANADASHBOARDDIR= /var/db/${PORTNAME}/dashboards
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} \
GRAFANADASHBOARDDIR=${GRAFANADASHBOARDDIR}
PLIST_SUB+= GRAFANAHOMEDIR=${GRAFANAHOMEDIR}
post-patch:
@${RM} -r ${WRKSRC}/public
@(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/grafana-${PORTVERSION}.linux-x64${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}${GRAFANADASHBOARDDIR}
${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 <bsd.port.mk>