]> git.immae.eu Git - perso/Immae/Config/AUR.git/blob - PKGBUILD
gcc7 fix and run with --daemon
[perso/Immae/Config/AUR.git] / PKGBUILD
1 # Maintainer: Jonathan Steel <jsteel at archlinux.org>
2
3 pkgname=naemon
4 pkgver=1.0.6
5 pkgrel=4
6 pkgdesc="System and network monitoring application"
7 arch=('i686' 'x86_64')
8 url="http://naemon.org"
9 license=('GPL2')
10 depends=('icu' 'glib2')
11 optdepends=('logrotate'
12 'thruk: Web interface for Naemon'
13 'monitoring-plugins')
14 makedepends=('gperf' 'help2man')
15 provides=('naemon-core' 'naemon-livestatus')
16 conflicts=('naemon-core' 'naemon-livestatus')
17 replaces=('naemon-core' 'naemon-livestatus')
18 source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgname-$pkgver.tar.gz
19 gcc7.patch
20 $pkgname.service)
21 md5sums=('6c9b95a737a8f232e114f4cff200ff92'
22 '4a6d8f9b39335dfe3348a1a20df10dfd'
23 '29f1d11c1a7f4f1515b7993c540dabe8')
24 backup=('etc/logrotate.d/naemon'
25 'etc/naemon/naemon.cfg'
26 'etc/naemon/resource.cfg')
27 install=$pkgname.install
28
29 prepare() {
30 cd $pkgname-$pkgver/naemon-core
31
32 patch -Np1 -i "$srcdir"/gcc7.patch
33 }
34
35 build() {
36 cd $pkgname-$pkgver
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" \
55 --with-lockfile="/run/naemon/naemon.pid" \
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
67 check() {
68 cd $pkgname-$pkgver/naemon-core
69
70 make check
71 }
72
73 package() {
74 cd $pkgname-$pkgver
75
76 make DESTDIR="$pkgdir" install
77
78 install -d "$pkgdir"/etc/naemon/module-conf.d
79 install -d "$pkgdir"/var/lib/naemon/spool/checkresults
80
81 chown -R 44:44 "$pkgdir"/var/{cache,lib,log}/$pkgname
82 chown -R 44:44 "$pkgdir"/etc/naemon
83 chmod -R 750 "$pkgdir"/var/{cache,lib,log}/$pkgname
84
85 install -Dm644 "$srcdir"/$pkgname.service \
86 "$pkgdir"/usr/lib/systemd/system/$pkgname.service
87 install -Dm644 naemon-core/naemon.tmpfiles.conf \
88 "$pkgdir"/usr/lib/tmpfiles.d/naemon.conf
89
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
94 # Remove non-Arch directories
95 rm -rf "$pkgdir"/etc/init.d
96 rm -rf "$pkgdir"/etc/apache2
97 }