ax_nagios_get_paths.m4 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. # ===========================================================================
  2. # SYNOPSIS
  3. #
  4. # AX_NAGIOS_GET_PATHS
  5. #
  6. # DESCRIPTION
  7. #
  8. # This macro figures out the installation & run paths for various systems
  9. # The argument are:
  10. # the O/S determined by the AX_NAGIOS_GET_OS macro.
  11. # the distribution type as determined by AX_NAGIOS_GET_DISTRIB_TYPE
  12. # the init type as determined by AX_NAGIOS_GET_INIT
  13. # the inetd type as determined by AX_NAGIOS_GET_INETD
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2016 Nagios Core Development Team
  18. #
  19. # This program is free software; you can redistribute it and/or modify it
  20. # under the terms of the GNU General Public License as published by the
  21. # Free Software Foundation; either version 2 of the License, or (at your
  22. # option) any later version.
  23. #
  24. # This program is distributed in the hope that it will be useful, but
  25. # WITHOUT ANY WARRANTY; without even the implied warranty of
  26. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  27. # Public License for more details.
  28. #
  29. # You should have received a copy of the GNU General Public License along
  30. # with this program. If not, see <http://www.gnu.org/licenses/>.
  31. #
  32. # As a special exception, the respective Autoconf Macro's copyright owner
  33. # gives unlimited permission to copy, distribute and modify the configure
  34. # scripts that are the output of Autoconf when processing the Macro. You
  35. # need not follow the terms of the GNU General Public License when using
  36. # or distributing such scripts, even though portions of the text of the
  37. # Macro appear in them. The GNU General Public License (GPL) does govern
  38. # all other use of the material that constitutes the Autoconf Macro.
  39. #
  40. # This special exception to the GPL applies to versions of the Autoconf
  41. # Macro released by the Autoconf Archive. When you make and distribute a
  42. # modified version of the Autoconf Macro, you may extend this special
  43. # exception to the GPL to apply to your modified version as well.
  44. # ===========================================================================
  45. AC_DEFUN([AX_NAGIOS_GET_PATHS],
  46. [
  47. AC_SUBST(pkgsysconfdir)
  48. AC_SUBST(objsysconfdir)
  49. AC_SUBST(sbindir)
  50. AC_SUBST(initname)
  51. AC_SUBST(inetdname)
  52. AC_SUBST(pluginsdir)
  53. AC_SUBST(brokersdir)
  54. AC_SUBST(cgibindir)
  55. AC_SUBST(webdir)
  56. AC_SUBST(privatesysconfdir)
  57. AC_SUBST(pkglocalstatedir)
  58. AC_SUBST(logdir)
  59. AC_SUBST(piddir)
  60. AC_SUBST(pipedir)
  61. AC_SUBST(spooldir)
  62. AC_SUBST(initdir)
  63. AC_SUBST(inetddir)
  64. AC_SUBST(tmpfilesd)
  65. AC_SUBST(subsyslockdir)
  66. AC_SUBST(subsyslockfile)
  67. if test x$DBG_PATHS != x; then
  68. echo
  69. echo Incoming paths:
  70. echo " prefix $prefix"
  71. echo " exec_prefix $exec_prefix"
  72. echo " bindir $bindir"
  73. echo " sbindir $sbindir"
  74. echo " libexecdir $libexecdir"
  75. echo " sysconfdir $sysconfdir"
  76. echo " localstatedir $localstatedir"
  77. echo " datarootdir $datarootdir"
  78. echo " datadir $datadir"
  79. echo " localedir $localedir"
  80. echo
  81. fi
  82. AC_MSG_CHECKING(for which paths to use )
  83. AC_ARG_ENABLE(install_method,
  84. AS_HELP_STRING([--enable-install-method=<method>],[sets the install method to use: 'default' (the default) will install to
  85. /usr/local/nagios, 'os' will try to determine which method to use based
  86. on OS type and distribution. Fine tuning using the '--bindir', etc.
  87. overrides above will still work]),
  88. install_method=$enableval,
  89. install_method=default
  90. )
  91. AC_ARG_ENABLE(showdirs_only,
  92. AS_HELP_STRING([--enable-showdirs-only=yes],[This option will cause 'configure' to stop after determining the install
  93. locations based on '--enable-install-method', so you can see the
  94. destinations before a full './configure', 'make', 'make install'
  95. process.]),
  96. showdirs_only=$enableval,
  97. showdirs_only=no
  98. )
  99. AS_CASE([$install_method],
  100. [yes], install_method="os",
  101. [no], install_method="default",
  102. [default|os], :,
  103. [*], echo >&6; AC_MSG_ERROR(['--enable-install-method=$install_method' is invalid])
  104. )
  105. if test $showdirs_only != "no"; then showdirs_only="yes"; fi
  106. AS_CASE([$dist_type],
  107. [*solaris*|*hp-ux*|*aix*|*osx*], opsys=unix)
  108. # Does this package need to know:
  109. need_cgi=no # where the cgi-bin directory is
  110. need_web=no # where the website directory is
  111. need_brk=no # where the event broker modules directory is
  112. need_plg=no # where the plugins directory is
  113. need_pipe=no # where the pipe directory is
  114. need_spl=no # where the spool directory is
  115. need_loc=no # where the locale directory is
  116. need_log_subdir=no # where the loc sub-directory is
  117. need_etc_subdir=no # where the etc sub-directory is
  118. need_pls_dir=no # where the package locate state directory is
  119. if test x"$INIT_PROG" = x; then
  120. INIT_PROG="$PKG_NAME"
  121. fi
  122. AS_CASE([$PKG_NAME],
  123. [nagios],
  124. need_log_subdir=yes
  125. need_etc_subdir=yes
  126. need_pls_dir=yes
  127. need_brk=yes
  128. need_pipe=yes
  129. need_spl=yes
  130. need_loc=yes
  131. need_cgi=yes
  132. need_web=yes,
  133. [ndoutils],
  134. need_brk=yes
  135. need_spl=yes,
  136. [nrpe],
  137. need_plg=yes,
  138. [nsca],
  139. need_cgi=no,
  140. [plugins],
  141. need_loc=yes
  142. need_plg=yes
  143. )
  144. AC_ARG_WITH(pkgsysconfdir, AS_HELP_STRING([--with-pkgsysconfdir=DIR],[where configuration files should be placed]),
  145. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  146. pkgsysconfdir="$withval"
  147. fi)
  148. AC_ARG_WITH(objsysconfdir, AS_HELP_STRING([--with-objsysconfdir=DIR],[where object configuration files should be placed]),
  149. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  150. objsysconfdir="$withval"
  151. fi)
  152. AC_ARG_WITH(privatesysconfdir, AS_HELP_STRING([--with-privatesysconfdir=DIR],[where private configuration files should be placed]),
  153. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  154. privatesysconfdir="$withval"
  155. fi)
  156. AC_ARG_WITH(webdir, AS_HELP_STRING([--with-webdir=DIR],[where the website files should be placed]),
  157. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  158. webdir="$withval"
  159. fi)
  160. AC_ARG_WITH(pluginsdir, AS_HELP_STRING([--with-pluginsdir=DIR],[where the plugins should be placed]),
  161. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  162. pluginsdir="$withval"
  163. fi)
  164. AC_ARG_WITH(brokersdir, AS_HELP_STRING([--with-brokersdir=DIR],[where the broker modules should be placed]),
  165. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  166. brokersdir="$withval"
  167. fi)
  168. AC_ARG_WITH(cgibindir, AS_HELP_STRING([--with-cgibindir=DIR],[where the CGI programs should be placed]),
  169. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  170. cgibindir="$withval"
  171. fi)
  172. AC_ARG_WITH(logdir, AS_HELP_STRING([--with-logdir=DIR],[where log files should be placed]),
  173. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  174. logdir="$withval"
  175. fi)
  176. AC_ARG_WITH(piddir, AS_HELP_STRING([--with-piddir=DIR],[where the PID file should be placed]),
  177. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  178. piddir="$withval"
  179. fi)
  180. AC_ARG_WITH(pipedir, AS_HELP_STRING([--with-pipedir=DIR],[where socket and pipe files should be placed]),
  181. if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
  182. pipedir="$withval"
  183. fi)
  184. #
  185. # Setup the base directory
  186. #
  187. if test $install_method = "default"; then
  188. if test $opsys = "unix"; then
  189. if test x"$prefix" = "xNONE"; then prefix="/usr/local/nagios"; fi
  190. else
  191. if test x"$prefix" = "xNONE"; then prefix=${ac_default_prefix}; fi
  192. fi
  193. datarootdir=${datarootdir="$prefix"}
  194. else
  195. if test x"$datadir" = x'${datarootdir}'; then AS_UNSET(datadir); fi
  196. if test x"$sysconfdir" = x'${prefix}/etc'; then AS_UNSET(sysconfdir); fi
  197. if test x"$prefix" = "xNONE"; then
  198. if test $dist_type = freebsd -o $dist_type = openbsd -o $dist_type = osx; then
  199. prefix="/usr/local"
  200. elif test $dist_type = netbsd; then
  201. prefix="/usr/pkg"
  202. else
  203. prefix="/usr"
  204. fi
  205. fi
  206. if test x"$exec_prefix" = "xNONE"; then exec_prefix=$prefix; fi
  207. if test x"$localstatedir" = x'${prefix}/var'; then
  208. if test $dist_type = "osx"; then
  209. localstatedir="/private/var"
  210. else
  211. localstatedir="/var"
  212. fi
  213. fi
  214. if test $opsys = "unix"; then
  215. if test x"$datarootdir" = x'${prefix}/share'; then
  216. if test $dist_type = "hp-ux"; then
  217. datarootdir="/usr/local/share"
  218. if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
  219. libexecdir="/usr/nagios"
  220. fi
  221. elif test $dist_type = "osx"; then
  222. datarootdir="/usr/local/share"
  223. if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
  224. libexecdir="/usr/local/nagios"
  225. fi
  226. elif test x"$libexecdir" = x'${exec_prefix}/libexec'; then
  227. libexecdir="/usr/lib/nagios"
  228. fi
  229. fi
  230. if test $dist_type = "osx"; then
  231. if test x"$sbindir" = x'${exec_prefix}/sbin'; then
  232. sbindir="$libexecdir"
  233. fi
  234. if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
  235. libexecdir="/usr/local/libexec/nagios"
  236. fi
  237. fi
  238. elif test $opsys = "bsd"; then
  239. if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
  240. libexecdir=${exec_prefix}/libexec/nagios;
  241. fi
  242. elif test x"$libexecdir" = x'${exec_prefix}/lib'; then
  243. libexecdir=${libexecdir}/nagios;
  244. elif test x"$libexecdir" = x'${exec_prefix}/libexec'; then
  245. libexecdir=${exec_prefix}/lib/nagios;
  246. fi
  247. fi
  248. if test x"$exec_prefix" = "xNONE"; then exec_prefix=${prefix}; fi
  249. tmpfilesd=${tmpfilesd="/usr/lib/tmpfiles.d"}
  250. if test ! -d "$tmpfilesd"; then
  251. tmpfilesd="N/A"
  252. else
  253. tmpfilesd="$tmpfilesd/$INIT_PROG.conf"
  254. fi
  255. subsyslockdir=${subsyslockdir="/var/lock/subsys"}
  256. if test ! -d "$subsyslockdir"; then
  257. subsyslockdir="N/A"
  258. subsyslockfile="N/A"
  259. else
  260. subsyslockfile="$subsyslockdir/$INIT_PROG"
  261. fi
  262. if test "$need_loc" = no; then
  263. localedir="N/A"
  264. fi
  265. if test $install_method = "default" ; then
  266. #
  267. # Do the default setup
  268. #
  269. sbindir=${bindir}
  270. datadir=${datadir="$datarootdir"}
  271. if test $need_web = yes; then
  272. webdir=${webdir="$datadir"}
  273. else
  274. webdir="N/A"
  275. fi
  276. if test $opsys = "unix"; then
  277. sysconfdir=${sysconfdir="/etc/opt"}
  278. fi
  279. pkgsysconfdir=${pkgsysconfdir="$sysconfdir"}
  280. if test $need_etc_subdir = yes; then
  281. objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
  282. else
  283. objsysconfdir="N/A"
  284. fi
  285. privatesysconfdir=${privatesysconfdir="$pkgsysconfdir"}
  286. logdir=${logdir="$localstatedir"}
  287. piddir=${piddir="$localstatedir"}
  288. if test "$need_pipe" = yes; then
  289. pipedir=${pipedir="$localstatedir/rw"}
  290. else
  291. pipedir="N/A"
  292. fi
  293. if test "$need_pls_dir" = yes; then
  294. pkglocalstatedir=${pkglocalstatedir="$localstatedir"}
  295. else
  296. pkglocalstatedir="N/A"
  297. fi
  298. if test "$need_spl" = yes; then
  299. spooldir=${spooldir="$localstatedir/var"}
  300. else
  301. spooldir="N/A"
  302. fi
  303. if test $need_brk = yes; then
  304. brokersdir=${brokersdir="$bindir"}
  305. else
  306. brokersdir="N/A"
  307. fi
  308. if test $need_plg = yes; then
  309. pluginsdir=${pluginsdir="$libexecdir"}
  310. else
  311. pluginsdir="N/A"
  312. fi
  313. if test $need_cgi = yes; then
  314. cgibindir=${cgibindir="$prefix/sbin"}
  315. else
  316. cgibindir="N/A"
  317. fi
  318. elif test $opsys = "linux"; then
  319. #
  320. # Linux "Standard" install
  321. #
  322. install_method="$install_method : FHS"
  323. datadir=${datadir="$datarootdir/nagios"}
  324. if test $need_web = yes; then
  325. webdir=${webdir="$datadir/html"}
  326. else
  327. webdir="N/A"
  328. fi
  329. sysconfdir=${sysconfdir="/etc"}
  330. pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
  331. if test $need_etc_subdir = yes; then
  332. objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
  333. else
  334. objsysconfdir="N/A"
  335. fi
  336. privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
  337. if test $need_log_subdir = yes; then
  338. logdir=${logdir="$localstatedir/log/$INIT_PROG"}
  339. else
  340. logdir=${logdir="$localstatedir/log"}
  341. fi
  342. piddir=${piddir="$localstatedir/run/${INIT_PROG}"}
  343. if test "$need_pipe" = yes; then
  344. pipedir=${pipedir="$localstatedir/run/${INIT_PROG}"}
  345. else
  346. pipedir="N/A"
  347. fi
  348. if test "$need_pls_dir" = yes; then
  349. pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$INIT_PROG"}
  350. else
  351. pkglocalstatedir="N/A"
  352. fi
  353. if test "$need_spl" = yes; then
  354. spooldir=${spooldir="$localstatedir/spool/$INIT_PROG"}
  355. else
  356. spooldir="N/A"
  357. fi
  358. if test $need_brk = yes; then
  359. brokersdir=${brokersdir="$libexecdir/brokers"}
  360. else
  361. brokersdir="N/A"
  362. fi
  363. if test $need_plg = yes; then
  364. pluginsdir=${pluginsdir="$libexecdir/plugins"}
  365. else
  366. pluginsdir="N/A"
  367. fi
  368. if test $need_cgi = yes; then
  369. cgibindir=${cgibindir="$libexecdir/cgi-bin"}
  370. else
  371. cgibindir="N/A"
  372. fi
  373. elif test $opsys = "unix"; then
  374. #
  375. # "Standard" Unix install
  376. #
  377. install_method="$install_method : Unix Standard"
  378. if test $dist_type = osx; then
  379. install_method="$install_method : OS X Standard"
  380. sbindir=${sbindir="/usr/local/libexec"}
  381. fi
  382. datadir=${datadir="$datarootdir/nagios"}
  383. if test $need_web = yes; then
  384. webdir=${webdir="$datadir/html"}
  385. else
  386. webdir="N/A"
  387. fi
  388. if test $dist_type = osx; then
  389. sysconfdir=${sysconfdir="/private/etc"}
  390. else
  391. sysconfdir=${sysconfdir="/etc"}
  392. fi
  393. pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
  394. if test $need_etc_subdir = yes; then
  395. objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
  396. else
  397. objsysconfdir="N/A"
  398. fi
  399. privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
  400. if test "$need_pls_dir" = yes; then
  401. pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$INIT_PROG"}
  402. else
  403. pkglocalstatedir="N/A"
  404. fi
  405. if test "$need_loc" = yes; then
  406. localedir=${localedir="/usr/local/share/locale/<lang>/LC_MESSAGES/nagios-plugins.mo"}
  407. fi
  408. if test "$need_spl" = yes; then
  409. spooldir=${spooldir="$localstatedir/spool/$INIT_PROG"}
  410. else
  411. spooldir="N/A"
  412. fi
  413. if test $need_brk = yes; then
  414. brokersdir=${brokersdir="$libexecdir/brokers"}
  415. else
  416. brokersdir="N/A"
  417. fi
  418. if test $need_plg = yes; then
  419. pluginsdir=${pluginsdir="$libexecdir/plugins"}
  420. else
  421. pluginsdir="N/A"
  422. fi
  423. if test $need_cgi = yes; then
  424. cgibindir=${cgibindir="$libexecdir/cgi-bin"}
  425. else
  426. cgibindir="N/A"
  427. fi
  428. AS_CASE([$dist_type],
  429. [*hp-ux*],
  430. piddir=${piddir="$pkgsysconfdir"}
  431. pipedir=${pipedir="$pkglocalstatedir"}
  432. logdir=${logdir="$pkglocalstatedir/log"},
  433. [*],
  434. piddir=${piddir="$localstatedir/run/${INIT_PROG}"}
  435. if test "$need_pipe" = yes; then
  436. pipedir=${pipedir="$localstatedir/run/${INIT_PROG}"}
  437. else
  438. pipedir="N/A"
  439. fi
  440. if test $need_log_subdir = yes; then
  441. logdir=${logdir="$localstatedir/log/$INIT_PROG"}
  442. else
  443. logdir=${logdir="$localstatedir/log"}
  444. fi
  445. )
  446. elif test $opsys = "bsd"; then
  447. #
  448. # "Standard" BSD install
  449. #
  450. install_method="$install_method : BSD"
  451. if test $dist_type = freebsd -o $dist_type = openbsd; then
  452. prefix=${prefix="/usr/local"}
  453. exec_prefix=${exec_prefix="/usr/local"}
  454. if test $dist_type = freebsd; then
  455. install_method="$install_method : FreeBSD"
  456. else
  457. install_method="$install_method : OpenBSD"
  458. fi
  459. elif test $dist_type = netbsd; then
  460. prefix=${prefix="/usr/pkg"}
  461. exec_prefix=${exec_prefix="/usr/pkg"}
  462. install_method="$install_method : NetBSD"
  463. fi
  464. datadir=${datadir="$datarootdir/nagios"}
  465. if test $need_web = yes -o $need_cgi = yes; then
  466. if test $dist_type = freebsd; then
  467. webdir=${webdir="$prefix/www/nagios"}
  468. elif test $dist_type = netbsd; then
  469. webdir=${webdir="$prefix/share/nagios"}
  470. elif test $dist_type = openbsd; then
  471. webdir=${webdir="/var/www/nagios"}
  472. fi
  473. else
  474. webdir="N/A"
  475. fi
  476. if test $dist_type = freebsd; then
  477. sysconfdir=${sysconfdir="/usr/local/etc"}
  478. else
  479. sysconfdir=${sysconfdir="/etc"}
  480. fi
  481. pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
  482. if test $need_etc_subdir = yes; then
  483. objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
  484. else
  485. objsysconfdir="N/A"
  486. fi
  487. privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
  488. if test "$need_pls_dir" = yes; then
  489. pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$INIT_PROG"}
  490. else
  491. pkglocalstatedir="N/A"
  492. fi
  493. if test "$need_loc" = yes; then
  494. localedir=${localedir="/usr/local/share/locale/<lang>/LC_MESSAGES/nagios-plugins.mo"}
  495. fi
  496. if test "$need_spl" = yes; then
  497. spooldir=${spooldir="$localstatedir/spool/$INIT_PROG"}
  498. else
  499. spooldir="N/A"
  500. fi
  501. if test $need_brk = yes; then
  502. brokersdir=${brokersdir="$libexecdir/brokers"}
  503. else
  504. brokersdir="N/A"
  505. fi
  506. if test $need_plg = yes; then
  507. pluginsdir=${pluginsdir="$libexecdir/plugins"}
  508. else
  509. pluginsdir="N/A"
  510. fi
  511. if test $need_cgi = yes; then
  512. if test $dist_type = freebsd; then
  513. cgibindir=${cgibindir="$webdir/cgi-bin"}
  514. elif test $dist_type = netbsd; then
  515. cgibindir=${pluginsdir="$libexecdir/cgi-bin"}
  516. elif test $dist_type = openbsd; then
  517. cgibindir=${pluginsdir="/var/www/cgi-bin/nagios"}
  518. fi
  519. else
  520. cgibindir="N/A"
  521. fi
  522. piddir=${piddir="$localstatedir/run/${INIT_PROG}"}
  523. if test "$need_pipe" = yes; then
  524. pipedir=${pipedir="$localstatedir/run/${INIT_PROG}"}
  525. else
  526. pipedir="N/A"
  527. fi
  528. if test $need_log_subdir = yes; then
  529. logdir=${logdir="$localstatedir/log/$INIT_PROG"}
  530. else
  531. logdir=${logdir="$localstatedir/log"}
  532. fi
  533. else
  534. #
  535. # Unknown install
  536. #
  537. install_method="unknown"
  538. webdir=unknown
  539. pkgsysconfdir=unknown
  540. objsysconfdir=unknown
  541. privatesysconfdir=unknown
  542. logdir=unknown
  543. piddir=unknown
  544. pipedir=unknown
  545. pkglocalstatedir=unknown
  546. spooldir=unknown
  547. brokersdir=unknown
  548. pluginsdir=unknown
  549. cgibindir=unknown
  550. fi
  551. eval prefix=$prefix
  552. eval exec_prefix=$exec_prefix
  553. eval bindir=$bindir
  554. eval sbindir=$sbindir
  555. eval datarootdir=$datarootdir
  556. eval datadir=$datadir
  557. eval libexecdir=$libexecdir
  558. eval brokersdir=$brokersdir
  559. eval pluginsdir=$pluginsdir
  560. eval cgibindir=$cgibindir
  561. eval localstatedir=$localstatedir
  562. eval pkglocalstatedir=$pkglocalstatedir
  563. eval webdir=$webdir
  564. eval localedir=$localedir
  565. eval sysconfdir=$sysconfdir
  566. eval pkgsysconfdir=$pkgsysconfdir
  567. eval logdir=$logdir
  568. eval piddir=$piddir
  569. #
  570. # Init scripts/files
  571. #
  572. AS_CASE([$init_type],
  573. [sysv],
  574. if test $dist_type = "hp-ux"; then
  575. initdir=${initdir="/sbin/init.d"}
  576. else
  577. initdir=${initdir="/etc/init.d"}
  578. fi
  579. initname=${initname="$INIT_PROG"}
  580. initconfdir=${initconfdir="/etc/conf.d"}
  581. initconf=${initconf="$initconfdir/$INIT_PROG"},
  582. [systemd],
  583. if test $dist_type = "debian"; then
  584. initdir=${initdir="/lib/systemd/system"}
  585. else
  586. initdir=${initdir="/usr/lib/systemd/system"}
  587. fi
  588. initname=${initname="$INIT_PROG.service"},
  589. [bsd],
  590. if test $dist_type = "aix"; then
  591. initdir=${initdir="/sbin/rc.d/init.d"}
  592. initname=${initname="$INIT_PROG"}
  593. else
  594. initdir=${initdir="/etc/rc.d"}
  595. initname=${initname="rc.$INIT_PROG"}
  596. fi,
  597. [newbsd],
  598. initdir=${initdir="/etc/rc.d"}
  599. initname=${initname="$INIT_PROG"},
  600. [gentoo],
  601. initdir=${initdir="/etc/init.d"}
  602. initname=${initname="$INIT_PROG"}
  603. initconfdir=${initconfdir="/etc/init.d"}
  604. initconf=${initconf="$initconfdir/$INIT_PROG"},
  605. [openrc],
  606. initdir=${initdir="/etc/init.d"}
  607. initname=${initname="$INIT_PROG"}
  608. initconfdir=${initconfdir="/etc/conf.d"}
  609. initconf=${initconf="$initconfdir/$INIT_PROG"},
  610. [smf*],
  611. if test $init_type = smf10; then
  612. initdir=${initdir="/var/svc/manifest/network/nagios"}
  613. else
  614. initdir=${initdir="/lib/svc/manifest/network/nagios"}
  615. fi
  616. initname=${initname="$INIT_PROG.xml"}
  617. initconfdir=unknown
  618. initconf=unknown,
  619. [upstart],
  620. initdir=${initdir="/etc/init"}
  621. initname=${initname="$INIT_PROG.conf"}
  622. initconfdir=${initconfdir="/etc/default"}
  623. initconf=${initconf="$initconfdir/$INIT_PROG"},
  624. [launchd],
  625. initdir=${initdir="/Library/LaunchDaemons"}
  626. initname=${initname="org.nagios.$INIT_PROG.plist"},
  627. # initconfdir=${initconfdir="/private/etc"}
  628. # initconf=${initconf="$initconfdir/$INIT_PROG"},
  629. [*],
  630. initdir=unknown
  631. initname=unknown)
  632. #
  633. # Inetd (per connection) scripts/files
  634. #
  635. AS_CASE([$inetd_type],
  636. [inetd*],
  637. inetddir=${inetddir="/etc"}
  638. inetdname=${inetdname="inetd.conf"},
  639. [xinetd],
  640. inetddir=${inetddir="/etc/xinetd.d"}
  641. inetdname=${inetdname="$INIT_PROG"},
  642. [systemd],
  643. if test $dist_type = "debian"; then
  644. inetddir=${inetddir="/lib/systemd/system"}
  645. else
  646. inetddir=${inetddir="/usr/lib/systemd/system"}
  647. fi
  648. netdname=${inetdname="$INIT_PROG.socket"},
  649. [smf*],
  650. if test $init_type = smf10; then
  651. inetddir=${inetddir="/var/svc/manifest/network/nagios"}
  652. else
  653. inetddir=${inetddir="/lib/svc/manifest/network/nagios"}
  654. fi
  655. inetdname=${inetdname="$INIT_PROG.xml"},
  656. # [upstart],
  657. # inetddir=${inetddir="/etc/init.d"}
  658. # inetdname=${inetdname="$INIT_PROG"},
  659. [launchd],
  660. inetddir=${inetddir="/Library/LaunchDaemons"}
  661. inetdname=${inetdname="org.nagios.$INIT_PROG.plist"},
  662. [*],
  663. inetddir=${inetddir="unknown"}
  664. inetdname=${inetdname="unknown"})
  665. AC_MSG_RESULT($install_method)
  666. ])