diff options
author | Kevin Daudt <kdaudt@alpinelinux.org> | 2019-05-27 15:30:46 +0000 |
---|---|---|
committer | Kevin Daudt <kdaudt@alpinelinux.org> | 2019-05-27 15:30:57 +0000 |
commit | 5e53f637e0b4650f7f7f4df1a2bb6df6287d9866 (patch) | |
tree | 328f24b939d2ed7690c11c19b8afdff917bc1dc9 /testing/netdata | |
parent | 67a092075b8d623da92cb38d2d3db8cb69c16d95 (diff) | |
download | aports-5e53f637e0b4650f7f7f4df1a2bb6df6287d9866.tar.bz2 aports-5e53f637e0b4650f7f7f4df1a2bb6df6287d9866.tar.xz |
testing/netdata: adopt package
Diffstat (limited to 'testing/netdata')
-rw-r--r-- | testing/netdata/APKBUILD | 89 | ||||
-rw-r--r-- | testing/netdata/netdata.initd | 12 | ||||
-rw-r--r-- | testing/netdata/netdata.pre-install | 5 |
3 files changed, 106 insertions, 0 deletions
diff --git a/testing/netdata/APKBUILD b/testing/netdata/APKBUILD new file mode 100644 index 0000000000..2531b7cf52 --- /dev/null +++ b/testing/netdata/APKBUILD @@ -0,0 +1,89 @@ +# Contributor: Carlo Landmeter <clandmeter@gmail.com> +# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org> +pkgname=netdata +pkgver=1.14.0 +pkgrel=0 +pkgdesc="Real-time performance monitoring" +url="https://github.com/netdata/netdata" +license="GPL-3.0-or-later" +arch="all" +depends="bash" +makedepends="zlib-dev e2fsprogs-dev linux-headers libcap-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/releases/download/v${pkgver}/netdata-v${pkgver}.tar.gz + $pkgname.initd" +builddir="$srcdir"/$pkgname-v${pkgver} + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-zlib \ + --with-math \ + --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 +} + +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 (python support)" + depends="$pkgname python2" + + 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="593d3a0425838d0f82b5440e2158ac6e6d0ccf44a4fb267e6d528be0dc0da5a18b3981da5bcae8b27bb7fe6058541819fbe07aa6fc9fac33b4710a3c0663df6d netdata-1.14.0.tar.gz +0cc96162524bec0562e7ba0449d7d39ca6edd1928e2c1ac9f579a1fe5ea442f8ce670d04e84d2cac7c09843a9df7ed8151a6a3d2377713ffba4c86b43b8d9096 netdata.initd" diff --git a/testing/netdata/netdata.initd b/testing/netdata/netdata.initd new file mode 100644 index 0000000000..61cad7d002 --- /dev/null +++ b/testing/netdata/netdata.initd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +command=/usr/sbin/netdata +pidfile=/run/netdata.pid +command_args="-P ${pidfile}" +name="netdata" +description="Real-time performance monitoring" + +depend() { + need net + after apache2 squid nginx mysql named opensips hostapd postfix lm_sensors +} diff --git a/testing/netdata/netdata.pre-install b/testing/netdata/netdata.pre-install new file mode 100644 index 0000000000..7bcb4821ae --- /dev/null +++ b/testing/netdata/netdata.pre-install @@ -0,0 +1,5 @@ +#!/bin/sh +addgroup -S netdata 2>/dev/null +adduser -S -D -H -h /dev/null -s /sbin/nologin -G netdata -g netdata netdata 2>/dev/null +addgroup netdata readproc 2>/dev/null +exit 0 |