2021-01-08 01:24:06 +01:00
|
|
|
# Description: The analytics platform for all your metrics
|
|
|
|
# URL: https://grafana.com/
|
|
|
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
2022-09-03 01:24:11 +02:00
|
|
|
# Depends on: fontconfig go yarn
|
2021-01-08 01:24:06 +01:00
|
|
|
|
|
|
|
name=grafana
|
2022-09-03 01:24:11 +02:00
|
|
|
version=9.1.2
|
2021-01-08 01:24:06 +01:00
|
|
|
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() {
|
2021-10-10 17:38:39 +02:00
|
|
|
export CGO_LDFLAGS="${LDFLAGS}"
|
|
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
|
|
export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
|
2022-04-25 23:10:35 +02:00
|
|
|
|
|
|
|
mkdir "$PKGMK_SOURCE_DIR/gopath" || true
|
|
|
|
export GOPATH="$PKGMK_SOURCE_DIR/gopath"
|
|
|
|
|
2021-11-04 09:25:50 +01:00
|
|
|
cd $SRC/$name-$version
|
2022-04-25 23:10:35 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-09-03 01:24:11 +02:00
|
|
|
make gen-go
|
|
|
|
go run build.go setup
|
|
|
|
go run build.go build
|
|
|
|
export NPM_CONFIG_PREFIX="$srcdir/npm"
|
|
|
|
export PATH+=":$NPM_CONFIG_PREFIX/bin"
|
|
|
|
export NODE_OPTIONS="--max-old-space-size=16000" # Increase to 8 GB
|
|
|
|
yarn install
|
|
|
|
NODE_ENV=production yarn run build
|
2021-01-08 01:24:06 +01:00
|
|
|
|
|
|
|
install -Dm644 $SRC/$name.confd $PKG/etc/conf.d/$name
|
2022-09-03 01:24:11 +02:00
|
|
|
install -Dsm755 bin/linux-amd64/grafana-server $PKG/usr/bin/grafana-server
|
|
|
|
install -Dsm755 bin/linux-amd64/grafana-cli $PKG/usr/bin/grafana-cli
|
2021-01-08 01:24:06 +01:00
|
|
|
install -Dm644 conf/sample.ini $PKG/etc/grafana.ini
|
2022-09-03 01:24:11 +02:00
|
|
|
install -Dm644 conf/defaults.ini $PKG/usr/share/$name/conf/defaults.ini
|
|
|
|
install -dm755 $PKG/usr/share/$name
|
|
|
|
cp -r public $PKG/usr/share/$name/
|
2021-01-08 01:24:06 +01:00
|
|
|
|
|
|
|
## install rc file
|
|
|
|
install -Dm 755 $SRC/grafana.service $PKG/etc/rc.d/grafana
|
|
|
|
}
|