1dnl $Id: webmin.m4,v 1.1 2009-10-22 08:36:30 franklahm Exp $
2dnl Autoconf macro to install webmin + netatalk webmin module
3
4AC_DEFUN([NETATALK_WEBMIN],[
5    AC_ARG_WITH(webmin,
6        [  --with-webmin=PATH      path where webmin is installed [[$PKGCONFDIR/webmin]]],
7        if test "x$withval" = "xyes"; then
8            webminpath="$PKGCONFDIR"
9        elif test "x$withval" = "xno"; then
10            webminpath=""
11        else
12            webminpath="$withval"
13        fi
14    )
15
16    AC_ARG_WITH(webminuser,
17        [  --with-webminuser=NAME      name for the webmin admin user],
18        if test "x$withval" = "xyes"; then
19            webminuser=""
20        elif test "x$withval" = "xno"; then
21            webminuser=""
22        else
23            webminuser="$withval"
24        fi
25    )
26
27    AC_ARG_WITH(webminversion,
28        [  --with-webminversion=VERSION   Webmin version to fetch from sf.net [[1.490]]],
29        if test "x$withval" = "xyes"; then
30            webminversion="1.490"
31        elif test "x$withval" = "xno"; then
32            webminversions="1.490"
33        else
34            webminversion="$withval"
35        fi
36    )
37
38    AC_ARG_WITH(webminpass,
39        [  --with-webminpass=PASSWORD  password for the webmin admin user],
40        if test "x$withval" = "xyes"; then
41            webminpass=""
42        elif test "x$withval" = "xno"; then
43            webminpass=""
44        else
45            webminpass="$withval"
46        fi
47    )
48
49    AC_ARG_WITH(webminport,
50        [  --with-webminport=PORT  TCP port for webmin],
51        if test "x$withval" = "xyes"; then
52            webminport=""
53        elif test "x$withval" = "xno"; then
54            webminport=""
55        else
56            webminport="$withval"
57        fi
58    )
59
60    AC_MSG_CHECKING([if webmin administration shall be installed])
61    if test "x$webminpath" != "x" &&
62            test "x$webminuser" != "x" &&
63            test "x$webminpass" != "x" &&
64            test "x$webminport" != "x" &&
65            test "x$webminversion" != "x"; then
66        AC_MSG_RESULT([yes])
67        AC_MSG_CHECKING([if neccessary Perl module 'Net::SSLeay' is installed])
68        $ac_cv_path_PERL -e 'use Net::SSLeay' >/dev/null 2>/dev/null
69		if test "$?" != "0" ; then
70            AC_MSG_RESULT([no])
71            webminpath=""
72        else
73            AC_MSG_RESULT([yes])
74            AC_MSG_NOTICE([Installing Webmin in "$webminpath/webmin"])
75        fi
76    else
77        AC_MSG_RESULT([no])
78    fi
79
80    AC_SUBST(WEBMIN_PATH, $webminpath)
81    AC_SUBST(WEBMIN_VERSION, $webminversion)
82    AC_SUBST(WEBMIN_USER, $webminuser)
83    AC_SUBST(WEBMIN_PASS, $webminpass)
84    AC_SUBST(WEBMIN_PORT, $webminport)
85])