wok-next view nagios-nrpe/receipt @ rev 18641
Up tazpkg(877)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Nov 30 02:19:52 2015 +0200 (2015-11-30) |
parents | 3765f181a6d5 |
children | 9e01bc6321ea |
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios-nrpe"
4 VERSION="2.14"
5 CATEGORY="network"
6 SHORT_DESC="Service and network monitoring program, remote monitoring."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 SOURCE="nrpe"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="http://www.nagios.org/"
12 WGET_URL="$SF_MIRROR/nagios/$TARBALL"
14 BUILD_DEPENDS="libcrypto-dev openssl-dev openssl libwrap-dev"
15 DEPENDS="nagios-plugins libssl libcrypto"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 while read patch_file; do
22 if [ ! -f done.$patch_file ]; then
23 patch -p1 < $stuff/$patch_file || return 1
24 touch done.$patch_file
25 fi
26 done <<EOT
27 $PACKAGE-$VERSION-Makefile.u
28 EOT
29 ./configure --prefix=/usr --infodir=/usr/share/info \
30 --localstatedir=/var \
31 --datadir=/usr/share/nagios \
32 --sysconfdir=/etc/nagios \
33 --sbindir=/usr/lib/nagios \
34 --bindir=/usr/bin \
35 --libexecdir=/usr/lib/nagios/plugins \
36 --with-nagios-user=nagios \
37 --with-nagios-group=nagios \
38 --with-nrpe-user=nagios \
39 --with-nrpe-group=nagios \
40 --mandir=/usr/share/man $CONFIGURE_ARGS &&
41 make all &&
42 make install
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 mkdir -p $fs/etc/nagios/objects \
49 $fs/etc/init.d
51 cp -a $install/usr $fs
52 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
53 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
55 # Install config file nd init script
56 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
57 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
58 }
60 post_install()
61 {
62 if ! grep -q nagios $1/etc/passwd; then
63 echo -n "Adding user nagios..."
64 chroot $1/ adduser -S -D -H nagios
65 status
66 fi
68 # Set perms for files and directories
69 chroot $1/ chown -R nagios.nagios /usr/lib/nagios/plugins
70 chroot $1/ chown nagios.nagios /etc/nagios/*
72 # Add check_nrpe in nagios config file
73 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> $1/etc/nagios/nagios.cfg
74 }
76 post_remove()
77 {
78 [ -f $1/etc/nagios/nagios.cfg ] && sed -i 's/.*nrpe.cfg//' $1/etc/nagios/nagios.cfg
79 }