Ver Fonte

Updates for cross-platform compile and install changes

Added build-aux directory. Put config.guess, config.sub, install-sh there.
Added custom_help.m4 to build-aux for modified ./configure -h output.
Added custom autoconf macros to build-aux for figuring out install paths.
Added aclocal.m4 to include the new macros.
Deleted init-script.in, init-script.debian.in and init-script.suse.in.
Added paths.in file.
Added startup directory and put in init scripts and inetd configs for
the various platforms.
John C. Frickson há 9 anos atrás
pai
commit
e073e6acf8

+ 4 - 0
.gitignore

@@ -15,3 +15,7 @@ src/nrpe
 subst
 autom4te.cache/
 nbproject/
+.cproject
+.project
+.settings/
+paths

+ 23 - 7
Makefile.in

@@ -15,7 +15,7 @@ LDFLAGS=@LDFLAGS@ @LIBS@
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-CFGDIR=@sysconfdir@
+CFGDIR=@pkgsysconfdir@
 BINDIR=@bindir@
 SBINDIR=@sbindir@
 LIBEXECDIR=@libexecdir@
@@ -23,8 +23,13 @@ INSTALL=@INSTALL@
 NAGIOS_INSTALL_OPTS=@NAGIOS_INSTALL_OPTS@
 NRPE_INSTALL_OPTS=@NRPE_INSTALL_OPTS@
 
-INIT_DIR=@init_dir@
+INIT_DIR=@initdir@
 INIT_OPTS=-o root -g root
+INIT_FILE=@initname@
+INETD_DIR=@inetddir@
+INETD_FILE=@inetdname@
+SRC_INETD=@src_inetd@
+SRC_INIT=@src_init@
 
 
 all:
@@ -55,12 +60,23 @@ install-daemon:
 install:
 	$(MAKE) -C $(SRC_BASE) $@
 
-install-xinetd:
-	$(INSTALL) -m 644 sample-config/nrpe.xinetd /etc/xinetd.d/nrpe
+install-inetd:
+	@if test $(SRC_INETD) = unknown; then \
+		echo No inetd file to install; \
+		exit 1; \
+	fi
+	$(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE)
+
+install-init:
+	@if test $(SRC_INIT) = unknown; then \
+		echo No init file to install; \
+		exit 1; \
+	fi
+	$(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE)
 
-install-daemon-config:
-	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
-	$(INSTALL) -m 644 $(NRPE_INSTALL_OPTS) sample-config/nrpe.cfg $(DESTDIR)$(CFGDIR)
+install-config:
+	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(CFGDIR)
+	$(INSTALL) -m 644 $(NRPE_INSTALL_OPTS) sample-config/nrpe.cfg $(CFGDIR)
 
 solaris-package:
 	@if [ `uname -s` != "SunOS" ] ; then \

+ 6 - 0
aclocal.m4

@@ -0,0 +1,6 @@
+m4_include([build-aux/ax_nagios_get_os])
+m4_include([build-aux/ax_nagios_get_distrib])
+m4_include([build-aux/ax_nagios_get_init])
+m4_include([build-aux/ax_nagios_get_inetd])
+m4_include([build-aux/ax_nagios_get_paths])
+m4_include([build-aux/ax_nagios_get_files])

+ 149 - 0
build-aux/ax_nagios_get_distrib

@@ -0,0 +1,149 @@
+# ===========================================================================
+# SYNOPSIS
+#
+#   AX_NAGIOS_GET_DISTRIB_TYPE
+#
+# DESCRIPTION
+#
+#    This macro determines the O/S distribution of the computer it is run on.
+#    $dist_type will be set and will be one of:
+#        unknown (could not be determined)
+#        freebsd, netbsd, openbsd, dragonfly, etc (The BSDs)
+#        suse, rh, debian, gentoo (and possibly their descendants)
+#        Other major Linux distributions (and possibly their descendants)
+#        The O/S name for the rest
+#
+# LICENSE
+#
+#    Copyright (c) 2016 Nagios Core Development Team
+#
+#   This program 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 (at your
+#   option) any later version.
+#
+#   This program 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, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+# ===========================================================================
+
+AU_ALIAS([AC_NAGIOS_GET_DISTRIB_TYPE], [AX_NAGIOS_GET_DISTRIB_TYPE])
+AC_DEFUN([AX_NAGIOS_GET_DISTRIB_TYPE],
+[
+#
+# Get user hints for possible cross-compile
+#
+	AC_MSG_CHECKING(what the distribution type is )
+	AC_ARG_WITH(dist-type, AC_HELP_STRING([--with-dist-type=type],
+	[specify distribution type (suse, rh, debian, etc.)]),
+		[
+			#
+			# Run this if --with was specified
+			#
+			if test "x$withval" = x -o x$withval = xno; then
+				dist_type_wanted=yes
+			else
+				dist_type_wanted=no
+				dist_type="$withval"
+				dist_ver="unknown"
+				AC_MSG_RESULT($dist_type)
+			fi
+		], [
+			#
+			# Run this if --with was not specified
+			#
+			dist_type_wanted=yes
+		])
+
+		if test x$dist_type = xno; then
+			dist_type_wanted=yes
+		elif test x$dist_type = xyes; then
+			AC_MSG_ERROR([you must enter a distribution type if '--with-dist-type' is specified])
+		fi
+
+		#
+		# Determine distribution type if it wasn't supplied
+		#
+		dist_ver="unknown"
+
+		if test $dist_type_wanted=yes; then
+			dist_type="unknown"
+
+			if test "$opsys" != "linux"; then
+				dist_type="$opsys"
+				AS_CASE([$opsys],
+					[bsd],
+						dist_type=`uname -s | tr ["[A-Z]" "[a-z]"]`
+						dist_ver=`uname -r`,
+					[aix|hp-ux],
+						dist_ver=$OSTYPE,
+					[solaris],
+						dist_ver=`echo $OSTYPE | cut -d'.' -f2`,
+					[*],
+						dist_ver=$OSTYPE
+				)
+
+			else
+
+				if test -r "/etc/gentoo-release"; then
+					dist_type="gentoo"
+					dist_ver=`cat /etc/gentoo-release`
+
+				elif test -r "/etc/os-release"; then
+					. /etc/os-release
+					if test x"$ID_LIKE" != x; then
+						dist_type=`echo $ID_LIKE | cut -d' ' -f1 | tr ["[A-Z]" "[a-z]"]`
+					else
+						dist_type=`echo $ID | tr ["[A-Z]" "[a-z]"]`
+					fi
+					if test x"$VERSION_ID" != x; then
+						dist_ver=$VERSION_ID
+					elif test x"$VERSION" != x; then
+						dist_ver=`echo $VERSION | cut -d'.' -f1 | tr -d [:alpha:][:blank:][:punct:]`
+					fi
+
+				elif test -r "/etc/redhat-release"; then
+					dist_type=rh
+					dist_ver=`cat /etc/redhat-release`
+
+				elif test -r "/etc/debian_version"; then
+					dist_type="debian"
+					if test -r "/etc/lsb-release"; then
+						. /etc/lsb_release
+						dist_ver=`echo "$DISTRIB_RELEASE"`
+					else
+						dist_ver=`cat /etc/debian_version`
+					fi
+
+				elif test -r "/etc/SuSE-release"; then
+					dist_type=suse
+					dist_ver=`grep VERSION /etc/SuSE-release`
+
+				fi
+
+			fi
+
+			if test $dist_ver != "unknown"; then
+				dist_ver=`echo $dist_ver | cut -d'.' -f1 | tr -d [:alpha:][:blank:][:punct:]`
+			fi
+		fi
+
+		AC_MSG_RESULT($dist_type)
+])

+ 108 - 0
build-aux/ax_nagios_get_files

@@ -0,0 +1,108 @@
+# ===========================================================================
+# SYNOPSIS
+#
+#   AX_NAGIOS_GET_FILES
+#
+# DESCRIPTION
+#
+#    This macro figures out which init and/or inetd files to use based
+#    on the results of the AX_NAGIOS_GET_OS, AX_NAGIOS_GET_DISTRIB_TYPE,
+#    AX_NAGIOS_GET_INIT and AX_NAGIOS_GET_INETD macros. It will select
+#    the appropriate files(s) from the 'startup' directory and copy it.
+#
+# LICENSE
+#
+#    Copyright (c) 2016 Nagios Core Development Team
+#
+#   This program 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 (at your
+#   option) any later version.
+#
+#   This program 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, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+# ===========================================================================
+
+AU_ALIAS([AC_NAGIOS_GET_FILES], [AX_NAGIOS_GET_FILES])
+AC_DEFUN([AX_NAGIOS_GET_FILES],
+[
+
+src_inetd=""
+src_init=""
+
+AC_MSG_CHECKING(for which init file to use )
+
+AS_CASE([$init_type],
+
+	[sysv],
+		if test $dist_type = debian; then
+			src_init=debian-init.in
+		else
+			src_init=default-init.in
+		fi,
+
+	[systemd],
+		src_init=default-service.in
+		src_inetd=default-service.in,
+
+#	[*bsd],
+
+#	[gentoo],
+
+	[openrc],
+		src_init=openrc-init.in,
+
+	[smf*],
+		src_init="solaris-@PKG_NAME@.xml.in"
+		src_inetd="solaris-@PKG_NAME@.xml.in",
+
+#	[upstart],
+
+	[launchd],
+		src_init="mac-org.nagios.@PKG_NAME@.plist.in"
+		src_inetd="mac-org.nagios.@PKG_NAME@.plist.in",
+
+	[*],
+		src_init="unknown"
+)
+AC_MSG_RESULT($src_init)
+
+AC_MSG_CHECKING(for which inetd files to use )
+
+if test x$src_inetd = x; then
+
+	AS_CASE([$inetd_type],
+		[inetd],
+			src_inetd=default-inetd.in,
+
+		[xinetd],
+			src_inetd=default-xinetd.in,
+
+#		[upstart],
+
+		[*],
+			src_inetd="unknown"
+	)
+
+fi
+AC_MSG_RESULT($src_inetd)
+
+])

+ 142 - 0
build-aux/ax_nagios_get_inetd

@@ -0,0 +1,142 @@
+# ===========================================================================
+# SYNOPSIS
+#
+#   AX_NAGIOS_GET_INETD
+#
+# DESCRIPTION
+#
+#    This macro determines whether inetd or xinetd is being used
+#    The argument are:
+#        the init type as determined by AX_NAGIOS_GET_INIT
+#    $inetd_type will be set and will be one of:
+#        unknown (could not be determined)
+#        launchd (Mac OS X)
+#        smf10   (Solaris)
+#        smf11   (Solaris)
+#        upstart (Older Debian)
+#        xinetd  (Most Linux, BSD)
+#        inetd   (The rest)
+#
+# LICENSE
+#
+#    Copyright (c) 2016 Nagios Core Development Team
+#
+#   This program 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 (at your
+#   option) any later version.
+#
+#   This program 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, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+# ===========================================================================
+
+AU_ALIAS([AC_NAGIOS_GET_INETD], [AX_NAGIOS_GET_INETD])
+AC_DEFUN([AX_NAGIOS_GET_INETD],
+[
+#
+# Get user hints for possible cross-compile
+#
+	AC_MSG_CHECKING(what inetd is being used )
+	AC_ARG_WITH(inetd_type, AC_HELP_STRING([--with-inetd-type=type],
+	[which super-server the system runs (inetd, xinetd, systemd, launchd,
+	 smf10, smf11, etc.)]),
+		[
+			inetd_type_wanted=yes
+			#
+			# Run this if --with was specified
+			#
+			if test "x$withval" = x -o x$withval = xno; then
+				inetd_type_wanted=yes
+			else
+				inetd_type_wanted=no
+				inetd_type="$withval"
+				AC_MSG_RESULT($inetd_type)
+			fi
+		], [
+			#
+			# Run this if --with was not specified
+			#
+			inetd_type_wanted=yes
+		])
+
+		if test x$inetd_type = xno; then
+			inetd_type_wanted=yes
+		elif test x$inetd_type = xyes; then
+			AC_MSG_ERROR([you must enter an inetd type if '--with-inetd-type' is specified])
+		fi
+
+		#
+		# Determine inetd type if it wasn't supplied
+		#
+		if test $inetd_type_wanted = yes; then
+
+			inetd_disabled=""
+
+			if test x"$init_type" = "xupstart"; then
+				inetd_type="upstart"
+			elif test "$opsys" = "osx"; then
+				inetd_type="launchd"
+			fi
+
+			if test x"$inetd_type" = x; then
+				AS_CASE([$dist_type],
+					[solaris],
+						if test x"$init_type" = "xsmf10" -o x"$init_type" = "xsmf11"; then
+							inetd_type="$init_type"
+						else
+							inetd_type="inetd"
+						fi,
+
+					[*bsd*],
+						inetd_type=`ps -A -o comm -c | grep inetd`,
+
+					[aix|hp-ux],
+						inetd_type=`UNIX95= ps -A -o comm | grep inetd | head -1`,
+
+					[*],
+						inetd_type=[`ps -C "inetd,xinetd" -o fname | grep -vi COMMAND`])
+			fi
+
+			if test x"$inetd_type" = x; then
+				if test -f /etc/xinetd.conf -a -d /etc/xinetd.d; then
+					inetd_disabled="(Not running)"
+					inetd_type=xinetd
+				elif test -f /etc/inetd.conf; then
+					inetd_type=inetd
+					inetd_disabled="(Not running)"
+				fi
+			fi
+
+			if test x"$inetd_type" = x; then
+				if test x"$init_type" = "xsystemd"; then
+					inetd_type="systemd"
+				else
+					inetd_type="unknown"
+				fi
+			fi
+
+			if test -n $inetd_disabled; then
+				AC_MSG_RESULT($inetd_type $inetd_disabled)
+			else
+				AC_MSG_RESULT($inetd_type)
+			fi
+		fi
+])

+ 192 - 0
build-aux/ax_nagios_get_init

