From nobody Thu Jun 30 13:19:03 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6B73D8B0954; Thu, 30 Jun 2022 13:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LYf6w1tTDz4kFH; Thu, 30 Jun 2022 13:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656595144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3RejQHK8fP0J6eeEN+3Oj9djMdSISaHyzIhPvW1jqjY=; b=QLgJL//5nj+YIrHUUlM3t0z7qpIkdHsXxKR9BG0XIhAR1ZkRq507b0Nd+T2c69bqHm5Unq LEJ5pWkkr45/k3wMsWy1/2dNVTuvgAJyPUaHehljTzmvDvEUNMksrIlHy/GmOhqbbO8QSz 8GHkpi/wC4yUmarwd3DxOBeD26apKz8xLhqIvBxEnEcCAuCzFs8lIzZQAlyqwyrZUIHsZt ORe7ATmi3sXC6jdFlc2sKPERGGgmjpEoMO/ujITOsZ/aAT5/93dMzwdBi2zSceU310trHx 7k+7oxz/QJiQRdu3IRSfuQEw3rKPw+Dd4XSA0w12vEVk1BVSigtqXPzGBKrLUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1802526D3C; Thu, 30 Jun 2022 13:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25UDJ3O4070118; Thu, 30 Jun 2022 13:19:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25UDJ3eT070117; Thu, 30 Jun 2022 13:19:03 GMT (envelope-from git) Date: Thu, 30 Jun 2022 13:19:03 GMT Message-Id: <202206301319.25UDJ3eT070117@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dmitri Goutnik Subject: git: f7db38fe17b8 - main - www/grafana9: Add new port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dmgk X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7db38fe17b80f39aa195d7c1419305f5f594d5b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656595144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3RejQHK8fP0J6eeEN+3Oj9djMdSISaHyzIhPvW1jqjY=; b=EPkI/Z72y+lbUKbwgHnVHuiw6c+kIvW/wSNw2FCgqocmvd5uFtc/oL6GAHT6vNi9sYhm7N wKIrQMdXFfO/xmCBYxIq2U9JnFJ8V2/a5WKycwpr5HqXpvoYKGSgv7BxD21Nib/yGI8UbJ 6GIcUPqwVdraLqbDprLMqFiLxGX9VwEVqyGH2LwIe8rk9KtqmfAq/+v+R9xGZxHVPNMMSh cajOOAvlCQtpD1IorwH1YGj+8im/loBdqNlSrC/ngw5LSV4/PaZ5/pOda9/B9djvP4B2bY D1AcaECOiYgzLqZyjK2uk5741iL1ODkB7aj9cqW1q+P5VwQqU/WOBXUKC5WxZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656595144; a=rsa-sha256; cv=none; b=G8XAznH0+NIN1vfc0J3dULlQmscp5zpie1OMDv9Tvd3nVSTEsgRYaQokxCy+Cf+fKcb53m wKbjyE8gugdPwrvIVD607Qng3aFLaWbh+aEi4RGKuegXC8oEu1Eaeg1WC+YNjN+Z8Rms3p 3Mb4rDgU7TSqDao6AIJOlCdXAzR5QvKOFKmQlVGxU5FCE22KO4bMTqWl4jyNUE0XBVYccS 5f/KJ+mwH9zcvHCKe/inK6CNX60zZ8x/Lh89CFvudQkSo0DV6iaQmmkPtPv3epfcjt4iDr /UHj6cAbzLybgKDErK4entFY3yAgxJREZlkBmqPu+JowOFCYs+ytkNwELPN7Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dmgk: URL: https://cgit.FreeBSD.org/ports/commit/?id=f7db38fe17b80f39aa195d7c1419305f5f594d5b commit f7db38fe17b80f39aa195d7c1419305f5f594d5b Author: Boris Korzun AuthorDate: 2022-06-30 13:16:17 +0000 Commit: Dmitri Goutnik CommitDate: 2022-06-30 13:16:17 +0000 www/grafana9: Add new port 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. WWW: https://github.com/grafana/grafana PR: 264959 --- www/Makefile | 1 + www/grafana9/Makefile | 104 + www/grafana9/distinfo | 7 + www/grafana9/files/grafana.in | 77 + www/grafana9/pkg-descr | 5 + www/grafana9/pkg-message | 11 + www/grafana9/pkg-plist | 6011 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 6216 insertions(+) diff --git a/www/Makefile b/www/Makefile index b90351c846cb..ab6e4de29c40 100644 --- a/www/Makefile +++ b/www/Makefile @@ -197,6 +197,7 @@ SUBDIR += gpx2map SUBDIR += grafana7 SUBDIR += grafana8 + SUBDIR += grafana9 SUBDIR += grails SUBDIR += gregarius SUBDIR += groupoffice diff --git a/www/grafana9/Makefile b/www/grafana9/Makefile new file mode 100644 index 000000000000..881a2e469061 --- /dev/null +++ b/www/grafana9/Makefile @@ -0,0 +1,104 @@ +PORTNAME= grafana +DISTVERSIONPREFIX= v +DISTVERSION= 9.0.2 +CATEGORIES= www +MASTER_SITES= https://dl.grafana.com/oss/release/:public \ + https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/${DISTVERSIONFULL}/:gomod +PKGNAMESUFFIX= ${DISTVERSION:C/([0-9]).*/\1/1} +DISTFILES= ${GRAFANA_PREBUILT}:public \ + go.mod:gomod + +MAINTAINER= drtr0jan@yandex.ru +COMMENT= Dashboard and graph editor for multiple data stores + +LICENSE= AGPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= aarch64 amd64 i386 + +BUILD_DEPENDS= wire:devel/go-wire +RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss + +USES= cpe go:modules + +USE_GITHUB= yes + +USE_RC_SUBR= grafana +TAG= 0641b5d + +GO_MODULE= github.com/grafana/grafana +GO_TARGET= ./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_PREBUILT= grafana-${DISTVERSION}.linux-amd64${EXTRACT_SUFX} +GRAFANA_DATADIR?= /var/db/${PORTNAME} +GRAFANA_HOMEDIR?= ${DATADIR} +GRAFANA_LOGDIR?= /var/log/${PORTNAME} +GRAFANA_PLUGINDIR?= ${GRAFANA_DATADIR}/plugins +GRAFANA_PROVISIONINGDIR?= ${ETCDIR}/provisioning + +do-extract: ${EXTRACT_WRKDIR} + @if ! (cd ${EXTRACT_WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${DISTFILE_DEFAULT} ${EXTRACT_AFTER_ARGS});\ + then \ + ${ECHO_MSG} "===> Failed to extract \"${_DISTDIR}/${GRAFANA_SOURCES}\"."; \ + exit 1; \ + fi; + @${RM} -r ${WRKSRC}/public + @${RM} -r ${WRKSRC}/plugins-bundled + @if ! (cd ${EXTRACT_WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${GRAFANA_PREBUILT} ${EXTRACT_AFTER_ARGS});\ + then \ + ${ECHO_MSG} "===> Failed to extract \"${_DISTDIR}/${GRAFANA_PREBUILT}\"."; \ + exit 1; \ + fi + @if [ ${UID} = 0 ]; then \ + ${CHMOD} -R ug-s ${WRKDIR}; \ + ${CHOWN} -R 0:0 ${WRKDIR}; \ + fi + +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 ./pkg/cmd/grafana-cli/runner ) + +post-install: + ${MKDIR} ${STAGEDIR}${GRAFANA_HOMEDIR} + ${MKDIR} ${STAGEDIR}${GRAFANA_HOMEDIR}/conf + ${MKDIR} ${STAGEDIR}${GRAFANA_DATADIR} + ${MKDIR} ${STAGEDIR}${GRAFANA_PLUGINDIR} +.for dir in access-control dashboards datasources notifiers plugins + ${MKDIR} ${STAGEDIR}${GRAFANA_PROVISIONINGDIR}/${dir} +.endfor + ${MKDIR} ${STAGEDIR}${GRAFANA_LOGDIR} + ( cd ${WRKSRC} && ${COPYTREE_SHARE} public ${STAGEDIR}${GRAFANA_HOMEDIR} ) + ( cd ${WRKSRC} && ${COPYTREE_SHARE} plugins-bundled/internal ${STAGEDIR}${GRAFANA_HOMEDIR} ) + ${INSTALL_DATA} ${WRKSRC}/conf/defaults.ini ${STAGEDIR}${GRAFANA_HOMEDIR}/conf/defaults.ini + ${INSTALL_DATA} ${WRKSRC}/conf/sample.ini ${STAGEDIR}${ETCDIR}/grafana.ini.sample + +.include diff --git a/www/grafana9/distinfo b/www/grafana9/distinfo new file mode 100644 index 000000000000..79e0f769332a --- /dev/null +++ b/www/grafana9/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1656443884 +SHA256 (go/www_grafana9/grafana-grafana-v9.0.2_GH0/grafana-9.0.2.linux-amd64.tar.gz) = 50dd7927c1313e47a30f531d0e3f145297c485666865a97a6c936427dd8a55fd +SIZE (go/www_grafana9/grafana-grafana-v9.0.2_GH0/grafana-9.0.2.linux-amd64.tar.gz) = 79887781 +SHA256 (go/www_grafana9/grafana-grafana-v9.0.2_GH0/go.mod) = a84b5b1b3e321ef645d4da02224c9a90cc13ca79a456795c4b7b1c4df2afa178 +SIZE (go/www_grafana9/grafana-grafana-v9.0.2_GH0/go.mod) = 16817 +SHA256 (go/www_grafana9/grafana-grafana-v9.0.2_GH0/grafana-grafana-v9.0.2_GH0.tar.gz) = 77607c4b215164d74ff8e8d75e2a2b72edbaa0afb6e968120b1c3aa508315c29 +SIZE (go/www_grafana9/grafana-grafana-v9.0.2_GH0/grafana-grafana-v9.0.2_GH0.tar.gz) = 19275491 diff --git a/www/grafana9/files/grafana.in b/www/grafana9/files/grafana.in new file mode 100644 index 000000000000..d6c7df4bcae1 --- /dev/null +++ b/www/grafana9/files/grafana.in @@ -0,0 +1,77 @@ +#!/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-server" +command="/usr/sbin/daemon" +command_args="-f ${grafana_syslog_output_flags} -p ${pidfile} -t ${name} \ + /usr/bin/env ${grafana_env} ${procname} \ + -config=${grafana_config} \ + -homepath=${grafana_homepath} \ + ${grafana_args}" + +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/grafana9/pkg-descr b/www/grafana9/pkg-descr new file mode 100644 index 000000000000..b1043c68ae37 --- /dev/null +++ b/www/grafana9/pkg-descr @@ -0,0 +1,5 @@ +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. + +WWW: https://github.com/grafana/grafana diff --git a/www/grafana9/pkg-message b/www/grafana9/pkg-message new file mode 100644 index 000000000000..cbc9028e8329 --- /dev/null +++ b/www/grafana9/pkg-message @@ -0,0 +1,11 @@ +[ +{ + type: upgrade + maximum_version: "8.0" + message: <