#!/bin/sh # Installs Opentox Webservice. # Author: Christoph Helma, Andreas Maunz. SELF=$(basename $0 -install) [ "`id -u`" = "0" ] && echo "This script must be run as non-root." 1>&2 && exit 1 # check wd is root of service DIR=`pwd` if echo $DIR | grep "algorithm/bin" >/dev/null 2>&1 ; then cd ..; fi # # # Boot the script # load base config, helper funs, environment OT_CONFIG_DIR="$HOME/.opentox" ! [ -f "$OT_CONFIG_DIR/config/install/config.sh" ] && echo "config.sh not found." 1>&2 && exit 1 || . $OT_CONFIG_DIR/config/install/config.sh ! [ -f "$OT_PREFIX/install/utils.sh" ] && echo "utils.sh not found." 1>&2 && exit 1 || . $OT_PREFIX/install/utils.sh ! [ -f $OT_CONFIG_DIR/opentox-ui.sh ] && echo "opentox-ui.sh not found." 1>&2 && exit 1 || . $OT_CONFIG_DIR/opentox-ui.sh RUBY_DIR="$HOME/.rbenv/versions/$RUBY_NUM_VER" # # # Install LOG="$OT_PREFIX/tmp/`basename $0`.log" check_utils "rbenv find" echo echo "Installation ('$LOG'):" echo if [ "$OT_BRANCH" = "development" ]; then cmd="test -d $OT_PREFIX/opentox-server" && run_cmd "$cmd" "Opentox-server" cmd="test -d $OT_PREFIX/opentox-client" && run_cmd "$cmd" "Opentox-client" fi # log directory for this service [ -d $OT_CONFIG_DIR/config/$SELF ] || cmd="mkdir -p $OT_CONFIG_DIR/config/$SELF" && run_cmd "$cmd" "Config directory" [ "`$RBENV local 2>/dev/null`" = "$RUBY_NUM_VER" ] || install_ruby [ -n "`$FIND $RUBY_DIR -name openbabel.so 2>/dev/null`" ] || install_ob_ruby ( [ -n "`$FIND libfminer/ -name bbrc.so 2>/dev/null`" ] && [ -n "`$FIND libfminer/ -name last.so 2>/dev/null`" ] ) || . ./bin/fminer-install echo install_with_bundler # return to wd cd "$DIR"