From 5b78578939fdada743c1106ac5881a4afab3af11 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 14 Jan 2017 17:19:08 +0100 Subject: [PATCH] github issue #626: installing in non-standard paths --- s/cmake-init | 3 ++- s/install | 2 -- s/setup | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/s/cmake-init b/s/cmake-init index ea94afb7c..84a1d9cdb 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -35,12 +35,13 @@ if [ -d $HOME/usr ]; then PREFIX_PATH=$HOME/usr:$HOME/usr/local:$PREFIX_PATH fi +DEST=$(dirname $ROOT)/server ARGS=" -DCMAKE_MODULE_PATH=$ROOT/cmake/Modules \ -DCMAKE_BUILD_TYPE=$BUILD \ -DCMAKE_LIBRARY_PATH=$LIBRARY_PATH \ -DCMAKE_INCLUDE_PATH=$INCLUDE_PATH \ -DCMAKE_PREFIX_PATH=$PREFIX_PATH \ - -DCMAKE_INSTALL_PREFIX=$HOME/eressea/server" + -DCMAKE_INSTALL_PREFIX=$DEST" git submodule update --init diff --git a/s/install b/s/install index 416d07f9a..962961063 100755 --- a/s/install +++ b/s/install @@ -8,8 +8,6 @@ while [ ! -d $ROOT/.git ]; do fi done -DEST=$(dirname $ROOT)/server - [ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" [ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" [ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" diff --git a/s/setup b/s/setup index 0839d5b8f..fc5fb9874 100755 --- a/s/setup +++ b/s/setup @@ -1,5 +1,15 @@ #!/bin/bash +ROOT=$(pwd) +while [ ! -d $ROOT/.git ]; do + ROOT=$(dirname $ROOT) + if [ "/" = "$ROOT" ]; then + echo "could not find root, are you in the git repository?" + exit + fi +done +ERESSEA=$(dirname $ROOT) + function abort() { echo $1 [ -z $2 ] && exit -1 @@ -37,7 +47,6 @@ while getopts :d:g:r:s:hfn o; do done [ $game -gt 0 ] || abort "must use a positive integer for game id" -[ -d $ERESSEA ] || abort "invalid or missing env variable ERESSEA ($ERESSEA)" [ -z $SOURCE ] && SOURCE=$ERESSEA/$src [ -d $SOURCE ] || abort "invalid source directory $SOURCE" [ -z $rules ] && rules=e$game @@ -46,7 +55,8 @@ done [ -e $TOOLS ] || TOOLS=$SOURCE/bin [ -z $INIFILE ] && INIFILE=$TOOLS/inifile [ -e $INIFILE ] || INIFILE=$TOOLS/iniparser/inifile -#[ -e $INIFILE ] || abort "tool is not installed: $INIFILE" + +[ -e $SOURCE/conf/$rules/config.xml ] || abort "cannot find conf/$rules/config.xml" cd $ERESSEA if [ -d $dir ] ; then