From dd9914082e121658912acdbfbcf73e1fa6263a6c Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Sun, 26 Mar 2017 21:34:52 +0000 Subject: [PATCH] added community/netdata --- community/netdata/PKGBUILD | 45 +++++++++++++++++++++++++++++++ community/netdata/netdata.install | 26 ++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 community/netdata/PKGBUILD create mode 100644 community/netdata/netdata.install diff --git a/community/netdata/PKGBUILD b/community/netdata/PKGBUILD new file mode 100644 index 000000000..45ec6606b --- /dev/null +++ b/community/netdata/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: Sven-Hendrik Haase +# Contributor: SanskritFritz (gmail) + +# ALARM: Kevin Mihelich +# - disable LTO + +pkgname=netdata +pkgver=1.6.0 +pkgrel=1 +pkgdesc="Real-time performance monitoring, in the greatest possible detail, over the web." +url="https://github.com/firehol/netdata/wiki" +arch=('i686' 'x86_64') +license=('GPL') +depends=('libmnl' 'libnetfilter_acct' 'zlib') +optdepends=('nodejs: Webbox plugin' + 'lm_sensors: sensors module') +backup=('etc/netdata/netdata.conf' 'etc/netdata/charts.d.conf' 'etc/netdata/apps_groups.conf') +install="$pkgname.install" +source=("https://github.com/firehol/netdata/releases/download/v${pkgver}/netdata-${pkgver}.tar.xz") +sha512sums=('e091c2b3a619f62c209d2de8389bc33f98159071730344b17b66a766a3dcf2f598c95f10dbaf1421e32a468f18c975373291e3909002e9bf21dea9939559e1fc') + +build() { + cd "$pkgname-$pkgver" + + ./autogen.sh + ./configure \ + --prefix="/usr" \ + --sbindir="/usr/bin" \ + --sysconfdir="/etc" \ + --libexecdir="/usr/lib" \ + --localstatedir="/var" \ + --with-zlib --with-math --with-user=netdata --disable-lto + make +} + +package() { + cd "$pkgname-$pkgver" + + make DESTDIR="$pkgdir" install + + touch "$pkgdir/etc/netdata/netdata.conf" + + install -Dm0644 "system/netdata.service" "$pkgdir/usr/lib/systemd/system/netdata.service" +} + diff --git a/community/netdata/netdata.install b/community/netdata/netdata.install new file mode 100644 index 000000000..dd03e8ffa --- /dev/null +++ b/community/netdata/netdata.install @@ -0,0 +1,26 @@ +chown_netdata() { + chown -R netdata:netdata /var/lib/netdata + chown -R netdata:netdata /var/log/netdata + chown -R netdata:netdata /var/cache/netdata + chown -R netdata:netdata /usr/share/netdata/web + chown -R netdata:netdata /etc/netdata +} + +post_install() { + getent group netdata > /dev/null || groupadd -g 134 netdata 1>/dev/null + getent passwd netdata > /dev/null || useradd -u 134 -d /var/cache/netdata -g netdata -s /bin/nologin netdata 1>/dev/null + + chown_netdata + + echo + echo "After the daemon has been started for the first time," + echo "download the default config file from" + echo "http://127.0.0.1:19999/netdata.conf" + echo + echo "Copy it to /etc/netdata/ and modify it." + echo +} + +post_upgrade() { + chown_netdata +}