wok-current view nagios-nrpe/receipt @ rev 23350

updated perl-io-socket-inet6 (2.56 -> 2.72)
author Hans-G?nter Theisgen
date Tue Mar 31 09:47:36 2020 +0100 (2020-03-31)
parents 0fda98eeae85
children 5ea0ce1cecc0
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios-nrpe"
4 VERSION="4.0.2"
5 CATEGORY="network"
6 SHORT_DESC="Service and network monitoring program, remote monitoring."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.nagios.org/"
11 SOURCE="nrpe"
12 TARBALL="$SOURCE-$VERSION.tar.gz"
13 WGET_URL="https://github.com/NagiosEnterprises/$SOURCE/releases/download/$SOURCE-$VERSION/$TARBALL"
15 BUILD_DEPENDS="libcrypto-dev libwrap-dev openssl openssl-dev"
16 DEPENDS="libcrypto libssl nagios-plugins"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 while read patch_file
22 do
23 if [ ! -f done.$patch_file ]
24 then
25 patch -p1 < $stuff/$patch_file || return 1
26 touch done.$patch_file
27 fi
28 done <<EOT
29 $PACKAGE-$VERSION-Makefile.u
30 EOT
32 addgroup nagios
33 adduser -D -G nagios nagios
35 ./configure \
36 --prefix=/usr \
37 --infodir=/usr/share/info \
38 --localstatedir=/var \
39 --datadir=/usr/share/nagios \
40 --sysconfdir=/etc/nagios \
41 --sbindir=/usr/lib/nagios \
42 --bindir=/usr/bin \
43 --libexecdir=/usr/lib/nagios/plugins \
44 --enable-ssl \
45 --with-nagios-user=nagios \
46 --with-nagios-group=nagios \
47 --with-nrpe-user=nagios \
48 --with-nrpe-group=nagios \
49 --mandir=/usr/share/man \
50 $CONFIGURE_ARGS &&
51 make all &&
52 make install
53 }
55 # Rules to gen a SliTaz package suitable for Tazpkg.
56 genpkg_rules()
57 {
58 mkdir -p $fs/etc/nagios/objects
59 mkdir -p $fs/etc/init.d
61 cp -a $install/usr $fs
62 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
64 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
66 # Install configuration file and init script
67 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
68 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
69 }
71 post_install()
72 {
73 if ! grep -q nagios "$1/etc/passwd"
74 then
75 echo
76 echo -n "Adding user nagios..."
77 chroot "$1/" adduser -S -D -H nagios
78 status
79 fi
81 # Set permissions for files and directories
82 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
83 chroot "$1/" chown nagios.nagios /etc/nagios/*
85 # Add check_nrpe in nagios configuration file
86 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
87 }
89 post_remove()
90 {
91 [ -f "$1/etc/nagios/nagios.cfg" ] &&
92 sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
93 }