diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-14 14:18:04 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-14 14:18:04 +0100 |
commit | 872e3678865d0da64a2110b3595f47f0bf3f8ab0 (patch) | |
tree | f896cdc8448d0f5037599617f028dbe46c87c10c | |
parent | 9fdac65911c67456485615088b8291b97cf72c99 (diff) | |
parent | a4b20506c21eeead57d134bdf6ac77cd23e1664a (diff) | |
download | AUR-872e3678865d0da64a2110b3595f47f0bf3f8ab0.tar.gz AUR-872e3678865d0da64a2110b3595f47f0bf3f8ab0.tar.zst AUR-872e3678865d0da64a2110b3595f47f0bf3f8ab0.zip |
Add 'naemon/' from commit 'a4b20506c21eeead57d134bdf6ac77cd23e1664a'
git-subtree-dir: naemon
git-subtree-mainline: 9fdac65911c67456485615088b8291b97cf72c99
git-subtree-split: a4b20506c21eeead57d134bdf6ac77cd23e1664a
-rw-r--r-- | naemon/.SRCINFO | 31 | ||||
-rw-r--r-- | naemon/PKGBUILD | 82 | ||||
-rw-r--r-- | naemon/naemon-tmpfiles.conf | 9 | ||||
-rw-r--r-- | naemon/naemon.install | 21 | ||||
-rw-r--r-- | naemon/naemon.service | 18 |
5 files changed, 161 insertions, 0 deletions
diff --git a/naemon/.SRCINFO b/naemon/.SRCINFO new file mode 100644 index 0000000..49a36ad --- /dev/null +++ b/naemon/.SRCINFO | |||
@@ -0,0 +1,31 @@ | |||
1 | # Generated by mksrcinfo v8 | ||
2 | # Thu Feb 14 12:35:45 UTC 2019 | ||
3 | pkgbase = naemon | ||
4 | pkgdesc = System and network monitoring application | ||
5 | pkgver = 1.0.9 | ||
6 | pkgrel = 1 | ||
7 | url = http://naemon.org | ||
8 | install = naemon.install | ||
9 | arch = i686 | ||
10 | arch = x86_64 | ||
11 | license = GPL2 | ||
12 | makedepends = gperf | ||
13 | makedepends = help2man | ||
14 | depends = icu | ||
15 | depends = glib2 | ||
16 | optdepends = logrotate | ||
17 | optdepends = thruk: Web interface for Naemon | ||
18 | optdepends = naemon-livestatus: Event broker | ||
19 | optdepends = monitoring-plugins | ||
20 | backup = etc/logrotate.d/naemon | ||
21 | backup = etc/naemon/naemon.cfg | ||
22 | backup = etc/naemon/resource.cfg | ||
23 | source = http://labs.consol.de/naemon/release/v1.0.9/src/naemon-1.0.9.tar.gz | ||
24 | source = naemon-tmpfiles.conf | ||
25 | source = naemon.service | ||
26 | sha512sums = cf2a359a7fcf95a7668f8db35ccd23ad607c05cd85f51a9488cc183a2683da1ba9c7b0a7303d9f03825fbd13103372944267f2a99c10280004c51669e6343793 | ||
27 | sha512sums = 756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d | ||
28 | sha512sums = 28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2 | ||
29 | |||
30 | pkgname = naemon | ||
31 | |||
diff --git a/naemon/PKGBUILD b/naemon/PKGBUILD new file mode 100644 index 0000000..fdcf283 --- /dev/null +++ b/naemon/PKGBUILD | |||
@@ -0,0 +1,82 @@ | |||
1 | # Maintainer: Immae <ismael.bouya@normalesup.org> | ||
2 | # Contributor: Jonathan Steel <jsteel at archlinux.org> | ||
3 | |||
4 | pkgname=naemon | ||
5 | pkgver=1.0.9 | ||
6 | pkgrel=1 | ||
7 | pkgdesc="System and network monitoring application" | ||
8 | arch=('i686' 'x86_64') | ||
9 | url="http://naemon.org" | ||
10 | license=('GPL2') | ||
11 | depends=('icu' 'glib2') | ||
12 | optdepends=('logrotate' | ||
13 | 'thruk: Web interface for Naemon' | ||
14 | 'naemon-livestatus: Event broker' | ||
15 | 'monitoring-plugins') | ||
16 | makedepends=('gperf' 'help2man') | ||
17 | source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgname-$pkgver.tar.gz | ||
18 | $pkgname-tmpfiles.conf | ||
19 | $pkgname.service) | ||
20 | sha512sums=('cf2a359a7fcf95a7668f8db35ccd23ad607c05cd85f51a9488cc183a2683da1ba9c7b0a7303d9f03825fbd13103372944267f2a99c10280004c51669e6343793' | ||
21 | '756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d' | ||
22 | '28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2') | ||
23 | backup=('etc/logrotate.d/naemon' | ||
24 | 'etc/naemon/naemon.cfg' | ||
25 | 'etc/naemon/resource.cfg') | ||
26 | install=$pkgname.install | ||
27 | |||
28 | build() { | ||
29 | cd "$srcdir/$pkgname-$pkgver" | ||
30 | |||
31 | ./configure --prefix=/usr \ | ||
32 | --bindir=/usr/bin \ | ||
33 | --datadir="/usr/share/naemon" \ | ||
34 | --libdir="/usr/lib/naemon" \ | ||
35 | --localstatedir="/var/lib/naemon" \ | ||
36 | --sysconfdir="/etc/naemon" \ | ||
37 | --with-pkgconfdir="/etc/naemon" \ | ||
38 | --mandir="/usr/share/man" \ | ||
39 | --with-pluginsdir="/usr/lib/monitoring-plugins" \ | ||
40 | --with-tempdir="/var/cache/naemon" \ | ||
41 | --with-checkresultdir="/var/cache/naemon/checkresults" \ | ||
42 | --with-logdir="/var/log/naemon" \ | ||
43 | --with-initdir="/etc/init.d" \ | ||
44 | --with-logrotatedir="/etc/logrotate.d" \ | ||
45 | --with-naemon-user="naemon" \ | ||
46 | --with-naemon-group="naemon" \ | ||
47 | --with-lockfile="/run/naemon/naemon.pid" | ||
48 | |||
49 | make | ||
50 | } | ||
51 | |||
52 | check() { | ||
53 | cd "$srcdir/$pkgname-$pkgver" | ||
54 | |||
55 | # One of the tests fail for some reason, upstream notified. | ||
56 | make check || true | ||
57 | } | ||
58 | |||
59 | package() { | ||
60 | cd "$srcdir/$pkgname-$pkgver" | ||
61 | |||
62 | make DESTDIR="$pkgdir" install | ||
63 | |||
64 | install -d "$pkgdir"/etc/naemon/module-conf.d | ||
65 | |||
66 | rm -rf "$pkgdir"/var/{cache,log} | ||
67 | |||
68 | install -dm755 "$pkgdir"/var/lib/naemon | ||
69 | install -Dm644 "$srcdir"/$pkgname.service \ | ||
70 | "$pkgdir"/usr/lib/systemd/system/$pkgname.service | ||
71 | |||
72 | # Move sample config files | ||
73 | install -dm755 "$pkgdir"/user/share/doc/naemon | ||
74 | mv "$pkgdir"/etc/naemon/conf.d "$pkgdir"/user/share/doc/naemon/ | ||
75 | install -d "$pkgdir"/etc/naemon/conf.d/templates | ||
76 | |||
77 | # Remove non-Arch directories | ||
78 | rm -rf "$pkgdir"/etc/init.d | ||
79 | rm -rf "$pkgdir"/etc/apache2 | ||
80 | |||
81 | install -Dm644 "$srcdir"/naemon-tmpfiles.conf "$pkgdir"/usr/lib/tmpfiles.d/naemon.conf | ||
82 | } | ||
diff --git a/naemon/naemon-tmpfiles.conf b/naemon/naemon-tmpfiles.conf new file mode 100644 index 0000000..a7d9d86 --- /dev/null +++ b/naemon/naemon-tmpfiles.conf | |||
@@ -0,0 +1,9 @@ | |||
1 | D /var/run/naemon 0770 naemon naemon - | ||
2 | D /var/cache/naemon 0770 naemon naemon - | ||
3 | D /var/cache/naemon/checkresults 0770 naemon naemon - | ||
4 | D /var/lib/naemon/spool 0775 naemon naemon - | ||
5 | D /var/lib/naemon/spool/checkresults 0775 naemon naemon - | ||
6 | D /var/lib/naemon/thruk 0775 naemon naemon - | ||
7 | D /var/lib/naemon/perl5 0775 naemon naemon - | ||
8 | D /var/log/naemon 0770 naemon naemon - | ||
9 | D /var/log/naemon/archives 0770 naemon naemon - | ||
diff --git a/naemon/naemon.install b/naemon/naemon.install new file mode 100644 index 0000000..c32c848 --- /dev/null +++ b/naemon/naemon.install | |||
@@ -0,0 +1,21 @@ | |||
1 | post_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 /usr/bin/false -c "Naemon" naemon | ||
5 | |||
6 | chown naemon:naemon /var/lib/naemon | ||
7 | chown -R naemon:naemon /etc/naemon | ||
8 | /usr/bin/systemd-tmpfiles --create naemon.conf | ||
9 | } | ||
10 | |||
11 | pre_remove() { | ||
12 | if [[ -f /run/naemon/naemon.pid ]]; then | ||
13 | systemctl stop naemon | ||
14 | fi | ||
15 | /usr/bin/systemd-tmpfiles --remove naemon.conf | ||
16 | |||
17 | userdel naemon &> /dev/null | ||
18 | groupdel naemon &> /dev/null | ||
19 | |||
20 | rm -rf /var/lib/naemon | ||
21 | } | ||
diff --git a/naemon/naemon.service b/naemon/naemon.service new file mode 100644 index 0000000..0c3a0da --- /dev/null +++ b/naemon/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=forking | ||
8 | PIDFile=/run/naemon/naemon.pid | ||
9 | ExecStartPre=/usr/bin/naemon -vp /etc/naemon/naemon.cfg | ||
10 | ExecStart=/usr/bin/naemon --daemon /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 | ||