summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rwxr-xr-xconfigure32
-rw-r--r--database/sqlite/CMakeLists.txt7
-rw-r--r--plugin/CMakeLists.txt1
-rw-r--r--plugin/firewall/iptables/CMakeLists.txt1
5 files changed, 39 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18d1cfa..7c74924 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,8 +4,10 @@ cmake_minimum_required(VERSION 2.6)
OPTION(DEBUG "Add more verbose debug information" OFF)
OPTION(SHOW_SECRETS "Show passwords as clear text in logs." OFF)
OPTION(SQLITE3 "Build database driver for SQLite3" OFF)
-SET(OPNVPN_SRC "" CACHE STRING "Path to OpenVPN source code")
+SET(OPENVPN_SRC "" CACHE STRING "Path to OpenVPN source code")
+SET(PREFIX "/etc/openvpn/eurephia" CACHE STRING "Install prefix for eurephia")
+SET(CMAKE_INSTALL_PREFIX ${PREFIX})
IF(SQLITE3)
message(STATUS "Will build database interface for SQLite")
SET(subdirs ${subdirs} database/sqlite)
diff --git a/configure b/configure
index c365363..0c9f327 100755
--- a/configure
+++ b/configure
@@ -5,13 +5,16 @@ usage() {
configure help for eurephia
--help | -h -- This help screen
+ --prefix <path> | -p <path> -- Root directory of installation
+ (default: /etc/openvpn/eurephia)
--openvpn-src <path> | -s <path> -- OpenVPN source directory (needed for building)
--debug | -D -- Enable verbose debug logging
--show-secrets | -S -- Log passwords as clear text in log files
| (only available when debug is enabled)
--fw-iptables | -- Build iptables firewall module
--db-sqlite3 | -- Build SQLite3 database module
-
+ --sqlite3-prefix | -sp -- Root directory of SQLite3 eurephia database
+ (default: /etc/openvpn)
EOF
}
@@ -19,12 +22,18 @@ PARAMS=""
DB=""
FW=""
OPENVPN_SRC_DIR=""
+PREFIX="/etc/openvpn/eurephia"
+SQLITE3PREFIX="/etc/openvpn"
while [ ! -z "$1" ]; do
case $1 in
-h|--help)
usage
exit 0
;;
+ -p|--prefix)
+ PREFIX="$2";
+ shift;
+ ;;
-s|--openvpn-src)
OPENVPN_SRC_DIR="$2"
PARAMS="${PARAMS} -DOPENVPN_SRC:STRING=$2"
@@ -46,6 +55,10 @@ while [ ! -z "$1" ]; do
PARAMS="${PARAMS} -DSQLITE3=ON"
DB="SQLite3 "
;;
+ --sp|--sqlite3-prefix)
+ SQLITE3PREFIX="$2"
+ shift
+ ;;
*)
echo "Unkown option: $1"
exit 2
@@ -69,8 +82,12 @@ if [ -z "${DB}" ]; then
exit 1;
fi
+if [ ${DB} = "SQLite3" ]; then
+ PARAMS="${PARAMS} -DSQLITE3PREFIX:STIRNG=${SQLITE3PREFIX}"
+fi
+
rm -f CMakeCache.txt
-cmake . ${PARAMS}
+cmake . ${PARAMS} -DPREFIX:STRING=${PREFIX}
ec=$?
if [ $ec = 0 ]; then
cat >> Makefile <<EOF
@@ -78,6 +95,7 @@ dist-clean : clean
find -type d -name "CMakeFiles" | xargs rm -rf
find -type f -name "cmake_install.cmake" | xargs rm -rf
find -type f -name CMakeCache.txt | xargs rm -rf
+ find -type f -name install_manifest.txt | xargs rm -rf
find -type f -name Makefile | xargs rm -rf
find -type f -name "*~" | xargs rm -f
rm -f CMakeCache.txt
@@ -88,8 +106,14 @@ EOF
echo
echo "eurephia will be built with support for: "
echo
- echo " Database: ${DB}"
- echo " Firewall: ${FW:-"None"}"
+ echo " Database: ${DB}"
+ echo " Firewall: ${FW:-"None"}"
+ echo
+ echo " Install prefix: ${PREFIX}"
+ if [ ${DB} = "SQLite3" ]; then
+ echo " SQLite3 database path: ${SQLITE3PREFIX}"
+ fi
+ echo
echo
if [ "$DEBUG_WARN" = 1 ]; then
echo
diff --git a/database/sqlite/CMakeLists.txt b/database/sqlite/CMakeLists.txt
index 6bdd5e0..be869da 100644
--- a/database/sqlite/CMakeLists.txt
+++ b/database/sqlite/CMakeLists.txt
@@ -1,5 +1,7 @@
PROJECT(eurephiadb-sqlite C)
cmake_minimum_required(VERSION 2.6)
+SET(SQLITE3PREFIX "/etc/openvpn" CACHE STRING "Install prefix for the eurephia SQLite3 database")
+
SET(eurephiadb_sqlite_SRC
sqlite.c
eurephiadb-sqlite.c
@@ -38,4 +40,7 @@ TARGET_LINK_LIBRARIES(eurephiadb-sqlite sqlite3)
SET_TARGET_PROPERTIES(eurephiadb-sqlite PROPERTIES OUTPUT_NAME eurephiadb-sqlite PREFIX "")
SET_SOURCE_FILES_PROPERTIES(${common_files_SRC} PROPERTIES GENERATED true)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES eurephiadb)
-
+INSTALL(TARGETS eurephiadb-sqlite LIBRARY DESTINATION ${PREFIX})
+IF(SQLITE3BIN)
+ INSTALL(FILES eurephiadb DESTINATION ${SQLITE3PREFIX}/ RENAME eurephiadb-template)
+ENDIF(SQLITE3BIN)
diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt
index d2b922f..de67d1a 100644
--- a/plugin/CMakeLists.txt
+++ b/plugin/CMakeLists.txt
@@ -40,4 +40,5 @@ ADD_LIBRARY(eurephia-auth MODULE ${eurephia_auth_SRC})
TARGET_LINK_LIBRARIES(eurephia-auth dl pthread rt crypto)
SET_TARGET_PROPERTIES(eurephia-auth PROPERTIES OUTPUT_NAME eurephia-auth PREFIX "")
+INSTALL(TARGETS eurephia-auth LIBRARY DESTINATION ${PREFIX})
SUBDIRS(${subdirs})
diff --git a/plugin/firewall/iptables/CMakeLists.txt b/plugin/firewall/iptables/CMakeLists.txt
index 0f77a1b..103eea9 100644
--- a/plugin/firewall/iptables/CMakeLists.txt
+++ b/plugin/firewall/iptables/CMakeLists.txt
@@ -10,3 +10,4 @@ INCLUDE_DIRECTORIES(BEFORE ../..)
ADD_LIBRARY(efw_iptables MODULE ${efw_ipt_SRC})
TARGET_LINK_LIBRARIES(efw_iptables pthread rt gcc_s)
SET_TARGET_PROPERTIES(efw_iptables PROPERTIES PREFIX "")
+INSTALL(TARGETS efw_iptables LIBRARY DESTINATION ${PREFIX})