aboutsummaryrefslogtreecommitdiffstats
path: root/testing/netdata/APKBUILD
blob: 3f1d658d8d9fc23ade04b8166ca6fbe5e2e8923e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=netdata
pkgver=1.6.0
pkgrel=0
pkgdesc="Real-time performance monitoring"
url="https://github.com/firehol/netdata"
license="GPL3+"
arch="all"
depends="bash"
makedepends="zlib-dev e2fsprogs-dev"
pkgusers="netdata"
pkggroups="netdata"
subpackages="$pkgname-nodejs $pkgname-python"
install="$pkgname.pre-install"
source="https://github.com/firehol/netdata/releases/download/v$pkgver/netdata-$pkgver.tar.xz
	$pkgname.initd"
builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	default_prepare
	update_config_guess
}

build() {
	cd "$builddir"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--with-zlib \
		--with-math \
		--with-webdir=/usr/share/webapss/netdata \
		--with-user=netdata || return 1
	make || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install || return 1
	chgrp -R $pkggroups "$pkgdir"/usr/share/webapss/netdata || return 1
	chown -R $pkgusers:$pkggroups $pkgdir/var/lib/netdata \
		$pkgdir/var/cache/netdata || return 1
	install -Dm755 $srcdir/$pkgname.initd \
		$pkgdir/etc/init.d/$pkgname || return 1
}

nodejs() {
	pkgdesc="$pkgdesc (nodejs support)"
	depends="$pkgname nodejs"
	mkdir -p "$subpkgdir"/usr/libexec/netdata
	mv $pkgdir/usr/libexec/netdata/node.d \
		$subpkgdir/usr/libexec/netdata || return 1
}

python() {
	pkgdesc="$pkgdesc (python support)"
	depends="$pkgname python2"
	mkdir -p "$subpkgdir"/usr/libexec/netdata
	mv $pkgdir/usr/libexec/netdata/python.d \
		"$subpkgdir"/usr/libexec/netdata || return 1
}

sha512sums="e091c2b3a619f62c209d2de8389bc33f98159071730344b17b66a766a3dcf2f598c95f10dbaf1421e32a468f18c975373291e3909002e9bf21dea9939559e1fc  netdata-1.6.0.tar.xz
2aaaee7010c24b3f52be8b01295f73ac6c38ac4d1b627e8b9227d03fe3b248b7157b1d5217edebd88ba461adc1ce89503520acd877b300e4503e75125f40da96  netdata.initd"