wok-next annotate nagios-nrpe/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents a3c581bf52b8
children
rev   line source
al@20513 1 # SliTaz package receipt v2.
erjo@8331 2
erjo@8331 3 PACKAGE="nagios-nrpe"
erjo@14457 4 VERSION="2.14"
erjo@8331 5 CATEGORY="network"
al@20513 6 SHORT_DESC="Service and network monitoring program, remote monitoring"
al@21020 7 MAINTAINER="devel@slitaz.org"
pascal@15584 8 LICENSE="GPL2"
al@20906 9 WEB_SITE="https://www.nagios.org/"
al@20513 10
al@20513 11 TARBALL="nrpe-$VERSION.tar.gz"
erjo@8331 12 WGET_URL="$SF_MIRROR/nagios/$TARBALL"
pascal@15584 13
al@20453 14 BUILD_DEPENDS="openssl-dev openssl libwrap-dev"
erjo@8331 15
al@20513 16 compile_rules() {
al@20513 17 ./configure \
al@20513 18 --datadir=/usr/share/nagios \
al@20513 19 --sysconfdir=/etc/nagios \
al@20513 20 --sbindir=/usr/lib/nagios \
al@20513 21 --bindir=/usr/bin \
al@20513 22 --libexecdir=/usr/lib/nagios/plugins \
al@20513 23 --with-nagios-user=nagios \
al@20513 24 --with-nagios-group=nagios \
al@20513 25 --with-nrpe-user=nagios \
al@20513 26 --with-nrpe-group=nagios \
al@20513 27 $CONFIGURE_ARGS &&
erjo@8331 28 make all &&
al@20513 29 make install || return 1
al@20513 30
al@20513 31 # Install config file nd init script
al@20513 32 install -Dm644 $stuff/nrpe.cfg $install/etc/nagios/objects/nrpe.cfg
al@20513 33 install -Dm755 $stuff/nrpe $install/etc/init.d/nrpe
al@20513 34
al@20513 35 install -Dm644 $src/sample-config/nrpe.cfg $install/etc/nagios/nrpe.cfg
al@20513 36 sed -i 's|/var/run|/var/run/nagios|' $install/etc/nagios/nrpe.cfg
erjo@8331 37 }
erjo@8331 38
al@20513 39 genpkg_rules() {
al@20513 40 copy @std
al@20513 41 DEPENDS="nagios-plugins openssl"
erjo@8331 42 }
erjo@8331 43
al@20513 44 post_install() {
pascal@18730 45 if ! grep -q nagios "$1/etc/passwd"; then
pascal@18730 46 chroot "$1/" adduser -S -D -H nagios
erjo@8331 47 fi
al@20513 48
erjo@8331 49 # Set perms for files and directories
pascal@18730 50 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
al@20534 51 chroot "$1/" chown nagios.nagios /etc/nagios/*
al@20513 52
erjo@8331 53 # Add check_nrpe in nagios config file
pascal@18730 54 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
erjo@8331 55 }
erjo@8331 56
al@20513 57 post_remove() {
al@20513 58 [ -f "$1/etc/nagios/nagios.cfg" ] &&
al@20513 59 sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
erjo@8331 60 }