@@ -0,0 +1,192 @@
+# ===========================================================================
+# SYNOPSIS
+#
+#   AX_NAGIOS_GET_INIT
+#
+# DESCRIPTION
+#
+#    This macro determines the O/S distribution of the computer it is run on.
+#    $init_type will be set and will be one of:
+#        unknown (could not be determined)
+#        launchd (Mac OS X)
+#        bsd     (Slackware Linux)
+#        newbsd  (FreeBSD, OpenBSD, NetBSD, Dragonfly, etc)
+#        smf10   (Solaris)
+#        smf11   (Solaris)
+#        systemd (Linux SystemD)
+#        gentoo  (Older Gentoo)
+#        openrc  (Recent Gentoo and some others)
+#        upstart (Older Debian)
+#        sysv    (The rest)
+#
+# LICENSE
+#
+#    Copyright (c) 2016 Nagios Core Development Team
+#
+#   This program 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 (at your
+#   option) any later version.
+#
+#   This program 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, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+# ===========================================================================
+
+AU_ALIAS([AC_NAGIOS_GET_INIT], [AX_NAGIOS_GET_INIT])
+AC_DEFUN([AX_NAGIOS_GET_INIT],
+[
+#
+# Get user hints for possible cross-compile
+#
+	AC_MSG_CHECKING(what init system is being used )
+	AC_ARG_WITH(init_type,AC_HELP_STRING([--with-init-type=type],
+	 [specify init type (bsd, sysv, systemd, launchd, smf10, smf11, upstart,
+		openrc, etc.)]),
+		[
+			#
+			# Run this if --with was specified
+			#
+			if test "x$withval" = x -o x$withval = xno; then
+					init_type_wanted=yes
+			else
+					init_type_wanted=no
+					init_type="$withval"
+					AC_MSG_RESULT($init_type)
+			fi
+		], [
+			#
+			# Run this if --with was not specified
+			#
+			init_type_wanted=yes
+		])
+
+		if test x$init_type = xno; then
+			init_type_wanted=yes
+		elif test x$init_type = xyes; then
+			AC_MSG_ERROR([you must enter an init type if '--with-init-type' is specified])
+		fi
+
+		#
+		# Determine init type if it wasn't supplied
+		#
+		if test $init_type_wanted = yes; then
+			init_type=""
+
+			if test x"$opsys" = x; then
+				init_type="unknown"
+				init_type_wanted=no
+			elif test x"$dist_type" = x; then
+				init_type="unknown"
+				init_type_wanted=no
+			elif test "$opsys" = "osx"; then
+				init_type="launchd"
+				init_type_wanted=no
+			elif test "$opsys" = "bsd"; then
+				init_type="newbsd"
+				init_type_wanted=no
+			elif test "$dist_type" = "solaris"; then
+				if test -d "/lib/svc/manifest"; then
+					init_type="smf11"
+					init_type_wanted=no
+				elif test -d "/lib/svc/monitor"; then
+					init_type="smf10"
+					init_type_wanted=no
+				else
+					init_type="sysv"
+					init_type_wanted=no
+				fi
+			elif test "$dist_type" = "slackware"; then
+				init_type="bsd"
+				init_type_wanted=no
+			fi
+		fi
+
+		PSCMD="ps -p1 -o args"
+		AS_CASE([$dist_type],
+			[aix],		PSCMD="env UNIX95=1; ps -p1 -o args",
+			[solaris],	PSCMD="env UNIX95=1; ps -p1 -o args",
+			[hp-ux],	PSCMD="env UNIX95=1; ps -p1 -o args")
+
+		if test "$init_type_wanted" = yes; then
+			pid1=`$PSCMD | grep -vi COMMAND | cut -d' ' -f1`
+			if test x"$pid1" = "x"; then
+				init_type="unknown"
+				init_type_wanted=no
+			fi
+			if `echo $pid1 | grep "systemd" > /dev/null`; then
+				init_type="systemd"
+				init_type_wanted=no
+			fi
+
+			if test "$init_type_wanted" = yes; then
+				if test "$pid1" = "init"; then
+					if test -e "/sbin/init"; then
+						pid1="/sbin/init";
+					elif test -e "/usr/sbin/init"; then
+						pid1="/usr/sbin/init"
+					else
+						init_type="unknown"
+						init_type_wanted=no
+					fi
+				fi
+				if test -L "$pid1"; then
+					pid1=`readlink "$pid1"`
+				fi
+			fi
+
+			if test "$init_type_wanted" = yes; then
+				if `echo $pid1 | grep "systemd" > /dev/null`; then
+					init_type="systemd"
+					init_type_wanted=no
+				elif test -f "/sbin/rc"; then
+					if test -f /sbin/runscript; then
+						init_type_wanted=no
+						if `/sbin/start-stop-daemon -V | grep "OpenRC" > /dev/null`; then
+							init_type="openrc"
+						else
+							init_type="gentoo"
+						fi
+					fi
+				fi
+			fi
+
+			if test "$init_type_wanted" = yes; then
+				if test "$pid1" = "/sbin/init" -o "$pid1" = "/usr/sbin/init"; then
+					if `/sbin/init --version 2>/dev/null | grep "upstart" >/dev/null`; then
+						init_type="upstart"
+						init_type_wanted=no
+					elif test -f "/etc/rc"; then
+						init_type="newbsd"
+						init_type_wanted=no
+					else
+						init_type="sysv"
+						init_type_wanted=no
+					fi
+				fi
+			fi
+
+			if test "$init_type_wanted" = yes; then
+				init_type="unknown"
+			fi
+		fi
+
+		AC_MSG_RESULT($init_type)
+])

+ 95 - 0
build-aux/ax_nagios_get_os

@@ -0,0 +1,95 @@
+# ===========================================================================
+# SYNOPSIS
+#
+#   AX_NAGIOS_GET_OS
+#
+# DESCRIPTION
+#
+#    This macro determines the operating system of the computer it is run on.
+#
+# LICENSE
+#
+#    Copyright (c) 2016 Nagios Core Development Team
+#
+#   This program 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 (at your
+#   option) any later version.
+#
+#   This program 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, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+# ===========================================================================
+
+AU_ALIAS([AC_NAGIOS_GET_OS], [AX_NAGIOS_GET_OS])
+AC_DEFUN([AX_NAGIOS_GET_OS],
+[
+#
+# Get user hints
+#
+	AC_MSG_CHECKING(what the operating system is )
+	AC_ARG_WITH(opsys, AC_HELP_STRING([--with-opsys=OS],
+	[specify operating system (linux, osx, bsd, solaris, irix, cygwin,
+	 aix, hp-ux, etc.)]),
+		[
+			#
+			# Run this if --with was specified
+			#
+			if test "x$withval" = x -o x$withval = xno; then
+				opsys_wanted=yes
+			else
+				opsys_wanted=no
+				opsys="$withval"
+				AC_MSG_RESULT($opsys)
+			fi
+		], [
+			#
+			# Run this if --with was not specified
+			#
+			opsys_wanted=yes
+		])
+
+		if test x$opsys = xno; then
+			opsys=""
+			opsys_wanted=yes
+		elif test x$opsys = xyes; then
+			AC_MSG_ERROR([you must enter an O/S type if '--with-opsys' is specified])
+		fi
+
+		#
+		# Determine operating system if it wasn't supplied
+		#
+		if test $opsys_wanted=yes; then
+			opsys=`uname -s | tr ["[A-Z]" "[a-z]"]`
+			if test x"$opsys" = "x"; then opsys="unknown"; fi
+			AS_CASE([$opsys],
+				[darwin*],		opsys="osx",
+				[*bsd*],		opsys="bsd",
+				[dragonfly],	opsys="bsd",
+				[sunos],		opsys="solaris",
+				[gnu/hurd],		opsys="linux",
+				[irix*],		opsys="irix",
+				[cygwin*],		opsys="cygwin",
+				[mingw*],		opsys="mingw",
+				[msys*],		opsys="msys")
+		fi
+
+		AC_MSG_RESULT($opsys)
+])

+ 597 - 0
build-aux/ax_nagios_get_paths

