aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris P. Korzun <drtr0jan@yandex.ru>2023-12-19 20:52:42 +0000
committerMatthew Seaman <matthew@FreeBSD.org>2023-12-21 10:33:47 +0000
commit3bc70fc442bee55bb59659e0c295bc0ebc4504c5 (patch)
tree98af2f6fd573e1da4011e334663be9769dceb1f3
parent9ebc503a446f553862b1676ab890d46e16f1ff65 (diff)
downloadports-3bc70fc442bee55bb59659e0c295bc0ebc4504c5.tar.gz
ports-3bc70fc442bee55bb59659e0c295bc0ebc4504c5.zip
www/grafana: Revive and update to 10.2.3
-rw-r--r--MOVED1
-rw-r--r--www/Makefile1
-rw-r--r--www/grafana/Makefile92
-rw-r--r--www/grafana/distinfo9
-rw-r--r--www/grafana/files/grafana.in78
-rw-r--r--www/grafana/pkg-descr3
-rw-r--r--www/grafana/pkg-plist27
7 files changed, 210 insertions, 1 deletions
diff --git a/MOVED b/MOVED
index 69d97eaf403f..cb4054d0d55c 100644
--- a/MOVED
+++ b/MOVED
@@ -6245,7 +6245,6 @@ www/py-dj31-django-mptt||2021-12-31|Has expired: Extended support of Django 3.1
net/py-flask-xml-rpc||2021-12-31|Has expired: No longer maintained upstream
audio/libaacplus||2021-12-31|Has expired: Abandoned upstream, no new release since 2011
security/obfsclient||2021-12-31|Has expired: https://github.com/Yawning/obfsclient/issues/37
-www/grafana||2021-12-31|Has expired: No longer maintained upstream, use www/grafana8
www/py-dj31-django-auth-ldap||2021-12-31|Has expired: Extended support of Django 3.1 ends December 2021, upgrade to the Django 3.2+ version of this port. See https://www.djangoproject.com/download/
www/py-dj31-django-filter||2021-12-31|Has expired: Extended support of Django 3.1 ends December 2021, upgrade to the Django 3.2+ version of this port. See https://www.djangoproject.com/download/
www/py-dj31-drf-yasg||2021-12-31|Has expired: Extended support of Django 3.1 ends December 2021, upgrade to the Django 3.2+ version of this port. See https://www.djangoproject.com/download/
diff --git a/www/Makefile b/www/Makefile
index 8e1f9bb3c925..072da607d4fe 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -221,6 +221,7 @@
SUBDIR += gopherus
SUBDIR += gotty
SUBDIR += gpx2map
+ SUBDIR += grafana
SUBDIR += grafana9
SUBDIR += grails
SUBDIR += gregarius
diff --git a/www/grafana/Makefile b/www/grafana/Makefile
new file mode 100644
index 000000000000..383f8ae32e65
--- /dev/null
+++ b/www/grafana/Makefile
@@ -0,0 +1,92 @@
+PORTNAME= grafana
+DISTVERSIONPREFIX= v
+DISTVERSION= 10.2.3
+CATEGORIES= www
+MASTER_SITES= https://dl.grafana.com/oss/release/:public \
+ https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/${DISTVERSIONFULL}/:gomod
+DISTFILES= grafana-${DISTVERSION}.linux-amd64${EXTRACT_SUFX}:public \
+ go.mod:gomod \
+ pkg/util/xorm/go.mod:gomod
+
+MAINTAINER= drtr0jan@yandex.ru
+COMMENT= Dashboard and graph editor for multiple data stores
+WWW= https://grafana.com/grafana/
+
+LICENSE= AGPLv3
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+ONLY_FOR_ARCHS= aarch64 amd64 i386 riscv64
+
+BUILD_DEPENDS= wire:devel/go-wire
+RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss
+
+USES= cpe go:1.21,modules
+
+USE_GITHUB= yes
+
+USE_RC_SUBR= grafana
+TAG= 1e84fed
+
+GO_MODULE= github.com/grafana/grafana
+GO_TARGET= ./pkg/cmd/grafana \
+ ./pkg/cmd/grafana-server \
+ ./pkg/cmd/grafana-cli
+GO_BUILDFLAGS= -ldflags="-w -X main.version=${PORTVERSION} -X main.commit=${TAG}"
+
+CONFLICTS_INSTALL= grafana*
+
+SUB_LIST= GRAFANA_USER=${GRAFANA_USER} \
+ GRAFANA_GROUP=${GRAFANA_GROUP} \
+ GRAFANA_DATADIR=${GRAFANA_DATADIR} \
+ GRAFANA_HOMEDIR=${GRAFANA_HOMEDIR} \
+ GRAFANA_LOGDIR=${GRAFANA_LOGDIR} \
+ GRAFANA_PLUGINDIR=${GRAFANA_PLUGINDIR} \
+ GRAFANA_PROVISIONINGDIR=${GRAFANA_PROVISIONINGDIR}
+
+GRAFANA_USER?= grafana
+GRAFANA_GROUP?= grafana
+
+USERS= ${GRAFANA_USER}
+GROUPS= ${GRAFANA_GROUP}
+
+PLIST_SUB= ${SUB_LIST}
+
+GRAFANA_DATADIR?= /var/db/${PORTNAME}
+GRAFANA_HOMEDIR?= ${DATADIR}
+GRAFANA_LOGDIR?= /var/log/${PORTNAME}
+GRAFANA_PLUGINDIR?= ${GRAFANA_DATADIR}/plugins
+GRAFANA_PROVISIONINGDIR?= ${ETCDIR}/provisioning
+
+post-patch:
+ @${REINPLACE_CMD} \
+ -e 's|;data = /var/lib/grafana|data = ${GRAFANA_DATADIR}|g' \
+ -e 's|;logs = /var/log/grafana|logs = ${GRAFANA_LOGDIR}|g' \
+ -e 's|;plugins = /var/lib/grafana/plugins|plugins = ${GRAFANA_PLUGINDIR}|g' \
+ -e 's|;provisioning = conf/provisioning|provisioning = ${GRAFANA_PROVISIONINGDIR}|g' \
+ ${WRKSRC}/conf/sample.ini
+
+pre-build:
+ @(cd ${GO_WRKSRC}; \
+ ${ECHO_MSG} "===> Generating wire_gen.go"; \
+ ${SETENV} ${MAKE_ENV} ${GO_ENV} wire gen -tags "oss" ./pkg/server )
+
+post-install:
+ ${MKDIR} ${STAGEDIR}${GRAFANA_HOMEDIR}
+ ${MKDIR} ${STAGEDIR}${GRAFANA_HOMEDIR}/conf
+ ${MKDIR} ${STAGEDIR}${GRAFANA_DATADIR}
+ ${MKDIR} ${STAGEDIR}${GRAFANA_PLUGINDIR}
+.for dir in access-control alerting dashboards datasources notifiers plugins
+ ${MKDIR} ${STAGEDIR}${GRAFANA_PROVISIONINGDIR}/${dir}
+.endfor
+ ${MKDIR} ${STAGEDIR}${GRAFANA_LOGDIR}
+ ( cd ${WRKDIR}/${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX} && ${COPYTREE_SHARE} public ${STAGEDIR}${GRAFANA_HOMEDIR} )
+.for dir in input-datasource
+ ${MKDIR} ${STAGEDIR}${GRAFANA_HOMEDIR}/plugins-bundled/internal/${dir}
+ ( cd ${WRKDIR}/${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}/plugins-bundled/internal/${dir}/dist && ${COPYTREE_SHARE} . ${STAGEDIR}${GRAFANA_HOMEDIR}/plugins-bundled/internal/${dir} )
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/conf/defaults.ini ${STAGEDIR}${GRAFANA_HOMEDIR}/conf/defaults.ini
+ ${INSTALL_DATA} ${WRKSRC}/conf/sample.ini ${STAGEDIR}${ETCDIR}/grafana.ini.sample
+ ${INSTALL_DATA} ${WRKSRC}/conf/ldap.toml ${STAGEDIR}${ETCDIR}/ldap.toml.sample
+ ${FIND} ${STAGEDIR}${DATADIR}/public -type f | ${SED} "s,^${STAGEDIR}${DATADIR},${DATADIR}," >> ${TMPPLIST}
+
+.include <bsd.port.mk>
diff --git a/www/grafana/distinfo b/www/grafana/distinfo
new file mode 100644
index 000000000000..e04cd1d1c639
--- /dev/null
+++ b/www/grafana/distinfo
@@ -0,0 +1,9 @@
+TIMESTAMP = 1703017992
+SHA256 (go/www_grafana/grafana-grafana-v10.2.3_GH0/grafana-10.2.3.linux-amd64.tar.gz) = c686606a6975481f4f108de44c4df3465251e4ee2da20e7c6ee6b66e5bdcf2da
+SIZE (go/www_grafana/grafana-grafana-v10.2.3_GH0/grafana-10.2.3.linux-amd64.tar.gz) = 108993853
+SHA256 (go/www_grafana/grafana-grafana-v10.2.3_GH0/go.mod) = 57efc74766589103576e6369515af9ed502536283ff57af3c27677121ef5a671
+SIZE (go/www_grafana/grafana-grafana-v10.2.3_GH0/go.mod) = 30043
+SHA256 (go/www_grafana/grafana-grafana-v10.2.3_GH0/pkg/util/xorm/go.mod) = a1e29d55ee560ec78876999d3f3e83b687895b1d8f107ddd14deeb740f2f9e88
+SIZE (go/www_grafana/grafana-grafana-v10.2.3_GH0/pkg/util/xorm/go.mod) = 406
+SHA256 (go/www_grafana/grafana-grafana-v10.2.3_GH0/grafana-grafana-v10.2.3_GH0.tar.gz) = fb7da288a64a1dbaed1dd5a4db88b6eb5c0f5f8be652143c547cad6b8985acd0
+SIZE (go/www_grafana/grafana-grafana-v10.2.3_GH0/grafana-grafana-v10.2.3_GH0.tar.gz) = 28073283
diff --git a/www/grafana/files/grafana.in b/www/grafana/files/grafana.in
new file mode 100644
index 000000000000..8f13bdaf969b
--- /dev/null
+++ b/www/grafana/files/grafana.in
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+# PROVIDE: grafana
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable grafana
+# grafana_enable="YES"
+#
+# grafana_enable (bool):
+# Set it to YES to enable grafana
+# Set to NO by default
+# grafana_user (string):
+# Set user that grafana will run under
+# Default is "%%GRAFANA_USER%%"
+# grafana_group (string):
+# Set group that own grafana files
+# Default is "%%GRAFANA_GROUP%%"
+# grafana_config (string)
+# Set full path to config file
+# Default is "%%ETCDIR%%/grafana.ini"
+# grafana_homepath (string)
+# Set full path to homepath dir
+# Default is "%%GRAFANA_HOMEDIR%%"
+# grafana_syslog_output_enable (bool)
+# Set it to YES to enable stdout/stderr syslog output
+# Set to NO by default
+# grafana_syslog_output_tag (str)
+# Set syslog tag if syslog enabled
+# Default is "grafana"
+# grafana_args (string)
+# Set additional command line arguments
+# Default is ""
+
+. /etc/rc.subr
+
+name=grafana
+rcvar=grafana_enable
+
+load_rc_config $name
+
+: ${grafana_enable:="NO"}
+: ${grafana_user:="%%GRAFANA_USER%%"}
+: ${grafana_group:="%%GRAFANA_GROUP%%"}
+: ${grafana_config:="%%ETCDIR%%/grafana.ini"}
+: ${grafana_homepath:="%%GRAFANA_HOMEDIR%%"}
+: ${grafana_syslog_output_enable:="NO"}
+
+if checkyesno grafana_syslog_output_enable; then
+ if [ -n "${grafana_syslog_output_tag}" ]; then
+ grafana_syslog_output_flags="-T ${grafana_syslog_output_tag}"
+ else
+ grafana_syslog_output_flags="-T ${name}"
+ fi
+fi
+
+pidfile="/var/run/${name}/${name}.pid"
+required_files="${grafana_config}"
+
+procname="%%PREFIX%%/bin/grafana"
+command="/usr/sbin/daemon"
+command_args="-f ${grafana_syslog_output_flags} -p ${pidfile} -t ${name} \
+ /usr/bin/env ${grafana_env} ${procname} server \
+ -config=${grafana_config} \
+ -homepath=${grafana_homepath} \
+ ${grafana_args}"
+grafana_chdir="${grafana_homepath}"
+
+start_precmd="grafana_start_precmd"
+
+grafana_start_precmd()
+{
+ if [ ! -d "/var/run/${name}" ]; then
+ install -d -m 0750 -o ${grafana_user} -g ${grafana_group} "/var/run/${name}"
+ fi
+}
+
+run_rc_command "$1"
diff --git a/www/grafana/pkg-descr b/www/grafana/pkg-descr
new file mode 100644
index 000000000000..f3c0ebf71117
--- /dev/null
+++ b/www/grafana/pkg-descr
@@ -0,0 +1,3 @@
+Grafana is an open source and composable observability and data visualization
+platform. Visualize metrics, logs, and traces from multiple sources like
+Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
diff --git a/www/grafana/pkg-plist b/www/grafana/pkg-plist
new file mode 100644
index 000000000000..9f0792edc8fe
--- /dev/null
+++ b/www/grafana/pkg-plist
@@ -0,0 +1,27 @@
+bin/grafana
+bin/grafana-cli
+bin/grafana-server
+@sample %%ETCDIR%%/grafana.ini.sample
+@sample %%ETCDIR%%/ldap.toml.sample
+%%DATADIR%%/conf/defaults.ini
+%%DATADIR%%/plugins-bundled/internal/input-datasource/README.md
+%%DATADIR%%/plugins-bundled/internal/input-datasource/img/input.svg
+%%DATADIR%%/plugins-bundled/internal/input-datasource/module.js
+%%DATADIR%%/plugins-bundled/internal/input-datasource/module.js.map
+%%DATADIR%%/plugins-bundled/internal/input-datasource/plugin.json
+@owner %%GRAFANA_USER%%
+@group %%GRAFANA_GROUP%%
+@mode 750
+@dir %%GRAFANA_DATADIR%%
+@dir %%GRAFANA_PLUGINDIR%%
+@dir %%GRAFANA_PROVISIONINGDIR%%
+@dir %%GRAFANA_PROVISIONINGDIR%%/access-control
+@dir %%GRAFANA_PROVISIONINGDIR%%/alerting
+@dir %%GRAFANA_PROVISIONINGDIR%%/dashboards
+@dir %%GRAFANA_PROVISIONINGDIR%%/datasources
+@dir %%GRAFANA_PROVISIONINGDIR%%/notifiers
+@dir %%GRAFANA_PROVISIONINGDIR%%/plugins
+@dir %%GRAFANA_LOGDIR%%
+@mode
+@group
+@owner