PKGBUILD 1.33 KB
Newer Older
Nigel Kukard's avatar
Nigel Kukard committed
1
2
3
# Maintainer: Nigel Kukard <nkukard@LBSD.net>
# Contributor: Florian Pritz <bluewind@xinu.at>
pkgname=grafana-zabbix
Nigel Kukard's avatar
Nigel Kukard committed
4
pkgver=4.2.3
Nigel Kukard's avatar
Nigel Kukard committed
5
6
7
8
9
10
pkgrel=1.1
pkgdesc="Zabbix plugin for Grafana dashboard"
arch=('any')
url="https://github.com/alexanderzobnin/grafana-zabbix"
license=('APACHE')
depends=('grafana')
Nigel Kukard's avatar
Nigel Kukard committed
11
makedepends=('nodejs-lts-fermium' 'yarn' 'python2' 'libfaketime' 'go' 'git') # node-sass depends on node-gyp 3.8.0 which is still python2 https://github.com/sass/node-sass/issues/2877
Nigel Kukard's avatar
Nigel Kukard committed
12
source=("$pkgname-$pkgver.tar.gz::https://github.com/alexanderzobnin/grafana-zabbix/archive/v$pkgver.tar.gz")
Nigel Kukard's avatar
Nigel Kukard committed
13
sha256sums=('e004a75acbbe2f8229fc1783522b1b94253b3c74675ccd036224fa09bdfb371c')
Nigel Kukard's avatar
Nigel Kukard committed
14
15
16

build() {
	cd "$pkgname-$pkgver"
Nigel Kukard's avatar
Nigel Kukard committed
17
	export GOPATH="$srcdir"/go
Nigel Kukard's avatar
Nigel Kukard committed
18
	export CXXFLAGS+=' -std=c++14 '
Nigel Kukard's avatar
Nigel Kukard committed
19
20
21
22
23
24
25
26
27
28
	make install
	make build
	make dist
	# Rerun this part since otherwise the linux_amd64 file ist missing from the
	# dist dir
	make dist-backend
}

check() {
	cd "$pkgname-$pkgver"
Nigel Kukard's avatar
Nigel Kukard committed
29
	export GOPATH="$srcdir"/go
Nigel Kukard's avatar
Nigel Kukard committed
30
	# Force UTC timezone so that tests pass, even after a DST change
Nigel Kukard's avatar
Nigel Kukard committed
31
	PATH="$PATH:/build/go/bin" TZ=UTC make test
Nigel Kukard's avatar
Nigel Kukard committed
32
33
34
35
36
37
38
39
}

package() {
	cd "$pkgname-$pkgver"
	install -dm755 "$pkgdir/var/lib/grafana/plugins/alexanderzobnin-zabbix-app"
	cp -r dist/* "$pkgdir/var/lib/grafana/plugins/alexanderzobnin-zabbix-app"
	rm -rf "$pkgdir/var/lib/grafana/plugins/alexanderzobnin-zabbix-app/node_modules"
}