@@ -0,0 +1,597 @@
+# ===========================================================================
+# SYNOPSIS
+#
+#   AX_NAGIOS_GET_PATHS
+#
+# DESCRIPTION
+#
+#    This macro figures out the installation & run paths for various systems
+#    The argument are:
+#        the O/S determined by the AX_NAGIOS_GET_OS macro.
+#        the distribution type as determined by AX_NAGIOS_GET_DISTRIB_TYPE
+#        the init type as determined by AX_NAGIOS_GET_INIT
+#        the inetd type as determined by AX_NAGIOS_GET_INETD
+#
+# LICENSE
+#
+#    Copyright (c) 2016 Nagios Core Development Team
+#
+#   This program 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 (at your
+#   option) any later version.
+#
+#   This program 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, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+# ===========================================================================
+
+AU_ALIAS([AC_NAGIOS_GET_PATHS], [AX_NAGIOS_GET_PATHS])
+AC_DEFUN([AX_NAGIOS_GET_PATHS],
+[
+
+if test x$DBG_PATHS != x; then
+	echo
+	echo Incoming paths:
+	echo "    prefix        $prefix"
+	echo "    execprefix    $execprefix"
+	echo "    bindir        $bindir"
+	echo "    sbindir       $sbindir"
+	echo "    libexecdir    $libexecdir"
+	echo "    sysconfdir    $sysconfdir"
+	echo "    localstatedir $localstatedir"
+	echo "    datarootdir   $datarootdir"
+	echo "    datadir       $datadir"
+	echo "    localedir     $localedir"
+	echo
+fi
+
+AC_MSG_CHECKING(for which paths to use )
+
+AC_ARG_ENABLE(install_method,
+	AC_HELP_STRING([--enable-install-method=<method>],
+	[sets the install method to use: 'default' (the default) will install to
+	/usr/local/nagios, 'opt' will be like 'default', except will install to
+	/opt/nagios instead, 'os' will try to determine which method to use based
+	on OS type and distribution. Fine tuning using the '--bindir', etc.
+	overrides above will still work]),
+	install_method=$enableval,
+	install_method=default
+)
+
+AC_ARG_ENABLE(showdirs_only,
+	AC_HELP_STRING([--enable-showdirs-only=yes],
+	[This option will cause 'configure' to stop after determining the install
+	 locations based on '--enable-install-method', so you can see the
+	 destinations before a full './configure', 'make', 'make install'
+	 process.]),
+	showdirs_only=$enableval,
+	showdirs_only=no
+)
+
+AS_CASE([$install_method],
+	[yes], install_method="os",
+	[no],  install_method="default",
+	[opt|default|os], :,
+	[*], echo >&6; AC_MSG_ERROR(['--enable-install-method=$install_method' is invalid])
+)
+
+if test $showdirs_only != "no"; then showdirs_only="yes"; fi
+
+AS_CASE([$dist_type],
+	[*solaris*|*hp-ux*|*aix*|*osx*], opsys=unix)
+
+
+need_cgi=no
+need_web=no
+need_brk=no
+need_plg=no
+need_pipe=no
+need_spl=no
+need_loc=no
+need_log_subdir=no
+need_etc_subdir=no
+need_pls_dir=no
+
+AS_CASE([$PKG_NAME],
+	[nagios],
+		need_log_subdir=yes
+		need_etc_subdir=yes
+		need_pls_dir=yes
+		need_brk=yes
+		need_pipe=yes
+		need_spl=yes
+		need_loc=yes
+		need_cgi=yes
+		need_web=yes,
+
+	[ndoutils],
+		need_spl=yes,
+
+	[nrpe],
+		need_plg=yes,
+
+	[nsca],
+		need_cgi=no,
+
+	[plugins],
+		need_loc=yes
+		need_plg=yes
+)
+
+AC_ARG_WITH(pkgsysconfdir, AC_HELP_STRING([--with-pkgsysconfdir=DIR],
+	[where configuration files should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		pkgsysconfdir="$withval"
+	fi)
+AC_ARG_WITH(objsysconfdir, AC_HELP_STRING([--with-objsysconfdir=DIR],
+	[where object configuration files should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		objsysconfdir="$withval"
+	fi)
+AC_ARG_WITH(privatesysconfdir, AC_HELP_STRING([--with-privatesysconfdir=DIR],
+	[where private configuration files should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		privatesysconfdir="$withval"
+	fi)
+AC_ARG_WITH(webdir, AC_HELP_STRING([--with-webdir=DIR],
+	[where the website files should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		webdir="$withval"
+	fi)
+AC_ARG_WITH(pluginsdir, AC_HELP_STRING([--with-pluginsdir=DIR],
+	[where the plugins should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		pluginsdir="$withval"
+	fi)
+AC_ARG_WITH(brokersdir, AC_HELP_STRING([--with-brokersdir=DIR],
+	[where the broker modules should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		brokersdir="$withval"
+	fi)
+AC_ARG_WITH(cgibindir, AC_HELP_STRING([--with-cgibindir=DIR],
+	[where the CGI programs should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		cgibindir="$withval"
+	fi)
+AC_ARG_WITH(logdir, AC_HELP_STRING([--with-logdir=DIR],
+	[where log files should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		logdir="$withval"
+	fi)
+AC_ARG_WITH(piddir, AC_HELP_STRING([--with-piddir=DIR],
+	[where the PID file should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		piddir="$withval"
+	fi)
+AC_ARG_WITH(pipedir, AC_HELP_STRING([--with-pipedir=DIR],
+	[where socket and pipe files should be placed]),
+	if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
+		pipedir="$withval"
+	fi)
+
+
+#AC_SUBST(sbindir)
+#AC_SUBST(initname)
+#AC_SUBST(inetdname)
+#AC_SUBST(pkglocalstatedir)
+#AC_SUBST(spooldir)
+#AC_SUBST(initdir)
+#AC_SUBST(inetddir)
+#AC_SUBST(tmpfilesd)
+#AC_SUBST(subsyslockdir)
+
+
+
+
+# docdir ??
+# includedir ??
+# mandir ??
+# pdfdir ??
+
+#
+# Setup the base directory
+#
+
+if test $install_method = "default"; then
+	if test $opsys = "unix"; then
+		if test x"$prefix" = "xNONE"; then prefix="/usr/local/$PKG_NAME"; fi
+	else
+		if test x"$prefix" = "xNONE"; then prefix=${ac_default_prefix}; fi
+	fi
+	datarootdir=${datarootdir="$prefix"}
+
+elif test $install_method = "opt"; then
+	if test x"$prefix" = "xNONE"; then prefix="/opt/$PKG_NAME"; fi
+
+else
+	if test x"$datadir" = x'${datarootdir}'; then AS_UNSET(datadir); fi
+	if test x"$sysconfdir" = x'${prefix}/etc'; then AS_UNSET(sysconfdir); fi
+
+	if test x"$prefix" = "xNONE"; then prefix="/usr"; fi
+	if test x"$exec_prefix" = "xNONE"; then exec_prefix=${prefix}; fi
+	if test x"$localstatedir" = x'${prefix}/var'; then
+		if test $opsys = "osx"; then
+			localstatedir="/private/var"
+		else
+			localstatedir="/var"
+		fi
+	fi
+
+	if test $opsys = "unix"; then
+		if test x"$datarootdir" = x'${prefix}/share'; then
+			if test $dist_type = "hp-ux"; then
+				datarootdir="/usr/local/share"
+				if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
+					libexecdir="/usr/nagios"
+				fi
+			elif test x"$libexecdir" = x'${exec_prefix}/libexec'; then
+				libexecdir="/usr/lib/nagios"
+			fi
+		fi
+	elif test $opsys = "osx"; then
+		if test x"$sbindir" = x'${exec_prefix}/sbin'; then
+			sbindir="$libexecdir"
+		fi
+		if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
+			libexecdir="/usr/libexec/nagios"
+		fi
+	elif test x"$libexecdir" = x'${exec_prefix}/lib'; then
+		libexecdir=${libexecdir}/nagios;
+	fi
+
+fi
+
+if test x"$exec_prefix" = "xNONE"; then exec_prefix=${prefix}; fi
+
+tmpfilesd=${tmpfilesd="/var/lib/tmpfiles.d"}
+if test ! -d "$tmpfilesd"; then
+	tmpfilesd="N/A"
+else
+	tmpfilesd="$tmpfilesd/$PKG_NAME.conf"
+fi
+subsyslockdir=${subsyslockdir="/var/lock/subsys"}
+if test ! -d "$subsyslockdir"; then
+	subsyslockdir="N/A"
+	subsyslockfile="N/A"
+else
+	subsyslockfile="$subsyslockdir/$PKG_NAME"
+fi
+if test "$need_loc" = no; then
+	localedir="N/A"
+fi
+
+if test $install_method = "default" -o $install_method = "opt"; then
+	#
+	# Do the default setup
+	#
+	sbindir=${bindir}
+	datadir=${datadir="$datarootdir"}
+	if test $need_web = yes; then
+		webdir=${webdir="$datadir"}
+	else
+		webdir="N/A"
+	fi
+	if test $opsys = "unix"; then
+		sysconfdir=${sysconfdir="/etc/opt"}
+	fi
+	pkgsysconfdir=${pkgsysconfdir="$sysconfdir"}
+	if test $need_etc_subdir = yes; then
+		objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
+	else
+		objsysconfdir="N/A"
+	fi
+	privatesysconfdir=${privatesysconfdir="$pkgsysconfdir"}
+	logdir=${logdir="$localstatedir"}
+	piddir=${piddir="$localstatedir"}
+	if test "$need_pipe" = yes; then
+		pipedir=${pipedir="$localstatedir/rw"}
+	else
+		pipedir="N/A"
+	fi
+	if test "$need_pls_dir" = yes; then
+		pkglocalstatedir=${pkglocalstatedir="$localstatedir"}
+	else
+		pkglocalstatedir="N/A"
+	fi
+	if test "$need_spl" = yes; then
+		spooldir=${spooldir="$localstatedir/var"}
+	else
+		spooldir="N/A"
+	fi
+	if test $need_brk = yes; then
+		brokersdir=${brokersdir="$bindir"}
+	else
+		brokersdir="N/A"
+	fi
+	if test $need_plg = yes; then
+		pluginsdir=${pluginsdir="$libexecdir"}
+	else
+		pluginsdir="N/A"
+	fi
+	if test $need_cgi = yes; then
+		cgibindir=${cgibindir="$prefix/sbin"}
+	else
+		cgibindir="N/A"
+	fi
+
+elif test $opsys = "linux"; then
+
+	#
+	# Linux "Standard" install
+	#
+	install_method="$install_method : FHS"
+	datadir=${datadir="$datarootdir/nagios"}
+	if test $need_web = yes; then
+		webdir=${webdir="$datadir/html"}
+	else
+		webdir="N/A"
+	fi
+	sysconfdir=${sysconfdir="/etc"}
+	pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
+#																		  --pkgsysconfdir=DIR     read-only pakcage-specific data [PREFIX/etc/PKG_NAME]
+	if test $need_etc_subdir = yes; then
+		objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
+	else
+		objsysconfdir="N/A"
+	fi
+	privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
+	if test $need_log_subdir = yes; then
+		logdir=${logdir="$localstatedir/log/$PKG_NAME"}
+	else
+		logdir=${logdir="$localstatedir/log"}
+	fi
+	piddir=${piddir="$localstatedir/run/${PKG_NAME}"}
+	if test "$need_pipe" = yes; then
+		pipedir=${pipedir="$localstatedir/run/${PKG_NAME}"}
+	else
+		pipedir="N/A"
+	fi
+	if test "$need_pls_dir" = yes; then
+		pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$PKG_NAME"}
+	else
+		pkglocalstatedir="N/A"
+	fi
+	if test "$need_spl" = yes; then
+		spooldir=${spooldir="$localstatedir/spool/$PKG_NAME"}
+	else
+		spooldir="N/A"
+	fi
+	if test $need_brk = yes; then
+		brokersdir=${brokersdir="$libexecdir/brokers"}
+	else
+		brokersdir="N/A"
+	fi
+	if test $need_plg = yes; then
+		pluginsdir=${pluginsdir="$libexecdir/plugins"}
+	else
+		pluginsdir="N/A"
+	fi
+	if test $need_cgi = yes; then
+		cgibindir=${cgibindir="$libexecdir/cgi-bin"}
+	else
+		cgibindir="N/A"
+	fi
+
+elif test $opsys = "unix"; then
+
+	#
+	# "Standard" Unix install
+	#
+	install_method="$install_method : Unix Standard"
+	if test $dist_type = osx; then
+		install_method="$install_method : OS X Standard"
+		sbindir=${sbindir="/usr/libexec"}
+	fi
+	datadir=${datadir="$datarootdir/nagios"}
+	if test $need_web = yes; then
+		webdir=${webdir="$datadir/html"}
+	else
+		webdir="N/A"
+	fi
+	if test $dist_type = osx; then
+		sysconfdir=${sysconfdir="/private/etc"}
+	else
+		sysconfdir=${sysconfdir="/etc"}
+	fi
+	pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
+	if test $need_etc_subdir = yes; then
+		objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
+	else
+		objsysconfdir="N/A"
+	fi
+	privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
+	if test "$need_pls_dir" = yes; then
+		pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$PKG_NAME"}
+	else
+		pkglocalstatedir="N/A"
+	fi
+	if test "$need_loc" = yes; then
+		localedir=${localedir="/usr/local/share/locale/<lang>/LC_MESSAGES/nagios-plugins.mo"}
+	fi
+	if test "$need_spl" = yes; then
+		spooldir=${spooldir="$localstatedir/spool/$PKG_NAME"}
+	else
+		spooldir="N/A"
+	fi
+	if test $need_brk = yes; then
+		brokersdir=${brokersdir="$libexecdir/brokers"}
+	else
+		brokersdir="N/A"
+	fi
+	if test $need_plg = yes; then
+		pluginsdir=${pluginsdir="$libexecdir/plugins"}
+	else
+		pluginsdir="N/A"
+	fi
+	if test $need_cgi = yes; then
+		cgibindir=${cgibindir="$libexecdir/cgi-bin"}
+	else
+		cgibindir="N/A"
+	fi
+	AS_CASE([$dist_type],
+		[*hp-ux*],
+			piddir=${piddir="$pkgsysconfdir"}
+			pipedir=${pipedir="$pkglocalstatedir"}
+			logdir=${logdir="$pkglocalstatedir/log"},
+
+		[*],
+			piddir=${piddir="$localstatedir/run/${PKG_NAME}"}
+			if test "$need_pipe" = yes; then
+				pipedir=${pipedir="$localstatedir/run/${PKG_NAME}"}
+			else
+				pipedir="N/A"
+			fi
+			if test $need_log_subdir = yes; then
+				logdir=${logdir="$localstatedir/log/$PKG_NAME"}
+			else
+				logdir=${logdir="$localstatedir/log"}
+			fi
+	)
+
+else
+
+	#
+	# Unknown install
+	#
+	install_method="unknown"
+	webdir=unknown
+	pkgsysconfdir=unknown
+	objsysconfdir=unknown
+	privatesysconfdir=unknown
+	logdir=unknown
+	piddir=unknown
+	pipedir=unknown
+	pkglocalstatedir=unknown
+	spooldir=unknown
+	brokersdir=unknown
+	pluginsdir=unknown
+	cgibindir=unknown
+
+fi
+
+#
+# Init scripts/files
+#
+AS_CASE([$init_type],
+
+	[sysv],
+		if test $dist_type = "hp-ux"; then
+			initdir=${initdir="/sbin/init.d"}
+		else
+			initdir=${initdir="/etc/init.d"}
+		fi
+		initname=${initname="$PKG_NAME"}
+		initconfdir=${initconfdir="/etc/conf.d"}
+		initconf=${initconf="$initconfdir/$PKG_NAME"},
+
+	[systemd],
+		if test $dist_type = "debian"; then
+			initdir=${initdir="/lib/systemd/system"}
+		else
+			initdir=${initdir="/usr/lib/systemd/system"}
+		fi
+		initname=${initname="$PKG_NAME.service"},
+
+	[*bsd],
+		initdir=${initdir="/etc/rc.d"}
+		initname=${initname="$PKG_NAME"},
+
+	[gentoo],
+		initdir=${initdir="/etc/init.d"}
+		initname=${initname="$PKG_NAME"}
+		initconfdir=${initconfdir="/etc/init.d"}
+		initconf=${initconf="$initconfdir/$PKG_NAME"},
+
+	[openrc],
+		initdir=${initdir="/etc/init.d"}
+		initname=${initname="$PKG_NAME"}
+		initconfdir=${initconfdir="/etc/conf.d"}
+		initconf=${initconf="$initconfdir/$PKG_NAME"},
+
+	[smf*],
+		if test $init_type = smf10; then
+			initdir=${initdir="/var/svc/manifest/network"}
+		else
+			initdir=${initdir="/lib/svc/manifest/network"}
+		fi
+		initname=${initname="$PKG_NAME.xml"}
+		initconfdir=unknown
+		initconf=unknown,
+
+	[upstart],
+		initdir=${initdir="/etc/init"}
+		initname=${initname="$PKG_NAME"}
+		initconfdir=${initconfdir="/etc/default"}
+		initconf=${initconf="$initconfdir/$PKG_NAME"},
+
+	[launchd],
+		initdir=${initdir="/System/Library/LaunchDaemons"}
+		initname=${initname="org.nagios.$PKG_NAME.plist"},
+#		initconfdir=${initconfdir="/private/etc"}
+#		initconf=${initconf="$initconfdir/$PKG_NAME"},
+
+
+	[*],
+		initdir=unknown
+		initname=unknown)
+
+#
+# Inetd (per connection) scripts/files
+#
+AS_CASE([$inetd_type],
+	[inetd],
+		inetddir=${inetddir="/etc"}
+		inetdname=${inetdname="inetd.conf"},
+
+	[xinetd],
+		inetddir=${inetddir="/etc/xinetd.d"}
+		inetdname=${inetdname="$PKG_NAME"},
+
+	[systemd],
+		if test $dist_type = "debian"; then
+			inetddir=${inetddir="/lib/systemd/system"}
+		else
+			inetddir=${inetddir="/usr/lib/systemd/system"}
+		fi
+		netdname=${inetdname="$PKG_NAME.socket"},
+
+	[smf*],
+		if test $init_type = smf10; then
+			inetddir=${inetddir="/var/svc/manifest/network"}
+		else
+			inetddir=${inetddir="/lib/svc/manifest/network"}
+		fi
+		inetdname=${inetdname="$PKG_NAME.xml"},
+
+	[upstart],
+		inetddir=${inetddir="/etc/init"}
+		inetdname=${inetdname="$PKG_NAME"},
+
+	[launchd],
+		inetddir=${inetddir="/System/Library/LaunchDaemons"}
+		inetdname=${inetdname="org.nagios.$PKG_NAME.plist"},
+
+	[*],
+		inetddir=${inetddir="unknown"}
+		inetdname=${inetdname="unknown"})
+
+AC_MSG_RESULT($install_method)
+])

Diff do ficheiro suprimidas por serem muito extensas
+ 333 - 276
build-aux/config.guess


+ 312 - 111
config.sub → build-aux/config.sub

@@ -1,43 +1,40 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2006-01-02'
+timestamp='2014-12-03'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file 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
+# This file 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 3 of the License, or
 # (at your option) any later version.
 #
-# This program 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.
+# This program 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
 
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -71,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -119,12 +115,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -147,10 +149,13 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
+	-bluegene*)
+		os=-cnk
+		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
@@ -165,10 +170,10 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
- 	-chorusrdb)
- 		os=-chorusrdb
+	-chorusrdb)
+		os=-chorusrdb
 		basic_machine=$1
- 		;;
+		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -213,6 +218,12 @@ case $os in
 	-isc*)
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
 	-lynx*)
 		os=-lynxos
 		;;
@@ -237,59 +248,90 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| fr30 | frv \
+	| epiphany \
+	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \
+	| k1om \
+	| le32 | le64 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
-	| mips64vr | mips64vrel \
+	| mips64octeon | mips64octeonel \
 	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
 	| mips64vr4100 | mips64vr4100el \
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| moxie \
 	| mt \
 	| msp430 \
+	| nds32 | nds32le | nds32be \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| riscv32 | riscv64 \
+	| rl78 | rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b \
-	| strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
-	| v850 | v850e \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| visium \
 	| we32k \
-	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
-	| z8k)
+	| x86 | xc16x | xstormy16 | xtensa \
+	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m32c)
-		basic_machine=$basic_machine-unknown
+	c54x)
+		basic_machine=tic54x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12)
-		# Motorola 68HC11/12.
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	leon|leon[3-9])
+		basic_machine=sparc-$basic_machine
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -299,6 +341,21 @@ case $basic_machine in
 		basic_machine=mt-unknown
 		;;
 
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -313,65 +370,87 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* \
+	| avr-* | avr32-* \
+	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
-	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
-	| m32r-* | m32rle-* \
+	| k1om-* \
+	| le32-* | le64-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
-	| mips64vr-* | mips64vrel-* \
+	| mips64octeon-* | mips64octeonel-* \
 	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
 	| mips64vr4100-* | mips64vr4100el-* \
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
+	| nds32-* | nds32le-* | nds32be-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile*-* \
 	| tron-* \
-	| v850-* | v850e-* | vax-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
+	| visium-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
-	| xstormy16-* | xtensa-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
+	| xstormy16-* | xtensa*-* \
 	| ymp-* \
-	| z8k-*)
+	| z8k-* | z80-*)
 		;;
-	m32c-*)
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
@@ -389,7 +468,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
+	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -435,6 +514,10 @@ case $basic_machine in
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -443,10 +526,35 @@ case $basic_machine in
 		basic_machine=ns32k-sequent
 		os=-dynix
 		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
+	cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -475,8 +583,8 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16c)
-		basic_machine=cr16c-unknown
+	cr16 | cr16-*)
+		basic_machine=cr16-unknown
 		os=-elf
 		;;
 	crds | unos)
@@ -514,6 +622,10 @@ case $basic_machine in
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
 	djgpp)
 		basic_machine=i586-pc
 		os=-msdosdjgpp
@@ -629,7 +741,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -668,6 +779,17 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	leon-*|leon[3-9]-*)
+		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
 	m88k-omron*)
 		basic_machine=m88k-omron
 		;;
