blob: ed99c407f87ecfff671cf9496231257a56e7473c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# Contributor: Konstantin Kulikov <k.kulikov2@gmail.com>
# Maintainer: Konstantin Kulikov <k.kulikov2@gmail.com>
# Keep in sync with grafana-frontend.
pkgname=grafana
pkgver=9.0.5
pkgrel=0
_commit=1b595e434a # git rev-parse --short HEAD
_stamp=1658828128 # 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-r$pkgrel"
makedepends="go wire-go"
checkdepends="mailcap"
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
fix-dev-dashboards-tests.patch"
export GOPATH="$srcdir"/go
export GOCACHE="$srcdir"/go-build
export GOTMPDIR="$srcdir"
export GOFLAGS="$GOFLAGS -modcacherw"
# secfixes:
# 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 -ldflags "$ldflags" -v ./pkg/cmd/grafana-server
go build -ldflags "$ldflags" -v ./pkg/cmd/grafana-cli
}
check() {
local pkgs="./..."
case "$CARCH" in
# FP precision bugs in tests.
aarch64|ppc64le) pkgs="$(go list ./... | grep -Ev 'pkg/tsdb/testdatasource$')" ;;
esac
go test $pkgs
}
package() {
install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
install -Dm644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname"
install -Dm755 "$builddir/$pkgname-server" "$pkgdir/usr/sbin/$pkgname-server"
install -Dm755 "$builddir/$pkgname-cli" "$pkgdir/usr/bin/$pkgname-cli"
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="
c72d1ce837f0d02faa188dc722f1816c1099b1666642aee658cf2c15a3b8967adbc01e5e9b349da0f7f8503a23af607c4246d7f0e2d9ef2a2e600310fc355870 grafana-9.0.5.tar.gz
98494f722fac4f8a28c33e2efda6f49896d137ede402f29f621712af5d575d29e4efcb0f920be5e04c269b8552cf8b31512673b9743bc7c4ce430882616ca4af grafana.initd
c2d9896ae9a9425f759a47aeab42b7c43b63328e82670d50185de8c08cda7b8df264c8b105c5c3138b90dd46e86598b16826457eb3b2979a899b3a508cbe4e8c grafana.confd
de9cbf41fcaffc73422298f6d32fc95358657dcacf9fa6e991e45f472aec894c3be406407ab289615a7cccc14a9014dd654a376470534adff009180389f64fa6 fix-dev-dashboards-tests.patch
"
|