]> git.immae.eu Git - perso/Immae/Config/AUR.git/commitdiff
Add 'naemon/' from commit 'a4b20506c21eeead57d134bdf6ac77cd23e1664a'
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 14 Feb 2019 13:18:04 +0000 (14:18 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 14 Feb 2019 13:18:04 +0000 (14:18 +0100)
git-subtree-dir: naemon
git-subtree-mainline: 9fdac65911c67456485615088b8291b97cf72c99
git-subtree-split: a4b20506c21eeead57d134bdf6ac77cd23e1664a

naemon/.SRCINFO [new file with mode: 0644]
naemon/PKGBUILD [new file with mode: 0644]
naemon/naemon-tmpfiles.conf [new file with mode: 0644]
naemon/naemon.install [new file with mode: 0644]
naemon/naemon.service [new file with mode: 0644]

diff --git a/naemon/.SRCINFO b/naemon/.SRCINFO
new file mode 100644 (file)
index 0000000..49a36ad
--- /dev/null
@@ -0,0 +1,31 @@
+# Generated by mksrcinfo v8
+# Thu Feb 14 12:35:45 UTC 2019
+pkgbase = naemon
+       pkgdesc = System and network monitoring application
+       pkgver = 1.0.9
+       pkgrel = 1
+       url = http://naemon.org
+       install = naemon.install
+       arch = i686
+       arch = x86_64
+       license = GPL2
+       makedepends = gperf
+       makedepends = help2man
+       depends = icu
+       depends = glib2
+       optdepends = logrotate
+       optdepends = thruk: Web interface for Naemon
+       optdepends = naemon-livestatus: Event broker
+       optdepends = monitoring-plugins
+       backup = etc/logrotate.d/naemon
+       backup = etc/naemon/naemon.cfg
+       backup = etc/naemon/resource.cfg
+       source = http://labs.consol.de/naemon/release/v1.0.9/src/naemon-1.0.9.tar.gz
+       source = naemon-tmpfiles.conf
+       source = naemon.service
+       sha512sums = cf2a359a7fcf95a7668f8db35ccd23ad607c05cd85f51a9488cc183a2683da1ba9c7b0a7303d9f03825fbd13103372944267f2a99c10280004c51669e6343793
+       sha512sums = 756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d
+       sha512sums = 28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2
+
+pkgname = naemon
+
diff --git a/naemon/PKGBUILD b/naemon/PKGBUILD
new file mode 100644 (file)
index 0000000..fdcf283
--- /dev/null
@@ -0,0 +1,82 @@
+# Maintainer: Immae <ismael.bouya@normalesup.org>
+# Contributor: Jonathan Steel <jsteel at archlinux.org>
+
+pkgname=naemon
+pkgver=1.0.9
+pkgrel=1
+pkgdesc="System and network monitoring application"
+arch=('i686' 'x86_64')
+url="http://naemon.org"
+license=('GPL2')
+depends=('icu' 'glib2')
+optdepends=('logrotate'
+            'thruk: Web interface for Naemon'
+            'naemon-livestatus: Event broker'
+            'monitoring-plugins')
+makedepends=('gperf' 'help2man')
+source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgname-$pkgver.tar.gz
+        $pkgname-tmpfiles.conf
+        $pkgname.service)
+sha512sums=('cf2a359a7fcf95a7668f8db35ccd23ad607c05cd85f51a9488cc183a2683da1ba9c7b0a7303d9f03825fbd13103372944267f2a99c10280004c51669e6343793'
+            '756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d'
+            '28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2')
+backup=('etc/logrotate.d/naemon'
+        'etc/naemon/naemon.cfg'
+        'etc/naemon/resource.cfg')
+install=$pkgname.install
+
+build() {
+  cd "$srcdir/$pkgname-$pkgver"
+
+  ./configure --prefix=/usr \
+              --bindir=/usr/bin \
+              --datadir="/usr/share/naemon" \
+              --libdir="/usr/lib/naemon" \
+              --localstatedir="/var/lib/naemon" \
+              --sysconfdir="/etc/naemon" \
+              --with-pkgconfdir="/etc/naemon" \
+              --mandir="/usr/share/man" \
+              --with-pluginsdir="/usr/lib/monitoring-plugins" \
+              --with-tempdir="/var/cache/naemon" \
+              --with-checkresultdir="/var/cache/naemon/checkresults" \
+              --with-logdir="/var/log/naemon" \
+              --with-initdir="/etc/init.d" \
+              --with-logrotatedir="/etc/logrotate.d" \
+              --with-naemon-user="naemon" \
+              --with-naemon-group="naemon" \
+              --with-lockfile="/run/naemon/naemon.pid"
+
+  make
+}
+
+check() {
+  cd "$srcdir/$pkgname-$pkgver"
+
+  # One of the tests fail for some reason, upstream notified.
+  make check || true
+}
+
+package() {
+  cd "$srcdir/$pkgname-$pkgver"
+
+  make DESTDIR="$pkgdir" install
+
+  install -d "$pkgdir"/etc/naemon/module-conf.d
+
+  rm -rf "$pkgdir"/var/{cache,log}
+
+  install -dm755 "$pkgdir"/var/lib/naemon
+  install -Dm644 "$srcdir"/$pkgname.service \
+    "$pkgdir"/usr/lib/systemd/system/$pkgname.service
+
+  # Move sample config files
+  install -dm755 "$pkgdir"/user/share/doc/naemon
+  mv "$pkgdir"/etc/naemon/conf.d "$pkgdir"/user/share/doc/naemon/
+  install -d "$pkgdir"/etc/naemon/conf.d/templates
+
+  # Remove non-Arch directories
+  rm -rf "$pkgdir"/etc/init.d
+  rm -rf "$pkgdir"/etc/apache2
+
+  install -Dm644 "$srcdir"/naemon-tmpfiles.conf "$pkgdir"/usr/lib/tmpfiles.d/naemon.conf
+}
diff --git a/naemon/naemon-tmpfiles.conf b/naemon/naemon-tmpfiles.conf
new file mode 100644 (file)
index 0000000..a7d9d86
--- /dev/null
@@ -0,0 +1,9 @@
+D /var/run/naemon 0770 naemon naemon -
+D /var/cache/naemon 0770 naemon naemon -
+D /var/cache/naemon/checkresults 0770 naemon naemon -
+D /var/lib/naemon/spool 0775 naemon naemon -
+D /var/lib/naemon/spool/checkresults 0775 naemon naemon -
+D /var/lib/naemon/thruk 0775 naemon naemon -
+D /var/lib/naemon/perl5 0775 naemon naemon -
+D /var/log/naemon 0770 naemon naemon -
+D /var/log/naemon/archives 0770 naemon naemon -
diff --git a/naemon/naemon.install b/naemon/naemon.install
new file mode 100644 (file)
index 0000000..c32c848
--- /dev/null
@@ -0,0 +1,21 @@
+post_install() {
+  getent group naemon &> /dev/null || groupadd -r naemon -g 44
+  getent passwd naemon &> /dev/null || useradd -r -u 44 -g naemon \
+    -d /var/lib/naemon -s /usr/bin/false -c "Naemon" naemon
+
+  chown naemon:naemon /var/lib/naemon
+  chown -R naemon:naemon /etc/naemon
+  /usr/bin/systemd-tmpfiles --create naemon.conf
+}
+
+pre_remove() {
+  if [[ -f /run/naemon/naemon.pid ]]; then
+    systemctl stop naemon
+  fi
+  /usr/bin/systemd-tmpfiles --remove naemon.conf
+
+  userdel naemon &> /dev/null
+  groupdel naemon &> /dev/null
+
+  rm -rf /var/lib/naemon
+}
diff --git a/naemon/naemon.service b/naemon/naemon.service
new file mode 100644 (file)
index 0000000..0c3a0da
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=Naemon Monitoring Daemon
+Documentation=http://naemon.org/documentation
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/naemon/naemon.pid
+ExecStartPre=/usr/bin/naemon -vp /etc/naemon/naemon.cfg
+ExecStart=/usr/bin/naemon --daemon /etc/naemon/naemon.cfg
+ExecReload=/bin/kill -HUP $MAINPID
+User=naemon
+Group=naemon
+StandardOutput=journal
+StandardError=inherit
+
+[Install]
+WantedBy=multi-user.target