wok view nagios-nrpe/receipt @ rev 24947

updated nagios-nrpe (4.0.2 -> 4.0.3)
author Hans-G?nter Theisgen
date Fri Apr 22 17:39:55 2022 +0100 (2022-04-22)
parents 5ea0ce1cecc0
children 7364ffdaaa60
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios-nrpe"
4 VERSION="4.0.3"
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/"
10 REPOLOGY="nrpe"
12 SOURCE="nrpe"
13 TARBALL="$SOURCE-$VERSION.tar.gz"
14 WGET_URL="https://github.com/NagiosEnterprises/$SOURCE/releases/download/$SOURCE-$VERSION/$TARBALL"
16 DEPENDS="libcrypto libssl nagios-plugins"
17 BUILD_DEPENDS="libcrypto-dev libwrap-dev openssl openssl-dev"
19 current_version()
20 {
21 wget -O - ${WGET_URL%/down*} 2>/dev/null | \
22 sed '/archive.*tar/!d;s|.*/nrpe-\(.*\).tar.*|\1|;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 while read patch_file
29 do
30 if [ ! -f done.$patch_file ]
31 then
32 patch -p1 < $stuff/$patch_file || return 1
33 touch done.$patch_file
34 fi
35 done <<EOT
36 $PACKAGE-$VERSION-Makefile.u
37 EOT
39 addgroup nagios
40 adduser -D -G nagios nagios
42 ./configure \
43 --prefix=/usr \
44 --infodir=/usr/share/info \
45 --localstatedir=/var \
46 --datadir=/usr/share/nagios \
47 --sysconfdir=/etc/nagios \
48 --sbindir=/usr/lib/nagios \
49 --bindir=/usr/bin \
50 --libexecdir=/usr/lib/nagios/plugins \
51 --enable-ssl \
52 --with-nagios-user=nagios \
53 --with-nagios-group=nagios \
54 --with-nrpe-user=nagios \
55 --with-nrpe-group=nagios \
56 --mandir=/usr/share/man \
57 $CONFIGURE_ARGS &&
58 make all &&
59 make install
60 }
62 # Rules to gen a SliTaz package suitable for Tazpkg.
63 genpkg_rules()
64 {
65 mkdir -p $fs/etc/nagios/objects
66 mkdir -p $fs/etc/init.d
68 cp -a $install/usr $fs
69 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
71 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
73 # Install configuration file and init script
74 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
75 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
76 }
78 post_install()
79 {
80 if ! grep -q nagios "$1/etc/passwd"
81 then
82 echo
83 echo -n "Adding user nagios..."
84 chroot "$1/" adduser -S -D -H nagios
85 status
86 fi
88 # Set permissions for files and directories
89 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
90 chroot "$1/" chown nagios.nagios /etc/nagios/*
92 # Add check_nrpe in nagios configuration file
93 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
94 }
96 post_remove()
97 {
98 [ -f "$1/etc/nagios/nagios.cfg" ] &&
99 sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
100 }