wok view nagios-nrpe/receipt @ rev 25691

Up lynis (3.1.1), ncurses-examples (20211021)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 16 10:43:04 2024 +0000 (4 weeks ago)
parents 5b83babda761
children
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 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - ${WGET_URL%/down*} 2>/dev/null | \
23 sed '/tag\//!d;s|.*tag/[a-z-]*||;s|".*||;q'
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 while read patch_file
30 do
31 if [ ! -f done.$patch_file ]
32 then
33 patch -p1 < $stuff/$patch_file || return 1
34 touch done.$patch_file
35 fi
36 done <<EOT
37 $PACKAGE-$VERSION-Makefile.u
38 EOT
40 addgroup nagios
41 adduser -D -G nagios nagios
43 ./configure \
44 --prefix=/usr \
45 --infodir=/usr/share/info \
46 --localstatedir=/var \
47 --datadir=/usr/share/nagios \
48 --sysconfdir=/etc/nagios \
49 --sbindir=/usr/lib/nagios \
50 --bindir=/usr/bin \
51 --libexecdir=/usr/lib/nagios/plugins \
52 --enable-ssl \
53 --with-nagios-user=nagios \
54 --with-nagios-group=nagios \
55 --with-nrpe-user=nagios \
56 --with-nrpe-group=nagios \
57 --mandir=/usr/share/man \
58 $CONFIGURE_ARGS &&
59 make all &&
60 make install
61 }
63 # Rules to gen a SliTaz package suitable for Tazpkg.
64 genpkg_rules()
65 {
66 mkdir -p $fs/etc/nagios/objects
67 mkdir -p $fs/etc/init.d
69 cp -a $install/usr $fs
70 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
72 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
74 # Install configuration file and init script
75 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
76 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
77 }
79 post_install()
80 {
81 if ! grep -q nagios "$1/etc/passwd"
82 then
83 echo
84 echo -n "Adding user nagios..."
85 chroot "$1/" adduser -S -D -H nagios
86 status
87 fi
89 # Set permissions for files and directories
90 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
91 chroot "$1/" chown nagios.nagios /etc/nagios/*
93 # Add check_nrpe in nagios configuration file
94 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
95 }
97 post_remove()
98 {
99 [ -f "$1/etc/nagios/nagios.cfg" ] &&
100 sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
101 }