diff options
author | Jonathan Steel <jsteel@archlinux.org> | 2015-06-08 18:37:33 +0100 |
---|---|---|
committer | Jonathan Steel <jsteel@archlinux.org> | 2015-06-08 18:37:33 +0100 |
commit | 403b591f0104d36ebd13eaddf6da2263941b8eae (patch) | |
tree | f924d70713ef8ef03283585c9a894445aa7c90af | |
download | AUR-403b591f0104d36ebd13eaddf6da2263941b8eae.tar.gz AUR-403b591f0104d36ebd13eaddf6da2263941b8eae.tar.zst AUR-403b591f0104d36ebd13eaddf6da2263941b8eae.zip |
Initial commit
-rw-r--r-- | .SRCINFO | 61 | ||||
-rw-r--r-- | PKGBUILD | 120 | ||||
-rw-r--r-- | naemon.install | 19 | ||||
-rw-r--r-- | naemon.service | 18 |
4 files changed, 218 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..356c51e --- /dev/null +++ b/.SRCINFO | |||
@@ -0,0 +1,61 @@ | |||
1 | # Generated by makepkg 4.2.1 | ||
2 | # Tue Apr 21 14:57:11 UTC 2015 | ||
3 | pkgbase = naemon | ||
4 | pkgver = 1.0.3 | ||
5 | pkgrel = 1 | ||
6 | url = http://naemon.org | ||
7 | arch = i686 | ||
8 | arch = x86_64 | ||
9 | license = GPL2 | ||
10 | makedepends = gperf | ||
11 | makedepends = rsync | ||
12 | makedepends = gd | ||
13 | makedepends = mariadb-clients | ||
14 | source = http://labs.consol.de/naemon/release/v1.0.3/src/naemon-1.0.3.tar.gz | ||
15 | source = naemon.service | ||
16 | md5sums = 0d6873669bd44375978c97174529e258 | ||
17 | md5sums = d6a77534e612e8f65ff3360336faec77 | ||
18 | |||
19 | pkgname = naemon-core | ||
20 | pkgdesc = System and network monitoring application | ||
21 | install = naemon.install | ||
22 | depends = bash | ||
23 | optdepends = logrotate | ||
24 | optdepends = monitoring-plugins | ||
25 | backup = etc/logrotate.d/naemon | ||
26 | backup = etc/naemon/conf.d/commands.cfg | ||
27 | backup = etc/naemon/conf.d/contacts.cfg | ||
28 | backup = etc/naemon/conf.d/localhost.cfg | ||
29 | backup = etc/naemon/conf.d/printer.cfg | ||
30 | backup = etc/naemon/conf.d/switch.cfg | ||
31 | backup = etc/naemon/conf.d/templates/contacts.cfg | ||
32 | backup = etc/naemon/conf.d/templates/hosts.cfg | ||
33 | backup = etc/naemon/conf.d/templates/services.cfg | ||
34 | backup = etc/naemon/conf.d/timeperiods.cfg | ||
35 | backup = etc/naemon/conf.d/windows.cfg | ||
36 | backup = etc/naemon/naemon.cfg | ||
37 | backup = etc/naemon/resource.cfg | ||
38 | |||
39 | pkgname = naemon-livestatus | ||
40 | pkgdesc = Standard API for Naemon | ||
41 | depends = icu | ||
42 | |||
43 | pkgname = naemon-thruk | ||
44 | pkgdesc = Monitoring Webinterface for Naemon | ||
45 | depends = gd | ||
46 | depends = mariadb-clients | ||
47 | depends = apache | ||
48 | depends = mod_fcgid | ||
49 | backup = etc/naemon/cgi.cfg | ||
50 | backup = etc/naemon/htpasswd | ||
51 | backup = etc/naemon/log4perl.conf | ||
52 | backup = etc/naemon/menu_local.conf | ||
53 | backup = etc/naemon/naglint.conf | ||
54 | backup = etc/httpd/conf/extra/thruk.conf | ||
55 | backup = etc/httpd/conf/extra/thruk_cookie_auth_vhost.conf | ||
56 | backup = etc/naemon/thruk_local.conf | ||
57 | backup = etc/naemon/thruk.conf | ||
58 | backup = etc/naemon/conf.d/thruk_bp_generated.cfg | ||
59 | backup = etc/naemon/conf.d/thruk_templates.cfg | ||
60 | backup = etc/logrotate.d/thruk | ||
61 | |||
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..01f7a64 --- /dev/null +++ b/PKGBUILD | |||
@@ -0,0 +1,120 @@ | |||
1 | # Maintainer: Jonathan Steel <jsteel at archlinux.org> | ||
2 | |||
3 | pkgbase=naemon | ||
4 | pkgname=('naemon-core' 'naemon-livestatus' 'naemon-thruk') | ||
5 | pkgver=1.0.3 | ||
6 | pkgrel=1 | ||
7 | arch=('i686' 'x86_64') | ||
8 | url="http://naemon.org" | ||
9 | license=('GPL2') | ||
10 | makedepends=('gperf' 'rsync' 'gd' 'mariadb-clients') | ||
11 | source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgbase-$pkgver.tar.gz | ||
12 | $pkgbase.service) | ||
13 | md5sums=('0d6873669bd44375978c97174529e258' | ||
14 | 'd6a77534e612e8f65ff3360336faec77') | ||
15 | |||
16 | prepare() { | ||
17 | cd $pkgbase-$pkgver | ||
18 | |||
19 | # Break up the install process so we can package the separate components | ||
20 | sed -i '60iinstall-livestatus:' Makefile | ||
21 | sed -i '62iinstall-thruk:' Makefile | ||
22 | } | ||
23 | |||
24 | build() { | ||
25 | cd $pkgbase-$pkgver | ||
26 | |||
27 | ./configure --prefix=/usr \ | ||
28 | --bindir=/usr/bin \ | ||
29 | --datadir="/usr/share/naemon" \ | ||
30 | --libdir="/usr/lib/naemon" \ | ||
31 | --localstatedir="/var/lib/naemon" \ | ||
32 | --sysconfdir="/etc/naemon" \ | ||
33 | --with-pkgconfdir="/etc/naemon" \ | ||
34 | --mandir="/usr/share/man" \ | ||
35 | --enable-event-broker \ | ||
36 | --with-pluginsdir="/usr/lib/monitoring-plugins" \ | ||
37 | --with-tempdir="/var/cache/naemon" \ | ||
38 | --with-checkresultdir="/var/cache/naemon/checkresults" \ | ||
39 | --with-logdir="/var/log/naemon" \ | ||
40 | --with-initdir="/etc/init.d" \ | ||
41 | --with-logrotatedir="/etc/logrotate.d" \ | ||
42 | --with-naemon-user="naemon" \ | ||
43 | --with-naemon-group="naemon" \ | ||
44 | --with-lockfile="/run/naemon.pid" \ | ||
45 | --with-thruk-user="http" \ | ||
46 | --with-thruk-group="naemon" \ | ||
47 | --with-thruk-libs="/usr/lib/naemon/perl5" \ | ||
48 | --with-thruk-tempdir="/var/cache/naemon/thruk" \ | ||
49 | --with-thruk-vardir="/var/lib/naemon/thruk" \ | ||
50 | --with-httpd-conf="/etc/httpd/conf/extra/" \ | ||
51 | --with-htmlurl="/naemon" | ||
52 | |||
53 | make | ||
54 | } | ||
55 | |||
56 | check() { | ||
57 | cd $pkgbase-$pkgver/naemon-core | ||
58 | |||
59 | make check | ||
60 | } | ||
61 | |||
62 | package_naemon-core() { | ||
63 | pkgdesc="System and network monitoring application" | ||
64 | depends=('bash') | ||
65 | optdepends=('logrotate' | ||
66 | 'monitoring-plugins') | ||
67 | backup=('etc/logrotate.d/naemon' 'etc/naemon/conf.d/commands.cfg' | ||
68 | 'etc/naemon/conf.d/contacts.cfg' 'etc/naemon/conf.d/localhost.cfg' | ||
69 | 'etc/naemon/conf.d/printer.cfg' 'etc/naemon/conf.d/switch.cfg' | ||
70 | 'etc/naemon/conf.d/templates/contacts.cfg' | ||
71 | 'etc/naemon/conf.d/templates/hosts.cfg' | ||
72 | 'etc/naemon/conf.d/templates/services.cfg' | ||
73 | 'etc/naemon/conf.d/timeperiods.cfg' 'etc/naemon/conf.d/windows.cfg' | ||
74 | 'etc/naemon/naemon.cfg' 'etc/naemon/resource.cfg') | ||
75 | install=$pkgbase.install | ||
76 | |||
77 | cd $pkgbase-$pkgver | ||
78 | |||
79 | make DESTDIR="$pkgdir" install | ||
80 | |||
81 | chown -R 44:44 "$pkgdir"/var/{cache,log}/$pkgbase | ||
82 | chmod -R 770 "$pkgdir"/var/{cache,log}/$pkgbase | ||
83 | |||
84 | install -Dm644 "$srcdir"/$pkgbase.service \ | ||
85 | "$pkgdir"/usr/lib/systemd/system/$pkgbase.service | ||
86 | |||
87 | # Remove init script | ||
88 | rm -rf "$pkgdir"/etc/init.d | ||
89 | } | ||
90 | |||
91 | package_naemon-livestatus() { | ||
92 | pkgdesc="Standard API for Naemon" | ||
93 | depends=('icu') | ||
94 | |||
95 | cd $pkgbase-$pkgver | ||
96 | |||
97 | make DESTDIR="$pkgdir" install-livestatus | ||
98 | } | ||
99 | |||
100 | package_naemon-thruk() { | ||
101 | pkgdesc="Monitoring Webinterface for Naemon" | ||
102 | depends=('gd' 'mariadb-clients' 'apache' 'mod_fcgid') | ||
103 | backup=('etc/naemon/cgi.cfg' 'etc/naemon/htpasswd' | ||
104 | 'etc/naemon/log4perl.conf' 'etc/naemon/menu_local.conf' | ||
105 | 'etc/naemon/naglint.conf' 'etc/httpd/conf/extra/thruk.conf' | ||
106 | 'etc/httpd/conf/extra/thruk_cookie_auth_vhost.conf' | ||
107 | 'etc/naemon/thruk_local.conf' 'etc/naemon/thruk.conf' | ||
108 | 'etc/naemon/conf.d/thruk_bp_generated.cfg' | ||
109 | 'etc/naemon/conf.d/thruk_templates.cfg' 'etc/logrotate.d/thruk') | ||
110 | |||
111 | cd $pkgbase-$pkgver | ||
112 | |||
113 | make DESTDIR="$pkgdir" install-thruk | ||
114 | |||
115 | chown -R 44:44 "$pkgdir"/var/{cache,lib,log}/$pkgbase | ||
116 | chmod -R 770 "$pkgdir"/var/{cache,lib,log}/$pkgbase | ||
117 | |||
118 | # Remove init script | ||
119 | rm -rf "$pkgdir"/etc/init.d | ||
120 | } | ||
diff --git a/naemon.install b/naemon.install new file mode 100644 index 0000000..429505a --- /dev/null +++ b/naemon.install | |||
@@ -0,0 +1,19 @@ | |||
1 | pre_install() { | ||
2 | getent group naemon &> /dev/null || groupadd -r naemon -g 44 | ||
3 | getent passwd naemon &> /dev/null || useradd -r -u 44 -g naemon \ | ||
4 | -d /var/lib/naemon -s /sbin/nologin -c "Naemon" naemon | ||
5 | } | ||
6 | |||
7 | pre_upgrade() { | ||
8 | pre_install | ||
9 | } | ||
10 | |||
11 | pre_remove() { | ||
12 | if [[ -f /run/naemon/naemon.pid ]]; then | ||
13 | systemctl stop naemon | ||
14 | fi | ||
15 | } | ||
16 | |||
17 | post_remove() { | ||
18 | userdel naemon | ||
19 | } | ||
diff --git a/naemon.service b/naemon.service new file mode 100644 index 0000000..6b3edc8 --- /dev/null +++ b/naemon.service | |||
@@ -0,0 +1,18 @@ | |||
1 | [Unit] | ||
2 | Description=Naemon Monitoring Daemon | ||
3 | Documentation=http://naemon.org/documentation | ||
4 | After=network.target | ||
5 | |||
6 | [Service] | ||
7 | Type=simple | ||
8 | PIDFile=/run/naemon.pid | ||
9 | ExecStartPre=/usr/bin/naemon -vp /etc/naemon/naemon.cfg | ||
10 | ExecStart=/usr/bin/naemon /etc/naemon/naemon.cfg | ||
11 | ExecReload=/bin/kill -HUP $MAINPID | ||
12 | User=naemon | ||
13 | Group=naemon | ||
14 | StandardOutput=journal | ||
15 | StandardError=inherit | ||
16 | |||
17 | [Install] | ||
18 | WantedBy=multi-user.target | ||