| 1 |
# =========================================================================== |
| 2 |
# SYNOPSIS |
| 3 |
# |
| 4 |
# AX_NAGIOS_GET_FILES |
| 5 |
# |
| 6 |
# DESCRIPTION |
| 7 |
# |
| 8 |
# This macro figures out which init and/or inetd files to use based |
| 9 |
# on the results of the AX_NAGIOS_GET_OS, AX_NAGIOS_GET_DISTRIB_TYPE, |
| 10 |
# AX_NAGIOS_GET_INIT and AX_NAGIOS_GET_INETD macros. It will select |
| 11 |
# the appropriate files(s) from the 'startup' directory and copy it. |
| 12 |
# |
| 13 |
# LICENSE |
| 14 |
# |
| 15 |
# Copyright (c) 2016 Nagios Core Development Team |
| 16 |
# |
| 17 |
# This program is free software; you can redistribute it and/or modify it |
| 18 |
# under the terms of the GNU General Public License as published by the |
| 19 |
# Free Software Foundation; either version 2 of the License, or (at your |
| 20 |
# option) any later version. |
| 21 |
# |
| 22 |
# This program is distributed in the hope that it will be useful, but |
| 23 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 24 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
| 25 |
# Public License for more details. |
| 26 |
# |
| 27 |
# You should have received a copy of the GNU General Public License along |
| 28 |
# with this program. If not, see <http://www.gnu.org/licenses/>. |
| 29 |
# |
| 30 |
# As a special exception, the respective Autoconf Macro's copyright owner |
| 31 |
# gives unlimited permission to copy, distribute and modify the configure |
| 32 |
# scripts that are the output of Autoconf when processing the Macro. You |
| 33 |
# need not follow the terms of the GNU General Public License when using |
| 34 |
# or distributing such scripts, even though portions of the text of the |
| 35 |
# Macro appear in them. The GNU General Public License (GPL) does govern |
| 36 |
# all other use of the material that constitutes the Autoconf Macro. |
| 37 |
# |
| 38 |
# This special exception to the GPL applies to versions of the Autoconf |
| 39 |
# Macro released by the Autoconf Archive. When you make and distribute a |
| 40 |
# modified version of the Autoconf Macro, you may extend this special |
| 41 |
# exception to the GPL to apply to your modified version as well. |
| 42 |
# =========================================================================== |
| 43 |
|
| 44 |
AU_ALIAS([AC_NAGIOS_GET_FILES], [AX_NAGIOS_GET_FILES]) |
| 45 |
AC_DEFUN([AX_NAGIOS_GET_FILES], |
| 46 |
[ |
| 47 |
|
| 48 |
AC_SUBST(src_init) |
| 49 |
AC_SUBST(src_inetd) |
| 50 |
AC_SUBST(src_tmpfile) |
| 51 |
AC_SUBST(bsd_enable) |
| 52 |
|
| 53 |
src_inetd="" |
| 54 |
src_init="" |
| 55 |
bsd_enable="" |
| 56 |
|
| 57 |
AC_MSG_CHECKING(for which init file to use ) |
| 58 |
|
| 59 |
AS_CASE([$init_type], |
| 60 |
|
| 61 |
[sysv], |
| 62 |
src_init=default-init, |
| 63 |
|
| 64 |
[systemd], |
| 65 |
src_tmpfile=tmpfile.conf |
| 66 |
src_init=default-service, |
| 67 |
|
| 68 |
[bsd], |
| 69 |
src_init=bsd-init, |
| 70 |
|
| 71 |
[newbsd], |
| 72 |
if test $dist_type = freebsd ; then |
| 73 |
bsd_enable="_enable" |
| 74 |
src_init=newbsd-init |
| 75 |
elif test $dist_type = openbsd ; then |
| 76 |
bsd_enable="_flags" |
| 77 |
src_init=openbsd-init |
| 78 |
elif test $dist_type = netbsd ; then |
| 79 |
bsd_enable="" |
| 80 |
src_init=newbsd-init |
| 81 |
fi, |
| 82 |
|
| 83 |
# [gentoo], |
| 84 |
|
| 85 |
[openrc], |
| 86 |
src_init=openrc-init, |
| 87 |
|
| 88 |
[smf*], |
| 89 |
src_init="solaris-init.xml" |
| 90 |
src_inetd="solaris-inetd.xml", |
| 91 |
|
| 92 |
[upstart], |
| 93 |
if test $dist_type = rh ; then |
| 94 |
src_init=rh-upstart-init |
| 95 |
else |
| 96 |
src_init=upstart-init |
| 97 |
fi, |
| 98 |
|
| 99 |
[launchd], |
| 100 |
src_init="mac-init.plist", |
| 101 |
|
| 102 |
[*], |
| 103 |
src_init="unknown" |
| 104 |
) |
| 105 |
AC_MSG_RESULT($src_init) |
| 106 |
|
| 107 |
AC_MSG_CHECKING(for which inetd files to use ) |
| 108 |
|
| 109 |
if test x$src_inetd = x; then |
| 110 |
|
| 111 |
AS_CASE([$inetd_type], |
| 112 |
[inetd*], |
| 113 |
src_inetd=default-inetd, |
| 114 |
|
| 115 |
[xinetd], |
| 116 |
src_inetd=default-xinetd, |
| 117 |
|
| 118 |
[systemd], |
| 119 |
src_inetd=default-socket, |
| 120 |
|
| 121 |
[launchd], |
| 122 |
src_inetd="mac-inetd.plist", |
| 123 |
|
| 124 |
[*], |
| 125 |
src_inetd="unknown" |
| 126 |
) |
| 127 |
|
| 128 |
fi |
| 129 |
AC_MSG_RESULT($src_inetd) |
| 130 |
|
| 131 |
]) |