From cda490e1fc19904d015d8d5853af731d3cd983ea Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 30 Mar 2009 00:34:00 +0200 Subject: Restructured ./configure and improved the path setup Also added install rules to XSLT files --- configure | 80 +++++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 18 deletions(-) (limited to 'configure') diff --git a/configure b/configure index b54774c..758db91 100755 --- a/configure +++ b/configure @@ -1,26 +1,47 @@ #!/bin/sh -XSLTPATH="/usr/share/eurephia/xslt" +PREFIX="/usr/local" +BINDIR="${PREFIX}/bin" +BINDIR_SET=0 +PLUGINDIR="${PREFIX}/lib/eurephia" +PLUGINDIR_SET=0 +XSLTPATH="${PREFIX}/share/eurephia/xslt" +XSLTPATH_SET=0 EUREPHIADM_XSLT="${XSLTPATH}/eurephiadm" EUREPHIADM_XSLT_SET=0 +SQLITE3PREFIX="/etc/openvpn" + usage() { cat < -- Root directory of installation - (default: /etc/openvpn/eurephia) + (default: ${PREFIX}) + --bin-dir -- Directory where to place binaries + (default: ${BINDIR}) --xslt-path | -X -- Default XSLT path - (default: /usr/share/eurephia/xslt) + (default: ${XSLTPATH}) + + ** Debug options --debug | -D -- Enable verbose debug logging --show-secrets | -S -- Log passwords as clear text in log files | (only available when debug is enabled) + + ** Plug-in options --plug-in | -p -- Build the eurephia plug-in for OpenVPN + --plug-in-dir | -P -- Destination path for the plug-ins and other modules + (default: ${PLUGINDIR}) --openvpn-src | -s -- OpenVPN source directory (needed when building plug-in) --fw-iptables | -- Build iptables firewall module + + ** Database options --db-sqlite3 | -- Build SQLite3 database module - --sqlite3-prefix | -sp -- Root directory of SQLite3 eurephia database - (default: /etc/openvpn) + --sqlite3-path | -sp -- Root directory of SQLite3 eurephia database file + (default: ${SQLITE3PREFIX}) + ** Administration utility options --eurephiadm | -A -- Build command line admin utility --eurephiadm-fw -- Include the firewall info even without any firewall interface being built @@ -34,8 +55,6 @@ DB="" FW="" ADMIN=""; OPENVPN_SRC_DIR="" -PREFIX="/etc/openvpn/eurephia" -SQLITE3PREFIX="/etc/openvpn" PLUGIN="" while [ ! -z "$1" ]; do @@ -46,10 +65,26 @@ while [ ! -z "$1" ]; do ;; --prefix) PREFIX="$2"; - shift; + shift + if [ "${BINDIR_SET}" = "0" ]; then + BINDIR="${PREFIX}/bin"; + fi + if [ "${PLUGINDIR_SET}" = "0" ]; then + PLUGINDIR="${PREFIX}/lib/eurephia" + fi + if [ "${XSLTPATH_SET}" = "0" ]; then + XSLTPATH="${PREFIX}/share/eurephia/xslt" + if [ "${EUREPHIADM_XSLT_SET}" = "0" ]; then + EUREPHIADM_XSLT="${XSLTPATH}/eurephiadm" + fi + fi + ;; + --bin-dir) + BINDIR="$2" + BINDIR_SET=1 + shift ;; -X|--xslt-path) - PARAMS="${PARAMS} -DXSLTROOT:STRING=$2" XSLTPATH="$2" if [ "${EUREPHIADM_XSLT_SET}" = "0" ]; then EUREPHIADM_XSLT="${XSLTPATH}/eurephiadm" @@ -68,6 +103,11 @@ while [ ! -z "$1" ]; do PARAMS="${PARAMS} -DPLUGIN=ON" PLUGIN="eurephia-auth" ;; + -P|--plug-in-dir) + PLUGINDIR="$2" + PLUGINDIR_SET=1 + shift + ;; -s|--openvpn-src) OPENVPN_SRC_DIR="$2" PARAMS="${PARAMS} -DOPENVPN_SRC:STRING=$2" @@ -81,7 +121,7 @@ while [ ! -z "$1" ]; do PARAMS="${PARAMS} -DSQLITE3=ON" DB="SQLite3 " ;; - --sp|--sqlite3-prefix) + --sp|--sqlite3-path) SQLITE3PREFIX="$2" shift ;; @@ -93,8 +133,7 @@ while [ ! -z "$1" ]; do PARAMS="${PARAMS} -DFIREWALL=ON" ;; --eurephiadm-xslt) - PARAMS="${PARAMS} -DEUREPHIADM_XSLT_PATH:STRING=$2" - EUREPHIADM_XSLT="$2" + EUREPHIADM_XSLT="$2" EUREPHIADM_XSLT_SET=1 shift ;; @@ -126,7 +165,12 @@ if [ ${DB} = "SQLite3" ]; then fi rm -f CMakeCache.txt -cmake . ${PARAMS} -DPREFIX:STRING=${PREFIX} +cmake . ${PARAMS} -DPREFIX:STRING=${PREFIX} -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} \ + -DPLUGINDIR:STRING=${PLUGINDIR} -DBINDIR:STRING=${BINDIR} \ + -DEUREPHIADM_XSLT_PATH:STRING=${EUREPHIADM_XSLT} -DXSLTROOT:STRING=${XSLTPATH} + + +echo $PARAMS ec=$? if [ $ec = 0 ]; then echo @@ -139,15 +183,15 @@ if [ $ec = 0 ]; then echo " Admin tools: ${ADMIN:-"None"}" echo echo " Install prefix: ${PREFIX}" - if [ ${DB} = "SQLite3" ]; then - echo " SQLite3 database path: ${SQLITE3PREFIX}" - fi - + echo " Binaries dir: ${BINDIR}" + echo " Plug-in path: ${PLUGINDIR}" if [ ! -z "${ADMIN}" ]; then - echo "" echo " XSLT base path: ${XSLTPATH}" echo " eurephiadm XSLT path: ${EUREPHIADM_XSLT}" fi + if [ ${DB} = "SQLite3" ]; then + echo " SQLite3 database path: ${SQLITE3PREFIX}" + fi echo echo -- cgit