60 lines
2.5 KiB
Text
60 lines
2.5 KiB
Text
# Contributor: Konstantin Kulikov <k.kulikov2@gmail.com>
|
|
# Maintainer: Konstantin Kulikov <k.kulikov2@gmail.com>
|
|
pkgname=grafana
|
|
pkgver=6.3.5
|
|
pkgrel=0
|
|
_commit=84d0a71b2 # git rev-parse --short HEAD
|
|
_stamp=1565860092 # 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"
|
|
|
|
# secfixes:
|
|
# 6.3.4-r0:
|
|
# - CVE-2019-15043
|
|
|
|
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="c0151583bbed121290b091d40aae655ca22901d80ab02eafb5fea96f80bdcb88d070c4d778284d7c4605a420fe8918c82a67a51325cc71d605e4212a6a1c9162 grafana-6.3.5.tar.gz
|
|
ab6e36b314728a95e1fbb27eb724d8d347fc1c06b26febc4650cb63d35eab18e38727a0dcc0165555c56150dad147d5d525af174e8718189b238f47f93a1147c grafana.initd
|
|
00bbd8e650c3dac7c3e92d7fbeb99265f4ef5f5a70876d551173eb2bfc8732f8d9c4e03ed5fb776e1e2e58a5e9778a09cc551e5a30b9c73b9f4051393fd10f4b grafana.confd
|
|
740df131d7e8897b30c53140e170c9a5a1d84d422d8ae395b244bb525d4416c4e5acae2c6e1c2baf2710fe8e7067f849fc2986f567640afef0f28a694f560f86 phantomjs"
|