@@ -679,10 +801,21 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+	microblaze*)
+		basic_machine=microblaze-xilinx
+		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
@@ -704,6 +837,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -711,10 +848,18 @@ case $basic_machine in
 	ms1-*)
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
+	msys)
+		basic_machine=i686-pc
+		os=-msys
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -779,6 +924,12 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -809,6 +960,14 @@ case $basic_machine in
 		basic_machine=i860-intel
 		os=-osf
 		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
 	pbd)
 		basic_machine=sparc-tti
 		;;
@@ -853,9 +1012,10 @@ case $basic_machine in
 		;;
 	power)	basic_machine=power-ibm
 		;;
-	ppc)	basic_machine=powerpc-unknown
+	ppc | ppcbe)	basic_machine=powerpc-unknown
 		;;
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
@@ -880,7 +1040,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -910,6 +1074,10 @@ case $basic_machine in
 	sb1el)
 		basic_machine=mipsisa64sb1el-unknown
 		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
 	sei)
 		basic_machine=mips-sei
 		os=-seiux
@@ -921,6 +1089,9 @@ case $basic_machine in
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
 	sh64)
 		basic_machine=sh64-unknown
 		;;
@@ -942,6 +1113,9 @@ case $basic_machine in
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	sun2)
 		basic_machine=m68000-sun
 		;;
@@ -998,17 +1172,9 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	tic54x | c54x*)
-		basic_machine=tic54x-unknown
-		os=-coff
-		;;
-	tic55x | c55x*)
-		basic_machine=tic55x-unknown
-		os=-coff
-		;;
-	tic6x | c6x*)
-		basic_machine=tic6x-unknown
-		os=-coff
+	tile*)
+		basic_machine=$basic_machine-unknown
+		os=-linux-gnu
 		;;
 	tx39)
 		basic_machine=mipstx39-unknown
@@ -1077,6 +1243,9 @@ case $basic_machine in
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
@@ -1085,6 +1254,10 @@ case $basic_machine in
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
 	none)
 		basic_machine=none-none
 		os=-none
@@ -1123,10 +1296,10 @@ case $basic_machine in
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b)
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
 		basic_machine=sparc-sun
 		;;
 	cydra)
@@ -1170,9 +1343,12 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+	# First match some system type aliases
+	# that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
+	-auroraux)
+		os=-auroraux
+		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
@@ -1193,29 +1369,31 @@ case $os in
 	# Each alternative MUST END IN A *, to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* \
+	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1254,7 +1432,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
+	-os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1303,7 +1481,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
+	-tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1339,12 +1517,14 @@ case $os in
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
+	-dicos*)
+		os=-dicos
+		;;
+	-nacl*)
+		;;
 	-none)
 		;;
 	*)
@@ -1367,6 +1547,12 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+	score-*)
+		os=-elf
+		;;
+	spu-*)
+		os=-elf
+		;;
 	*-acorn)
 		os=-riscix1.2
 		;;
@@ -1376,9 +1562,24 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	c8051-*)
+		os=-elf
+		;;
+	hexagon-*)
+		os=-elf
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
+		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
 		os=-tops20
@@ -1397,13 +1598,13 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
 		;;
+	mep-*)
+		os=-elf
+		;;
 	mips*-cisco)
 		os=-elf
 		;;
@@ -1428,7 +1629,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
+	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
@@ -1533,7 +1734,7 @@ case $basic_machine in
 			-sunos*)
 				vendor=sun
 				;;
-			-aix*)
+			-cnk*|-aix*)
 				vendor=ibm
 				;;
 			-beos*)

+ 131 - 0
build-aux/custom_help.m4

