]> git.immae.eu Git - perso/Immae/Config/AUR.git/blame - PKGBUILD
gcc7 fix and run with --daemon
[perso/Immae/Config/AUR.git] / PKGBUILD
CommitLineData
403b591f
JS
1# Maintainer: Jonathan Steel <jsteel at archlinux.org>
2
859eea34
JS
3pkgname=naemon
4pkgver=1.0.6
746bfc7e 5pkgrel=4
859eea34 6pkgdesc="System and network monitoring application"
403b591f
JS
7arch=('i686' 'x86_64')
8url="http://naemon.org"
9license=('GPL2')
8b3611ea 10depends=('icu' 'glib2')
859eea34
JS
11optdepends=('logrotate'
12 'thruk: Web interface for Naemon'
13 'monitoring-plugins')
14makedepends=('gperf' 'help2man')
15provides=('naemon-core' 'naemon-livestatus')
16conflicts=('naemon-core' 'naemon-livestatus')
17replaces=('naemon-core' 'naemon-livestatus')
18source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgname-$pkgver.tar.gz
746bfc7e 19 gcc7.patch
859eea34
JS
20 $pkgname.service)
21md5sums=('6c9b95a737a8f232e114f4cff200ff92'
746bfc7e
JS
22 '4a6d8f9b39335dfe3348a1a20df10dfd'
23 '29f1d11c1a7f4f1515b7993c540dabe8')
8b3611ea
JS
24backup=('etc/logrotate.d/naemon'
25 'etc/naemon/naemon.cfg'
26 'etc/naemon/resource.cfg')
859eea34 27install=$pkgname.install
403b591f 28
746bfc7e
JS
29prepare() {
30 cd $pkgname-$pkgver/naemon-core
31
32 patch -Np1 -i "$srcdir"/gcc7.patch
33}
34
403b591f 35build() {
859eea34 36 cd $pkgname-$pkgver
403b591f
JS
37
38 ./configure --prefix=/usr \
39 --bindir=/usr/bin \
40 --datadir="/usr/share/naemon" \
41 --libdir="/usr/lib/naemon" \
42 --localstatedir="/var/lib/naemon" \
43 --sysconfdir="/etc/naemon" \
44 --with-pkgconfdir="/etc/naemon" \
45 --mandir="/usr/share/man" \
46 --enable-event-broker \
47 --with-pluginsdir="/usr/lib/monitoring-plugins" \
48 --with-tempdir="/var/cache/naemon" \
49 --with-checkresultdir="/var/cache/naemon/checkresults" \
50 --with-logdir="/var/log/naemon" \
51 --with-initdir="/etc/init.d" \
52 --with-logrotatedir="/etc/logrotate.d" \
53 --with-naemon-user="naemon" \
54 --with-naemon-group="naemon" \
746bfc7e 55 --with-lockfile="/run/naemon/naemon.pid" \
403b591f
JS
56 --with-thruk-user="http" \
57 --with-thruk-group="naemon" \
58 --with-thruk-libs="/usr/lib/naemon/perl5" \
59 --with-thruk-tempdir="/var/cache/naemon/thruk" \
60 --with-thruk-vardir="/var/lib/naemon/thruk" \
61 --with-httpd-conf="/etc/httpd/conf/extra/" \
62 --with-htmlurl="/naemon"
63
64 make
65}
66
67check() {
859eea34 68 cd $pkgname-$pkgver/naemon-core
403b591f
JS
69
70 make check
71}
72
859eea34
JS
73package() {
74 cd $pkgname-$pkgver
403b591f
JS
75
76 make DESTDIR="$pkgdir" install
77
859eea34 78 install -d "$pkgdir"/etc/naemon/module-conf.d
8b3611ea 79 install -d "$pkgdir"/var/lib/naemon/spool/checkresults
403b591f 80
859eea34 81 chown -R 44:44 "$pkgdir"/var/{cache,lib,log}/$pkgname
8b3611ea 82 chown -R 44:44 "$pkgdir"/etc/naemon
679640f8 83 chmod -R 750 "$pkgdir"/var/{cache,lib,log}/$pkgname
403b591f 84
859eea34
JS
85 install -Dm644 "$srcdir"/$pkgname.service \
86 "$pkgdir"/usr/lib/systemd/system/$pkgname.service
746bfc7e
JS
87 install -Dm644 naemon-core/naemon.tmpfiles.conf \
88 "$pkgdir"/usr/lib/tmpfiles.d/naemon.conf
403b591f 89
8b3611ea
JS
90 # Move sample config files
91 mv "$pkgdir"/etc/naemon/conf.d "$pkgdir"/etc/naemon/examples
92 install -d "$pkgdir"/etc/naemon/conf.d/templates
93
859eea34 94 # Remove non-Arch directories
403b591f 95 rm -rf "$pkgdir"/etc/init.d
859eea34 96 rm -rf "$pkgdir"/etc/apache2
403b591f 97}