forked from ovido/check_rhev3
-
Notifications
You must be signed in to change notification settings - Fork 10
/
configure.ac
76 lines (64 loc) · 3.01 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Process this file with autoconf to produce a configure script.
# 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 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.63])
AC_INIT([check_rhv], [2.0], [rkoch@rk-it.at])
AM_INIT_AUTOMAKE
AC_PREFIX_DEFAULT(/usr/local/nagios/libexec)
PKG_NAME="check_rhv"
PKG_VERSION="2.0"
PKG_REL_DATE="2018-10-19"
# Figure out how to invoke "install" and what install options to use
AC_PROG_INSTALL
AC_SUBST(INSTALL)
# What OS are we running?
AC_CANONICAL_HOST
# Check for programs
AC_PATH_PROG([PERL],[perl])
AX_PROG_PERL_MODULES( LWP::UserAgent, , AC_MSG_ERROR(Missing Perl module LWP::UserAgent))
AX_PROG_PERL_MODULES( HTTP::Request, , AC_MSG_ERROR(Missing Perl module HTTP::Request))
AX_PROG_PERL_MODULES( HTTP::Request::Common, , AC_MSG_ERROR(Missing Perl module HTTP::Request::Common))
AX_PROG_PERL_MODULES( Getopt::Long, , AC_MSG_ERROR(Missing Perl module Getopt::Long))
AX_PROG_PERL_MODULES( XML::Simple, , AC_MSG_ERROR(Missing Perl module XML::Simple))
AX_PROG_PERL_MODULES( Data::Dumper, , AC_MSG_ERROR(Missing Perl module Data::Dumper))
# Options
AC_ARG_WITH(nagios_user,AC_HELP_STRING([--with-nagios-user=<user>],[sets user name to run Nagios]),nagios_user=$withval,nagios_user=nagios)
AC_ARG_WITH(nagios_group,AC_HELP_STRING([--with-nagios-group=<grp>],[sets group name to run Nagios]),nagios_group=$withval,nagios_group=nagios)
AC_ARG_WITH(pnp_dir,AC_HELP_STRING([--with-pnp-dir=<dir>],[path to PNP share directory]),pnp_dir=$withval,pnp_dir=/usr/local/pnp4nagios/share)
AC_ARG_ENABLE(pnp_template,AC_HELP_STRING([--enable-pnp-template],[install template for PNP4Nagios]),pnp_template=$enableval,pnp_template=yes)
AC_SUBST(nagios_user)
AC_SUBST(nagios_group)
AC_SUBST(pnp_dir)
AC_SUBST(pnp_template)
INSTALL_OPTS="-o $nagios_user -g $nagios_group"
AC_SUBST(INSTALL_OPTS)
AC_CONFIG_FILES([Makefile plugin-dir/Makefile contrib/Makefile])
AC_OUTPUT
# Review options
echo ""
echo ""
AC_MSG_RESULT([*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:])
echo ""
echo ""
echo " General Options:"
echo " ------------------------- -------------------------"
AC_MSG_RESULT([ Nagios user: $nagios_user])
AC_MSG_RESULT([ Nagios group: $nagios_group])
AC_MSG_RESULT([ Plugins directory: $prefix])
AC_MSG_RESULT([ PNP directory: $pnp_dir])
AC_MSG_RESULT([ Install PNP template: $pnp_template])
echo ""
echo ""
echo "Review the options above for accuray. If they look okay,"
echo "type 'make all' to compile."
echo ""