@@ -0,0 +1,131 @@
+# _AC_INIT_HELP
+# -------------
+# Handle the `configure --help' message.
+m4_define([_AC_INIT_HELP],
+[m4_divert_push([HELP_BEGIN])dnl
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures m4_ifset([AC_PACKAGE_STRING],
+            [AC_PACKAGE_STRING],
+            [this package]) to adapt to many kinds of systems.
+
+Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
+
+[To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [/usr/local/nagios]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`/usr/local/nagios/bin', \`/usr/local/nagios/lib' etc.  You can specify
+an installation prefix other than \`/usr/local/nagios' using \`--prefix',
+for instance \`--prefix=$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        plugins, brokers, CGI [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           r/o arch.-independent data [DATAROOTDIR/PKG_NAME]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+_ACEOF
+
+  cat <<\_ACEOF]
+m4_divert_pop([HELP_BEGIN])dnl
+dnl The order of the diversions here is
+dnl - HELP_BEGIN
+dnl   which may be extended by extra generic options such as with X or
+dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
+dnl
+dnl - HELP_CANON
+dnl   Support for cross compilation (--build, --host and --target).
+dnl   Display only in long --help.
+dnl
+dnl - HELP_ENABLE
+dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
+dnl   then implements the header of the non generic options.
+dnl
+dnl - HELP_WITH
+dnl
+dnl - HELP_VAR
+dnl
+dnl - HELP_VAR_END
+dnl
+dnl - HELP_END
+dnl   initialized below, in which we dump the trailer (handling of the
+dnl   recursion for instance).
+m4_divert_push([HELP_ENABLE])dnl
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+m4_ifset([AC_PACKAGE_STRING],
+[  case $ac_init_help in
+     short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
+   esac])
+  cat <<\_ACEOF
+m4_divert_pop([HELP_ENABLE])dnl
+m4_divert_push([HELP_END])dnl
+
+Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
+  [the package provider]).dnl
+m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
+AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
+m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
+General help using GNU software: <http://www.gnu.org/gethelp/>.])])
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    _AC_SRCDIRS(["$ac_dir"])
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      AC_MSG_WARN([no configuration information is in $ac_dir])
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+m4_divert_pop([HELP_END])dnl
+])# _AC_INIT_HELP

+ 501 - 0
build-aux/install-sh

@@ -0,0 +1,501 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2013-12-25.23; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab='	'
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
+
+    -o) chowncmd="$chownprog $2"
+        shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
+
+    -T) is_target_a_directory=never;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --) shift
+        break;;
+
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call 'install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      dstdir=`dirname "$dst"`
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/d" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      set -f
+      set fnord $dstdir
+      shift
+      set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       set +f &&
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

Diff do ficheiro suprimidas por serem muito extensas
+ 2348 - 151
configure


+ 98 - 50
configure.ac

@@ -4,19 +4,10 @@ dnl Disable caching
 define([AC_CACHE_LOAD],)
 define([AC_CACHE_SAVE],)
 
-AC_INIT([nrpe],[2.16RC2],[nagios-users@lists.sourceforge.net],[nrpe],[http://www.nagios.org])
+m4_include([build-aux/custom_help.m4])
+AC_INIT([nrpe],[2.16RC2],[nagios-users@lists.sourceforge.net],[nrpe],[https://www.nagios.org/downloads/nagios-core-addons/])
 AC_CONFIG_SRCDIR([src/nrpe.c])
-AC_CONFIG_HEADERS([include/config.h])
-AC_CONFIG_FILES([Makefile
-	subst
-	src/Makefile
-	package/solaris/Makefile
-	init-script
-	init-script.debian
-	init-script.suse
-	nrpe.spec
-	sample-config/nrpe.cfg
-	sample-config/nrpe.xinetd])
+AC_CONFIG_AUX_DIR([build-aux])
 AC_PREFIX_DEFAULT(/usr/local/nagios)
 
 PKG_NAME=nrpe
@@ -24,18 +15,103 @@ PKG_VERSION="2.16RC2"
 PKG_HOME_URL="http://www.nagios.org/"
 PKG_REL_DATE="11-09-2015"
 RPM_RELEASE=1
+
+LANG=C
+LC_ALL=C
+LC_COLLATE=C
+LC_CTYPE=C
+LC_MESSAGES=C
+LC_MONETARY=C
+LC_NUMERIC=C
+LC_TIME=C
+
 AC_SUBST(PKG_NAME)
 AC_SUBST(PKG_VERSION)
 AC_SUBST(PKG_HOME_URL)
 AC_SUBST(PKG_REL_DATE)
 AC_SUBST(RPM_RELEASE)
+AC_SUBST(INSTALL)
+AC_SUBST(SNPRINTF_O)
+AC_SUBST(OTHERLIBS)
+AC_SUBST(SOCKETLIBS)
+AC_SUBST(LIBWRAPLIBS)
+AC_SUBST(HAVE_SSL)
+AC_SUBST(NRPE_INSTALL_OPTS)
+AC_SUBST(log_facility)
+AC_SUBST(nrpe_user)
+AC_SUBST(nrpe_group)
+AC_SUBST(nrpe_port)
+AC_SUBST(nagios_user)
+AC_SUBST(nagios_group)
+AC_SUBST(NAGIOS_INSTALL_OPTS)
+AC_SUBST(TARGET_VER)
+AC_SUBST(TARGET_OS)
+AC_SUBST(TARGET_ARCH)
+AC_SUBST(TARGET_PLATFORM)
+AC_SUBST(pkgsysconfdir)
+AC_SUBST(objsysconfdir)
+AC_SUBST(sbindir)
+AC_SUBST(initname)
+AC_SUBST(inetdname)
+AC_SUBST(pluginsdir)
+AC_SUBST(brokersdir)
+AC_SUBST(cgibindir)
+AC_SUBST(webdir)
+AC_SUBST(privatesysconfdir)
+AC_SUBST(pkglocalstatedir)
+AC_SUBST(logdir)
+AC_SUBST(piddir)
+AC_SUBST(pipedir)
+AC_SUBST(spooldir)
+AC_SUBST(initdir)
+AC_SUBST(inetddir)
+AC_SUBST(tmpfilesd)
+AC_SUBST(subsyslockdir)
+AC_SUBST(subsyslockfile)
+AC_SUBST(src_init)
+AC_SUBST(src_inetd)
 
 dnl Figure out how to invoke "install" and what install options to use.
 AC_PROG_INSTALL
-AC_SUBST(INSTALL)
 
-dnl What OS are we running?
-AC_CANONICAL_HOST
+dnl Get O/S, Distribution, init, inetd, system-specific directories
+AC_NAGIOS_GET_OS
+AC_NAGIOS_GET_DISTRIB_TYPE
+AC_NAGIOS_GET_INIT
+AC_NAGIOS_GET_INETD
+AC_NAGIOS_GET_PATHS
+AC_NAGIOS_GET_FILES
+
+dnl Do they just want to see where things will go?
+if test x${showdirs_only} = xyes; then
+	AC_CONFIG_FILES([paths])
+	AC_OUTPUT()
+	chmod 755 paths
+	./paths
+	exit 0
+fi
+
+AC_CONFIG_HEADERS([include/config.h])
+AC_CONFIG_FILES([Makefile
+	subst
+	src/Makefile
+	package/solaris/Makefile
+	nrpe.spec
+	sample-config/nrpe.cfg
+	startup/bsd-init
+	startup/debian-init
+	startup/default-init
+	startup/default-inetd
+	startup/default-service
+	startup/default-xinetd
+	startup/mac-org.nagios.PKG_NAME.plist
+	startup/openrc-conf
+	startup/openrc-init
+	startup/solaris-PKG_NAME.xml
+])
+
+#sample-config/debian-nrpe-inetd
+#sample-config/openrc-nrpe-inetd
 
 dnl Checks for programs.
 AC_PROG_CC
@@ -158,21 +234,17 @@ if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
 fi
 
 dnl AC_CHECK_FUNC(snprintf,AC_DEFINE(HAVE_SNPRINTF),SNPRINTF_O=./snprintf.o)
-AC_SUBST(SNPRINTF_O)
 
 dnl Check for getopt_long (Solaris)
 AC_CHECK_FUNCS([getopt_long],,AC_CHECK_LIB([iberty],[getopt_long],OTHERLIBS="$OTHERLIBS -liberty"))
-AC_SUBST(OTHERLIBS)
 
 dnl Checks for library functions.
 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
 AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
-AC_SUBST(SOCKETLIBS)
 AC_CHECK_LIB(wrap,main,[
 	LIBWRAPLIBS="$LIBWRAPLIBS -lwrap"
 	AC_DEFINE(HAVE_LIBWRAP,[1],[Have the TCP wrappers library])
 	])
-AC_SUBST(LIBWRAPLIBS)
 AC_CHECK_FUNCS(strdup strstr strtoul initgroups closesocket sigaction)
 
 dnl socklen_t check - from curl
@@ -224,18 +296,6 @@ AC_TRY_COMPILE([#include <stdlib.h>
 [AC_DEFINE(SOCKET_SIZE_TYPE, size_t, [Socket Size Type]) AC_MSG_RESULT(size_t)],
 [AC_DEFINE(SOCKET_SIZE_TYPE, int, [Socket Size Type]) AC_MSG_RESULT(int)])
 
-dnl Stolen from Python code: loewis@users.sourceforge.net
-#AC_CHECK_TYPE(socklen_t,int,
-#	AC_DEFINE(socklen_t,int,
-#	Define to `int' if <sys/socket.h> does not define.),[
-#	#ifdef HAVE_SYS_TYPES_H
-#	#include <sys/types.h>
-#	#endif
-#	#ifdef HAVE_SYS_SOCKET_H
-#	#include <sys/socket.h>
-#	#endif
-#	])
-
 dnl Does user want to check for SSL?
 AC_ARG_ENABLE([ssl],
 	AS_HELP_STRING([--enable-ssl],[enables native SSL support]),[
@@ -338,7 +398,6 @@ if test x$check_for_ssl = xyes; then
 		        LIBS="$LIBS -lssl -lcrypto";
 
 			AC_DEFINE_UNQUOTED(HAVE_SSL,[1],[Have SSL support])
-			AC_SUBST(HAVE_SSL)
 	
 			dnl Generate DH parameters
 			echo ""
@@ -349,7 +408,8 @@ if test x$check_for_ssl = xyes; then
 				sslbin=$ssldir/bin/openssl
 			fi
 			# awk to strip off meta data at bottom of dhparam output
-			$sslbin dhparam -C 2048 | awk '/^-----/ {exit} {print}' > include/dh.h
+#			$sslbin dhparam -C 2048 | awk '/^-----/ {exit} {print}' > include/dh.h
+			$sslbin dhparam -C 1024 | awk '/^-----/ {exit} {print}' > include/dh.h
 		fi
 	fi
 
@@ -381,7 +441,6 @@ AC_ARG_WITH([log_facility],
 		[sets NRPE syslog facility]),
 	[log_facility=$withval],
 	[log_facility=daemon])
-AC_SUBST(log_facility)
 AC_DEFINE_UNQUOTED(NRPE_LOG_FACILITY,["$log_facility"],[NRPE syslog facility])
 
 AC_ARG_WITH([nrpe_user],
@@ -399,11 +458,7 @@ AC_ARG_WITH([nrpe_port],
 		[sets port number for NRPE to listen on]),
 	[nrpe_port=$withval],
 	[nrpe_port=5666])
-AC_SUBST(nrpe_user)
-AC_SUBST(nrpe_group)
 NRPE_INSTALL_OPTS="-o $nrpe_user -g $nrpe_group"
-AC_SUBST(NRPE_INSTALL_OPTS)
-AC_SUBST(nrpe_port)
 AC_DEFINE_UNQUOTED(DEFAULT_SERVER_PORT,$nrpe_port,[Default port for NRPE daemon])
 
 AC_ARG_WITH([nagios_user],
@@ -416,10 +471,7 @@ AC_ARG_WITH([nagios_group],
 		[sets group name file permissions]),
 	[nagios_group=$withval],
 	[nagios_group=nagios])
-AC_SUBST(nagios_user)
-AC_SUBST(nagios_group)
 NAGIOS_INSTALL_OPTS="-o $nagios_user -g $nagios_group"
-AC_SUBST(NAGIOS_INSTALL_OPTS)
 
 # Determine target OS, version and architecture for package build macros
 if test "x$target_ver" = "x" ; then
@@ -427,26 +479,22 @@ if test "x$target_ver" = "x" ; then
 else
 	TARGET_VER=$target_ver
 fi
-AC_SUBST(TARGET_VER)
 if test "x$target_os" = "x" ; then
 	TARGET_OS=`uname -s`
 else
 	TARGET_OS=$target_os
 fi
-AC_SUBST(TARGET_OS)
 if test "x$target_cpu" = "x" ; then
 	TARGET_ARCH=`uname -p`
 else
 	TARGET_ARCH=$target_cpu
 fi
-AC_SUBST(TARGET_ARCH)
 TARGET_PLATFORM=""
 if test "x$TARGET_OS" = "xSunOS" ; then
 	if test "x$TARGET_VER" = "x5.10" ; then
 		TARGET_PLATFORM="sol10"
 	fi
 fi
-AC_SUBST(TARGET_PLATFORM)
 
 AC_ARG_ENABLE([command-args],
 	AS_HELP_STRING([--enable-command-args],[allows clients to specify command arguments.  *** THIS IS A SECURITY RISK! *** Read the SECURITY file before using this option!]),
@@ -460,11 +508,11 @@ AC_ARG_ENABLE([bash-command-substitution],
 AC_PATH_PROG(PERL,perl)
 AC_OUTPUT()
 
-perl subst init-script
-perl subst init-script.debian
-perl subst init-script.suse
-perl subst sample-config/nrpe.cfg
-perl subst sample-config/nrpe.xinetd
+#perl subst init-script
+#perl subst init-script.debian
+#perl subst init-script.suse
+#perl subst sample-config/nrpe.cfg
+#perl subst sample-config/nrpe.xinetd
 
 
 dnl Review options

+ 0 - 34
init-script.debian.in

@@ -1,34 +0,0 @@
-#!/bin/sh
-# Start/stop the nrpe daemon.
-#
-# Contributed by Andrew Ryder 06-22-02
-# Slight mods by Ethan Galstad 07-09-02
-
-NrpeBin=@bindir@/nrpe
-NrpeCfg=@sysconfdir@/nrpe.cfg
-
-test -f $NrpeBin || exit 0
-
-case "$1" in
-start)	echo -n "Starting nagios remote plugin daemon: nrpe"
-        start-stop-daemon --start --quiet --exec $NrpeBin -- -c $NrpeCfg -d
-        echo "." 
-	;;
-stop)	echo -n "Stopping nagios remote plugin daemon: nrpe"
-        start-stop-daemon --stop --quiet --exec $NrpeBin
-        echo "."
-        ;;
-restart) echo -n "Restarting nagios remote plugin daemon: nrpe"
-        start-stop-daemon --stop --quiet --exec $NrpeBin
-        start-stop-daemon --start --quiet --exec $NrpeBin -- -c $NrpeCfg -d
-        echo "."
-        ;;
-reload|force-reload) echo -n "Reloading configuration files for nagios remote plugin daemon: nrpe"
-	# nrpe reloads automatically
-        echo "."
-        ;;
-*)	echo "Usage: /etc/init.d/nrpe start|stop|restart|reload|force-reload"
-        exit 1 
-        ;;
-esac
-exit 0

+ 0 - 62
init-script.in

@@ -1,62 +0,0 @@
-#!/bin/sh
-#
-#  Created 2000-01-03 by jaclu@grm.se
-#
-# nrpe          This shell script takes care of starting and stopping
-#               nrpe.
-#
-# chkconfig: 2345 80 30
-# description: nrpe is a daemon for a remote nagios server, \
-#              running nagios plugins on this host.
-# processname: nrpe
-# config: /usr/local/nagios/etc/nrpe.cfg
-
-
-# Source function library
-if [ -f /etc/rc.d/init.d/functions ]; then
-. /etc/rc.d/init.d/functions
-elif [ -f /etc/init.d/functions ]; then
-. /etc/init.d/functions
-elif [ -f /etc/rc.d/functions ]; then
-. /etc/rc.d/functions
-fi
-
-# Source networking configuration.
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
-
-NrpeBin=@bindir@/nrpe
-NrpeCfg=@sysconfdir@/nrpe.cfg
-LockFile=/var/lock/subsys/nrpe
-
-# See how we were called.
-case "$1" in
-  start)
-	# Start daemons.
-	echo -n "Starting nrpe: "
-	daemon $NrpeBin -c $NrpeCfg -d
-	echo
-	touch $LockFile
-	;;
-  stop)
-	# Stop daemons.
-	echo -n "Shutting down nrpe: "
-	killproc nrpe
-	echo
-	rm -f $LockFile
-	;;
-  restart)
-	$0 stop
-	$0 start
-	;;
-  status)
-	status nrpe
-	;;
-  *)
-	echo "Usage: nrpe {start|stop|restart|status}"
-	exit 1
-esac
-
-exit 0

+ 0 - 84
init-script.suse.in

@@ -1,84 +0,0 @@
-#! /bin/sh
-# Copyright (c) 1996-2002 SuSE GmbH Nuernberg, Germany.  All rights reserved.
-# Modifications for NRPE Copyright (c) 2003 Subhendu Ghosh
-# Author: Christopher Mahmood <ckm+snmp@suse.de>, Remo Behn <ray+snmp@suse.de>
-# Modifications for NRPE: Subhendu Ghosh <sghosh@users.sourceforge.net>
-#
-# /etc/init.d/nrpe
-#
-### BEGIN INIT INFO
-# Provides:            nrpe
-# Required-Start:      $network
-# Required-Stop:
-# Default-Start:       2 3 5
-# Default-Stop:        0 1 6
-# Description:         start nrpe
-### END INIT INFO
-
-NRPEBIN=@bindir@/nrpe
-NRPECFG=@sysconfdir@/nrpe.cfg
-
-test -x $NRPEBIN || exit 5
-
-# Shell functions sourced from /etc/rc.status:
-#      rc_check         check and set local and overall rc status
-#      rc_status        check and set local and overall rc status
-#      rc_status -v     ditto but be verbose in local rc status
-#      rc_status -v -r  ditto and clear the local rc status
-#      rc_failed        set local and overall rc status to failed
-#      rc_failed <num>  set local and overall rc status to <num><num>
-#      rc_reset         clear local rc status (overall remains)
-#      rc_exit          exit appropriate to overall rc status
-. /etc/rc.status
-
-# First reset status of this service
-rc_reset
-
-# Return values acc. to LSB for all commands but status:
-# 0 - success
-# 1 - generic or unspecified error
-# 2 - invalid or excess argument(s)
-# 3 - unimplemented feature (e.g. "reload")
-# 4 - insufficient privilege
-# 5 - program is not installed
-# 6 - program is not configured
-# 7 - program is not running
-# 
-# Note that starting an already running service, stopping
-# or restarting a not-running service as well as the restart
-# with force-reload (in case signalling is not supported) are
-# considered a success.
-
-
-case "$1" in
-    start)
-	echo -n "Starting nrpe:"
-	startproc $NRPEBIN -c $NRPECFG -d
-	rc_status -v
-	rc_reset
-
-	;;
-    stop)
-	echo -n "Shutting down nrpe:"
-	killproc -TERM $NRPEBIN
-	rc_status -v ; rc_reset
-	;;
-    restart)
-	$0 stop
-	$0 start
-	rc_status
-	;;
-    status)
-	echo -n "Checking for service nrpe:"
-	checkproc $NRPEBIN
-	rc_status -v
-	rc_reset
-
-	;;
-    *)
-	echo "Usage: $0 {start|stop|restart|status}"
-	exit 1
-	;;
-esac
-rc_exit
-

+ 0 - 250
install-sh

