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

Up: vlc (2.2.1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 03 16:53:03 2016 +0100 (2016-03-03)
parents 0d8a1a3edc72
children 970c5ec9a60a
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 \
pascal@16681 49 $fs/etc/init.d
erjo@8331 50
erjo@14457 51 cp -a $install/usr $fs
erjo@8331 52 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
erjo@8331 53 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
erjo@8331 54
erjo@8331 55 # Install config file nd init script
erjo@14457 56 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
erjo@14457 57 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
erjo@8331 58 }
erjo@8331 59
erjo@8331 60 post_install()
erjo@8331 61 {
pascal@18730 62 if ! grep -q nagios "$1/etc/passwd"; then
erjo@8331 63 echo -n "Adding user nagios..."
pascal@18730 64 chroot "$1/" adduser -S -D -H nagios
erjo@8331 65 status
erjo@8331 66 fi
erjo@8331 67
erjo@8331 68 # Set perms for files and directories
pascal@18730 69 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
pascal@18730 70 chroot "$1/" chown nagios.nagios /etc/nagios/*
erjo@8331 71
erjo@8331 72 # Add check_nrpe in nagios config file
pascal@18730 73 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
erjo@8331 74 }
erjo@8331 75
erjo@8331 76 post_remove()
erjo@8331 77 {
pascal@18730 78 [ -f "$1/etc/nagios/nagios.cfg" ] && sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
erjo@8331 79 }