summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbase-install.sh8
-rwxr-xr-xkernlab.sh5
-rwxr-xr-xnginx.sh5
-rwxr-xr-xopenbabel.sh8
-rwxr-xr-xopentox-ruby.sh4
-rwxr-xr-xopentox-webservices.sh4
-rwxr-xr-xredis.sh6
-rwxr-xr-xruby.sh7
-rw-r--r--utils.sh4
9 files changed, 26 insertions, 25 deletions
diff --git a/base-install.sh b/base-install.sh
index f3ed3e8..ac200c6 100755
--- a/base-install.sh
+++ b/base-install.sh
@@ -5,6 +5,10 @@
#
# Your installed packages are safe and will not be updated.
# A Java configuration is created and included in your '~.bashrc'.
+
+source "`pwd`/utils.sh"
+DIR="`pwd`"
+
if [ "$(id -u)" = "0" ]; then
echo "This script must not be run as root" 1>&2
exit 1
@@ -20,8 +24,6 @@ if [ ! -e "$APTITUDE" ]; then
exit 1
fi
-# Dest
-source ./utils.sh
# Pkgs
packs="lsb-release binutils gcc g++ gfortran wget hostname pwgen git-core raptor-utils r-base sun-java6-jdk libssl-dev zlib1g-dev libreadline-dev libmysqlclient-dev libcurl4-openssl-dev libxml2-dev libxslt1-dev libgsl0-dev sun-java6-jdk"
@@ -90,3 +92,5 @@ if [ ! -f $JAVA_CONF ]; then
fi
fi
+cd "$DIR"
+
diff --git a/kernlab.sh b/kernlab.sh
index 73353a6..2716b66 100755
--- a/kernlab.sh
+++ b/kernlab.sh
@@ -4,7 +4,8 @@
# Author: Christoph Helma, Andreas Maunz.
#
-source ./utils.sh
+source "`pwd`/utils.sh"
+DIR="`pwd`"
if [ "$(id -u)" = "0" ]; then
echo "This script must be run as non-root." 1>&2
@@ -29,8 +30,6 @@ LOG="/tmp/`basename $0`-log.txt"
echo "Kernlab ('$LOG')."
-DIR="`pwd`"
-
R_DONE=false
mkdir "$KL_DEST" >/dev/null 2>&1
if [ ! -d "$KL_DEST" ]; then
diff --git a/nginx.sh b/nginx.sh
index 863b405..d049500 100755
--- a/nginx.sh
+++ b/nginx.sh
@@ -4,7 +4,8 @@
# Author: Christoph Helma, Andreas Maunz.
#
-source ./utils.sh
+source "`pwd`./utils.sh"
+DIR="`pwd`"
if [ "$(id -u)" = "0" ]; then
echo "This script must be run as non-root." 1>&2
@@ -23,8 +24,6 @@ LOG="/tmp/`basename $0`-log.txt"
echo
echo "Nginx ('$LOG'):"
-DIR="`pwd`"
-
NGINX_DONE=false
mkdir "$NGINX_DEST" >/dev/null 2>&1
if [ ! -d "$NGINX_DEST" ]; then
diff --git a/openbabel.sh b/openbabel.sh
index 0bcd148..94ff981 100755
--- a/openbabel.sh
+++ b/openbabel.sh
@@ -5,7 +5,8 @@
# Author: Christoph Helma, Andreas Maunz.
#
-source ./utils.sh
+source "`pwd`/utils.sh"
+DIR="`pwd`"
if [ "$(id -u)" = "0" ]; then
echo "This script must be run as non-root." 1>&2
@@ -25,7 +26,6 @@ LOG="/tmp/`basename $0`-log.txt"
echo
echo "Openbabel ('$OB_DEST', '$LOG'):"
-DIR="`pwd`"
mkdir "$OB_DEST" >/dev/null 2>&1
if [ ! -d "$OB_DEST" ]; then
@@ -39,13 +39,13 @@ else
fi
if [ ! $OB_DONE ]; then
- cd /tmp
+ cd "/tmp">>$LOG 2>/dev/null
URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent"
if ! [ -d "/tmp/$OB_VER" ]; then
cmd="$WGET $URI" && run_cmd "$cmd" "Download"
cmd="tar zxf $OB_VER.tar.gz?use_mirror=kent $OB_VER" && run_cmd "$cmd" "Unpack"
fi
- cd "/tmp/$OB_VER"
+ cd "/tmp/$OB_VER">>$LOG 2>/dev/null
cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure"
cmd="make" && run_cmd "$cmd" "Make"
diff --git a/opentox-ruby.sh b/opentox-ruby.sh
index 63fa158..492a167 100755
--- a/opentox-ruby.sh
+++ b/opentox-ruby.sh
@@ -4,7 +4,8 @@
# Author: Christoph Helma, Andreas Maunz.
#
-source ./utils.sh
+source "`pwd`/utils.sh"
+DIR="`pwd`"
if [ "$(id -u)" = "0" ]; then
echo "This script must be run as non-root." 1>&2
@@ -36,7 +37,6 @@ LOG="/tmp/`basename $0`-log.txt"
echo
echo "Opentox-ruby ('$LOG'):"
-DIR="`pwd`"
for mygem in opentox-ruby builder jeweler; do
if ! $GEM list | grep "$mygem" >/dev/null 2>&1; then
diff --git a/opentox-webservices.sh b/opentox-webservices.sh
index 9756c51..1fce812 100755
--- a/opentox-webservices.sh
+++ b/opentox-webservices.sh
@@ -4,7 +4,8 @@
# Author: Christoph Helma, Andreas Maunz.
#
-source ./utils.sh
+source "`pwd`/utils.sh"
+DIR=`pwd`
if [ "$(id -u)" = "0" ]; then
echo "This script must be run as non-root." 1>&2
@@ -28,7 +29,6 @@ LOG="/tmp/`basename $0`-log.txt"
echo "Webservices ('$LOG'):"
-DIR=`pwd`
mkdir -p "$WWW_DEST/opentox" >>$LOG 2>&1
cd "$WWW_DEST/opentox" >>$LOG 2>&1
diff --git a/redis.sh b/redis.sh
index ea85c3b..a6fdc30 100755
--- a/redis.sh
+++ b/redis.sh
@@ -4,7 +4,8 @@
# Author: Christoph Helma, Andreas Maunz.
#
-source ./utils.sh
+source "`pwd`/utils.sh"
+DIR=`pwd`
if [ "$(id -u)" = "0" ]; then
echo "This script must be run as non-root." 1>&2
@@ -23,7 +24,6 @@ LOG="/tmp/`basename $0`-log.txt"
echo "This installs Redis."
echo "Log file is '$LOG'."
-DIR=`pwd`
REDIS_DONE=false
mkdir "$REDIS_DEST" >/dev/null 2>&1
@@ -60,8 +60,6 @@ if ! $REDIS_DONE; then
fi
fi
-cd "$DIR"
-
if [ ! -f $REDIS_CONF ]; then
echo "export PATH=$REDIS_DEST/src:\$PATH" >> "$REDIS_CONF"
echo "Redis configuration has been stored in '$REDIS_CONF'."
diff --git a/ruby.sh b/ruby.sh
index b3cb32d..8c3361a 100755
--- a/ruby.sh
+++ b/ruby.sh
@@ -6,6 +6,9 @@
# Author: Christoph Helma, Andreas Maunz.
#
+source "`pwd`/utils.sh"
+DIR="`pwd`"
+
if [ "$(id -u)" = "0" ]; then
echo "This script must be run as non-root." 1>&2
exit 1
@@ -19,13 +22,11 @@ if [ ! -e "$WGET" ]; then
fi
# Pkg
-source ./utils.sh
LOG="/tmp/`basename $0`-log.txt"
echo
echo "Ruby Enterprise edition ('$RUBY_DEST', '$LOG')."
-DIR="`pwd`"
mkdir "$RUBY_DEST" >/dev/null 2>&1
if [ ! -d "$RUBY_DEST" ]; then
@@ -48,7 +49,6 @@ if [ ! $RUBY_DONE ]; then
cmd="sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install"
fi
-cd "$DIR"
if ! [ -f "$RUBY_CONF" ]; then
@@ -83,3 +83,4 @@ if [ "$PASSENGER_SKIP" != "s" ]; then
fi
+cd "$DIR"
diff --git a/utils.sh b/utils.sh
index 45cdbba..b49e6fc 100644
--- a/utils.sh
+++ b/utils.sh
@@ -32,6 +32,6 @@ abs_path()
esac
}
-source ~/.bashrc
-source .config.sh
+source "$HOME/.bashrc"
+source "`pwd`/config.sh"
check_dest