diff options
Diffstat (limited to 'portal-gui/configure.ac')
-rw-r--r-- | portal-gui/configure.ac | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/portal-gui/configure.ac b/portal-gui/configure.ac new file mode 100644 index 00000000..fc5cb103 --- /dev/null +++ b/portal-gui/configure.ac @@ -0,0 +1,59 @@ +# $Id$ + +AC_INIT(portal-gui, 1.0) + +AC_ARG_WITH([python], + [AS_HELP_STRING([--with-python=PATH], [specify location of the python interpreter to use])], + [], + [with_python=detect]) + +AC_ARG_WITH([myrpki], + [AS_HELP_STRING([--with-myrpki=DIR], [specify the directory containing the myrpki.py command line tool])], + [], + [with_myrpki=no]) + +AS_IF([test "x$with_python" = "xdetect"], + [AC_CHECK_PROGS(PYTHON, [python2.6 python2.5 python], [none])], + [PYTHON=$with_python]) +AS_IF([test "x$PYTHON" = "xnone"], + [AC_MSG_ERROR([unable to find python interpreter, use --with-python])]) + +AS_IF([test "x$with_myrpki" = "xno"], + [AC_MSG_ERROR([must specify the --with-myrpki option])]) +MYRPKIDIR=$with_myrpki +MYRPKI_TOOL=$with_myrpki/myrpki.py +AC_MSG_RESULT([Full path to rpki Python module is $MYRPKIDIR]) +AC_MSG_RESULT([Full path to the myrpki.py tool is $MYRPKI_TOOL]) +AC_SUBST(MYRPKIDIR) +AC_SUBST(MYRPKI_TOOL) + +# this is a bit of nastiness to expand $datarootdir for subsitution into +# the python scripts since we can't expand $prefix inline +if test x$prefix = xNONE; then + prefix=$ac_default_prefix +fi +eval 'exp_datarootdir='$datarootdir +AC_SUBST(MEDIADIR, "$exp_datarootdir/$PACKAGE_NAME/media") +AC_SUBST(TEMPLATEDIR, "$exp_datarootdir/$PACKAGE_NAME/rpkigui/templates") + +if test "x$DATABASE_PATH" = x; then + eval 'exp_localstatedir='$localstatedir + DATABASE_PATH="$exp_localstatedir/$PACKAGE_NAME/rpkiop" +fi +AC_SUBST(DATABASE_PATH) +AC_MSG_RESULT([Full path to the portal-gui database is $DATABASE_PATH]) + +if test "x$CONFDIR" = x; then + AC_MSG_ERROR('Must specify the toplevel directory containing your resource handle files with CONFDIR=<DIR>') +fi +AC_MSG_RESULT([Toplevel resource directory is $CONFDIR]) +AC_SUBST(CONFDIR) + +# source: http://blog.leosoto.com/2008/04/django-secretkey-generation.html +AC_SUBST(SECRET_KEY, `$PYTHON -c 'import random; print "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])'`) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([rpkigui/settings.py rpkigui/urls.py scripts/helper]) +AC_CONFIG_FILES([scripts/runserver]) + +AC_OUTPUT |