ax_nagios_get_files 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. AU_ALIAS([AC_NAGIOS_GET_FILES], [AX_NAGIOS_GET_FILES])
  44. AC_DEFUN([AX_NAGIOS_GET_FILES],
  45. [
  46. src_inetd=""
  47. src_init=""
  48. bsd_enable=""
  49. AC_MSG_CHECKING(for which init file to use )
  50. AS_CASE([$init_type],
  51. [sysv],
  52. if test $dist_type = debian; then
  53. src_init=debian-init
  54. else
  55. src_init=default-init
  56. fi,
  57. [systemd],
  58. src_tmpfile=tmpfile.conf
  59. src_init=default-service,
  60. [bsd],
  61. if test $dist_type = freebsd ; then
  62. bsd_enable="_enable"
  63. elif test $dist_type = openbsd ; then
  64. bsd_enable="_flags"
  65. fi
  66. src_init=bsd-init,
  67. [newbsd],
  68. src_init=newbsd-init,
  69. # [gentoo],
  70. [openrc],
  71. src_init=openrc-init,
  72. [smf*],
  73. src_init="solaris-init.xml"
  74. src_inetd="solaris-inetd.xml",
  75. [upstart],
  76. if test $dist_type = rh ; then
  77. src_init=rh-upstart-init
  78. else
  79. src_init=upstart-init
  80. fi,
  81. [launchd],
  82. src_init="mac-org.nagios.PKG_NAME.plist"
  83. src_inetd="mac-org.nagios.PKG_NAME.plist",
  84. [*],
  85. src_init="unknown"
  86. )
  87. AC_MSG_RESULT($src_init)
  88. AC_MSG_CHECKING(for which inetd files to use )
  89. if test x$src_inetd = x; then
  90. AS_CASE([$inetd_type],
  91. [inetd],
  92. src_inetd=default-inetd,
  93. [xinetd],
  94. src_inetd=default-xinetd,
  95. [systemd],
  96. src_inetd=default-socket,
  97. [*],
  98. src_inetd="unknown"
  99. )
  100. fi
  101. AC_MSG_RESULT($src_inetd)
  102. ])