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

updated nagios-nrpe (2.14 -> 3.2.1)
author Hans-G?nter Theisgen
date Fri May 03 12:32:48 2019 +0100 (2019-05-03)
parents a78610b2eb47
children 02aa9958ad62
rev   line source
erjo@8331 1 # SliTaz package receipt.
erjo@8331 2
erjo@8331 3 PACKAGE="nagios-nrpe"
Hans-G?nter@21511 4 VERSION="3.2.1"
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"
erjo@8331 13 WGET_URL="$SF_MIRROR/nagios/$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@21511 22 do
erjo@8331 23 if [ ! -f done.$patch_file ]; then
slaxemulator@9700 24 patch -p1 < $stuff/$patch_file || return 1
erjo@8331 25 touch done.$patch_file
erjo@8331 26 fi
Hans-G?nter@21511 27 done <<EOT
erjo@8331 28 $PACKAGE-$VERSION-Makefile.u
erjo@8331 29 EOT
Hans-G?nter@21511 30
Hans-G?nter@21511 31 ./configure \
Hans-G?nter@21511 32 --prefix=/usr \
Hans-G?nter@21511 33 --infodir=/usr/share/info \
Hans-G?nter@21511 34 --localstatedir=/var \
Hans-G?nter@21511 35 --datadir=/usr/share/nagios \
Hans-G?nter@21511 36 --sysconfdir=/etc/nagios \
Hans-G?nter@21511 37 --sbindir=/usr/lib/nagios \
Hans-G?nter@21511 38 --bindir=/usr/bin \
Hans-G?nter@21511 39 --libexecdir=/usr/lib/nagios/plugins \
Hans-G?nter@21511 40 --enable-ssl \
Hans-G?nter@21511 41 --with-nagios-user=nagios \
Hans-G?nter@21511 42 --with-nagios-group=nagios \
Hans-G?nter@21511 43 --with-nrpe-user=nagios \
Hans-G?nter@21511 44 --with-nrpe-group=nagios \
Hans-G?nter@21511 45 --mandir=/usr/share/man \
Hans-G?nter@21511 46 $CONFIGURE_ARGS &&
erjo@8331 47 make all &&
Hans-G?nter@21511 48 make install
erjo@8331 49 }
erjo@8331 50
erjo@8331 51 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@8331 52 genpkg_rules()
erjo@8331 53 {
Hans-G?nter@21511 54 mkdir -p $fs/etc/nagios/objects
Hans-G?nter@21511 55 mkdir -p $fs/etc/init.d
Hans-G?nter@21511 56
Hans-G?nter@21511 57 cp -a $install/usr $fs
Hans-G?nter@21511 58 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
Hans-G?nter@21511 59
erjo@8331 60 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
Hans-G?nter@21511 61
Hans-G?nter@21511 62 # Install configuration file and init script
Hans-G?nter@21511 63 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
Hans-G?nter@21511 64 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
erjo@8331 65 }
erjo@8331 66
erjo@8331 67 post_install()
erjo@8331 68 {
pascal@18730 69 if ! grep -q nagios "$1/etc/passwd"; then
pascal@20319 70 echo
erjo@8331 71 echo -n "Adding user nagios..."
pascal@18730 72 chroot "$1/" adduser -S -D -H nagios
erjo@8331 73 status
erjo@8331 74 fi
erjo@8331 75
Hans-G?nter@21511 76 # Set permissions for files and directories
Hans-G?nter@21511 77 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
Hans-G?nter@21511 78 chroot "$1/" chown nagios.nagios /etc/nagios/*
erjo@8331 79
Hans-G?nter@21511 80 # Add check_nrpe in nagios configuration file
pascal@18730 81 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
erjo@8331 82 }
erjo@8331 83
erjo@8331 84 post_remove()
erjo@8331 85 {
pascal@18730 86 [ -f "$1/etc/nagios/nagios.cfg" ] && sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
erjo@8331 87 }