[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / www / grafana

File: [cvs.NetBSD.org] / pkgsrc / www / grafana / Makefile (download)

Revision 1.72, Tue Jul 12 15:16:00 2022 UTC (6 months, 2 weeks ago) by triaxx
Branch: MAIN
Changes since 1.71: +2 -3 lines

grafana: Update to 9.0.2

upstream changes:
-----------------
9.0.2 (2022-06-28)
Features and enhancements
  o Alerting: Add support for images in Pushover alerts. #51372,
    @grobinson-grafana
  o Alerting: Don't stop the migration when alert rule tags are invalid.
    #51253, @gotjosh
  o Alerting: Don't stop the migration when alert rule tags are invalid (
    #51341, @gotjosh
  o Alerting: Skip the default data source if incompatible. #51452,
    @gillesdemey
  o AzureMonitor: Parse non-fatal errors for Logs. #51320, @andresmgot
  o OAuth: Restore debug log behavior. #51244, @Jguer
  o Plugins: Improved handling of symlinks. #51324, @marefr

Bug fixes
  o Alerting: Code-gen parsing of URL parameters and fix related bugs. #51353,
    @alexweav
  o Alerting: Code-gen parsing of URL parameters and fix related bugs. #50731,
    @alexweav
  o Annotations: Fix annotation autocomplete causing panels to crash. #51164,
    @ashharrison90
  o Barchart: Fix warning not showing. #51190, @joshhunt
  o CloudWatch: Enable custom session duration in AWS plugin auth. #51322,
    @sunker
  o Dashboards: Fixes issue with the initial panel layout counting as an
    unsaved change. #51315, @JoaoSilvaGrafana
  o Plugins: Use a Grafana specific SDK logger implementation for core plugins.
    #51229, @marefr
  o Search: Fix pagination in the new search page. #51366, @ArturWierzbicki

Changes for previous releases:
https://github.com/grafana/grafana/blob/v9.0.2/CHANGELOG.md

# $NetBSD: Makefile,v 1.72 2022/07/12 15:16:00 triaxx Exp $

DISTNAME=	grafana-9.0.2
CATEGORIES=	www
MASTER_SITES=	${MASTER_SITE_GITHUB:=grafana/}
GITHUB_TAG=	v${PKGVERSION_NOREV}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://grafana.com/
COMMENT=	Metrics dashboard and graph editor
LICENSE=	apache-2.0

DISTFILES=	${DEFAULT_DISTFILES}

# We don't have suitable infrastructure in pkgsrc for generating frontend
# assets, so we'll extract prebuilt frontend assets.
FE_DISTNAME=			${DISTNAME}.linux-amd64.tar.gz
DISTFILES+=			${FE_DISTNAME}
SITES.${FE_DISTNAME}=		https://dl.grafana.com/oss/release/
EXTRACT_DIR.${FE_DISTNAME}=	${WRKDIR}/linux

BUILD_DEPENDS+=			go-wire-[0-9]*:../../devel/go-wire

CHECK_PORTABILITY_SKIP=		packaging/* devenv/*
CHECK_PORTABILITY_SKIP+=	packages/grafana-toolkit/docker/*

USE_TOOLS+=			pax

PUBLICDIR=	${PREFIX}/share/grafana/public
DATADIR=	${VARBASE}/lib/grafana/data
PLUGINDIR=	${VARBASE}/lib/grafana/plugins
LOGDIR=		${VARBASE}/log/grafana

SUBST_CLASSES+=		fix-cfg
SUBST_STAGE.fix-cfg=	pre-configure
SUBST_MESSAGE.fix-cfg=	Adding pkgsrc paths in sample config
SUBST_FILES.fix-cfg=	conf/sample.ini pkg/cmd/grafana-server/commands/cli.go
SUBST_SED.fix-cfg=	-e 's,^;\(data = \).*,\1${DATADIR},g'
SUBST_SED.fix-cfg+=	-e 's,^;\(logs = \).*,\1${LOGDIR},g'
SUBST_SED.fix-cfg+=	-e 's,^;\(plugins = \).*,\1${PLUGINDIR},g'
SUBST_SED.fix-cfg+=	-e 's,^;\(static_root_path = \).*,\1${PUBLICDIR},g'
SUBST_VARS.fix-cfg=	DATADIR PKG_SYSCONFDIR PREFIX

SUBST_CLASSES+=		build
SUBST_STAGE.build=	pre-build
SUBST_MESSAGE.build=	Fixing go path in build.go
SUBST_FILES.build=	pkg/build/cmd.go
SUBST_VARS.build=	GO

BUILD_DEFS+=		GRAFANA_USER GRAFANA_GROUP VARBASE
FILES_SUBST+=		GRAFANA_USER=${GRAFANA_USER:Q}
FILES_SUBST+=		GRAFANA_GROUP=${GRAFANA_GROUP:Q}
FILES_SUBST+=		DATADIR=${DATADIR:Q}

.include "go-modules.mk"

.include "../../lang/go/go-vars.mk"
.include "../../mk/bsd.prefs.mk"

GRAFANA_USER?=		grafana
GRAFANA_GROUP?=		grafana
OWN_DIRS_PERMS+=	${DATADIR} ${GRAFANA_USER} ${GRAFANA_GROUP} 0700
OWN_DIRS_PERMS+=	${LOGDIR} ${GRAFANA_USER} ${GRAFANA_GROUP} 0700
OWN_DIRS_PERMS+=	${PLUGINDIR} ${GRAFANA_USER} ${GRAFANA_GROUP} 0700
PKG_USERS_VARS+=	GRAFANA_USER
PKG_GROUPS_VARS+=	GRAFANA_GROUP
PKG_GROUPS=		${GRAFANA_GROUP}
PKG_USERS=		${GRAFANA_USER}:${GRAFANA_GROUP}
RCD_SCRIPTS=		grafana

INSTALLATION_DIRS+=	bin
INSTALLATION_DIRS+=	share/grafana/public

CONF_FILES+=	${PREFIX}/share/grafana/conf/sample.ini \
		${PKG_SYSCONFDIR}/grafana.conf

post-extract:
	${FIND} ${WRKDIR}/linux -type f -a -exec ${CHMOD} -x "{}" \;

# These comands come from Makefile, build-go target.
do-build:
	cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${PREFIX}/bin/wire gen -tags oss ./pkg/server ./pkg/cmd/grafana-cli/runner
	cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} run build.go build

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/bin/*/grafana-cli ${DESTDIR}${PREFIX}/bin/
	${INSTALL_PROGRAM} ${WRKSRC}/bin/*/grafana-server ${DESTDIR}${PREFIX}/bin/
	cd ${WRKDIR}/linux/${DISTNAME}/public && \
		${PAX} -rw . ${DESTDIR}${PUBLICDIR}
	cd ${WRKSRC} && ${PAX} -rw conf \
		${DESTDIR}${PREFIX}/share/grafana/

.include "../../lang/go/go-module.mk"
.include "../../mk/bsd.pkg.mk"