]> git.immae.eu Git - perso/Immae/Config/AUR.git/commitdiff
Initial commit
authorJonathan Steel <jsteel@archlinux.org>
Mon, 8 Jun 2015 17:37:33 +0000 (18:37 +0100)
committerJonathan Steel <jsteel@archlinux.org>
Mon, 8 Jun 2015 17:37:33 +0000 (18:37 +0100)
.SRCINFO [new file with mode: 0644]
PKGBUILD [new file with mode: 0644]
naemon.install [new file with mode: 0644]
naemon.service [new file with mode: 0644]

diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644 (file)
index 0000000..356c51e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,61 @@
+# Generated by makepkg 4.2.1
+# Tue Apr 21 14:57:11 UTC 2015
+pkgbase = naemon
+       pkgver = 1.0.3
+       pkgrel = 1
+       url = http://naemon.org
+       arch = i686
+       arch = x86_64
+       license = GPL2
+       makedepends = gperf
+       makedepends = rsync
+       makedepends = gd
+       makedepends = mariadb-clients
+       source = http://labs.consol.de/naemon/release/v1.0.3/src/naemon-1.0.3.tar.gz
+       source = naemon.service
+       md5sums = 0d6873669bd44375978c97174529e258
+       md5sums = d6a77534e612e8f65ff3360336faec77
+
+pkgname = naemon-core
+       pkgdesc = System and network monitoring application
+       install = naemon.install
+       depends = bash
+       optdepends = logrotate
+       optdepends = monitoring-plugins
+       backup = etc/logrotate.d/naemon
+       backup = etc/naemon/conf.d/commands.cfg
+       backup = etc/naemon/conf.d/contacts.cfg
+       backup = etc/naemon/conf.d/localhost.cfg
+       backup = etc/naemon/conf.d/printer.cfg
+       backup = etc/naemon/conf.d/switch.cfg
+       backup = etc/naemon/conf.d/templates/contacts.cfg
+       backup = etc/naemon/conf.d/templates/hosts.cfg
+       backup = etc/naemon/conf.d/templates/services.cfg
+       backup = etc/naemon/conf.d/timeperiods.cfg
+       backup = etc/naemon/conf.d/windows.cfg
+       backup = etc/naemon/naemon.cfg
+       backup = etc/naemon/resource.cfg
+
+pkgname = naemon-livestatus
+       pkgdesc = Standard API for Naemon
+       depends = icu
+
+pkgname = naemon-thruk
+       pkgdesc = Monitoring Webinterface for Naemon
+       depends = gd
+       depends = mariadb-clients
+       depends = apache
+       depends = mod_fcgid
+       backup = etc/naemon/cgi.cfg
+       backup = etc/naemon/htpasswd
+       backup = etc/naemon/log4perl.conf
+       backup = etc/naemon/menu_local.conf
+       backup = etc/naemon/naglint.conf
+       backup = etc/httpd/conf/extra/thruk.conf
+       backup = etc/httpd/conf/extra/thruk_cookie_auth_vhost.conf
+       backup = etc/naemon/thruk_local.conf
+       backup = etc/naemon/thruk.conf
+       backup = etc/naemon/conf.d/thruk_bp_generated.cfg
+       backup = etc/naemon/conf.d/thruk_templates.cfg
+       backup = etc/logrotate.d/thruk
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644 (file)
index 0000000..01f7a64
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,120 @@
+# Maintainer: Jonathan Steel <jsteel at archlinux.org>
+
+pkgbase=naemon
+pkgname=('naemon-core' 'naemon-livestatus' 'naemon-thruk')
+pkgver=1.0.3
+pkgrel=1
+arch=('i686' 'x86_64')
+url="http://naemon.org"
+license=('GPL2')
+makedepends=('gperf' 'rsync' 'gd' 'mariadb-clients')
+source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgbase-$pkgver.tar.gz
+        $pkgbase.service)
+md5sums=('0d6873669bd44375978c97174529e258'
+         'd6a77534e612e8f65ff3360336faec77')
+
+prepare() {
+  cd $pkgbase-$pkgver
+
+  # Break up the install process so we can package the separate components
+  sed -i '60iinstall-livestatus:' Makefile
+  sed -i '62iinstall-thruk:' Makefile
+}
+
+build() {
+  cd $pkgbase-$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" \
+              --enable-event-broker \
+              --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.pid" \
+              --with-thruk-user="http" \
+              --with-thruk-group="naemon" \
+              --with-thruk-libs="/usr/lib/naemon/perl5" \
+              --with-thruk-tempdir="/var/cache/naemon/thruk" \
+              --with-thruk-vardir="/var/lib/naemon/thruk" \
+              --with-httpd-conf="/etc/httpd/conf/extra/" \
+              --with-htmlurl="/naemon"
+
+  make
+}
+
+check() {
+  cd $pkgbase-$pkgver/naemon-core
+
+  make check
+}
+
+package_naemon-core() {
+pkgdesc="System and network monitoring application"
+depends=('bash')
+optdepends=('logrotate'
+            'monitoring-plugins')
+backup=('etc/logrotate.d/naemon' 'etc/naemon/conf.d/commands.cfg'
+  'etc/naemon/conf.d/contacts.cfg' 'etc/naemon/conf.d/localhost.cfg'
+  'etc/naemon/conf.d/printer.cfg' 'etc/naemon/conf.d/switch.cfg'
+  'etc/naemon/conf.d/templates/contacts.cfg'
+  'etc/naemon/conf.d/templates/hosts.cfg'
+  'etc/naemon/conf.d/templates/services.cfg'
+  'etc/naemon/conf.d/timeperiods.cfg' 'etc/naemon/conf.d/windows.cfg'
+  'etc/naemon/naemon.cfg' 'etc/naemon/resource.cfg')
+install=$pkgbase.install
+
+  cd $pkgbase-$pkgver
+
+  make DESTDIR="$pkgdir" install
+
+  chown -R 44:44 "$pkgdir"/var/{cache,log}/$pkgbase
+  chmod -R 770 "$pkgdir"/var/{cache,log}/$pkgbase
+
+  install -Dm644 "$srcdir"/$pkgbase.service \
+    "$pkgdir"/usr/lib/systemd/system/$pkgbase.service
+
+  # Remove init script
+  rm -rf "$pkgdir"/etc/init.d
+}
+
+package_naemon-livestatus() {
+pkgdesc="Standard API for Naemon"
+depends=('icu')
+
+  cd $pkgbase-$pkgver
+
+  make DESTDIR="$pkgdir" install-livestatus
+}
+
+package_naemon-thruk() {
+pkgdesc="Monitoring Webinterface for Naemon"
+depends=('gd' 'mariadb-clients' 'apache' 'mod_fcgid')
+backup=('etc/naemon/cgi.cfg' 'etc/naemon/htpasswd'
+  'etc/naemon/log4perl.conf' 'etc/naemon/menu_local.conf'
+  'etc/naemon/naglint.conf' 'etc/httpd/conf/extra/thruk.conf'
+  'etc/httpd/conf/extra/thruk_cookie_auth_vhost.conf'
+  'etc/naemon/thruk_local.conf' 'etc/naemon/thruk.conf'
+  'etc/naemon/conf.d/thruk_bp_generated.cfg'
+  'etc/naemon/conf.d/thruk_templates.cfg' 'etc/logrotate.d/thruk')
+
+  cd $pkgbase-$pkgver
+
+  make DESTDIR="$pkgdir" install-thruk
+
+  chown -R 44:44 "$pkgdir"/var/{cache,lib,log}/$pkgbase
+  chmod -R 770 "$pkgdir"/var/{cache,lib,log}/$pkgbase
+
+  # Remove init script
+  rm -rf "$pkgdir"/etc/init.d
+}
diff --git a/naemon.install b/naemon.install
new file mode 100644 (file)
index 0000000..429505a
--- /dev/null
@@ -0,0 +1,19 @@
+pre_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 /sbin/nologin -c "Naemon" naemon
+}
+
+pre_upgrade() {
+  pre_install
+}
+
+pre_remove() {
+  if [[ -f /run/naemon/naemon.pid ]]; then
+    systemctl stop naemon
+  fi
+}
+
+post_remove() {
+  userdel naemon
+}
diff --git a/naemon.service b/naemon.service
new file mode 100644 (file)
index 0000000..6b3edc8
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=Naemon Monitoring Daemon
+Documentation=http://naemon.org/documentation
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/run/naemon.pid
+ExecStartPre=/usr/bin/naemon -vp /etc/naemon/naemon.cfg
+ExecStart=/usr/bin/naemon /etc/naemon/naemon.cfg
+ExecReload=/bin/kill -HUP $MAINPID
+User=naemon
+Group=naemon
+StandardOutput=journal
+StandardError=inherit
+
+[Install]
+WantedBy=multi-user.target