ax_nagios_get_files 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. AC_MSG_CHECKING(for which init file to use )
  49. AS_CASE([$init_type],
  50. [sysv],
  51. if test $dist_type = debian; then
  52. src_init=debian-init
  53. else
  54. src_init=default-init
  55. fi,
  56. [systemd],
  57. src_init=default-service,
  58. [bsd],
  59. src_init=bsd-init,
  60. [newbsd],
  61. src_init=newbsd-init,
  62. # [gentoo],
  63. [openrc],
  64. src_init=openrc-init,
  65. [smf*],
  66. src_init="solaris-PKG_NAME.xml"
  67. src_inetd="solaris-PKG_NAME.xml",
  68. [upstart],
  69. src_init=default-init,
  70. [launchd],
  71. src_init="mac-org.nagios.PKG_NAME.plist"
  72. src_inetd="mac-org.nagios.PKG_NAME.plist",
  73. [*],
  74. src_init="unknown"
  75. )
  76. AC_MSG_RESULT($src_init)
  77. AC_MSG_CHECKING(for which inetd files to use )
  78. if test x$src_inetd = x; then
  79. AS_CASE([$inetd_type],
  80. [inetd],
  81. src_inetd=default-inetd,
  82. [xinetd],
  83. src_inetd=default-xinetd,
  84. [systemd],
  85. src_inetd=default-socket,
  86. [*],
  87. src_inetd="unknown"
  88. )
  89. fi
  90. AC_MSG_RESULT($src_inetd)
  91. ])