# Contributor: Konstantin Kulikov # Maintainer: Konstantin Kulikov # Keep in sync with grafana-frontend. pkgname=grafana pkgver=10.0.3 pkgrel=1 _commit=eb8dd72637 # git rev-parse --short HEAD _stamp=1690307759 # git --no-pager show -s --format=%ct pkgdesc="Open source, feature rich metrics dashboard and graph editor" url="https://grafana.com" # x86, armhf, armv7: many test failures, for example https://github.com/grafana/grafana/issues/26389 # s390x: test failures https://github.com/grafana/grafana/issues/26390 arch="all !s390x !x86 !armhf !armv7" license="AGPL-3.0-only" depends="grafana-frontend~=$pkgver" makedepends="go sqlite-dev wire-go" checkdepends="mailcap tzdata" install="$pkgname.pre-install" subpackages="$pkgname-openrc" options="net" source="$pkgname-$pkgver.tar.gz::https://github.com/grafana/grafana/archive/v$pkgver.tar.gz $pkgname.initd $pkgname.confd $pkgname-cli.sh $pkgname-server.sh" export GOFLAGS="$GOFLAGS -tags=libsqlite3" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" # secfixes: # 9.1.2-r0: # - CVE-2022-31176 # 9.0.3-r0: # - CVE-2022-31097 # - CVE-2022-31107 # 8.5.3-r0: # - CVE-2022-29170 # 8.3.6-r0: # - CVE-2022-21702 # - CVE-2022-21703 # - CVE-2022-21713 # 8.3.4-r0: # - CVE-2022-21673 # 8.3.2-r0: # - CVE-2021-43813 # - CVE-2021-43815 # 8.3.1-r0: # - CVE-2021-43798 # 8.2.4-r0: # - CVE-2021-41244 # 7.4.5-r0: # - CVE-2021-28146 # - CVE-2021-28147 # - CVE-2021-28148 # - CVE-2021-27962 # 7.0.2-r0: # - CVE-2020-13379 # 6.3.4-r0: # - CVE-2019-15043 build() { wire gen -tags oss ./pkg/server ./pkg/cmd/grafana-cli/runner local ldflags="-X main.version=$pkgver -X main.commit=$_commit -X main.buildstamp=$_stamp" go build -o ./ -ldflags "$ldflags" -v ./pkg/cmd/grafana } check() { # shellcheck disable=2046 go test $(go list ./... | grep -v api/alerting) } package() { install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname" install -Dm644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname" install -Dm755 "$srcdir/$pkgname-server.sh" "$pkgdir/usr/sbin/$pkgname-server" install -Dm755 "$srcdir/$pkgname-cli.sh" "$pkgdir/usr/bin/$pkgname-cli" install -Dm755 "$builddir/$pkgname" "$pkgdir/usr/bin/$pkgname" install -Dm644 "$builddir/conf/sample.ini" "$pkgdir/etc/grafana.ini" install -dm755 "$pkgdir/usr/share/grafana" cp -r "$builddir/conf" "$pkgdir/usr/share/$pkgname/" } sha512sums=" cad446bec687e2b4d6c6c4303f1dd2fc752e91e6309f66f5e8ef069c4853ddc76a4c06b3520e7599e87d7ca8a15f9b7ee39291a793418c6646038cd3d9424417 grafana-10.0.3.tar.gz 52793ecc49d0c355e11d3ae2a5c047b36c7b0dc687bd1b9f24a20e96a477ffe44ee70295d005bb202cf5b0294d63400066a236b7969cd4eb54d65e9f88d2a40d grafana.initd 055299dd0f3a3a42c7787246f5ffcc2571adcf298a9e0b572313764d532104b8a33becd387b9c7bc4361993e7333a4cb1658d354b0a786b36479f9d8c31adab8 grafana.confd 42472cad4b209fd9d63b0fe9a6a37d832a63309cc8cf08266085461dd6d08da9060b7956d44ef1be5c6a8f2fab5dca0803da00a85578a1bbde25e8c26c92f95d grafana-cli.sh 7a76cb84b8cd493cdd43373c79c24bfa6a96f756881bce97178438f0dcb755dddc01a6ea5b68eb285761aa553ae4ab21c12af012fc251092dd0f1d0ad858ee12 grafana-server.sh "