summaryrefslogtreecommitdiff
path: root/grafana/Pkgfile
blob: 60112b946ad33f3cb9636e4d6c898dbf4381397c (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 go yarn
    5 
    6 name=grafana
    7 version=9.2.4
    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   export CGO_LDFLAGS="${LDFLAGS}"
   15   export CGO_CPPFLAGS="${CPPFLAGS}"
   16   export CGO_CFLAGS="${CFLAGS}"
   17   export CGO_CXXFLAGS="${CXXFLAGS}"
   18   export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
   19 
   20   mkdir "$PKGMK_SOURCE_DIR/gopath" || true
   21   export GOPATH="$PKGMK_SOURCE_DIR/gopath"
   22 
   23   export PKG_CONFIG_PATH="/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
   24   #export PKG_CONFIG_PATH="/usr/lib/openssl-1.1/pkgconfig:$PKG_CONFIG_PATH"
   25   export PATH="/usr/bin:$PATH"
   26 
   27   cd $SRC/$name-$version
   28 
   29   sed -ri 's,^(\s*data\s*=).*,\1 /var/lib/grafana,' conf/defaults.ini
   30   sed -ri 's,^(\s*plugins\s*=).*,\1 /var/lib/grafana/plugins,' conf/defaults.ini
   31   sed -ri 's,^(\s*provisioning\s*=).*,\1 /var/lib/grafana/conf/provisioning,' conf/defaults.ini
   32   sed -ri 's,^(\s*logs\s*=).*,\1 /var/log/grafana,' conf/defaults.ini
   33 
   34   # backend
   35   make gen-go
   36   go run build.go setup
   37   go run build.go build
   38 
   39   # frontend
   40   export NPM_CONFIG_PREFIX="$SRC/npm"
   41   export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
   42   export NODE_OPTIONS="--max-old-space-size=16000"
   43 
   44   /usr/bin/yarn install
   45   NODE_ENV=production /usr/bin/yarn run build
   46 
   47   # install
   48   install -Dm644 $SRC/$name.confd $PKG/etc/conf.d/$name
   49   install -Dsm755 bin/linux-amd64/grafana-server $PKG/usr/bin/grafana-server
   50   install -Dsm755 bin/linux-amd64/grafana-cli $PKG/usr/bin/grafana-cli
   51   install -Dm644 conf/sample.ini $PKG/etc/grafana.ini
   52   install -Dm644 conf/defaults.ini $PKG/usr/share/$name/conf/defaults.ini
   53   install -dm755 $PKG/usr/share/$name
   54   cp -r public $PKG/usr/share/$name/
   55 
   56   ## install rc file
   57   install -Dm 755 $SRC/grafana.service $PKG/etc/rc.d/grafana
   58 }

Generated by cgit