@@ -1,250 +0,0 @@
-#! /bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  M.I.T. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-	-c) instcmd="$cpprog"
-	    shift
-	    continue;;
-
-	-d) dir_arg=true
-	    shift
-	    continue;;
-
-	-m) chmodcmd="$chmodprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-o) chowncmd="$chownprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-g) chgrpcmd="$chgrpprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-s) stripcmd="$stripprog"
-	    shift
-	    continue;;
-
-	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
-	    shift
-	    continue;;
-
-	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-	    shift
-	    continue;;
-
-	*)  if [ x"$src" = x ]
-	    then
-		src=$1
-	    else
-		# this colon is to work around a 386BSD /bin/sh bug
-		:
-		dst=$1
-	    fi
-	    shift
-	    continue;;
-    esac
-done
-
-if [ x"$src" = x ]
-then
-	echo "install:	no input file specified"
-	exit 1
-else
-	true
-fi
-
-if [ x"$dir_arg" != x ]; then
-	dst=$src
-	src=""
-	
-	if [ -d $dst ]; then
-		instcmd=:
-	else
-		instcmd=mkdir
-	fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-	if [ -f $src -o -d $src ]
-	then
-		true
-	else
-		echo "install:  $src does not exist"
-		exit 1
-	fi
-	
-	if [ x"$dst" = x ]
-	then
-		echo "install:	no destination specified"
-		exit 1
-	else
-		true
-	fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-	if [ -d $dst ]
-	then
-		dst="$dst"/`basename $src`
-	else
-		true
-	fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='	
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-	pathcomp="${pathcomp}${1}"
-	shift
-
-	if [ ! -d "${pathcomp}" ] ;
-        then
-		$mkdirprog "${pathcomp}"
-	else
-		true
-	fi
-
-	pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-	$doit $instcmd $dst &&
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-	if [ x"$transformarg" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		dstfile=`basename $dst $transformbasename | 
-			sed $transformarg`$transformbasename
-	fi
-
-# don't allow the sed command to completely eliminate the filename
-
-	if [ x"$dstfile" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		true
-	fi
-
-# Make a temp file name in the proper directory.
-
-	dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-	$doit $instcmd $src $dsttmp &&
-
-	trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
-	$doit $rmcmd -f $dstdir/$dstfile &&
-	$doit $mvcmd $dsttmp $dstdir/$dstfile 
-
-fi &&
-
-
-exit 0

+ 79 - 0
paths.in

@@ -0,0 +1,79 @@
+#!/bin/sh
+
+wrout () {
+	if test "$2" != "N/A"; then printf "  %-20s %s\n" "$1" "$2"; fi
+}
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+
+echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+echo "Paths are:"
+echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+wrout "prefix" "@prefix@"
+if test "@PKG_NAME@" = "nagios"; then
+	wrout "bindir" "@bindir@"
+fi
+wrout "sbindir" "@sbindir@"
+wrout "sysconfdir" "@sysconfdir@"
+wrout "pkgsysconfdir" "@pkgsysconfdir@"
+if test "@PKG_NAME@" = "nagios"; then
+	wrout "privatesysconfdir" "@privatesysconfdir@"
+fi
+wrout "localstatedir" "@localstatedir@"
+wrout "pkglocalstatedir" "@pkglocalstatedir@"
+wrout "datarootdir" "@datarootdir@"
+wrout "datadir" "@datadir@"
+wrout "webdir" "@webdir@"
+wrout "localedir" "@localedir@"
+wrout "logdir" "@logdir@"
+wrout "piddir" "@piddir@"
+wrout "pipedir" "@pipedir@"
+wrout "spooldir" "@spooldir@"
+wrout "libexecdir" "@libexecdir@"
+wrout "brokersdir" "@brokersdir@"
+wrout "pluginsdir" "@pluginsdir@"
+wrout "cgibindir" "@cgibindir@"
+wrout "initdir" "@initdir@"
+wrout "inetddir" "@inetddir@"
+wrout "subsyslockdir" "@subsyslockdir@"
+echo
+echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+echo '@PKG_NAME@ files will be installed or created as follows:'
+echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+wrout "Config file" "@pkgsysconfdir@/@PKG_NAME@.cfg"
+wrout "Object config dir" "@objsysconfdir@"
+wrout "daemon" "@sbindir@/@PKG_NAME@"
+if test "@PKG_NAME@" = "nrpe"; then
+	wrout "check_@PKG_NAME@" "@pluginsdir@/check_@PKG_NAME@"
+fi
+if test "@PKG_NAME@" = "nagios"; then
+	wrout "nagiostats (prog)" "@bindir@/nagiostats"
+	wrout "Website password file" "@pkgsysconfdir@/passwd"
+	wrout "resource.cfg" "@privatesysconfdir@/resource.cfg"
+	wrout "event handlers dir" "@brokersdir@"
+	wrout "cgi program dir" "@cgibindir@"
+	wrout "website file dir" "@webdir@"
+	wrout "status.dat" "@pkglocalstatedir@/status.dat"
+	wrout "retention.dat" "@pkglocalstatedir@/retention.dat"
+	wrout "object cache dir" "@pkglocalstatedir@"
+	wrout "log file" "@logdir@/@PKG_NAME@.log"
+	wrout "log archive dir" "@logdir@/archives"
+	wrout "@PKG_NAME@.configtest" "@logdir@/@PKG_NAME@.configtest"
+	wrout "@PKG_NAME@.cmd" "@pipedir@/@PKG_NAME@.cmd"
+	wrout "@PKG_NAME@.qh" "@pipedir@/@PKG_NAME@.qh"
+	wrout "perfdata file dir" "@spooldir@"
+	wrout "checkresult files" "@spooldir@/checkresults"
+else
+	wrout "inetd config" "@inetddir@/@inetdname@"
+fi
+wrout "init script" "@initdir@/@initname@"
+wrout "@PKG_NAME@.conf (tmpfiles.d)" "@tmpfilesd@"
+wrout "@PKG_NAME@ lock file" "@piddir@/@PKG_NAME@.pid"
+wrout "language files" "@localedir@"
+wrout "init lock file" "@subsyslockfile@"
+wrout "init source file" "@src_init@"
+wrout "inetd source file" "@src_inetd@"
+echo
+echo "To show this list again, type './paths' at the prompt"

+ 10 - 81
sample-config/nrpe.cfg.in

@@ -23,7 +23,7 @@ log_facility=@log_facility@
 # number.  The file is only written if the NRPE daemon is started by the root
 # user and is running in standalone mode.
 
-pid_file=/var/run/nrpe.pid
+pid_file=@piddir@/nrpe.pid
 
 
 
@@ -186,66 +186,6 @@ connection_timeout=300
 
 
 
-# SSL/TLS OPTIONS
-# These directives allow you to specify how to use SSL/TLS.
-
-# SSL VERSION
-# This can be any of: SSLv2 (only use SSLv2), SSLv2+ (use any version),
-#        SSLv3 (only use SSLv3), SSLv3+ (use SSLv3 or above), TLSv1 (only use
-#        TLSv1), TLSv1+ (use TLSv1 or above), TLSv1.1 (only use TLSv1.1),
-#        TLSv1.1+ (use TLSv1.1 or above), TLSv1.2 (only use TLSv1.2),
-#        TLSv1.2+ (use TLSv1.2 or above)
-# If an "or above" version is used, the best will be negotiated. So if both
-# ends are able to do TLSv1.2 and use specify SSLv2, you will get TLSv1.2.
-
-#ssl_version=TLSv1+
-
-# SSL USE ADH
-# This is for backward compatibility and is DEPRECATED. Set to 1 to enable
-# ADH or 2 to require ADH. 1 is currently the default but will be changed
-# in a later version.
-
-#ssl_use_adh=1
-
-# SSL CIPHER LIST
-# This lists which ciphers can be used. For backward compatibility, this
-# defaults to 'ssl_cipher_list=ALL:!MD5:@STRENGTH' in this version but
-# will be changed to something something else in a later version of NRPE.
-
-#ssl_cipher_list=ALL:!MD5:@STRENGTH
-
-# SSL Certificate and Private Key Files
-
-#ssl_cacert_file=@sysconfdir@/ssl/ca-cert.pem
-#ssl_cert_file=@sysconfdir@/ssl/nagios-cert.pem
-#ssl_privatekey_file=@sysconfdir@/ssl/nagios-key.pem
-
-
-# SSL CLIENT CERTS
-# This options determines client certificate usage.
-# Values: 0 = Don't ask for or require client certificates
-#         1 = Ask for client certificates
-#         2 = Require client certificates
-
-#ssl_client_certs=0
-
-# SSL LOGGING
-# This option determines which SSL messages are send to syslog. OR values
-# together to specify multiple options.
-
-# Values: 0x00 (0)  = No additional logging (default)
-#         0x01 (1)  = Log startup SSL/TLS parameters
-#         0x02 (2)  = Log remote IP address
-#         0x04 (4)  = Log SSL/TLS version of connections
-#         0x08 (8)  = Log which cipher is being used for the connection
-#         0x10 (16) = Log if client has a certificate
-#         0x20 (32) = Log details of client's certificate if it has one
-#         -1 or 0xff or 0x2f = All of the above
-
-#ssl_logging=0
-
-
-
 # INCLUDE CONFIG FILE
 # This directive allows you to include definitions from an external config file.
 
@@ -262,17 +202,6 @@ connection_timeout=300
 
 
 
-# KEEP ENVIRONMENT VARIABLES
-# As of NRPE v3.0, the environment is being sanitized. HOME, IFS, LOGNAME,
-# USER, PATH and SHELL will be set. Everything else will be removed. This
-# directive is a comma-separated list that allows you to indicate which
-# environment variables should be kept, possibly including any of the
-# 6 mentioned above. USE WITH CAUTION
-
-#keep_env_vars=TERM,POSIXLY_CORRECT,TZ
-
-
-
 # COMMAND DEFINITIONS
 # Command definitions that this daemon will run.  Definitions
 # are in the following format:
@@ -295,11 +224,11 @@ connection_timeout=300
 
 # The following examples use hardcoded command arguments...
 
-command[check_users]=@libexecdir@/check_users -w 5 -c 10
-command[check_load]=@libexecdir@/check_load -w .75,.5,.25 -c 1.5,1.25,1
-command[check_hda1]=@libexecdir@/check_disk -w 20% -c 10% -p /dev/hda1
-command[check_zombie_procs]=@libexecdir@/check_procs -w 5 -c 10 -s Z
-command[check_total_procs]=@libexecdir@/check_procs -w 150 -c 200 
+command[check_users]=@pluginsdir@/check_users -w 5 -c 10
+command[check_load]=@pluginsdir@/check_load -w 15,10,5 -c 30,25,20
+command[check_hda1]=@pluginsdir@/check_disk -w 20% -c 10% -p /dev/hda1
+command[check_zombie_procs]=@pluginsdir@/check_procs -w 5 -c 10 -s Z
+command[check_total_procs]=@pluginsdir@/check_procs -w 150 -c 200 
 
 
 # The following examples allow user-supplied arguments and can
@@ -308,7 +237,7 @@ command[check_total_procs]=@libexecdir@/check_procs -w 150 -c 200
 # config file is set to '1'.  This poses a potential security risk, so
 # make sure you read the SECURITY file before doing this.
 
-#command[check_users]=@libexecdir@/check_users -w $ARG1$ -c $ARG2$
-#command[check_load]=@libexecdir@/check_load -w $ARG1$ -c $ARG2$
-#command[check_disk]=@libexecdir@/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
-#command[check_procs]=@libexecdir@/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
+#command[check_users]=@pluginsdir@/check_users -w $ARG1$ -c $ARG2$
+#command[check_load]=@pluginsdir@/check_load -w $ARG1$ -c $ARG2$
+#command[check_disk]=@pluginsdir@/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
+#command[check_procs]=@pluginsdir@/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

+ 25 - 5
src/Makefile.in

@@ -21,7 +21,7 @@ CP=@CP@
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-CFGDIR=@sysconfdir@
+CFGDIR=@pkgsysconfdir@
 BINDIR=@bindir@
 SBINDIR=@sbindir@
 LIBEXECDIR=@libexecdir@
@@ -29,6 +29,26 @@ INSTALL=@INSTALL@
 NAGIOS_INSTALL_OPTS=@NAGIOS_INSTALL_OPTS@
 NRPE_INSTALL_OPTS=@NRPE_INSTALL_OPTS@
 
+PLUGINSDIR=@pluginsdir@
+
+#AC_SUBST(pkgsysconfdir)
+#AC_SUBST(objsysconfdir)
+#AC_SUBST(sbindir)
+#AC_SUBST(brokersdir)
+#AC_SUBST(cgibindir)
+#AC_SUBST(webdir)
+#AC_SUBST(privatesysconfdir)
+#AC_SUBST(pkglocalstatedir)
+#AC_SUBST(logdir)
+#AC_SUBST(piddir)
+#AC_SUBST(pipedir)
+#AC_SUBST(spooldir)
+#AC_SUBST(tmpfilesd)
+#AC_SUBST(subsyslockdir)
+#AC_SUBST(subsyslockfile)
+
+
+
 # Generated automatically from configure script
 SNPRINTF_O=@SNPRINTF_O@
 
@@ -46,12 +66,12 @@ install:
 	$(MAKE) install-daemon
 
 install-plugin:
-	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(DESTDIR)$(LIBEXECDIR)
-	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) check_nrpe $(DESTDIR)$(LIBEXECDIR)
+	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(PLUGINSDIR)
+	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) check_nrpe $(PLUGINSDIR)
 
 install-daemon:
-	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(DESTDIR)$(BINDIR)
-	$(INSTALL) -m 775 $(NRPE_INSTALL_OPTS) nrpe $(DESTDIR)$(BINDIR)
+	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(SBINDIR)
+	$(INSTALL) -m 775 $(NRPE_INSTALL_OPTS) nrpe $(SBINDIR)
 
 clean:
 	rm -f core nrpe check_nrpe $(SNPRINTF_O)

+ 2 - 2
src/utils.c

@@ -234,9 +234,9 @@ void add_listen_addr(struct addrinfo **listen_addrs, int address_family, char *a
 int clean_environ(const char *keep_env_vars, const char *nrpe_user)
 {
 #ifdef HAVE_PATHS_H
-	static char *path = _PATH_STDPATH;
+	static char	*path = _PATH_STDPATH;
 #else
-	*path = "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin";
+	static char	*path = "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin";
 #endif
 	struct passwd *pw;
 	size_t len, var_sz = 0;

+ 54 - 0
startup/bsd-init

@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# PROVIDE: nrpe
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable nrpe:
+#
+# nrpe_enable (bool):    Set to "NO" by default.
+#                        Set it to "YES" to enable nrpe.
+# nrpe_flags (str):      Set to "" by default.
+# nrpe_configfile (str): Set to "/etc/nagios/nrpe.cfg" by default.
+#
+
+. /etc/rc.subr
+
+sig_reload=HUP
+
+nrpe_enable=${nrpe_enable:-"NO"}
+command=${nrpe_program:-"${exec_prefix}/sbin/nrpe"}
+command_args="-c ${nrpe_configfile} -d"
+extra_commands=reload
+pidfile=${pidfile:-"/var/run/nrpe.pid"}
+nrpe_configfile=${nrpe_configfile:-"/etc/nagios/nrpe.cfg"}
+
+name=nrpe
+rcvar=nrpe_enable
+load_rc_config "${name}"
+required_files="${nrpe_configfile}"
+
+start_precmd=nrpe_prestart
+stop_precmd=find_pidfile
+
+find_pidfile()
+{
+    [ -n "$nrpe_pidfile" ] &&
+        warn "No longer necessary to set nrpe_pidfile in rc.conf[.local]"
+
+    if getpidfile_from_conf pid_file ${nrpe_configfile}; then
+        pidfile="$_pidfile_from_conf"
+	else
+	    pidfile='%%PIDDIR%%/nrpe.pid'
+}
+
+nrpe_prestart()
+{
+    find_pidfile
+    install -d -o ${nrpe_user:-nagios} ${pidfile%/*}
+}
+
+run_rc_command "$1"

+ 54 - 0
startup/bsd-init.in

@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# PROVIDE: nrpe
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable nrpe:
+#
+# nrpe_enable (bool):    Set to "NO" by default.
+#                        Set it to "YES" to enable nrpe.
+# nrpe_flags (str):      Set to "" by default.
+# nrpe_configfile (str): Set to "@pkgsysconfdir@/nrpe.cfg" by default.
+#
+
+. /etc/rc.subr
+
+sig_reload=HUP
+
+nrpe_enable=${nrpe_enable:-"NO"}
+command=${nrpe_program:-"@sbindir@/nrpe"}
+command_args="-c ${nrpe_configfile} -d"
+extra_commands=reload
+pidfile=${pidfile:-"/var/run/nrpe.pid"}
+nrpe_configfile=${nrpe_configfile:-"@pkgsysconfdir@/nrpe.cfg"}
+
+name=nrpe
+rcvar=nrpe_enable
+load_rc_config "${name}"
+required_files="${nrpe_configfile}"
+
+start_precmd=nrpe_prestart
+stop_precmd=find_pidfile
+
+find_pidfile()
+{
+    [ -n "$nrpe_pidfile" ] &&
+        warn "No longer necessary to set nrpe_pidfile in rc.conf[.local]"
+
+    if getpidfile_from_conf pid_file ${nrpe_configfile}; then
+        pidfile="$_pidfile_from_conf"
+	else
+	    pidfile='%%PIDDIR%%/nrpe.pid'
+}
+
+nrpe_prestart()
+{
+    find_pidfile
+    install -d -o ${nrpe_user:-nagios} ${pidfile%/*}
+}
+
+run_rc_command "$1"

+ 47 - 0
startup/debian-init

@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# Start/stop the nrpe daemon.
+
+NRPE_BIN=${exec_prefix}/sbin/nrpe
+NRPE_CFG=/etc/nagios/nrpe.cfg
+PID_FILE=/var/run/nrpe/nrpe.pid
+
+test -x $NRPE_BIN || exit 0
+
+case "$1" in
+
+start)
+	echo -n "Starting nagios remote plugin daemon: nrpe"
+	start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $NRPE_BIN -- -c $NRPE_CFG -d
+	echo "." 
+	;;
+
+stop)
+	echo -n "Stopping nagios remote plugin daemon: nrpe"
+	start-stop-daemon --stop --quiet --pidfile $PID_FILE --exec $NRPE_BIN
+	echo "."
+	;;
+
+restart|force-reload)
+	echo -n "Restarting nagios remote plugin daemon: nrpe"
+	start-stop-daemon --stop --quiet --pidfile $PID_FILE --exec $NRPE_BIN
+	start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $NRPE_BIN -- -c $NRPE_CFG -d
+	echo "."
+	;;
+
+reload)
+	echo -n "Reloading configuration files for nagios remote plugin daemon: nrpe"
+	test -f $PID_FILE || exit 0
+	test -x /bin/kill && /bin/kill -HUP `cat $PID_FILE`
+	echo "."
+	;;
+
+*)
+	echo "Usage: $0 start|stop|restart|reload|force-reload"
+	exit 1 
+	;;
+esac
+
+exit 0

+ 47 - 0
startup/debian-init.in

@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# Start/stop the nrpe daemon.
+
+NRPE_BIN=@sbindir@/nrpe
+NRPE_CFG=@pkgsysconfdir@/nrpe.cfg
+PID_FILE=@piddir@/nrpe.pid
+
+test -x $NRPE_BIN || exit 0
+
+case "$1" in
+
+start)
+	echo -n "Starting nagios remote plugin daemon: nrpe"
+	start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $NRPE_BIN -- -c $NRPE_CFG -d
+	echo "." 
+	;;
+
+stop)
+	echo -n "Stopping nagios remote plugin daemon: nrpe"
+	start-stop-daemon --stop --quiet --pidfile $PID_FILE --exec $NRPE_BIN
+	echo "."
+	;;
+
+restart|force-reload)
+	echo -n "Restarting nagios remote plugin daemon: nrpe"
+	start-stop-daemon --stop --quiet --pidfile $PID_FILE --exec $NRPE_BIN
+	start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $NRPE_BIN -- -c $NRPE_CFG -d
+	echo "."
+	;;
+
+reload)
+	echo -n "Reloading configuration files for nagios remote plugin daemon: nrpe"
+	test -f $PID_FILE || exit 0
+	test -x /bin/kill && /bin/kill -HUP `cat $PID_FILE`
+	echo "."
+	;;
+
+*)
+	echo "Usage: $0 start|stop|restart|reload|force-reload"
+	exit 1 
+	;;
+esac
+
+exit 0

+ 2 - 0
startup/default-inetd

@@ -0,0 +1,2 @@
+# Enable the following entry to enable the nrpe daemon
+#nrpe stream tcp nowait nagios ${exec_prefix}/sbin/nrpe -c /etc/nagios/nrpe.cfg --inetd

+ 2 - 0
startup/default-inetd.in

@@ -0,0 +1,2 @@
+# Enable the following entry to enable the nrpe daemon
+#nrpe stream tcp nowait nagios @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg --inetd

+ 132 - 0
startup/default-init

@@ -0,0 +1,132 @@
+#!/bin/sh
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# chkconfig: - 80 30
+# description: Starts and stops the Nagios Remote Plugin Executor \
+#              so a remote nagios server can run plugins on this host
+#
+### BEGIN INIT INFO
+# Provides:           nrpe
+# Required-Start:     $local_fs $remote_fs $syslog $network $time
+# Required-Stop:      $local_fs $remote_fs $syslog $network
+# Default-Start:      2 3 4 5
+# Default-Stop:       0 1 6
+# Short-Description:  Starts and stops the Nagios Remote Plugin Executor
+# Description:        Starts and stops the Nagios Remote Plugin Executor
+#                     so a remote nagios server can run plugins on this host
+### END INIT INFO
+
+
+NRPE_BIN=${exec_prefix}/sbin/nrpe
+NRPE_CFG=/etc/nagios/nrpe.cfg
+LOCK_DIR=/var/lock/subsys
+LOCK_FILE=/var/lock/subsys/nrpe
+PID_FILE=/var/run/nrpe/nrpe.pid
+
+test -x $NRPE_BIN || exit 5
+
+RETVAL=0
+
+# Default these commands/functions to RedHat/CentOS etc. values
+START_CMD="daemon --pidfile $PID_FILE"
+STAT_CMD="status nrpe"
+QSTAT_CMD="status nrpe >/dev/null 2>&1"
+TERM_CMD="killproc -p $PID_FILE $NRPE_BIN -TERM"
+HUP_CMD="killproc -p $PID_FILE $NRPE_BIN -HUP"
+PRT_STAT="echo"
+EXIT_CMD="exit"
+
+
+# Source the function library
+if [ -f /etc/rc.status ]; then
+
+	. /etc/rc.status
+	# Set these commands/functions to SuSE etc. values
+	START_CMD="startproc -p $PID_FILE"
+	STAT_CMD="checkproc"
+	QSTAT_CMD="rc_status"
+	TERM_CMD="killproc -p $PID_FILE -TERM $NRPE_BIN"
+	HUP_CMD="killproc -p $PID_FILE -HUP $NRPE_BIN"
+	PRT_STAT="rc_status -v -r"
+	EXIT_CMD="rc_exit"
+	rc_reset
+
+elif [ -f /lib/lsb/init-functions ]; then
+
+	. /lib/lsb/init-functions
+	START_CMD="start_daemon -p $PID_FILE"
+	QSTAT_CMD="pidofproc -p $PID_FILE $NRPE_BIN"
+	PRT_STAT="status_of_proc -p $PID_FILE $NRPE_BIN nrpe"
+
+elif [ -f /etc/rc.d/init.d/functions ]; then
+
+	. /etc/rc.d/init.d/functions
+
+elif [ -f /etc/init.d/functions ]; then
+
+	. /etc/init.d/functions
+
+elif [ -f /etc/rc.d/functions ]; then
+
+	. /etc/rc.d/functions
+
+fi
+
+
+# See how we were called.
+case "$1" in
+
+start)
+	# Start daemons.
+	echo -n "Starting nrpe: "
+	$START_CMD $NRPE_BIN -c $NRPE_CFG -d
+	RETVAL=$?
+	$PRT_STAT
+	if [ $RETVAL = 0 ]; then
+		[ -d $LOCK_DIR ] && touch $LOCK_FILE
+	fi
+	;;
+
+stop)
+	# Stop daemons.
+	echo -n "Shutting down nrpe: "
+	$TERM_CMD
+	RETVAL=$?
+	$PRT_STAT
+	if [ $RETVAL = 0 ]; then
+		[ -d $LOCK_DIR ] && rm -f $LOCK_FILE
+	fi
+	;;
+
+restart|force-reload)
+	$0 stop
+	$0 start
+	$QSTAT_CMD
+	;;
+
+reload)
+	echo -n "Reloading nrpe: "
+	$HUP_CMD
+	RETVAL=$?
+	$PRT_STAT
+	;;
+
+try-restart|condrestart)
+	$QSTAT_CMD || exit 0
+	$0 stop
+	$0 start
+	$QSTAT_CMD
+	;;
+
+status)
+	$STAT_CMD
+	RETVAL=$?
+	;;
+
+*)
+	echo "Usage: nrpe {start|stop|restart|reload|try-restart|condrestart|status}"
+	exit 1
+esac
+
+$EXIT_CMD $RETVAL

+ 132 - 0
startup/default-init.in

@@ -0,0 +1,132 @@
+#!/bin/sh
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# chkconfig: - 80 30
+# description: Starts and stops the Nagios Remote Plugin Executor \
+#              so a remote nagios server can run plugins on this host
+#
+### BEGIN INIT INFO
+# Provides:           nrpe
+# Required-Start:     $local_fs $remote_fs $syslog $network $time
+# Required-Stop:      $local_fs $remote_fs $syslog $network
+# Default-Start:      2 3 4 5
+# Default-Stop:       0 1 6
+# Short-Description:  Starts and stops the Nagios Remote Plugin Executor
+# Description:        Starts and stops the Nagios Remote Plugin Executor
+#                     so a remote nagios server can run plugins on this host
+### END INIT INFO
+
+
+NRPE_BIN=@sbindir@/nrpe
+NRPE_CFG=@pkgsysconfdir@/nrpe.cfg
+LOCK_DIR=@subsyslockdir@
+LOCK_FILE=@subsyslockfile@
+PID_FILE=@piddir@/nrpe.pid
+
+test -x $NRPE_BIN || exit 5
+
+RETVAL=0
+
+# Default these commands/functions to RedHat/CentOS etc. values
+START_CMD="daemon --pidfile $PID_FILE"
+STAT_CMD="status nrpe"
+QSTAT_CMD="status nrpe >/dev/null 2>&1"
+TERM_CMD="killproc -p $PID_FILE $NRPE_BIN -TERM"
+HUP_CMD="killproc -p $PID_FILE $NRPE_BIN -HUP"
+PRT_STAT="echo"
+EXIT_CMD="exit"
+
+
+# Source the function library
+if [ -f /etc/rc.status ]; then
+
+	. /etc/rc.status
+	# Set these commands/functions to SuSE etc. values
+	START_CMD="startproc -p $PID_FILE"
+	STAT_CMD="checkproc"
+	QSTAT_CMD="rc_status"
+	TERM_CMD="killproc -p $PID_FILE -TERM $NRPE_BIN"
+	HUP_CMD="killproc -p $PID_FILE -HUP $NRPE_BIN"
+	PRT_STAT="rc_status -v -r"
+	EXIT_CMD="rc_exit"
+	rc_reset
+
+elif [ -f /lib/lsb/init-functions ]; then
+
+	. /lib/lsb/init-functions
+	START_CMD="start_daemon -p $PID_FILE"
+	QSTAT_CMD="pidofproc -p $PID_FILE $NRPE_BIN"
+	PRT_STAT="status_of_proc -p $PID_FILE $NRPE_BIN nrpe"
+
+elif [ -f /etc/rc.d/init.d/functions ]; then
+
+	. /etc/rc.d/init.d/functions
+
+elif [ -f /etc/init.d/functions ]; then
+
+	. /etc/init.d/functions
+
+elif [ -f /etc/rc.d/functions ]; then
+
+	. /etc/rc.d/functions
+
+fi
+
+
+# See how we were called.
+case "$1" in
+
+start)
+	# Start daemons.
+	echo -n "Starting nrpe: "
+	$START_CMD $NRPE_BIN -c $NRPE_CFG -d
+	RETVAL=$?
+	$PRT_STAT
+	if [ $RETVAL = 0 ]; then
+		[ -d $LOCK_DIR ] && touch $LOCK_FILE
+	fi
+	;;
+
+stop)
+	# Stop daemons.
+	echo -n "Shutting down nrpe: "
+	$TERM_CMD
+	RETVAL=$?
+	$PRT_STAT
+	if [ $RETVAL = 0 ]; then
+		[ -d $LOCK_DIR ] && rm -f $LOCK_FILE
+	fi
+	;;
+
+restart|force-reload)
+	$0 stop
+	$0 start
+	$QSTAT_CMD
+	;;
+
+reload)
+	echo -n "Reloading nrpe: "
+	$HUP_CMD
+	RETVAL=$?
+	$PRT_STAT
+	;;
+
+try-restart|condrestart)
+	$QSTAT_CMD || exit 0
+	$0 stop
+	$0 start
+	$QSTAT_CMD
+	;;
+
+status)
+	$STAT_CMD
+	RETVAL=$?
+	;;
+
+*)
+	echo "Usage: nrpe {start|stop|restart|reload|try-restart|condrestart|status}"
+	exit 1
+esac
+
+$EXIT_CMD $RETVAL

+ 20 - 0
startup/default-service

@@ -0,0 +1,20 @@
+[Unit]
+Description=Nagios Remote Program Executor
+Documentation=http://www.nagios.org/documentation
+After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
+Before=getty@tty1.service plymouth-quit.service xdm.service
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=forking
+Restart=on-abort
+PIDFile=/var/run/nrpe.pid
+ExecStart=${exec_prefix}/sbin/nrpe -c /etc/nagios/nrpe.cfg
+ExecStopPost=/bin/rm -f /var/run/nrpe.pid
+TimeoutStopSec=60
+User=nagios
+Group=nagios
+PrivateTmp=true
+OOMScoreAdjust=-500

+ 20 - 0
startup/default-service.in

@@ -0,0 +1,20 @@
+[Unit]
+Description=Nagios Remote Program Executor
+Documentation=http://www.nagios.org/documentation
+After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
+Before=getty@tty1.service plymouth-quit.service xdm.service
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=forking
+Restart=on-abort
+PIDFile=/var/run/nrpe.pid
+ExecStart=@sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg
+ExecStopPost=/bin/rm -f /var/run/nrpe.pid
+TimeoutStopSec=60
+User=@nagios_user@
+Group=@nagios_group@
+PrivateTmp=true
+OOMScoreAdjust=-500

+ 15 - 0
startup/default-xinetd

@@ -0,0 +1,15 @@
+# default: on
+# description: NRPE (Nagios Remote Plugin Executor)
+service nrpe
+{
+    disable         = yes
+    socket_type     = stream
+    port            = 5666
+    wait            = no
+    user            = nagios
+    group           = nagios
+    server          = ${exec_prefix}/sbin/nrpe
+    server_args     = -c /etc/nagios/nrpe.cfg --inetd
+    only_from       = 127.0.0.1
+    log_on_failure  += USERID
+}

+ 15 - 0
startup/default-xinetd.in

@@ -0,0 +1,15 @@
+# default: on
+# description: NRPE (Nagios Remote Plugin Executor)
+service nrpe
+{
+    disable         = yes
+    socket_type     = stream
+    port            = 5666
+    wait            = no
+    user            = nagios
+    group           = nagios
+    server          = @sbindir@/nrpe
+    server_args     = -c @pkgsysconfdir@/nrpe.cfg --inetd
+    only_from       = 127.0.0.1
+    log_on_failure  += USERID
+}

+ 36 - 0
startup/mac-org.nagios.PKG_NAME.plist

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>Label</key>
+	<string>org.nagios.nrpe</string>
+	<key>UserName</key>
+	<string>nagios</string>
+	<key>GroupName</key>
+	<string>nagios</string>
+	<key>Program</key>
+	<string>${exec_prefix}/sbin/nrpe</string>
+	<key>ProgramArguments</key>
+	<array>
+		<string>-c</string>
+		<string>/etc/nagios/nrpe.cfg</string>
+	</array>
+	<key>KeepAlive</key>
+	<dict>
+		<key>SuccessfulExit</key>
+		<false/>
+		<key>NetworkState</key>
+		<true/>
+	</dict>
+	<key>RunAtLoad</key>
+	<true/>
+	<!-- ExitTimeOut would be for nagios itself, not nrpe -->
+	<key>ExitTimeOut</key>
+	<integer>120</integer>
+	<key>ProcessType</key>
+	<string>Background</string>
+	<!-- LaunchOnlyOnce might be for nagios checkconfig -->
+	<key>LaunchOnlyOnce</key>
+	<false/>
+</dict>
+</plist>

+ 36 - 0
startup/mac-org.nagios.PKG_NAME.plist.in

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>Label</key>
+	<string>org.nagios.nrpe</string>
+	<key>UserName</key>
+	<string>nagios</string>
+	<key>GroupName</key>
+	<string>nagios</string>
+	<key>Program</key>
+	<string>@sbindir@/nrpe</string>
+	<key>ProgramArguments</key>
+	<array>
+		<string>-c</string>
+		<string>@pkgsysconfdir@/nrpe.cfg</string>
+	</array>
+	<key>KeepAlive</key>
+	<dict>
+		<key>SuccessfulExit</key>
+		<false/>
+		<key>NetworkState</key>
+		<true/>
+	</dict>
+	<key>RunAtLoad</key>
+	<true/>
+	<!-- ExitTimeOut would be for nagios itself, not nrpe -->
+	<key>ExitTimeOut</key>
+	<integer>120</integer>
+	<key>ProcessType</key>
+	<string>Background</string>
+	<!-- LaunchOnlyOnce might be for nagios checkconfig -->
+	<key>LaunchOnlyOnce</key>
+	<false/>
+</dict>
+</plist>

+ 0 - 0
sample-config/nrpe.xinetd.in → startup/old/nrpe.xinetd.in


+ 7 - 0
startup/openrc-conf

@@ -0,0 +1,7 @@
+# /etc/conf.d/nrpe : config file for /etc/init.d/nrpe
+
+# Configuration file - default is /etc/nrpe.cfg
+NRPE_CFG="@pgksysconfdir@/nrpe.cfg"
+
+# Any additional nrpe options (-n -4 -6)
+NRPE_OPTS=""

+ 7 - 0
startup/openrc-conf.in

@@ -0,0 +1,7 @@
+# /etc/conf.d/nrpe : config file for /etc/init.d/nrpe
+
+# Configuration file - default is @sysconfdir@/nrpe.cfg
+NRPE_CFG="@pgksysconfdir@/nrpe.cfg"
+
+# Any additional nrpe options (-n -4 -6)
+NRPE_OPTS=""

+ 49 - 0
startup/openrc-init

@@ -0,0 +1,49 @@
+#!/sbin/runscript
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# Start/stop the nrpe daemon.
+#
+# Goes in /etc/init.d - Config is in /etc/conf.d/nrpe
+
+opts="reload"
+# extra_started_commands="reload"		use this if OpenRC >= 0.9.4
+
+NRPE_BIN="${exec_prefix}/sbin/nrpe"
+NRPE_PID="/var/run/nrpe/nrpe.pid"
+
+depend() {
+	use logger dns net localmount netmount nfsmount
+}
+
+checkconfig() {
+	# Make sure the config file exists
+	if [ ! -f $NRPE_CFG ]; then
+		eerror "You need to setup $NRPE_CFG.
+		return 1
+	fi
+	return 0
+}
+
+start() {
+	checkconfig || return 1
+	ebegin "Starting nrpe"
+	# Make sure we have a sane current directory
+	cd /
+	start-stop-daemon --start --exec $NRPE_BIN --pidfile $PID_FILE \
+		-- -c $NRPE_CFG -d $NRPE_OPTS
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping nrpe"
+	start-stop-daemon --stop --exec $NRPE_BIN --pidfile $PID_FILE
+	eend $?
+}
+
+reload() {
+	ebegin "Reloading nrpe"
+	start-stop-daemon --stop --oknodo --exec $NRPE_BIN \
+		--pidfile $PID_FILE --signal HUP
+	eend $?
+}

+ 49 - 0
startup/openrc-init.in

@@ -0,0 +1,49 @@
+#!/sbin/runscript
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# Start/stop the nrpe daemon.
+#
+# Goes in /etc/init.d - Config is in /etc/conf.d/nrpe
+
+opts="reload"
+# extra_started_commands="reload"		use this if OpenRC >= 0.9.4
+
+NRPE_BIN="@sbindir@/nrpe"
+NRPE_PID="@piddir@/nrpe.pid"
+
+depend() {
+	use logger dns net localmount netmount nfsmount
+}
+
+checkconfig() {
+	# Make sure the config file exists
+	if [ ! -f $NRPE_CFG ]; then
+		eerror "You need to setup $NRPE_CFG.
+		return 1
+	fi
+	return 0
+}
+
+start() {
+	checkconfig || return 1
+	ebegin "Starting nrpe"
+	# Make sure we have a sane current directory
+	cd /
+	start-stop-daemon --start --exec $NRPE_BIN --pidfile $PID_FILE \
+		-- -c $NRPE_CFG -d $NRPE_OPTS
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping nrpe"
+	start-stop-daemon --stop --exec $NRPE_BIN --pidfile $PID_FILE
+	eend $?
+}
+
+reload() {
+	ebegin "Reloading nrpe"
+	start-stop-daemon --stop --oknodo --exec $NRPE_BIN \
+		--pidfile $PID_FILE --signal HUP
+	eend $?
+}

+ 152 - 0
startup/solaris-PKG_NAME.xml

@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<!--
+	This is a manifest file for the nrpe service. Import it using
+		svccfg import <path/to/this/file>
+	and enable it using
+		svcadm enable nrpe
+-->
+
+<service_bundle type='manifest' name='NGOS:nrpe'>
+
+	<service
+		name='network/nagios/nrpe'
+		version='1'
+		type='service'>
+
+		<single_instance />
+
+		<dependency
+			name='fs-local'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+				<service_fmri value='svc:/system/filesystem/local' />
+		</dependency>
+
+		<dependency
+			name='autofs'
+			grouping='optional_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/filesystem/autofs' />
+		</dependency>
+
+		<dependency name='net-loopback'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/network/loopback' />
+		</dependency>
+
+		<dependency name='net-physical'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/network/physical' />
+		</dependency>
+
+		<dependency name='cryptosvc'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/cryptosvc' />
+		</dependency>
+
+		<dependency name='utmp'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/utmp' />
+		</dependency>
+
+		<dependency name='config_data'
+			grouping='require_all'
+			restart_on='restart'
+			type='path'>
+			<service_fmri
+			    value='file://localhost/pkg/etc/nrpe.cfg' />
+		</dependency>
+
+		<dependency
+			name='system-log'
+			grouping='optional_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/system-log' />
+		</dependency>
+
+		<dependent
+			name='nrpe_multi-user-server'
+			grouping='optional_all'
+			restart_on='none'>
+				<service_fmri
+				    value='svc:/milestone/multi-user-server' />
+		</dependent>
+
+		<method_context>
+			<method_credential user='nagios' group='nagios'/>
+			<method_environment>
+				<envvar name='BASEDIR' value='/export/home/nagios'/>
+			</method_environment>
+		</method_context>
+
+		<exec_method
+			type='method'
+			name='start'
+			exec='/usr/sfw/sbin/tcpd -c /etc/nagios/nrpe.cfg -i'
+			arg0='${exec_prefix}/sbin/nrpe'
+			timeout_seconds='60'/>
+
+		<exec_method
+			type='method'
+			name='stop'
+			exec=':kill'
+			timeout_seconds='60'/>
+
+		<exec_method
+			type='method'
+			name='refresh'
+			exec=':hup'
+			timeout_seconds='60'/>
+
+		<property_group name='startd' type='framework'>
+			<propval name='ignore_error'
+				type='astring'
+				value='core,signal' />
+		</property_group>
+
+		<property_group name='general' type='framework'>
+			<propval name='enabled'
+				type='boolean'
+				value='false'/>
+			<propval name='action_authorization'
+				type='astring'
+				value='solaris.smf.manage.nrpe'/>
+			<propval name='value_authorization'
+				type='astring'
+				value='solaris.smf.manage.nrpe'/>
+		</property_group>
+
+		<stability value='Unstable' />
+
+		<create_default_instance name='default' enabled='false' />
+
+		<template>
+			<common_name>
+				<loctext xml:lang="C">NRPE daemon</loctext>
+			</common_name>
+			<description>
+				<loctext xml:lang="C">
+					Nagios Remote Plugin Executor daemon
+				</loctext>
+			</description>
+			<documentation>
+				<doc_link name='nagios.org' uri='http://www.nagios.org' />
+			</documentation>
+		</template>
+
+	</service>
+
+</service_bundle>

+ 152 - 0
startup/solaris-PKG_NAME.xml.in

@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<!--
+	This is a manifest file for the nrpe service. Import it using
+		svccfg import <path/to/this/file>
+	and enable it using
+		svcadm enable nrpe
+-->
+
+<service_bundle type='manifest' name='NGOS:nrpe'>
+
+	<service
+		name='network/nagios/nrpe'
+		version='1'
+		type='service'>
+
+		<single_instance />
+
+		<dependency
+			name='fs-local'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+				<service_fmri value='svc:/system/filesystem/local' />
+		</dependency>
+
+		<dependency
+			name='autofs'
+			grouping='optional_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/filesystem/autofs' />
+		</dependency>
+
+		<dependency name='net-loopback'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/network/loopback' />
+		</dependency>
+
+		<dependency name='net-physical'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/network/physical' />
+		</dependency>
+
+		<dependency name='cryptosvc'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/cryptosvc' />
+		</dependency>
+
+		<dependency name='utmp'
+			grouping='require_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/utmp' />
+		</dependency>
+
+		<dependency name='config_data'
+			grouping='require_all'
+			restart_on='restart'
+			type='path'>
+			<service_fmri
+			    value='file://localhost/pkg@sysconfdir@/nrpe.cfg' />
+		</dependency>
+
+		<dependency
+			name='system-log'
+			grouping='optional_all'
+			restart_on='none'
+			type='service'>
+			<service_fmri value='svc:/system/system-log' />
+		</dependency>
+
+		<dependent
+			name='nrpe_multi-user-server'
+			grouping='optional_all'
+			restart_on='none'>
+				<service_fmri
+				    value='svc:/milestone/multi-user-server' />
+		</dependent>
+
+		<method_context>
+			<method_credential user='@nagios_user@' group='@nagios_group@'/>
+			<method_environment>
+				<envvar name='BASEDIR' value='/export/home/@nagios_user@'/>
+			</method_environment>
+		</method_context>
+
+		<exec_method
+			type='method'
+			name='start'
+			exec='/usr/sfw/sbin/tcpd -c @pkgsysconfdir@/nrpe.cfg -i'
+			arg0='@sbindir@/nrpe'
+			timeout_seconds='60'/>
+
+		<exec_method
+			type='method'
+			name='stop'
+			exec=':kill'
+			timeout_seconds='60'/>
+
+		<exec_method
+			type='method'
+			name='refresh'
+			exec=':hup'
+			timeout_seconds='60'/>
+
+		<property_group name='startd' type='framework'>
+			<propval name='ignore_error'
+				type='astring'
+				value='core,signal' />
+		</property_group>
+
+		<property_group name='general' type='framework'>
+			<propval name='enabled'
+				type='boolean'
+				value='false'/>
+			<propval name='action_authorization'
+				type='astring'
+				value='solaris.smf.manage.nrpe'/>
+			<propval name='value_authorization'
+				type='astring'
+				value='solaris.smf.manage.nrpe'/>
+		</property_group>
+
+		<stability value='Unstable' />
+
+		<create_default_instance name='default' enabled='false' />
+
+		<template>
+			<common_name>
+				<loctext xml:lang="C">NRPE daemon</loctext>
+			</common_name>
+			<description>
+				<loctext xml:lang="C">
+					Nagios Remote Plugin Executor daemon
+				</loctext>
+			</description>
+			<documentation>
+				<doc_link name='nagios.org' uri='http://www.nagios.org' />
+			</documentation>
+		</template>
+
+	</service>
+
+</service_bundle>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff