diff options
author | Konstantin Kulikov <k.kulikov2@gmail.com> | 2019-08-02 18:43:05 +0000 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2019-08-11 21:41:26 -0300 |
commit | e28d2e1f07e57e163b15dba7de2efc372cc06c5a (patch) | |
tree | e933a94ecb3383a2b09813620abc37324ec3ac19 /testing/grafana/APKBUILD | |
parent | 292c4bf77ed44d27e54df201fa5b89867888ca4e (diff) | |
download | aports-e28d2e1f07e57e163b15dba7de2efc372cc06c5a.tar.bz2 aports-e28d2e1f07e57e163b15dba7de2efc372cc06c5a.tar.xz |
testing/grafana: new aport
Diffstat (limited to 'testing/grafana/APKBUILD')
-rw-r--r-- | testing/grafana/APKBUILD | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/grafana/APKBUILD b/testing/grafana/APKBUILD new file mode 100644 index 0000000000..b9b5a0dbb6 --- /dev/null +++ b/testing/grafana/APKBUILD @@ -0,0 +1,56 @@ +# Contributor: Konstantin Kulikov <k.kulikov2@gmail.com> +# Maintainer: Konstantin Kulikov <k.kulikov2@gmail.com> +pkgname=grafana +pkgver=6.3.0 +pkgrel=0 +_commit=830da0fda # git rev-parse --short HEAD +_stamp=1565095768 # 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" + +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="d1af9c662011ba667465cde456daed42786269c41a0d2233bf9758da56d0ecbe8b4a7433e55d87f85a419da26b5d15b1f2df57c565333f7b79fc6a3863f6edc6 grafana-6.3.0.tar.gz +1d051e673c2904faf232f7cae790e69396504bddef3d8b7c892879eaf1a5906a566bb539d42f4d44b738dfa8eb37069a84b684c31cb93eb8d21e82a371ce1417 grafana.initd +00bbd8e650c3dac7c3e92d7fbeb99265f4ef5f5a70876d551173eb2bfc8732f8d9c4e03ed5fb776e1e2e58a5e9778a09cc551e5a30b9c73b9f4051393fd10f4b grafana.confd +740df131d7e8897b30c53140e170c9a5a1d84d422d8ae395b244bb525d4416c4e5acae2c6e1c2baf2710fe8e7067f849fc2986f567640afef0f28a694f560f86 phantomjs" |