#!/bin/bash # # nagios-plugins-nrpe.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # nagios-plugins-nrpe.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="nagios-plugins-nrpe" PACKAGE_EXT="gz" VERSION=${VERSION:=3.2.1} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi # Check for nagios account here if ! grep ^nagios: /etc/group 2>&1 > /dev/null; then groupadd -g 213 nagios fi if ! grep ^nagios: /etc/passwd 2>&1 > /dev/null; then useradd -d /dev/null -s /bin/false -u 213 -g 213 -c "Nagios" nagios fi check_required SRC="nrpe-$VERSION.tar.$PACKAGE_EXT" URL="https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-$VERSION/$SRC" _nagios_user="nagios" _nagios_group="nagios" get_source $SRC $URL unpack_source $SRC nrpe-$VERSION CFLAGS="$SLKCFLAGS" ./configure \ --prefix=/usr \ --libexecdir=/usr/share/nagios/libexec \ --libdir=${LIBDIR} \ --sysconfdir=/etc/nrpe \ --with-nrpe-user=$_nagios_user \ --with-nrpe-group=$_nagios_group \ --with-nagios-user=$_nagios_user \ --with-nagios-group=$_nagios_group \ --enable-command-args \ --build=$ARCH-slackware-linux || exit 1 make check_nrpe || exit 2 mkdir -p $DOCS cp -a LEGAL *.md $DOCS chmod 644 $DOCS/* mkdir -p $PKG/usr/share/nagios/libexec install src/check_nrpe $PKG/usr/share/nagios/libexec fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi