wok-6.x annotate nagios-nrpe/receipt @ rev 16280

Up: feh (2.10)
author Alexander Medvedev <devl547@gmail.com>
date Sun Apr 06 09:29:28 2014 +0000 (2014-04-06)
parents f96cbfce8e7e
children 0d8a1a3edc72
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"
pascal@15584 8 LICENSE="GPL2"
erjo@8331 9 SOURCE="nrpe"
erjo@8331 10 TARBALL="$SOURCE-$VERSION.tar.gz"
erjo@8331 11 WEB_SITE="http://www.nagios.org/"
erjo@8331 12 WGET_URL="$SF_MIRROR/nagios/$TARBALL"
pascal@15584 13
pascal@8938 14 BUILD_DEPENDS="libcrypto-dev openssl-dev openssl libwrap-dev"
erjo@8331 15 DEPENDS="nagios-plugins libssl libcrypto"
erjo@8331 16
erjo@8331 17 # Rules to configure and make the package.
erjo@8331 18 compile_rules()
erjo@8331 19 {
erjo@8331 20 cd $src
erjo@8331 21 while read patch_file; do
erjo@8331 22 if [ ! -f done.$patch_file ]; then
slaxemulator@9700 23 patch -p1 < $stuff/$patch_file || return 1
erjo@8331 24 touch done.$patch_file
erjo@8331 25 fi
erjo@8331 26 done <<EOT
erjo@8331 27 $PACKAGE-$VERSION-Makefile.u
erjo@8331 28 EOT
erjo@8331 29 ./configure --prefix=/usr --infodir=/usr/share/info \
erjo@8331 30 --localstatedir=/var \
erjo@8331 31 --datadir=/usr/share/nagios \
erjo@8331 32 --sysconfdir=/etc/nagios \
erjo@8331 33 --sbindir=/usr/lib/nagios \
erjo@8331 34 --bindir=/usr/bin \
erjo@8331 35 --libexecdir=/usr/lib/nagios/plugins \
erjo@8331 36 --with-nagios-user=nagios \
erjo@8331 37 --with-nagios-group=nagios \
erjo@8331 38 --with-nrpe-user=nagios \
erjo@8331 39 --with-nrpe-group=nagios \
erjo@8331 40 --mandir=/usr/share/man $CONFIGURE_ARGS &&
erjo@8331 41 make all &&
erjo@14457 42 make install
erjo@8331 43 }
erjo@8331 44
erjo@8331 45 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@8331 46 genpkg_rules()
erjo@8331 47 {
erjo@8331 48 mkdir -p $fs/etc/nagios/objects \
erjo@8331 49 $fs/etc/init.d \
erjo@8331 50 $fs/var/run/nagios
erjo@8331 51
erjo@14457 52 cp -a $install/usr $fs
erjo@8331 53 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
erjo@8331 54 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
erjo@8331 55
erjo@8331 56 # Install config file nd init script
erjo@14457 57 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
erjo@14457 58 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
erjo@8331 59 }
erjo@8331 60
erjo@8331 61 post_install()
erjo@8331 62 {
erjo@8331 63 if ! grep -q nagios $1/etc/passwd; then
erjo@8331 64 echo -n "Adding user nagios..."
erjo@8331 65 chroot $1/ adduser -S -D -H nagios
erjo@8331 66 status
erjo@8331 67 fi
erjo@8331 68
erjo@8331 69 # Set perms for files and directories
erjo@8331 70 chroot $1/ chown -R nagios.nagios /usr/lib/nagios/plugins /var/run/nagios
erjo@8331 71 chroot $1/ chown nagios.nagios /etc/nagios/*
erjo@8331 72
erjo@8331 73 # Add check_nrpe in nagios config file
erjo@8331 74 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> $1/etc/nagios/nagios.cfg
erjo@8331 75 }
erjo@8331 76
erjo@8331 77 post_remove()
erjo@8331 78 {
erjo@8331 79 [ -f $1/etc/nagios/nagios.cfg ] && sed -i 's/.*nrpe.cfg//' $1/etc/nagios/nagios.cfg
erjo@8331 80 }