ax_nagios_get_paths 20 KB

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