ax_nagios_get_paths 19 KB

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