wok view nagios-nrpe/receipt @ rev 20319

Up tazlito (501)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 20 13:28:18 2018 +0200 (22 months ago)
parents 9e01bc6321ea
children 8c314507df00
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
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
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 }