]> git.immae.eu Git - perso/Immae/Config/AUR.git/blame - PKGBUILD
Move sample config files so they don't pollute the config directory on updates
[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
8b3611ea 5pkgrel=2
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
19 $pkgname.service)
20md5sums=('6c9b95a737a8f232e114f4cff200ff92'
403b591f 21 'd6a77534e612e8f65ff3360336faec77')
8b3611ea
JS
22backup=('etc/logrotate.d/naemon'
23 'etc/naemon/naemon.cfg'
24 'etc/naemon/resource.cfg')
859eea34 25install=$pkgname.install
403b591f
JS
26
27build() {
859eea34 28 cd $pkgname-$pkgver
403b591f
JS
29
30 ./configure --prefix=/usr \
31 --bindir=/usr/bin \
32 --datadir="/usr/share/naemon" \
33 --libdir="/usr/lib/naemon" \
34 --localstatedir="/var/lib/naemon" \
35 --sysconfdir="/etc/naemon" \
36 --with-pkgconfdir="/etc/naemon" \
37 --mandir="/usr/share/man" \
38 --enable-event-broker \
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.pid" \
48 --with-thruk-user="http" \
49 --with-thruk-group="naemon" \
50 --with-thruk-libs="/usr/lib/naemon/perl5" \
51 --with-thruk-tempdir="/var/cache/naemon/thruk" \
52 --with-thruk-vardir="/var/lib/naemon/thruk" \
53 --with-httpd-conf="/etc/httpd/conf/extra/" \
54 --with-htmlurl="/naemon"
55
56 make
57}
58
59check() {
859eea34 60 cd $pkgname-$pkgver/naemon-core
403b591f
JS
61
62 make check
63}
64
859eea34
JS
65package() {
66 cd $pkgname-$pkgver
403b591f
JS
67
68 make DESTDIR="$pkgdir" install
69
859eea34 70 install -d "$pkgdir"/etc/naemon/module-conf.d
8b3611ea 71 install -d "$pkgdir"/var/lib/naemon/spool/checkresults
403b591f 72
859eea34 73 chown -R 44:44 "$pkgdir"/var/{cache,lib,log}/$pkgname
8b3611ea 74 chown -R 44:44 "$pkgdir"/etc/naemon
859eea34 75 chmod -R 770 "$pkgdir"/var/{cache,lib,log}/$pkgname
403b591f 76
859eea34
JS
77 install -Dm644 "$srcdir"/$pkgname.service \
78 "$pkgdir"/usr/lib/systemd/system/$pkgname.service
403b591f 79
8b3611ea
JS
80 # Move sample config files
81 mv "$pkgdir"/etc/naemon/conf.d "$pkgdir"/etc/naemon/examples
82 install -d "$pkgdir"/etc/naemon/conf.d/templates
83
859eea34 84 # Remove non-Arch directories
403b591f 85 rm -rf "$pkgdir"/etc/init.d
859eea34 86 rm -rf "$pkgdir"/etc/apache2
403b591f 87}