updates
[torrus-plus.git] / plugins / siam / configure.ac
blob276672f1afb06d841384de8c54b3469f5f3c21f1
1 #  Copyright (C) 2011  Stanislav Sinyagin
3 #  This program is free software; you can redistribute it and/or modify
4 #  it under the terms of the GNU General Public License as published by
5 #  the Free Software Foundation; either version 2 of the License, or
6 #  (at your option) any later version.
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software
15 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 # Stanislav Sinyagin <ssinyagin@yahoo.com>
20 # SIAM Torrus plugin Autoconf script
22 AC_INIT(tp-siam, 2.01.02dev, ssinyagin@users.sourceforge.net)
23 AC_CONFIG_AUX_DIR(conftools)
24 AC_CANONICAL_HOST
25 AM_INIT_AUTOMAKE(1.9)
27 AC_PATH_PROG(PERL, perl, no)
28 AC_PATH_PROG(SED, sed, no)
31 AC_ARG_ENABLE(pkgonly,
32         [AC_HELP_STRING([--enable-pkgonly],
33                                 [Skip all checking])])
35 perllibdirs="\'\${perllibdir}\'"
37 PERLOPTS=
38 AC_ARG_VAR(PERLINC,  [[] Additional space-separated Perl library paths])
39 if test ! -z "$PERLINC"; then
40    for d in $PERLINC; do
41        PERLOPTS="${PERLOPTS} -I${d}"
42        perllibdirs=${perllibdirs}"\,\'"${d}"\'"
43    done
47 # Check the necessary Perl modules
48 # This is the example of AutoLoader search, which is always in Perl
49 # distribution anyway
51 if test "$enable_pkgonly" != yes; then
52   AC_MSG_CHECKING([environment variables])
53   if test -z "$pkghome" -o -z "$sitedir"; then
54     AC_MSG_ERROR([Missing mandatory environment variables]);
55   else
56     AC_MSG_RESULT([Ok])
57   fi
59   for module in 'YAML' 'SIAM'
60    do
61      AC_MSG_CHECKING([presence of $module])
62      if ${PERL} ${PERLOPTS} -e 'use '$module 2>/dev/null; then
63          AC_MSG_RESULT([Ok])
64      else
65          AC_MSG_ERROR([Perl cannot find $module]);
66      fi
67    done
71 AC_SUBST(perllibdirs, [${perllibdirs}])
74 AC_ARG_VAR(pkghome,   [[PREFIX/torrus] Place for Torrus static files])
75 AC_ARG_VAR(pkgbindir,   [[PKGHOME/bin] Torrus executables])
76 AC_ARG_VAR(cfgdefdir,   [[PKGHOME/conf_defaults] torrus-config.pl and others])
77 AC_ARG_VAR(pkgdocdir, [[PKGHOME/doc] Documentation files])
78 AC_ARG_VAR(exmpdir, [[PKGHOME/examples] Examples])
79 AC_ARG_VAR(perllibdir,  [[PKGHOME/lib] Torrus Perl libraries])
80 AC_ARG_VAR(pluginsdir,   [[PKGHOME/plugins] Plugin configurations])
81 AC_ARG_VAR(plugtorruscfgdir, [[PLUGINSDIR/torrus-config]])
82 AC_ARG_VAR(plugdevdisccfgdir, [[PLUGINSDIR/devdiscover-config]])
83 AC_ARG_VAR(plugwrapperdir, [[PLUGINSDIR/wrapper]])
84 AC_ARG_VAR(scriptsdir, [[PKGHOME/scripts] Script files])
85 AC_ARG_VAR(supdir, [[PKGHOME/sup] Supplementary files])
86 AC_ARG_VAR(webplaindir, [[SUPDIR/webplain] Web interface plain files path])
87 AC_ARG_VAR(webscriptsdir, [[SUPDIR/webscripts] Directory for web scripts])
88 AC_ARG_VAR(tmpldir, [[PKGHOME/templates] Template files])
89 AC_ARG_VAR(tmpluserdir, [[SITEDIR/templates] User-defined Template files])
90 AC_ARG_VAR(distxmldir, [[PKGHOME/xmlconfig] Distribution XML config files])
91 AC_ARG_VAR(sitedir, [[SYSCONFDIR/torrus] Site configuration files])
92 AC_ARG_VAR(siteconfdir, [[SITEDIR/conf] Site configuration files])
93 AC_ARG_VAR(sitexmldir, [[SITEDIR/xmlconfig] Site XML configs])
94 AC_ARG_VAR(logdir, [[/var/log/torrus] Log files])
95 AC_ARG_VAR(piddir, [[/var/run/torrus] PID files])
96 AC_ARG_VAR(varprefix, [[/var/torrus] Common prefix for runtime data])
97 AC_ARG_VAR(cachedir, [[VARPREFIX/cache] Renderer cache])
98 AC_ARG_VAR(dbhome, [[VARPREFIX/db] Berkeley DB files])
99 AC_ARG_VAR(seslockdir, [[VARPREFIX/session_data/lock] Web session locks])
100 AC_ARG_VAR(sesstordir, [[VARPREFIX/session_data/store] Web session storage])
101 AC_ARG_VAR(wrapperdir, [[BINDIR] CLI wrapper])
102 AC_ARG_VAR(defrrddir, [[/srv/torrus/collector_rrd] Default RRD storage path])
106 AC_CONFIG_FILES([Makefile])
107 AC_CONFIG_FILES([substvars.sh],[chmod +x substvars.sh])
109 AC_OUTPUT