summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-03-31 11:56:47 +0200
committerAndreas Maunz <andreas@maunz.de>2011-03-31 11:56:47 +0200
commit312d93bcc322fa5aca38f38cd266569aaf18b621 (patch)
tree670c31f02d166e5fd1fc33162bd401c1284b924a
parentbe4c94b29fc76904b279056b6a0af234e7cf1f4e (diff)
all
-rwxr-xr-xbase-install.sh26
-rwxr-xr-xkernlab.sh19
-rwxr-xr-xnginx.sh9
-rwxr-xr-xopenbabel.sh26
-rwxr-xr-xopentox-ruby.sh19
-rwxr-xr-xopentox-webservices.sh31
-rwxr-xr-xredis.sh6
-rwxr-xr-xruby.sh9
-rw-r--r--utils.sh1
9 files changed, 64 insertions, 82 deletions
diff --git a/base-install.sh b/base-install.sh
index 0f20239..27b895a 100755
--- a/base-install.sh
+++ b/base-install.sh
@@ -3,7 +3,8 @@
# Installs base packages for Ubuntu
# Author: Andreas Maunz
#
-
+# Your installed packages are safe and will not be updated.
+# A Java configuration is created and included in your '~.bashrc'.
if [ "$(id -u)" = "0" ]; then
echo "This script must not be run as root" 1>&2
exit 1
@@ -26,13 +27,9 @@ 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"
-echo "This installs missing base packages for Opentox-ruby on Ubuntu"
-echo "Your installed packages are safe and will not be updated."
-echo "A Java configuration is created and you are given the option to have it included in your '~.bashrc'."
-echo "Press <Return> to continue or <Ctrl+C> to abort."
-read
+echo
+echo "Base Packages:"
-echo "Checking for installed packages: "
pack_arr=""
for p in $packs; do
if $DPKG -s "$p" >/dev/null 2>&1; then
@@ -45,7 +42,7 @@ done
if [ -n "$pack_arr" ]; then
echo
- echo "Checking availablity of missing packages..."
+ echo "Checking availablity:"
echo -n "Updating package indices: "
sudo $APTITUDE update -y >/dev/null 2>&1
sudo $APTITUDE upgrade -y >/dev/null 2>&1
@@ -69,7 +66,10 @@ if [ -n "$pack_fail" ]; then
fi
echo
-echo "Installing missing packages, please wait..."
+if [ -n $pack_arr ]; then
+ echo "Installing missing packages:"
+fi
+
pack_fail=""
for p in $pack_arr; do
echo -n "'$p': "
@@ -87,7 +87,7 @@ if [ -n "$pack_fail" ]; then
fi
echo
-echo "Preparing JAVA..."
+echo "Preparing JAVA:"
if [ ! -f $JAVA_CONF ]; then
if [ ! -d "$JAVA_HOME" ]; then
@@ -102,11 +102,5 @@ if [ ! -f $JAVA_CONF ]; then
if ! grep "$JAVA_CONF" $HOME/.bashrc >/dev/null 2>&1; then
echo "source \"$JAVA_CONF\"" >> $HOME/.bashrc
fi
-
-else
- echo "It seems JAVA is already configured ('$JAVA_CONF' exists)."
fi
-source "$JAVA_CONF"
-echo
-echo "Installation finished."
diff --git a/kernlab.sh b/kernlab.sh
index 86f1503..5426744 100755
--- a/kernlab.sh
+++ b/kernlab.sh
@@ -25,12 +25,9 @@ fi
# Pkg
source ./config.sh
source ./utils.sh
-LOG="/tmp`basename $0`-log.txt"
+LOG="/tmp/`basename $0`-log.txt"
-echo "This installs Kernlab."
-echo "Log file is '$LOG'."
-echo "Press <Return> to continue, or <Ctrl+C> to abort."
-read
+echo "Kernlab ('$LOG')."
DIR="`pwd`"
@@ -41,7 +38,7 @@ if [ ! -d "$KL_DEST" ]; then
exit 1
else
if ! rmdir "$KL_DEST" >/dev/null 2>&1; then # if not empty this will fail
- echo "Install directory '$KL_DEST' is not empty. Skipping kernlab installation..."
+ echo "Install directory '$KL_DEST' not empty. Skipping kernlab installation."
R_DONE=true
else
mkdir "$KL_DEST" >/dev/null 2>&1
@@ -49,10 +46,13 @@ else
fi
+echo
+echo "Installing:"
+
if ! $R_DONE; then
cd /tmp
URI="http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz"
- if ! $WGET -O - "$URI">>$LOG 2>&1; then
+ if ! $WGET "$URI" >>$LOG 2>&1; then
printf "%25s%15s\n" "'Download'" "FAIL"
exit 1
fi
@@ -68,7 +68,7 @@ fi
echo
-echo "Preparing R..."
+echo "Preparing:"
if [ ! -f $KL_CONF ]; then
@@ -82,9 +82,6 @@ if [ ! -f $KL_CONF ]; then
else
echo "It seems R is already configured ('$KL_CONF' exists)."
fi
-source "$KL_CONF"
cd "$DIR"
-echo
-echo "Kernlab Installation finished."
diff --git a/nginx.sh b/nginx.sh
index 0b7d983..6ccf914 100755
--- a/nginx.sh
+++ b/nginx.sh
@@ -20,9 +20,7 @@ source ./config.sh
source ./utils.sh
LOG="/tmp/`basename $0`-log.txt"
-echo "This installs Nginx."
-echo "Press <Return> to continue, or <Ctrl+C> to abort."
-read
+echo "Nginx ('$LOG')."
DIR="`pwd`"
@@ -33,7 +31,7 @@ if [ ! -d "$NGINX_DEST" ]; then
exit 1
else
if ! rmdir "$NGINX_DEST" >/dev/null 2>&1; then # if not empty this will fail
- echo "Install directory '$NGINX_DEST' is not empty. Skipping kernlab installation..."
+ echo "Install directory '$NGINX_DEST' not empty. Skipping nginx installation."
NGINX_DONE=true
fi
fi
@@ -53,5 +51,4 @@ if ! $NGINX_DONE; then
fi
cd "$DIR"
-echo
-echo "Nginx installation finished."
+
diff --git a/openbabel.sh b/openbabel.sh
index ba5db54..b30d916 100755
--- a/openbabel.sh
+++ b/openbabel.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Installs Openbabel.
-# Pass an Openbabel version string as first argument to install a specific version (blank for default).
+# A configuration file is created and included in your '~.bashrc'.
# Author: Christoph Helma, Andreas Maunz.
#
@@ -22,12 +22,8 @@ source ./config.sh
source ./utils.sh
LOG="/tmp/`basename $0`-log.txt"
-echo "This installs Openbabel."
-echo "Your installation directory is '$OB_DEST'."
-echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'."
-echo "Log file is '$LOG'."
-echo "Press <Return> to continue, or <Ctrl+C> to abort."
-read
+echo "Openbabel ('$OB_DEST', '$LOG')"
+
DIR="`pwd`"
@@ -37,11 +33,13 @@ if [ ! -d "$OB_DEST" ]; then
exit 1
else
if ! rmdir "$OB_DEST" >/dev/null 2>&1; then # if not empty this will fail
- echo "Install directory '$OB_DEST' is not empty. Skipping openbabel base installation..."
+ echo "Install directory '$OB_DEST' is not empty. Skipping openbabel base installation."
OB_DONE=true
fi
fi
+echo
+echo "Install:"
if [ ! $OB_DONE ]; then
cd /tmp
URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent"
@@ -71,8 +69,8 @@ if [ ! $OB_DONE ]; then
printf "%25s%15s\n" "'Install'" "DONE"
fi
-
-
+echo
+echo "Bindings:"
OB_DONE=false
mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1
if [ ! -d "$OB_DEST_BINDINGS" ]; then
@@ -112,7 +110,7 @@ fi
cd "$DIR"
echo
-echo "Preparing Openbabel..."
+echo "Preparing:"
if [ ! -f $OB_CONF ]; then
@@ -127,11 +125,5 @@ if [ ! -f $OB_CONF ]; then
echo "source \"$OB_CONF\"" >> $HOME/.bashrc
fi
-else
- echo "It seems Openbabel is already configured ('$OB_CONF' exists)."
fi
-source "$OB_CONF"
-source "$RUBY_CONF"
-echo
-echo "Openbabel Installation finished."
diff --git a/opentox-ruby.sh b/opentox-ruby.sh
index 2404e5d..00bf8f1 100755
--- a/opentox-ruby.sh
+++ b/opentox-ruby.sh
@@ -34,13 +34,11 @@ source ./config.sh
source ./utils.sh
LOG="/tmp/`basename $0`-log.txt"
-echo "This installs the Opentox-ruby gem."
-echo "Log file is '$LOG'."
-echo "Press <Return> to continue, or <Ctrl+C> to abort."
-read
-
+echo "Opentox-ruby ('$LOG'):"
DIR="`pwd`"
+echo
+echo "Installing gem to pull dependencies:"
for mygem in opentox-ruby builder jeweler; do
if ! $GEM install $mygem>>$LOG 2>&1; then
printf "%25s%15s\n" "'Install $mygem'" "FAIL"
@@ -55,6 +53,9 @@ escapedserver="`echo $servername | sed 's/\/\\\//'`"
logger=":logger: backtrace"
aa="nil"
+echo
+echo "Install:"
+
mkdir -p "$HOME/.opentox/config" >>$LOG 2>&1
mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1
sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml 2>$LOG
@@ -74,9 +75,11 @@ printf "%25s%15s\n" "'Install opentox-ruby'" "DONE"
GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'`
mv "$GEM_LIB" "$GEM_LIB~"
-ln -s "$WWW_DEST/opentox/opentox-ruby/lib" "$GEM_LIB"
+if ! ln -s "$WWW_DEST/opentox/opentox-ruby/lib" "$GEM_LIB"; then
+ printf "%25s%15s\n" "'Linking back'" "FAIL"
+fi
+printf "%25s%15s\n" "'Linking back'" "DONE"
+
cd "$DIR"
-echo
-echo "Opentox-ruby gem finished."
diff --git a/opentox-webservices.sh b/opentox-webservices.sh
index d70bffe..ac0f95b 100755
--- a/opentox-webservices.sh
+++ b/opentox-webservices.sh
@@ -20,14 +20,12 @@ source ./config.sh
source ./utils.sh
LOG="/tmp/`basename $0`-log.txt"
-echo "This installs Opentox webservices."
-echo "Log file is '$LOG'."
-echo "Press <Return> to continue, or <Ctrl+C> to abort."
-read
+echo "Webservices ('$LOG'):"
DIR=`pwd`
-echo "Checking out webservices..."
+echo
+echo "Clone:"
mkdir -p "$WWW_DEST/opentox" >>$LOG 2>&1
cd "$WWW_DEST/opentox" >>$LOG 2>&1
for s in compound dataset algorithm model toxcreate task; do
@@ -35,11 +33,15 @@ for s in compound dataset algorithm model toxcreate task; do
cd "$s" >>$LOG 2>&1
- git checkout -t origin/development >>$LOG 2>&1
-# AM: use development
+ git checkout -t origin/development >>$LOG 2>&1 # AM: use development
+
+ rm -rf public >>$LOG 2>&1
mkdir public >>$LOG 2>&1
- if ln -s "$WWW_DEST/opentox/$s/public" "$WWW_DEST/$s" >>$LOG 2>&1; then
+ mypath_from=$WWW_DEST/opentox/$s/public
+ mypath_to=$WWW_DEST/$s
+ if ! ln -sf "$mypath_from" "$mypath_to" >>$LOG 2>&1; then
+
printf "%25s%15s\n" "'Linking $s'" "FAIL"
exit 1
fi
@@ -58,13 +60,13 @@ done
#ln -s /var/www/opentox/validation/public /var/www/validation
# fminer etc
-echo "Compiling Fminer..."
+echo "Fminer:"
-if ! [ -f $HOME/.opentox/production.yaml ]; then
- printf "%25s%15s\n" "'Config present'" "N"
+if ! [ -f $HOME/.opentox/config/production.yaml ]; then
+ printf "%25s%15s\n" "'Config present'" "FAIL"
exit 1
fi
-printf "%25s%15s\n" "'Config present'" "Y"
+printf "%25s%15s\n" "'Config present'" "DONE"
cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1
echo "Need root password:"
@@ -73,8 +75,7 @@ if ! rake fminer:install >>$LOG 2>&1; then
printf "%25s%15s\n" "'Make'" "FAIL"
exit 1
fi
-printf "%25s%15s\n" "'Make'" "FAIL"
+printf "%25s%15s\n" "'Make'" "DONE"
cd "$DIR"
-echo
-echo "Opentox webservices installation finished."
+
diff --git a/redis.sh b/redis.sh
index 932d4ce..6f84316 100755
--- a/redis.sh
+++ b/redis.sh
@@ -22,8 +22,6 @@ LOG="/tmp/`basename $0`-log.txt"
echo "This installs Redis."
echo "Log file is '$LOG'."
-echo "Press <Return> to continue, or <Ctrl+C> to abort."
-read
DIR=`pwd`
@@ -71,7 +69,7 @@ fi
cd "$DIR"
echo
-echo "Preparing Redis..."
+echo "Preparing Redis:"
if [ ! -f $REDIS_CONF ]; then
echo "export PATH=$REDIS_DEST/src:\$PATH" >> "$REDIS_CONF"
echo "Redis configuration has been stored in '$REDIS_CONF'."
@@ -85,5 +83,3 @@ else
fi
cd "$DIR"
-echo
-echo "Redis installation finished."
diff --git a/ruby.sh b/ruby.sh
index cfd78cc..c4377b7 100755
--- a/ruby.sh
+++ b/ruby.sh
@@ -27,8 +27,6 @@ echo "This installs Ruby Enterprise edition."
echo "Your installation directory is '$RUBY_DEST'."
echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'."
echo "Log file is '$LOG'."
-echo -n "Press <Return> to continue, or <Ctrl+C> to abort."
-read
DIR="`pwd`"
@@ -43,6 +41,8 @@ else
fi
fi
+echo
+echo "Installing Ruby:"
if [ ! $RUBY_DONE ]; then
cd /tmp
URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz"
@@ -61,7 +61,7 @@ fi
cd "$DIR"
echo
-echo "Preparing RUBY..."
+echo "Preparing Ruby:"
if ! [ -f "$RUBY_CONF" ]; then
@@ -78,7 +78,8 @@ fi
source "$RUBY_CONF"
-
+echo
+echo "Installing Passenger:"
GEM="`which gem`"
if [ ! -e "$GEM" ]; then
echo "'gem' missing. Install 'gem' first. Aborting..."
diff --git a/utils.sh b/utils.sh
index 6de9c89..cefd0fa 100644
--- a/utils.sh
+++ b/utils.sh
@@ -10,3 +10,4 @@ function check_dest {
}
check_dest
+source ~/.bashrc