wok annotate nagios-nrpe/receipt @ rev 24336
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jan 28 18:19:21 2022 +0000 (2022-01-28) |
parents | 02aa9958ad62 |
children | 5b83babda761 |
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 |
pascal@24055 | 18 current_version() |
pascal@24055 | 19 { |
pascal@24055 | 20 wget -O - ${WGET_URL%/down*} 2>/dev/null | \ |
pascal@24055 | 21 sed '/archive.*tar/!d;s|.*/nrpe-\(.*\).tar.*|\1|;q' |
pascal@24055 | 22 } |
pascal@24055 | 23 |
erjo@8331 | 24 # Rules to configure and make the package. |
erjo@8331 | 25 compile_rules() |
erjo@8331 | 26 { |
Hans-G?nter@21511 | 27 while read patch_file |
Hans-G?nter@23211 | 28 do |
Hans-G?nter@23211 | 29 if [ ! -f done.$patch_file ] |
Hans-G?nter@23211 | 30 then |
slaxemulator@9700 | 31 patch -p1 < $stuff/$patch_file || return 1 |
erjo@8331 | 32 touch done.$patch_file |
erjo@8331 | 33 fi |
Hans-G?nter@23211 | 34 done <<EOT |
erjo@8331 | 35 $PACKAGE-$VERSION-Makefile.u |
erjo@8331 | 36 EOT |
Hans-G?nter@21511 | 37 |
Hans-G?nter@23211 | 38 addgroup nagios |
Hans-G?nter@23211 | 39 adduser -D -G nagios nagios |
Hans-G?nter@23211 | 40 |
Hans-G?nter@21511 | 41 ./configure \ |
Hans-G?nter@21511 | 42 --prefix=/usr \ |
Hans-G?nter@21511 | 43 --infodir=/usr/share/info \ |
Hans-G?nter@21511 | 44 --localstatedir=/var \ |
Hans-G?nter@21511 | 45 --datadir=/usr/share/nagios \ |
Hans-G?nter@21511 | 46 --sysconfdir=/etc/nagios \ |
Hans-G?nter@21511 | 47 --sbindir=/usr/lib/nagios \ |
Hans-G?nter@21511 | 48 --bindir=/usr/bin \ |
Hans-G?nter@21511 | 49 --libexecdir=/usr/lib/nagios/plugins \ |
Hans-G?nter@21511 | 50 --enable-ssl \ |
Hans-G?nter@21511 | 51 --with-nagios-user=nagios \ |
Hans-G?nter@21511 | 52 --with-nagios-group=nagios \ |
Hans-G?nter@21511 | 53 --with-nrpe-user=nagios \ |
Hans-G?nter@21511 | 54 --with-nrpe-group=nagios \ |
Hans-G?nter@21511 | 55 --mandir=/usr/share/man \ |
Hans-G?nter@21511 | 56 $CONFIGURE_ARGS && |
erjo@8331 | 57 make all && |
Hans-G?nter@21511 | 58 make install |
erjo@8331 | 59 } |
erjo@8331 | 60 |
erjo@8331 | 61 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@8331 | 62 genpkg_rules() |
erjo@8331 | 63 { |
Hans-G?nter@21511 | 64 mkdir -p $fs/etc/nagios/objects |
Hans-G?nter@21511 | 65 mkdir -p $fs/etc/init.d |
Hans-G?nter@21511 | 66 |
Hans-G?nter@21511 | 67 cp -a $install/usr $fs |
Hans-G?nter@21511 | 68 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios |
Hans-G?nter@21511 | 69 |
erjo@8331 | 70 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg |
Hans-G?nter@21511 | 71 |
Hans-G?nter@21511 | 72 # Install configuration file and init script |
Hans-G?nter@21511 | 73 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects |
Hans-G?nter@21511 | 74 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d |
erjo@8331 | 75 } |
erjo@8331 | 76 |
erjo@8331 | 77 post_install() |
erjo@8331 | 78 { |
Hans-G?nter@23211 | 79 if ! grep -q nagios "$1/etc/passwd" |
Hans-G?nter@23211 | 80 then |
pascal@20319 | 81 echo |
erjo@8331 | 82 echo -n "Adding user nagios..." |
pascal@18730 | 83 chroot "$1/" adduser -S -D -H nagios |
erjo@8331 | 84 status |
erjo@8331 | 85 fi |
erjo@8331 | 86 |
Hans-G?nter@21511 | 87 # Set permissions for files and directories |
Hans-G?nter@21511 | 88 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins |
Hans-G?nter@21511 | 89 chroot "$1/" chown nagios.nagios /etc/nagios/* |
erjo@8331 | 90 |
Hans-G?nter@21511 | 91 # Add check_nrpe in nagios configuration file |
pascal@18730 | 92 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg" |
erjo@8331 | 93 } |
erjo@8331 | 94 |
erjo@8331 | 95 post_remove() |
erjo@8331 | 96 { |
Hans-G?nter@23211 | 97 [ -f "$1/etc/nagios/nagios.cfg" ] && |
Hans-G?nter@23211 | 98 sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg" |
erjo@8331 | 99 } |