SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "nagios-plugins"

# SliTaz package receipt.

PACKAGE="nagios-plugins"
VERSION="2.4.0"
CATEGORY="network"
SHORT_DESC="Plugins for host, service and network monitoring program nagios."
MAINTAINER="erjo@slitaz.org"
LICENSE="GPL3"
WEB_SITE="https://www.nagios-plugins.org/"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="https://github.com/$PACKAGE/$PACKAGE/archive/refs/tags/release-$VERSION.tar.gz"

SUGGESTED="nagios-plugins-lang"
DEPENDS="fping libssl procps"
BUILD_DEPENDS="automake file libmysqlclient mysql-dev openldap-dev openssl-dev
    procps radiusclient-ng radiusclient-ng-dev"

current_version()
{
    wget -O - $(dirname $WGET_URL) 2>/dev/null | \
    sed "/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    ./tools/setup &&
    ./configure                        \
        --prefix=/usr                    \
        --libexecdir=/usr/lib/nagios/plugins        \
        --with-nagios-user=nobody            \
        --with-nagios-group=nogroup            \
        --with-ping-command="/bin/ping -w %d -c %d %s"    \
        --with-fping-command="/usr/sbin/fping"        \
        --mandir=/usr/share/man                \
        $CONFIGURE_ARGS &&
    patch    --strip=0 --input=$stuff/patches/check_load.c-2.4.0 &&
    make &&
    make install DESTDIR=$DESTDIR &&
    make install-root DESTDIR=$DESTDIR
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/lib
    mkdir -p $fs/etc/nagios/objects

    cp -a $install/usr/lib/nagios    $fs/usr/lib

    # 
    stuff/convertcfg $src/command.cfg commands > $fs/etc/nagios/objects/command.cfg
    
    # Move mySQL plugins in a separate package.
    rm -f                $fs/usr/lib/nagios/plugins/*mysql*
}

post_install()
{
    if ! grep -q nagios "$1/etc/passwd"
      then
        echo
        echo -n "Adding user and group nagios..."
        chroot "$1/" addgroup -S nagios
        chroot "$1/" adduser -S -D -H -G nagios nagios
        status
    fi

    if [ -f "$1/etc/nagios/resource.cfg" ]
      then
        sed -i 's|/usr/lib/nagios|/usr/lib/nagios/plugins|' \
           "$1/etc/nagios/resource.cfg"
    fi

    # Set permissions for files and directories
    chroot "$1/" chown -R nagios.nagios    /usr/lib/nagios/plugins 
    chroot "$1/" chown -R nagios.nagios    /etc/nagios/objects
}
6047 packages and 209931 files in current database (Wed Jun 26 15:35:30 2024)