wok-current annotate nagios-nrpe/receipt @ rev 15518
Up: thunderbird-langpack-pl (17.0.10esr)
author | Dominique Corbex <domcox@slitaz.org> |
---|---|
date | Tue Nov 19 22:24:27 2013 +0100 (2013-11-19) |
parents | d1768332cee0 |
children | 3765f181a6d5 |
rev | line source |
---|---|
erjo@8331 | 1 # SliTaz package receipt. |
erjo@8331 | 2 |
erjo@8331 | 3 PACKAGE="nagios-nrpe" |
erjo@14457 | 4 VERSION="2.14" |
erjo@8331 | 5 CATEGORY="network" |
erjo@8331 | 6 SHORT_DESC="Service and network monitoring program, remote monitoring." |
erjo@8331 | 7 MAINTAINER="erjo@slitaz.org" |
erjo@8331 | 8 SOURCE="nrpe" |
erjo@8331 | 9 TARBALL="$SOURCE-$VERSION.tar.gz" |
erjo@8331 | 10 WEB_SITE="http://www.nagios.org/" |
erjo@8331 | 11 WGET_URL="$SF_MIRROR/nagios/$TARBALL" |
pascal@8938 | 12 BUILD_DEPENDS="libcrypto-dev openssl-dev openssl libwrap-dev" |
erjo@8331 | 13 DEPENDS="nagios-plugins libssl libcrypto" |
erjo@8331 | 14 |
erjo@8331 | 15 # Rules to configure and make the package. |
erjo@8331 | 16 compile_rules() |
erjo@8331 | 17 { |
erjo@8331 | 18 cd $src |
erjo@8331 | 19 while read patch_file; do |
erjo@8331 | 20 if [ ! -f done.$patch_file ]; then |
slaxemulator@9700 | 21 patch -p1 < $stuff/$patch_file || return 1 |
erjo@8331 | 22 touch done.$patch_file |
erjo@8331 | 23 fi |
erjo@8331 | 24 done <<EOT |
erjo@8331 | 25 $PACKAGE-$VERSION-Makefile.u |
erjo@8331 | 26 EOT |
erjo@8331 | 27 ./configure --prefix=/usr --infodir=/usr/share/info \ |
erjo@8331 | 28 --localstatedir=/var \ |
erjo@8331 | 29 --datadir=/usr/share/nagios \ |
erjo@8331 | 30 --sysconfdir=/etc/nagios \ |
erjo@8331 | 31 --sbindir=/usr/lib/nagios \ |
erjo@8331 | 32 --bindir=/usr/bin \ |
erjo@8331 | 33 --libexecdir=/usr/lib/nagios/plugins \ |
erjo@8331 | 34 --with-nagios-user=nagios \ |
erjo@8331 | 35 --with-nagios-group=nagios \ |
erjo@8331 | 36 --with-nrpe-user=nagios \ |
erjo@8331 | 37 --with-nrpe-group=nagios \ |
erjo@8331 | 38 --mandir=/usr/share/man $CONFIGURE_ARGS && |
erjo@8331 | 39 make all && |
erjo@14457 | 40 make install |
erjo@8331 | 41 } |
erjo@8331 | 42 |
erjo@8331 | 43 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@8331 | 44 genpkg_rules() |
erjo@8331 | 45 { |
erjo@8331 | 46 mkdir -p $fs/etc/nagios/objects \ |
erjo@8331 | 47 $fs/etc/init.d \ |
erjo@8331 | 48 $fs/var/run/nagios |
erjo@8331 | 49 |
erjo@14457 | 50 cp -a $install/usr $fs |
erjo@8331 | 51 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios |
erjo@8331 | 52 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg |
erjo@8331 | 53 |
erjo@8331 | 54 # Install config file nd init script |
erjo@14457 | 55 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects |
erjo@14457 | 56 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d |
erjo@8331 | 57 } |
erjo@8331 | 58 |
erjo@8331 | 59 post_install() |
erjo@8331 | 60 { |
erjo@8331 | 61 if ! grep -q nagios $1/etc/passwd; then |
erjo@8331 | 62 echo -n "Adding user nagios..." |
erjo@8331 | 63 chroot $1/ adduser -S -D -H nagios |
erjo@8331 | 64 status |
erjo@8331 | 65 fi |
erjo@8331 | 66 |
erjo@8331 | 67 # Set perms for files and directories |
erjo@8331 | 68 chroot $1/ chown -R nagios.nagios /usr/lib/nagios/plugins /var/run/nagios |
erjo@8331 | 69 chroot $1/ chown nagios.nagios /etc/nagios/* |
erjo@8331 | 70 |
erjo@8331 | 71 # Add check_nrpe in nagios config file |
erjo@8331 | 72 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> $1/etc/nagios/nagios.cfg |
erjo@8331 | 73 } |
erjo@8331 | 74 |
erjo@8331 | 75 post_remove() |
erjo@8331 | 76 { |
erjo@8331 | 77 [ -f $1/etc/nagios/nagios.cfg ] && sed -i 's/.*nrpe.cfg//' $1/etc/nagios/nagios.cfg |
erjo@8331 | 78 } |