Added grafana-6.3.5-r0

This commit is contained in:
ayakael 2019-10-13 14:37:33 -04:00
parent f44ab078bb
commit 9b04a1557e
Signed by untrusted user who does not match committer: forge
GPG key ID: D62A472A4AA7D541
5 changed files with 104 additions and 0 deletions

60
apk/grafana/APKBUILD Normal file
View file

@ -0,0 +1,60 @@
# 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"

View file

@ -0,0 +1,7 @@
GRAFANA_HOME=/var/lib/grafana
GRAFANA_OPTS="-config /etc/grafana.ini -homepath /usr/share/grafana \
cfg:paths.data=$GRAFANA_HOME/data \
cfg:paths.plugins=$GRAFANA_HOME/plugins \
cfg:paths.provisioning=$GRAFANA_HOME/provisioning \
cfg:server.http_addr=127.0.0.1 \
cfg:log.mode=syslog"

24
apk/grafana/grafana.initd Normal file
View file

@ -0,0 +1,24 @@
#!/sbin/openrc-run
supervisor=supervise-daemon
name="Grafana"
description="Metrics Dashboard and Graph Editor"
command="/usr/sbin/grafana-server"
command_args="$GRAFANA_OPTS"
command_user=grafana:grafana
depend() {
need net
after firewall
}
start_pre() {
checkpath -d -o grafana:grafana -m755 $GRAFANA_HOME \
$GRAFANA_HOME/provisioning \
$GRAFANA_HOME/provisioning/dashboards \
$GRAFANA_HOME/provisioning/datasources \
$GRAFANA_HOME/provisioning/notifiers
}

View file

@ -0,0 +1,8 @@
#!/bin/sh
name=grafana
addgroup -S "$name" 2>/dev/null
adduser -S -D -H -h "/var/lib/$name" -s /sbin/nologin -G "$name" -g "$name" "$name" 2>/dev/null
exit 0

5
apk/grafana/phantomjs Normal file
View file

@ -0,0 +1,5 @@
#!/bin/sh
echo 'Phantomjs not supported on alpine' >&2
exit 1