wok view nagios-nrpe/receipt @ rev 15614
cairo-compmgr-core, jfsutils: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Dec 08 08:06:26 2013 +0000 (2013-12-08) |
parents | f96cbfce8e7e |
children | 0d8a1a3edc72 |
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 \
50 $fs/var/run/nagios
52 cp -a $install/usr $fs
53 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
54 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
56 # Install config file nd init script
57 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
58 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
59 }
61 post_install()
62 {
63 if ! grep -q nagios $1/etc/passwd; then
64 echo -n "Adding user nagios..."
65 chroot $1/ adduser -S -D -H nagios
66 status
67 fi
69 # Set perms for files and directories
70 chroot $1/ chown -R nagios.nagios /usr/lib/nagios/plugins /var/run/nagios
71 chroot $1/ chown nagios.nagios /etc/nagios/*
73 # Add check_nrpe in nagios config file
74 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> $1/etc/nagios/nagios.cfg
75 }
77 post_remove()
78 {
79 [ -f $1/etc/nagios/nagios.cfg ] && sed -i 's/.*nrpe.cfg//' $1/etc/nagios/nagios.cfg
80 }