wok-current annotate nagios-nrpe/receipt @ rev 23295

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