blob: b9b5a0dbb6a3067f1c71e918452f23a5ab5478be (
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
|
# Contributor: Konstantin Kulikov <k.kulikov2@gmail.com>
# Maintainer: Konstantin Kulikov <k.kulikov2@gmail.com>
pkgname=grafana
pkgver=6.3.0
pkgrel=0
_commit=830da0fda # git rev-parse --short HEAD
_stamp=1565095768 # git --no-pager show -s --format=%ct
pkgdesc="Open source, feature rich metrics dashboard and graph editor"
url="https://grafana.com"
arch="x86_64" # Builds are slow on arm archs, x86 requires python2.
license="Apache-2.0"
makedepends="go nodejs yarn"
install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/grafana/$pkgname/archive/v$pkgver.tar.gz
grafana.initd
grafana.confd
phantomjs
"
export GOFLAGS="-mod=vendor"
export GOPATH="$srcdir/go"
export GOCACHE="$srcdir/gocache"
build() {
# Don't pollute our git repo with grafanas commit hooks.
# Also don't try to install phantomjs since it depends on glibc.
# This command also acts as "yarn install".
yarn remove husky phantomjs-prebuilt --pure-lockfile -W
yarn build --phjsToRelease "$srcdir/phantomjs" --force
local ldflags="-X main.version=$pkgver -X main.commit=$_commit -X main.buildstamp=$_stamp"
go build -ldflags "$ldflags" ./pkg/cmd/grafana-server
go build -ldflags "$ldflags" ./pkg/cmd/grafana-cli
}
check() {
go test ./pkg/...
}
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" "$builddir/public" "$builddir/tools" "$pkgdir/usr/share/grafana/"
install -Dm755 "$srcdir/phantomjs" "$pkgdir/usr/share/grafana/tools/phantomjs/phantomjs"
}
sha512sums="d1af9c662011ba667465cde456daed42786269c41a0d2233bf9758da56d0ecbe8b4a7433e55d87f85a419da26b5d15b1f2df57c565333f7b79fc6a3863f6edc6 grafana-6.3.0.tar.gz
1d051e673c2904faf232f7cae790e69396504bddef3d8b7c892879eaf1a5906a566bb539d42f4d44b738dfa8eb37069a84b684c31cb93eb8d21e82a371ce1417 grafana.initd
00bbd8e650c3dac7c3e92d7fbeb99265f4ef5f5a70876d551173eb2bfc8732f8d9c4e03ed5fb776e1e2e58a5e9778a09cc551e5a30b9c73b9f4051393fd10f4b grafana.confd
740df131d7e8897b30c53140e170c9a5a1d84d422d8ae395b244bb525d4416c4e5acae2c6e1c2baf2710fe8e7067f849fc2986f567640afef0f28a694f560f86 phantomjs"
|