35 lines
1.4 KiB
Plaintext
35 lines
1.4 KiB
Plaintext
# Description: The analytics platform for all your metrics
|
|
# URL: https://grafana.com/
|
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
|
# Depends on: fontconfig freetype2 go npm
|
|
|
|
name=grafana
|
|
version=8.0.5
|
|
release=1
|
|
source=(https://github.com/grafana/grafana/archive/v$version/$name-$version.tar.gz
|
|
https://dl.grafana.com/oss/release/grafana-$version.linux-amd64.tar.gz
|
|
grafana.confd grafana.service)
|
|
|
|
build() {
|
|
cd $name-$version
|
|
|
|
sed -ri 's,^(\s*data\s*=).*,\1 /var/lib/grafana,' conf/defaults.ini
|
|
sed -ri 's,^(\s*plugins\s*=).*,\1 /var/lib/grafana/plugins,' conf/defaults.ini
|
|
sed -ri 's,^(\s*provisioning\s*=).*,\1 /var/lib/grafana/conf/provisioning,' conf/defaults.ini
|
|
sed -ri 's,^(\s*logs\s*=).*,\1 /var/log/grafana,' conf/defaults.ini
|
|
|
|
local ldflags="-X main.version=$version -X main.commit=$version -X main.buildstamp=1607529777"
|
|
go build -ldflags "$ldflags" -v github.com/grafana/grafana/pkg/cmd/grafana-server
|
|
go build -ldflags "$ldflags" -v github.com/grafana/grafana/pkg/cmd/grafana-cli
|
|
|
|
install -Dm644 $SRC/$name.confd $PKG/etc/conf.d/$name
|
|
install -Dm755 $name-server $PKG/usr/sbin/$name-server
|
|
install -Dm755 $name-cli $PKG/usr/bin/$name-cli
|
|
install -Dm644 conf/sample.ini $PKG/etc/grafana.ini
|
|
install -dm755 $PKG/usr/share/grafana
|
|
cp -r conf public $PKG/usr/share/$name/
|
|
|
|
## install rc file
|
|
install -Dm 755 $SRC/grafana.service $PKG/etc/rc.d/grafana
|
|
}
|