summaryrefslogtreecommitdiff
path: root/grafana/Pkgfile
blob: 06eafed3f882e06039c0af4b6441459920f59678 (plain)
    1 # Description: The analytics platform for all your metrics
    2 # URL: https://grafana.com/
    3 # Maintainer: Tim Biermann, tbier at posteo dot de
    4 # Depends on: fontconfig freetype2 go npm
    5 
    6 name=grafana
    7 version=7.3.6
    8 release=1
    9 source=(https://github.com/grafana/grafana/archive/v$version/$name-$version.tar.gz
   10   https://dl.grafana.com/oss/release/grafana-$version.linux-amd64.tar.gz
   11   grafana.confd grafana.service)
   12 
   13 build() {
   14   cd $name-$version
   15 
   16   sed -ri 's,^(\s*data\s*=).*,\1 /var/lib/grafana,' conf/defaults.ini
   17   sed -ri 's,^(\s*plugins\s*=).*,\1 /var/lib/grafana/plugins,' conf/defaults.ini
   18   sed -ri 's,^(\s*provisioning\s*=).*,\1 /var/lib/grafana/conf/provisioning,' conf/defaults.ini
   19   sed -ri 's,^(\s*logs\s*=).*,\1 /var/log/grafana,' conf/defaults.ini
   20 
   21   local ldflags="-X main.version=$version -X main.commit=$version -X main.buildstamp=1607529777"
   22   go build -ldflags "$ldflags" -v github.com/grafana/grafana/pkg/cmd/grafana-server
   23   go build -ldflags "$ldflags" -v github.com/grafana/grafana/pkg/cmd/grafana-cli
   24 
   25   install -Dm644 $SRC/$name.confd $PKG/etc/conf.d/$name
   26   install -Dm755 $name-server $PKG/usr/sbin/$name-server
   27   install -Dm755 $name-cli $PKG/usr/bin/$name-cli
   28   install -Dm644 conf/sample.ini $PKG/etc/grafana.ini
   29   install -dm755 $PKG/usr/share/grafana
   30   cp -r conf public $PKG/usr/share/$name/
   31 
   32   ## install rc file
   33   install -Dm 755 $SRC/grafana.service $PKG/etc/rc.d/grafana
   34 }

Generated by cgit