aboutsummaryrefslogtreecommitdiffstats
path: root/testing/netdata/APKBUILD
blob: 72129518b24a5ca65baabcdd0f9a7894fa14f3a0 (plain) (blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=netdata
pkgver=1.18.1
pkgrel=2
pkgdesc="Real-time performance monitoring"
url="https://www.netdata.cloud/"
license="GPL-3.0-or-later"
arch="all"
depends="bash"
makedepends="zlib-dev e2fsprogs-dev linux-headers libcap-dev automake autoconf
	openssl-dev"
pkgusers="netdata"
pkggroups="netdata"
subpackages="$pkgname-openrc $pkgname-nodejs::noarch $pkgname-python::noarch"
install="$pkgname.pre-install"
source="$pkgname-$pkgver.tar.gz::https://github.com/netdata/netdata/archive/v$pkgver.tar.gz
	$pkgname.initd"

prepare() {
	default_prepare
	autoreconf -i
}

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--with-zlib \
		--with-math \
		--enable-https \
		--with-webdir=/usr/share/webapss/netdata \
		--with-user=netdata
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	chgrp -R $pkggroups "$pkgdir"/usr/share/webapss/netdata
	chown -R $pkgusers:$pkggroups $pkgdir/var/lib/netdata \
		$pkgdir/var/cache/netdata
	install -Dm755 $srcdir/$pkgname.initd \
		$pkgdir/etc/init.d/$pkgname
	install -Dm644 ./system/netdata.conf $pkgdir/etc/netdata/netdata.conf

	# cap needed for disk I/O utilization reporting
	setcap cap_dac_read_search,cap_sys_ptrace+ep \
		"$pkgdir"/usr/libexec/netdata/plugins.d/apps.plugin

	install -d -Dm0750 -o netdata -g netdata "$pkgdir"/var/lib/netdata
	install -d -Dm0750 -o netdata -g netdata "$pkgdir"/var/log/netdata
	install -d -Dm0750 -o netdata -g netdata "$pkgdir"/var/cache/netdata
}

nodejs() {
	pkgdesc="$pkgdesc (nodejs support)"
	depends="$pkgname nodejs"

	mkdir -p "$subpkgdir"/etc/netdata
	mkdir -p "$subpkgdir"/usr/libexec/netdata/plugins.d
	mkdir -p "$subpkgdir"/usr/lib/netdata/conf.d

	mv $pkgdir/usr/libexec/netdata/node.d \
		$subpkgdir/usr/libexec/netdata
	mv $pkgdir/usr/libexec/netdata/plugins.d/node.d.plugin \
		$subpkgdir/usr/libexec/netdata/plugins.d
	mv $pkgdir/etc/netdata/node.d \
		$subpkgdir/etc/netdata/
	mv $pkgdir/usr/lib/netdata/conf.d/node.d.conf \
		$subpkgdir/usr/lib/netdata/conf.d
}

python() {
	pkgdesc="$pkgdesc (python3 support)"
	depends="$pkgname python3"

	mkdir -p "$subpkgdir"/etc/netdata
	mkdir -p "$subpkgdir"/usr/libexec/netdata/plugins.d
	mkdir -p "$subpkgdir"/usr/lib/netdata/conf.d

	mv $pkgdir/usr/libexec/netdata/python.d \
		"$subpkgdir"/usr/libexec/netdata
	mv $pkgdir/usr/libexec/netdata/plugins.d/python.d.plugin \
		"$subpkgdir"/usr/libexec/netdata/plugins.d
	mv $pkgdir/etc/netdata/python.d \
		$subpkgdir/etc/netdata/
	mv $pkgdir/usr/lib/netdata/conf.d/python.d \
		$subpkgdir/usr/lib/netdata/conf.d
	mv $pkgdir/usr/lib/netdata/conf.d/python.d.conf \
		$subpkgdir/usr/lib/netdata/conf.d
}

sha512sums="fb72f4729e05ab83fe9462e31b10fc40243472ea9f6cbb9421e2ca549810f2f80b28b05e886faa66e15c53b317ee559a3e0fb3d382c36a424dd39fec779918d9  netdata-1.18.1.tar.gz
98dd8f188dfffe1221d05a4dd369e8f4f8dc2bf7a722ac8769afd351324b53b37c5675e705a4d42d20ce93ea9497fda9eb2457edaa500d4e72c9f1350b1d4652  netdata.initd"