1 # Contributor: <mathieu dot grzybek at gmail>
6 pkgdesc="The NDOUTILS addon is designed to store all configuration and event data from Nagios in a database."
9 url="http://www.nagios.org"
10 depends=('libmysqlclient' 'nagios' 'glibc' 'zlib' 'openssl')
11 source=("http://prdownloads.sourceforge.net/sourceforge/nagios/$pkgname-$pkgver.tar.gz" "ndo2db.rc")
12 md5sums=('659b759a5eb54b84eb44a29f26b603bc' '808d2fe4ef8fc45d5d54e8d4e524326c')
17 cd $srcdir/$pkgname-$pkgver
20 _nagios_group="nagios"
21 _instdir="usr/share/nagios"
26 getent group $_nagios_group || _nagios_group=30
27 getent passwd $_nagios_user || _nagios_user=30
30 --with-ndo2db-user=$_nagios_user \
31 --with-ndo2db-group=$_nagios_group \
32 --prefix="/$_instdir" \
33 --bindir="/$_bindir" \
34 --localstatedir="/$_vardir" \
35 --sysconfdir="/$_confdir" \
43 install -D src/file2sock $startdir/pkg/usr/bin/file2sock || return 1
44 install -D src/log2ndo $startdir/pkg/usr/bin/log2ndo || return 1
45 install -D src/ndo2db-3x $startdir/pkg/usr/bin/ndo2db-3x || return 1
46 install -D src/sockdebug $startdir/pkg/usr/bin/sockdebug || return 1
49 install -D src/ndomod-3x.o $startdir/pkg/usr/share/nagios/include/ndomod-3x.o || return 1
52 mkdir -p $startdir/pkg/usr/share/doc/ndoutils || return 1
53 mv db $startdir/pkg/usr/share/doc/ndoutils/ || return 1
54 mv docs/* $startdir/pkg/usr/share/doc/ndoutils/ || return 1
57 mv config $startdir/pkg/usr/share/doc/ndoutils/ || return 1
58 install -D $startdir/pkg/usr/share/doc/ndoutils/config/ndo2db.cfg-sample $startdir/pkg/etc/nagios/ndo2db.cfg-sample
59 install -D $startdir/pkg/usr/share/doc/ndoutils/config/ndomod.cfg-sample $startdir/pkg/etc/nagios/ndomod.cfg-sample
61 # rc script for ndo2db
62 install -o root -g root -m 755 -D $startdir/ndo2db.rc $pkgdir/etc/rc.d/ndo2db