From ce1b627f4c2e6c7648b6dae24b296c56c9058285 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 10:19:55 +0200 Subject: Installer up to OB --- base-install.sh | 117 +++++++++++++++++++++++++++++++++++++++++++++++ debian.sh | 23 ---------- install | 10 +++- openbabel.sh | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++------ ruby.sh | 100 ++++++++++++++++++++++++++++++++++------ 5 files changed, 334 insertions(+), 54 deletions(-) create mode 100755 base-install.sh delete mode 100644 debian.sh diff --git a/base-install.sh b/base-install.sh new file mode 100755 index 0000000..33df507 --- /dev/null +++ b/base-install.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# +# Installs base packages for Ubuntu +# Author: Andreas Maunz +# + +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +# Utils +APTITUDE=`which aptitude` +APT_CACHE=`which apt-cache` +DCSS=`which debconf-set-selections` +DPKG=`which dpkg` + +if [ ! -e $APTITUDE ]; then + echo "Aptitude missing. Install aptitude first." 1>&2 + exit 1 +fi + +# Dest +JAVA_CONF=$HOME/.bash_java_ot + +# 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 to continue or to abort." +read + +echo "Checking for installed packages: " +pack_arr="" +for p in $packs; do + if $DPKG -s "$p" >/dev/null 2>&1; then + printf "%25s%15s\n" "'$p'" "Y" + else + printf "%25s%15s\n" "'$p'" "N" + pack_arr="$pack_arr $p" + fi +done + +if [ -n "$pack_arr" ]; then + echo + echo "Checking availablity of missing packages..." + echo -n "Updating package indices: " + $APTITUDE update -y >/dev/null 2>&1 + $APTITUDE upgrade -y >/dev/null 2>&1 + echo "done." +fi + +for p in $pack_arr; do + if [ -n "`$APT_CACHE search $p`" ] ; then + printf "%25s%15s\n" "'$p'" "Y" + else + printf "%25s%15s\n" "'$p'" "N" + pack_fail="$pack_fail $p" + fi +done + +if [ -n "$pack_fail" ]; then + echo + echo "WARNING: At least one missing package has no suitable installation candidate." + echo "Press to continue or to abort." + read +fi + +echo +echo "Installing missing packages, please wait..." +pack_fail="" +for p in $pack_arr; do + echo -n "'$p': " + if $APTITUDE install "$p" -y >/dev/null 2>&1; then + printf "%25s%15s\n" "'$p'" "DONE" + else + printf "%25s%15s\n" "'$p'" "FAIL" + fi +done + +if [ -n "$pack_fail" ]; then + echo + echo "WARNING: At least one missing package could not be installed. Press to continue or to abort." + read +fi + +echo +echo "Preparing JAVA..." +if [ ! -f $JAVA_CONF ]; then + + echo -n "Please provide a path for JAVA_HOME (hint: type echo \$JAVA_HOME as normal user): " + read USER_SUBMITTED_JAVA_HOME + JAVA_HOME="$USER_SUBMITTED_JAVA_HOME" + + if [ ! -d "$JAVA_HOME" ]; then + echo "Directory '$JAVA_HOME' does not exist! Aborting..." + exit 1 + fi + + echo "JAVA_HOME=$JAVA_HOME" >> "$JAVA_CONF" + echo "PATH=$JAVA_HOME:\$PATH" >> "$JAVA_CONF" + + echo "Java configuration has been stored in '$JAVA_CONF'." + echo -n "Answer 'y' if Java configuration should be linked to your .bashrc: " + read ANSWER_JAVA_CONF + if [ $ANSWER_JAVA_CONF = "y" ]; then + echo "source \"$JAVA_CONF\"" >> $HOME/.bashrc + fi + +else + echo "It seems JAVA is already configured ('$JAVA_CONF' exists)." +fi + +echo +echo "Installation finished." diff --git a/debian.sh b/debian.sh deleted file mode 100644 index 7102a5e..0000000 --- a/debian.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -echo "Downloading and updating Debian packages" -echo "deb http://ftp.de.debian.org/debian squeeze main contrib -deb http://ftp.de.debian.org/debian/ squeeze non-free" > /etc/apt/sources.list - -apt-get install lsb-release -codename=`lsb_release -a|grep Codename|cut -f2` -if ! grep "^deb.*debian\.org.*non-free" /etc/apt/sources.list -then - echo "deb http://ftp.debian.org/debian/ $codename non-free" | tee -a /etc/apt/sources.list -fi -apt-get update -y -apt-get upgrade -y -apt-get install binutils gcc g++ gfortran wget hostname pwgen git-core raptor-utils r-base -y -# accept java license automatically -echo sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true | /usr/bin/debconf-set-selections -apt-get install --yes sun-java6-jdk -y -. ./config -#apt-get install xsltproc gnuplot -y # for validation -apt-get install libssl-dev zlib1g-dev libreadline-dev libmysqlclient-dev libmysqlclient-dev libcurl4-openssl-dev libxml2-dev libxslt1-dev libgsl0-dev -y -sed -i '/^JAVA_HOME=/d' /etc/profile -echo 'export JAVA_HOME=/usr/lib/jvm/java-6-sun' | tee -a /etc/profile diff --git a/install b/install index 9e72d13..d9cd3f2 100755 --- a/install +++ b/install @@ -1,7 +1,13 @@ -#!/bin/sh +#!/bin/bash +# Main Opentox-ruby install script +# Author: Christoph Helma, Andreas Maunz + +echo "Opentox-ruby installation" +echo "Press to continue..." +read . ./config -. ./$distribution.sh +. ./base-install.sh $distribution # Pass as parameter . ./ruby.sh . ./openbabel.sh . ./kernlab.sh diff --git a/openbabel.sh b/openbabel.sh index a1d90a4..4d1aaab 100644 --- a/openbabel.sh +++ b/openbabel.sh @@ -1,15 +1,123 @@ -#!/bin/sh - -echo "Installing OpenBabel libraries" -. /etc/profile -dir=`pwd` -cd /tmp -wget -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/2.2.3/openbabel-2.2.3.tar.gz?use_mirror=kent" | tar zxv -cd openbabel-2.2.3/ -./configure -make install -cd scripts/ruby/ -ruby extconf.rb --with-openbabel-include=/usr/local/include/openbabel-2.0 -make install -ldconfig -cd $dir +#!/bin/bash +# +# Installs Openbabel. +# Pass an Openbabel version string as first argument to install a specific version (blank for default). +# Author: Christoph Helma, Andreas Maunz. +# + +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 +fi + +# Utils +WGET="`which wget`" +if [ ! -e "$WGET" ]; then + echo "'wget' missing. Install 'wget' first. Aborting..." + exit 1 +fi + +# Pkg +OBVER="openbabel-2.2.3" +PREFIX="$HOME/$OBVER" +if [ -n "$1" ]; then + PREFIX="$1" +fi +PREFIX_BINDINGS="$HOME/openbabel-ruby-install" + +# Dest +OB_CONF=$HOME/.bash_OB_ot +RUBY_CONF=$HOME/.bash_ruby_ot + +mkdir "$PREFIX" >/dev/null 2>&1 +if [ ! -d "$PREFIX" ]; then + echo "Install directory '$PREFIX' is not available! Aborting..." + exit 1 +else + if ! rmdir "$PREFIX" >/dev/null 2>&1; then # if not empty this will fail + echo "Install directory '$PREFIX' is not empty. Skipping Openbabel installation..." + OB_DONE=true + fi +fi + +DIR="`pwd`" +if [ ! $OB_DONE ]; then + echo "This installs Openbabel Enterprise edition." + echo "Your installation directory is '$PREFIX'." + echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." + echo "Press to continue, or to abort." + cd /tmp + if ! $WGET -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/2.2.3/$OBVER.tar.gz?use_mirror=kent" | tar zxv >/dev/null 2>&1; then + echo "Download failed! Aborting..." + exit 1 + fi + cd "/tmp/$OBVER" + ./configure + make + make install +fi + +echo +echo "Openbabel installation done." +echo "Next ruby bindings should be installed." +echo "Press to continue, or to abort." +echo -n "Enter 's' to skip this step: " +read RBB_SKIP +if [ "$RBB_SKIP" != "s" ]; then + + mkdir "$PREFIX_BINDINGS">/dev/null 2>&1 + if [ ! -d "$PREFIX_BINDINGS" ]; then + echo "Install directory '$PREFIX_BINDINGS' is not available! Aborting..." + exit 1 + else + if [ `ls "$PREFIX_BINDINGS" | wc` -gt 0 ]; then + echo "Install directory '$PREFIX_BINDINGS' is not empty. Skipping Openbabel Binding installation..." + OB_DONE=true + fi + fi + + if ! $OB_DONE ; then + cd scripts/ruby/ + ruby extconf.rb --with-openbabel-include="$PREFIX/include/openbabel-2.0" + if make ; then + cp openbabel.so $PREFIX_BINDINGS + else + echo + echo "Make failed! Aborting..." + exit 1 + fi + fi +fi +cd "$DIR" + +echo +echo "Preparing Openbabel..." +if [ ! -f $OB_CONF ]; then + echo "PATH=$PREFIX/bin:\$PATH" >> "$OB_CONF" + echo "if [ -z \"$LD_LIBRARY_PATH\" ]; then \ + export LD_LIBRARY_PATH=\"$BABEL_INST/lib\" \ + else \ + export LD_LIBRARY_PATH=\"$BABEL_INST/lib:$LD_LIBRARY_PATH\" \ + fi" >> "$OB_CONF" + echo "if [ -z \"$BABEL_LIBDIR\" ]; then \ + export BABEL_LIBDIR=\"$BABEL_INST/lib/openbabel/2.3.0\" \ + fi" >> "$OB_CONF" + echo "if [ -z \"$BABEL_DATADIR\" ]; then \ + export BABEL_DATADIR=\"$BABEL_INST/share/openbabel/2.3.0\" \ + fi" >> "$OB_CONF" + echo "if [ -z \"$RUBYLIB\" ]; then \ + export RUBYLIB=\"$PREFIX_BINDINGS\" \ + fi" >> "$RUBY_CONF" + + echo "Openbabel configuration has been stored in '$OB_CONF'." + echo -n "Decide if Openbabel configuration should be linked to your .bashrc ('y/n'): " + read ANSWER_OB_CONF + if [ $ANSWER_OB_CONF = "y" ]; then + echo "source \"$OB_CONF\"" >> $HOME/.bashrc + fi +else + echo "It seems Openbabel is already configured ('$OB_CONF' exists)." +fi + +echo +echo "Openbabel Installation finished." diff --git a/ruby.sh b/ruby.sh index 31ea284..cc160ff 100644 --- a/ruby.sh +++ b/ruby.sh @@ -1,14 +1,86 @@ -#!/bin/sh - -echo "Installing Ruby Enterprise" -cd /tmp -wget -O - "http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz" | tar zxv -sh /tmp/ruby-enterprise-1.8.7-2011.03/installer --dont-install-useful-gems --no-dev-docs --auto=/opt/ruby-enterprise-1.8.7-2010.03 -sed -i '/^PATH=.*ruby-enterprise/d' /etc/profile -echo 'PATH=$PATH:/opt/ruby-enterprise-1.8.7-2010.03/bin' | tee -a /etc/profile -. /etc/profile -gem sources -a http://gemcutter.org -gem sources -r http://rubygems.org/ -echo "gem: --no-ri --no-rdoc" | tee -a ~/.gemrc -gem install passenger -cd - +#!/bin/bash +# +# Installs Ruby enterprise edition and passenger gem. +# Pass a ruby version string as first argument to install a specific version (blank for default). +# Author: Christoph Helma, Andreas Maunz. +# + +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 +fi + +# Utils +WGET="`which wget`" +if [ ! -e "$WGET" ]; then + echo "'wget' missing. Install 'wget' first. Aborting..." + exit 1 +fi + +# Pkg +RUBYVER="ruby-enterprise-1.8.7-2011.03" +PREFIX="$HOME/$RUBYVER" +if [ -n "$1" ]; then + PREFIX="$1" +fi + +# Dest +RUBY_CONF=$HOME/.bash_ruby_ot + +mkdir "$PREFIX" >/dev/null 2>&1 +if [ ! -d "$PREFIX" ]; then + echo "Install directory '$PREFIX' is not available! Aborting..." + exit 1 +else + if ! rmdir "$PREFIX" >/dev/null 2>&1; then # if not empty this will fail + echo "Install directory '$PREFIX' is not empty. Skipping Ruby installation..." + RUBY_DONE=true + fi +fi + +if [ ! $RUBY_DONE ]; then + echo "This installs Ruby Enterprise edition." + echo "Your installation directory is '$PREFIX'." + echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." + echo "Press to continue, or to abort." + DIR="`pwd`" + cd /tmp + if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBYVER.tar.gz" | tar zxv >/dev/null 2>&1 ; then + echo "Download failed! Aborting..." + exit 1 + fi + sh /tmp/$RUBYVER/installer --dont-install-useful-gems --no-dev-docs --auto="$PREFIX" +fi + +echo +echo "Ruby installation done." +echo "Next 'Passenger' should be installed." +echo "This will modify your '~/.gemrc'." +echo "Press to continue, or to abort." +echo -n "Enter 's' to skip this step: " +read PASSENGER_SKIP +if [ "$PASSENGER_SKIP" != "s" ]; then + export PATH="$PREFIX/bin:$PATH" + gem sources -a "http://gemcutter.org " + gem sources -r "http://rubygems.org/" + echo "gem: --no-ri --no-rdoc" | tee -a $HOME/.gemrc + gem install passenger +fi +cd "$DIR" + +echo +echo "Preparing RUBY..." +if [ ! -f $RUBY_CONF ]; then + echo "PATH=$PREFIX/bin:\$PATH" >> "$RUBY_CONF" + echo "Ruby configuration has been stored in '$RUBY_CONF'." + echo -n "Decide if Ruby configuration should be linked to your .bashrc ('y/n'): " + read ANSWER_JAVA_CONF + if [ $ANSWER_JAVA_CONF = "y" ]; then + echo "source \"$RUBY_CONF\"" >> $HOME/.bashrc + fi +else + echo "It seems RUBY is already configured ('$RUBY_CONF' exists)." +fi + +echo +echo "Ruby Installation finished." -- cgit v1.2.3 From b345b0ee923cd089a58feb8eeaba19cebd7f08c1 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 10:24:26 +0200 Subject: Making exec --- kernlab.sh | 0 nginx.sh | 0 openbabel.sh | 0 opentox-ruby.sh | 0 opentox-webservices.sh | 0 redis.sh | 0 ruby.sh | 0 7 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 kernlab.sh mode change 100644 => 100755 nginx.sh mode change 100644 => 100755 openbabel.sh mode change 100644 => 100755 opentox-ruby.sh mode change 100644 => 100755 opentox-webservices.sh mode change 100644 => 100755 redis.sh mode change 100644 => 100755 ruby.sh diff --git a/kernlab.sh b/kernlab.sh old mode 100644 new mode 100755 diff --git a/nginx.sh b/nginx.sh old mode 100644 new mode 100755 diff --git a/openbabel.sh b/openbabel.sh old mode 100644 new mode 100755 diff --git a/opentox-ruby.sh b/opentox-ruby.sh old mode 100644 new mode 100755 diff --git a/opentox-webservices.sh b/opentox-webservices.sh old mode 100644 new mode 100755 diff --git a/redis.sh b/redis.sh old mode 100644 new mode 100755 diff --git a/ruby.sh b/ruby.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From 79e608cc3777130fc575acf6cdac8e20f7b84a38 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 10:31:07 +0200 Subject: Base install not as root --- base-install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base-install.sh b/base-install.sh index 33df507..c19b6d6 100755 --- a/base-install.sh +++ b/base-install.sh @@ -4,16 +4,16 @@ # Author: Andreas Maunz # -if [ "$(id -u)" != "0" ]; then - echo "This script must be run as root" 1>&2 +if [ "$(id -u)" = "0" ]; then + echo "This script must not be run as root" 1>&2 exit 1 fi # Utils -APTITUDE=`which aptitude` -APT_CACHE=`which apt-cache` -DCSS=`which debconf-set-selections` -DPKG=`which dpkg` +APTITUDE="sudo `which aptitude`" +APT_CACHE="`which apt-cache`" +DCSS="sudo `which debconf-set-selections`" +DPKG="`which dpkg`" if [ ! -e $APTITUDE ]; then echo "Aptitude missing. Install aptitude first." 1>&2 -- cgit v1.2.3 From 8e9117931e2344a087a0ed36c4ed9f1c3ef6d9ce Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 10:39:08 +0200 Subject: Fixed missing ruby read --- ruby.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruby.sh b/ruby.sh index cc160ff..ed424f2 100755 --- a/ruby.sh +++ b/ruby.sh @@ -38,12 +38,13 @@ else fi fi +DIR="`pwd`" if [ ! $RUBY_DONE ]; then echo "This installs Ruby Enterprise edition." echo "Your installation directory is '$PREFIX'." echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." echo "Press to continue, or to abort." - DIR="`pwd`" + read cd /tmp if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBYVER.tar.gz" | tar zxv >/dev/null 2>&1 ; then echo "Download failed! Aborting..." -- cgit v1.2.3 From 9eee46910ade214786fe6362b9f9a60cf2b5e44d Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 10:41:34 +0200 Subject: Fixed missing OB read and version VAR --- openbabel.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openbabel.sh b/openbabel.sh index 4d1aaab..dddbfa9 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -18,7 +18,8 @@ if [ ! -e "$WGET" ]; then fi # Pkg -OBVER="openbabel-2.2.3" +VER="2.2.3" +OBVER="openbabel-$VER" PREFIX="$HOME/$OBVER" if [ -n "$1" ]; then PREFIX="$1" @@ -46,8 +47,9 @@ if [ ! $OB_DONE ]; then echo "Your installation directory is '$PREFIX'." echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." echo "Press to continue, or to abort." + read cd /tmp - if ! $WGET -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/2.2.3/$OBVER.tar.gz?use_mirror=kent" | tar zxv >/dev/null 2>&1; then + if ! $WGET -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/$VER/$OBVER.tar.gz?use_mirror=kent" | tar zxv >/dev/null 2>&1; then echo "Download failed! Aborting..." exit 1 fi -- cgit v1.2.3 From 2ad5e5733158fee481b8922163dcfdbb676fe389 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 10:54:47 +0200 Subject: Fixed OB build prefix --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index dddbfa9..2c09f4d 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -54,7 +54,7 @@ if [ ! $OB_DONE ]; then exit 1 fi cd "/tmp/$OBVER" - ./configure + ./configure --prefix="$PREFIX" make make install fi -- cgit v1.2.3 From efbb93fa26b088bfbf31546c465189a95a898c4d Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 11:07:40 +0200 Subject: Fixed OB wc --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index 2c09f4d..8ac66dc 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -72,7 +72,7 @@ if [ "$RBB_SKIP" != "s" ]; then echo "Install directory '$PREFIX_BINDINGS' is not available! Aborting..." exit 1 else - if [ `ls "$PREFIX_BINDINGS" | wc` -gt 0 ]; then + if [ "`ls $PREFIX_BINDINGS | wc -l`" -gt 0 ]; then echo "Install directory '$PREFIX_BINDINGS' is not empty. Skipping Openbabel Binding installation..." OB_DONE=true fi -- cgit v1.2.3 From 5b3efd446178d1b70d9f33aa7c2313d44b3468ae Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 11:10:51 +0200 Subject: Fixed line indent in bash conf --- openbabel.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/openbabel.sh b/openbabel.sh index 8ac66dc..0de3858 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -96,20 +96,20 @@ echo echo "Preparing Openbabel..." if [ ! -f $OB_CONF ]; then echo "PATH=$PREFIX/bin:\$PATH" >> "$OB_CONF" - echo "if [ -z \"$LD_LIBRARY_PATH\" ]; then \ - export LD_LIBRARY_PATH=\"$BABEL_INST/lib\" \ - else \ - export LD_LIBRARY_PATH=\"$BABEL_INST/lib:$LD_LIBRARY_PATH\" \ - fi" >> "$OB_CONF" - echo "if [ -z \"$BABEL_LIBDIR\" ]; then \ - export BABEL_LIBDIR=\"$BABEL_INST/lib/openbabel/2.3.0\" \ - fi" >> "$OB_CONF" - echo "if [ -z \"$BABEL_DATADIR\" ]; then \ - export BABEL_DATADIR=\"$BABEL_INST/share/openbabel/2.3.0\" \ - fi" >> "$OB_CONF" - echo "if [ -z \"$RUBYLIB\" ]; then \ - export RUBYLIB=\"$PREFIX_BINDINGS\" \ - fi" >> "$RUBY_CONF" + echo "if [ -z \"$LD_LIBRARY_PATH\" ]; then \n \ + export LD_LIBRARY_PATH=\"$BABEL_INST/lib\" \n \ + else \n\ + export LD_LIBRARY_PATH=\"$BABEL_INST/lib:$LD_LIBRARY_PATH\" \n\ + fi \n" >> "$OB_CONF" + echo "if [ -z \"$BABEL_LIBDIR\" ]; then \n \ + export BABEL_LIBDIR=\"$BABEL_INST/lib/openbabel/2.3.0\" \n \ + fi \n" >> "$OB_CONF" + echo "if [ -z \"$BABEL_DATADIR\" ]; then \n\ + export BABEL_DATADIR=\"$BABEL_INST/share/openbabel/2.3.0\" \n\ + fi \n" >> "$OB_CONF" + echo "if [ -z \"$RUBYLIB\" ]; then \n\ + export RUBYLIB=\"$PREFIX_BINDINGS\" \n\ + fi \n" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." echo -n "Decide if Openbabel configuration should be linked to your .bashrc ('y/n'): " -- cgit v1.2.3 From f4bb28d93e777bd7f1b89d291ff545138004046f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 11:13:31 +0200 Subject: Fixed line indent in bash conf --- openbabel.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openbabel.sh b/openbabel.sh index 0de3858..ddcea9a 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -96,19 +96,19 @@ echo echo "Preparing Openbabel..." if [ ! -f $OB_CONF ]; then echo "PATH=$PREFIX/bin:\$PATH" >> "$OB_CONF" - echo "if [ -z \"$LD_LIBRARY_PATH\" ]; then \n \ - export LD_LIBRARY_PATH=\"$BABEL_INST/lib\" \n \ + echo "if [ -z \"$LD_LIBRARY_PATH\" ]; then \ + export LD_LIBRARY_PATH=\"$PREFIX/lib\" \ else \n\ - export LD_LIBRARY_PATH=\"$BABEL_INST/lib:$LD_LIBRARY_PATH\" \n\ + export LD_LIBRARY_PATH=\"$PREFIX/lib:$LD_LIBRARY_PATH\" \ fi \n" >> "$OB_CONF" - echo "if [ -z \"$BABEL_LIBDIR\" ]; then \n \ - export BABEL_LIBDIR=\"$BABEL_INST/lib/openbabel/2.3.0\" \n \ + echo "if [ -z \"$BABEL_LIBDIR\" ]; then \ + export BABEL_LIBDIR=\"$PREFIX/lib/openbabel/2.3.0\" \ fi \n" >> "$OB_CONF" - echo "if [ -z \"$BABEL_DATADIR\" ]; then \n\ - export BABEL_DATADIR=\"$BABEL_INST/share/openbabel/2.3.0\" \n\ + echo "if [ -z \"$BABEL_DATADIR\" ]; then \ + export BABEL_DATADIR=\"$PREFIX/share/openbabel/2.3.0\" \ fi \n" >> "$OB_CONF" - echo "if [ -z \"$RUBYLIB\" ]; then \n\ - export RUBYLIB=\"$PREFIX_BINDINGS\" \n\ + echo "if [ -z \"$RUBYLIB\" ]; then \ + export RUBYLIB=\"$PREFIX_BINDINGS\" \ fi \n" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." -- cgit v1.2.3 From 6d5500ff01f83b006656ea39771f91cfcc844df6 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 11:18:35 +0200 Subject: Fixed line indent in bash conf --- openbabel.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/openbabel.sh b/openbabel.sh index ddcea9a..e233410 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -97,19 +97,19 @@ echo "Preparing Openbabel..." if [ ! -f $OB_CONF ]; then echo "PATH=$PREFIX/bin:\$PATH" >> "$OB_CONF" echo "if [ -z \"$LD_LIBRARY_PATH\" ]; then \ - export LD_LIBRARY_PATH=\"$PREFIX/lib\" \ - else \n\ - export LD_LIBRARY_PATH=\"$PREFIX/lib:$LD_LIBRARY_PATH\" \ - fi \n" >> "$OB_CONF" + export LD_LIBRARY_PATH=\"$PREFIX/lib\"; \ + else \ + export LD_LIBRARY_PATH=\"$PREFIX/lib:$LD_LIBRARY_PATH\"; \ + fi" >> "$OB_CONF" echo "if [ -z \"$BABEL_LIBDIR\" ]; then \ - export BABEL_LIBDIR=\"$PREFIX/lib/openbabel/2.3.0\" \ - fi \n" >> "$OB_CONF" + export BABEL_LIBDIR=\"$PREFIX/lib/openbabel/2.3.0\"; \ + fi" >> "$OB_CONF" echo "if [ -z \"$BABEL_DATADIR\" ]; then \ - export BABEL_DATADIR=\"$PREFIX/share/openbabel/2.3.0\" \ - fi \n" >> "$OB_CONF" + export BABEL_DATADIR=\"$PREFIX/share/openbabel/2.3.0\"; \ + fi" >> "$OB_CONF" echo "if [ -z \"$RUBYLIB\" ]; then \ - export RUBYLIB=\"$PREFIX_BINDINGS\" \ - fi \n" >> "$RUBY_CONF" + export RUBYLIB=\"$PREFIX_BINDINGS\"; \ + fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." echo -n "Decide if Openbabel configuration should be linked to your .bashrc ('y/n'): " -- cgit v1.2.3 From 580c6204ea78e5fa261fff262d207f1651b3b06f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 11:21:27 +0200 Subject: Fixed variable expansion in bash conf --- openbabel.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openbabel.sh b/openbabel.sh index e233410..6eb2e5c 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -96,17 +96,17 @@ echo echo "Preparing Openbabel..." if [ ! -f $OB_CONF ]; then echo "PATH=$PREFIX/bin:\$PATH" >> "$OB_CONF" - echo "if [ -z \"$LD_LIBRARY_PATH\" ]; then \ + echo "if [ -z \"\$LD_LIBRARY_PATH\" ]; then \ export LD_LIBRARY_PATH=\"$PREFIX/lib\"; \ else \ - export LD_LIBRARY_PATH=\"$PREFIX/lib:$LD_LIBRARY_PATH\"; \ + export LD_LIBRARY_PATH=\"$PREFIX/lib:\$LD_LIBRARY_PATH\"; \ fi" >> "$OB_CONF" - echo "if [ -z \"$BABEL_LIBDIR\" ]; then \ + echo "if [ -z \"\$BABEL_LIBDIR\" ]; then \ export BABEL_LIBDIR=\"$PREFIX/lib/openbabel/2.3.0\"; \ fi" >> "$OB_CONF" - echo "if [ -z \"$BABEL_DATADIR\" ]; then \ + echo "if [ -z \"\$BABEL_DATADIR\" ]; then \ export BABEL_DATADIR=\"$PREFIX/share/openbabel/2.3.0\"; \ - fi" >> "$OB_CONF" + fi" >> "\$OB_CONF" echo "if [ -z \"$RUBYLIB\" ]; then \ export RUBYLIB=\"$PREFIX_BINDINGS\"; \ fi" >> "$RUBY_CONF" -- cgit v1.2.3 From 3328abf1e969b280d5436909b54d2c4a78c6c80a Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 11:28:41 +0200 Subject: Fixed variable expansion in bash conf --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index 6eb2e5c..fcef99b 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -107,7 +107,7 @@ if [ ! -f $OB_CONF ]; then echo "if [ -z \"\$BABEL_DATADIR\" ]; then \ export BABEL_DATADIR=\"$PREFIX/share/openbabel/2.3.0\"; \ fi" >> "\$OB_CONF" - echo "if [ -z \"$RUBYLIB\" ]; then \ + echo "if [ -z \"\$RUBYLIB\" ]; then \ export RUBYLIB=\"$PREFIX_BINDINGS\"; \ fi" >> "$RUBY_CONF" -- cgit v1.2.3 From 5f516e2297a014fbf59caee50a17b696d8c5ae06 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 11:37:48 +0200 Subject: Fixed path and check --- openbabel.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index fcef99b..205c188 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -67,6 +67,7 @@ echo -n "Enter 's' to skip this step: " read RBB_SKIP if [ "$RBB_SKIP" != "s" ]; then + OB_DONE=false mkdir "$PREFIX_BINDINGS">/dev/null 2>&1 if [ ! -d "$PREFIX_BINDINGS" ]; then echo "Install directory '$PREFIX_BINDINGS' is not available! Aborting..." @@ -79,7 +80,7 @@ if [ "$RBB_SKIP" != "s" ]; then fi if ! $OB_DONE ; then - cd scripts/ruby/ + cd "/tmp/$OBVER/scripts/ruby/" ruby extconf.rb --with-openbabel-include="$PREFIX/include/openbabel-2.0" if make ; then cp openbabel.so $PREFIX_BINDINGS -- cgit v1.2.3 From 5b5f068e2096ef86491887e773e2cf2349bb6344 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 12:03:59 +0200 Subject: Added Kernlab --- kernlab.sh | 39 +++++++++++++++++++++++++++++++++------ openbabel.sh | 2 +- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/kernlab.sh b/kernlab.sh index db0c93d..d95b275 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -1,8 +1,35 @@ -#!/bin/sh +#!/bin/bash +# +# Installs Kernlab. +# Author: Christoph Helma, Andreas Maunz. +# -echo "Installing kernlab" -. /etc/profile +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 +fi + +# Utils +R="`which R`" +if [ ! -e "$R" ]; then + echo "'R' missing. Install 'R' first. Aborting..." + exit 1 +fi + +# Pkg +VER="0.9-11" + +DIR="`pwd`" +echo "This installs Kernlab." +echo "Press to continue, or to abort." +read cd /tmp -wget http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_0.9-11.tar.gz -R CMD INSTALL kernlab_0.9-11.tar.gz -cd - +if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$VER.tar.gz">/dev/null 2>&1; then + echo "Download failed! Aborting..." + exit 1 +fi +R CMD INSTALL kernlab_$VER.tar.gz +cd "$DIR" + +echo +echo "Kernlab Installation finished." diff --git a/openbabel.sh b/openbabel.sh index 205c188..37b92dc 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -43,7 +43,7 @@ fi DIR="`pwd`" if [ ! $OB_DONE ]; then - echo "This installs Openbabel Enterprise edition." + echo "This installs Openbabel." echo "Your installation directory is '$PREFIX'." echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." echo "Press to continue, or to abort." -- cgit v1.2.3 From e53c4f70598e403ba38c27a4637d540a10ee2075 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 12:07:43 +0200 Subject: Kernlab fix: Missing command --- kernlab.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernlab.sh b/kernlab.sh index d95b275..673c1f6 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -10,6 +10,12 @@ if [ "$(id -u)" = "0" ]; then fi # Utils +WGET="`which wget`" +if [ ! -e "$WGET" ]; then + echo "'wget' missing. Install 'wget' first. Aborting..." + exit 1 +fi + R="`which R`" if [ ! -e "$R" ]; then echo "'R' missing. Install 'R' first. Aborting..." -- cgit v1.2.3 From 6ba25c9cc51c285fdd1443057f61213668bb4a1b Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 12:24:28 +0200 Subject: Kernlab fix: Missing command --- kernlab.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++----- openbabel.sh | 21 +++++++++++---------- 2 files changed, 55 insertions(+), 15 deletions(-) diff --git a/kernlab.sh b/kernlab.sh index 673c1f6..56f3168 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -25,16 +25,55 @@ fi # Pkg VER="0.9-11" -DIR="`pwd`" +# Dest +R_CONF=$HOME/.bash_R_ot +DEST="$HOME/r-packages" +if [ -n "$1" ]; then + DEST="$1" +fi + + echo "This installs Kernlab." echo "Press to continue, or to abort." read -cd /tmp -if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$VER.tar.gz">/dev/null 2>&1; then - echo "Download failed! Aborting..." + +DIR="`pwd`" + +R_DONE=false +mkdir "$DEST" >/dev/null 2>&1 +if [ ! -d "$DEST" ]; then + echo "Install directory '$DEST' is not available! Aborting..." exit 1 +else + if ! rmdir "$DEST" >/dev/null 2>&1; then # if not empty this will fail + echo "Install directory '$DEST' is not empty. Skipping kernlab installation..." + R_DONE=true + fi +fi +if ! $R_DONE; then +cd /tmp + if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$VER.tar.gz">/dev/null 2>&1; then + echo "Download failed! Aborting..." + exit 1 + fi + export R_LIBS="$DEST" + $R CMD INSTALL "kernlab_$VER.tar.gz" fi -R CMD INSTALL kernlab_$VER.tar.gz + +echo +echo "Preparing R..." +if [ ! -f $R_CONF ]; then + echo "R_LIBS=\"$DEST\"" >> "$R_CONF" + echo "R package destination has been stored in '$R_CONF'." + echo -n "Decide if R configuration should be linked to your .bashrc ('y/n'): " + read ANSWER_R_CONF + if [ $ANSWER_R_CONF = "y" ]; then + echo "source \"$R_CONF\"" >> $HOME/.bashrc + fi +else + echo "It seems R is already configured ('$R_CONF' exists)." +fi + cd "$DIR" echo diff --git a/openbabel.sh b/openbabel.sh index 37b92dc..f132fd5 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -30,24 +30,26 @@ PREFIX_BINDINGS="$HOME/openbabel-ruby-install" OB_CONF=$HOME/.bash_OB_ot RUBY_CONF=$HOME/.bash_ruby_ot + +echo "This installs Openbabel." +echo "Your installation directory is '$PREFIX'." +echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." +echo "Press to continue, or to abort." +read + +DIR="`pwd`" + mkdir "$PREFIX" >/dev/null 2>&1 if [ ! -d "$PREFIX" ]; then echo "Install directory '$PREFIX' is not available! Aborting..." exit 1 else if ! rmdir "$PREFIX" >/dev/null 2>&1; then # if not empty this will fail - echo "Install directory '$PREFIX' is not empty. Skipping Openbabel installation..." + echo "Install directory '$PREFIX' is not empty. Skipping openbabel base installation..." OB_DONE=true fi fi - -DIR="`pwd`" if [ ! $OB_DONE ]; then - echo "This installs Openbabel." - echo "Your installation directory is '$PREFIX'." - echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." - echo "Press to continue, or to abort." - read cd /tmp if ! $WGET -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/$VER/$OBVER.tar.gz?use_mirror=kent" | tar zxv >/dev/null 2>&1; then echo "Download failed! Aborting..." @@ -66,7 +68,6 @@ echo "Press to continue, or to abort." echo -n "Enter 's' to skip this step: " read RBB_SKIP if [ "$RBB_SKIP" != "s" ]; then - OB_DONE=false mkdir "$PREFIX_BINDINGS">/dev/null 2>&1 if [ ! -d "$PREFIX_BINDINGS" ]; then @@ -78,7 +79,6 @@ if [ "$RBB_SKIP" != "s" ]; then OB_DONE=true fi fi - if ! $OB_DONE ; then cd "/tmp/$OBVER/scripts/ruby/" ruby extconf.rb --with-openbabel-include="$PREFIX/include/openbabel-2.0" @@ -91,6 +91,7 @@ if [ "$RBB_SKIP" != "s" ]; then fi fi fi + cd "$DIR" echo -- cgit v1.2.3 From bf309f52283db539ca1f8d9c004cad7eb88b2de4 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 12:28:03 +0200 Subject: Kernlab fix: install dir --- kernlab.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernlab.sh b/kernlab.sh index 56f3168..0c7d7e8 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -26,7 +26,7 @@ fi VER="0.9-11" # Dest -R_CONF=$HOME/.bash_R_ot +R_CONF="$HOME/.bash_R_ot" DEST="$HOME/r-packages" if [ -n "$1" ]; then DEST="$1" @@ -63,7 +63,7 @@ fi echo echo "Preparing R..." if [ ! -f $R_CONF ]; then - echo "R_LIBS=\"$DEST\"" >> "$R_CONF" + echo "export R_LIBS=\"$DEST\"" >> "$R_CONF" echo "R package destination has been stored in '$R_CONF'." echo -n "Decide if R configuration should be linked to your .bashrc ('y/n'): " read ANSWER_R_CONF -- cgit v1.2.3 From 0c926b09753901c446d9b5d82b8c3e9307fda887 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 12:57:21 +0200 Subject: nginx install --- base-install.sh | 2 +- kernlab.sh | 40 +++++++++++++++++++--------------------- nginx.sh | 27 +++++++++++++++++++++------ openbabel.sh | 54 ++++++++++++++++++++++++++---------------------------- ruby.sh | 28 ++++++++++++---------------- 5 files changed, 79 insertions(+), 72 deletions(-) diff --git a/base-install.sh b/base-install.sh index c19b6d6..a0a6c94 100755 --- a/base-install.sh +++ b/base-install.sh @@ -21,7 +21,7 @@ if [ ! -e $APTITUDE ]; then fi # Dest -JAVA_CONF=$HOME/.bash_java_ot +source ./config.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" diff --git a/kernlab.sh b/kernlab.sh index 0c7d7e8..8da3ec6 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -23,13 +23,9 @@ if [ ! -e "$R" ]; then fi # Pkg -VER="0.9-11" - -# Dest -R_CONF="$HOME/.bash_R_ot" -DEST="$HOME/r-packages" +source ./config.sh if [ -n "$1" ]; then - DEST="$1" + KL_DEST="$1" fi @@ -40,38 +36,40 @@ read DIR="`pwd`" R_DONE=false -mkdir "$DEST" >/dev/null 2>&1 -if [ ! -d "$DEST" ]; then - echo "Install directory '$DEST' is not available! Aborting..." +mkdir "$KL_DEST" >/dev/null 2>&1 +if [ ! -d "$KL_DEST" ]; then + echo "Install directory '$KL_DEST' is not available! Aborting..." exit 1 else - if ! rmdir "$DEST" >/dev/null 2>&1; then # if not empty this will fail - echo "Install directory '$DEST' is not empty. Skipping kernlab installation..." + 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..." R_DONE=true + else + mkdir "$KL_DEST" >/dev/null 2>&1 fi fi if ! $R_DONE; then cd /tmp - if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$VER.tar.gz">/dev/null 2>&1; then + if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz">/dev/null 2>&1; then echo "Download failed! Aborting..." exit 1 fi - export R_LIBS="$DEST" - $R CMD INSTALL "kernlab_$VER.tar.gz" + export R_LIBS="$KL_DEST" + $R CMD INSTALL "kernlab_$KL_VER.tar.gz" fi echo echo "Preparing R..." -if [ ! -f $R_CONF ]; then - echo "export R_LIBS=\"$DEST\"" >> "$R_CONF" - echo "R package destination has been stored in '$R_CONF'." +if [ ! -f $KL_CONF ]; then + echo "export R_LIBS=\"$KL_DEST\"" >> "$KL_CONF" + echo "R package destination has been stored in '$KL_CONF'." echo -n "Decide if R configuration should be linked to your .bashrc ('y/n'): " - read ANSWER_R_CONF - if [ $ANSWER_R_CONF = "y" ]; then - echo "source \"$R_CONF\"" >> $HOME/.bashrc + read ANSWER_KL_CONF + if [ $ANSWER_KL_CONF = "y" ]; then + echo "source \"$KL_CONF\"" >> $HOME/.bashrc fi else - echo "It seems R is already configured ('$R_CONF' exists)." + echo "It seems R is already configured ('$KL_CONF' exists)." fi cd "$DIR" diff --git a/nginx.sh b/nginx.sh index 09eebee..43a4a3e 100755 --- a/nginx.sh +++ b/nginx.sh @@ -1,11 +1,26 @@ -#!/bin/sh +#!/bin/bash +# +# Installs Passenger. +# Author: Christoph Helma, Andreas Maunz. +# -. /etc/profile -passenger-install-nginx-module --auto-download --auto --prefix=/opt/nginx +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 +fi -cd /opt/ruby-enterprise-1.8.7-2010.03/lib/ruby/gems/1.8/gems/ +# Utils +PIN="`which passenger-install-nginx-module`" +if [ ! -e "$PIN" ]; then + echo "'passenger-install-nginx-module' missing. Install 'passenger-install-nginx-module' first. Aborting..." + exit 1 +fi + +source ./config.sh +$PIN --auto-download --auto --prefix="$NGINX_DEST" + +cd $RUBY_DEST/lib/ruby/gems/1.8/gems/ passenger=`ls -d passenger*`; cd - servername=`hostname`.`dnsdomainname` -echo $passenger -sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/" nginx.conf > /opt/nginx/conf/nginx.conf +sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/" ./nginx.conf > $NGINX_DEST/nginx.conf diff --git a/openbabel.sh b/openbabel.sh index f132fd5..c75ca8d 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -18,13 +18,11 @@ if [ ! -e "$WGET" ]; then fi # Pkg -VER="2.2.3" -OBVER="openbabel-$VER" -PREFIX="$HOME/$OBVER" +source ./config if [ -n "$1" ]; then - PREFIX="$1" + OB_DEST="$1" fi -PREFIX_BINDINGS="$HOME/openbabel-ruby-install" +OB_DEST_BINDINGS="$HOME/openbabel-ruby-install" # Dest OB_CONF=$HOME/.bash_OB_ot @@ -32,31 +30,31 @@ RUBY_CONF=$HOME/.bash_ruby_ot echo "This installs Openbabel." -echo "Your installation directory is '$PREFIX'." +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 "Press to continue, or to abort." read DIR="`pwd`" -mkdir "$PREFIX" >/dev/null 2>&1 -if [ ! -d "$PREFIX" ]; then - echo "Install directory '$PREFIX' is not available! Aborting..." +mkdir "$OB_DEST" >/dev/null 2>&1 +if [ ! -d "$OB_DEST" ]; then + echo "Install directory '$OB_DEST' is not available! Aborting..." exit 1 else - if ! rmdir "$PREFIX" >/dev/null 2>&1; then # if not empty this will fail - echo "Install directory '$PREFIX' is not empty. Skipping openbabel base installation..." + 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..." OB_DONE=true fi fi if [ ! $OB_DONE ]; then cd /tmp - if ! $WGET -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/$VER/$OBVER.tar.gz?use_mirror=kent" | tar zxv >/dev/null 2>&1; then + if ! $WGET -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" | tar zxv >/dev/null 2>&1; then echo "Download failed! Aborting..." exit 1 fi - cd "/tmp/$OBVER" - ./configure --prefix="$PREFIX" + cd "/tmp/$OB_VER" + ./configure --prefix="$OB_DEST" make make install fi @@ -69,21 +67,21 @@ echo -n "Enter 's' to skip this step: " read RBB_SKIP if [ "$RBB_SKIP" != "s" ]; then OB_DONE=false - mkdir "$PREFIX_BINDINGS">/dev/null 2>&1 - if [ ! -d "$PREFIX_BINDINGS" ]; then - echo "Install directory '$PREFIX_BINDINGS' is not available! Aborting..." + mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1 + if [ ! -d "$OB_DEST_BINDINGS" ]; then + echo "Install directory '$OB_DEST_BINDINGS' is not available! Aborting..." exit 1 else - if [ "`ls $PREFIX_BINDINGS | wc -l`" -gt 0 ]; then - echo "Install directory '$PREFIX_BINDINGS' is not empty. Skipping Openbabel Binding installation..." + if [ "`ls $OB_DEST_BINDINGS | wc -l`" -gt 0 ]; then + echo "Install directory '$OB_DEST_BINDINGS' is not empty. Skipping Openbabel Binding installation..." OB_DONE=true fi fi if ! $OB_DONE ; then - cd "/tmp/$OBVER/scripts/ruby/" - ruby extconf.rb --with-openbabel-include="$PREFIX/include/openbabel-2.0" + cd "/tmp/$OB_VER/scripts/ruby/" + ruby extconf.rb --with-openbabel-include="$OB_DEST/include/openbabel-2.0" if make ; then - cp openbabel.so $PREFIX_BINDINGS + cp openbabel.so $OB_DEST_BINDINGS else echo echo "Make failed! Aborting..." @@ -97,20 +95,20 @@ cd "$DIR" echo echo "Preparing Openbabel..." if [ ! -f $OB_CONF ]; then - echo "PATH=$PREFIX/bin:\$PATH" >> "$OB_CONF" + echo "PATH=$OB_DEST/bin:\$PATH" >> "$OB_CONF" echo "if [ -z \"\$LD_LIBRARY_PATH\" ]; then \ - export LD_LIBRARY_PATH=\"$PREFIX/lib\"; \ + export LD_LIBRARY_PATH=\"$OB_DEST/lib\"; \ else \ - export LD_LIBRARY_PATH=\"$PREFIX/lib:\$LD_LIBRARY_PATH\"; \ + export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; \ fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_LIBDIR\" ]; then \ - export BABEL_LIBDIR=\"$PREFIX/lib/openbabel/2.3.0\"; \ + export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; \ fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_DATADIR\" ]; then \ - export BABEL_DATADIR=\"$PREFIX/share/openbabel/2.3.0\"; \ + export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; \ fi" >> "\$OB_CONF" echo "if [ -z \"\$RUBYLIB\" ]; then \ - export RUBYLIB=\"$PREFIX_BINDINGS\"; \ + export RUBYLIB=\"$OB_DEST_BINDINGS\"; \ fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." diff --git a/ruby.sh b/ruby.sh index ed424f2..fd00b2b 100755 --- a/ruby.sh +++ b/ruby.sh @@ -18,22 +18,18 @@ if [ ! -e "$WGET" ]; then fi # Pkg -RUBYVER="ruby-enterprise-1.8.7-2011.03" -PREFIX="$HOME/$RUBYVER" +source ./config.sh if [ -n "$1" ]; then - PREFIX="$1" + RUBY_DEST="$1" fi -# Dest -RUBY_CONF=$HOME/.bash_ruby_ot - -mkdir "$PREFIX" >/dev/null 2>&1 -if [ ! -d "$PREFIX" ]; then - echo "Install directory '$PREFIX' is not available! Aborting..." +mkdir "$RUBY_DEST" >/dev/null 2>&1 +if [ ! -d "$RUBY_DEST" ]; then + echo "Install directory '$RUBY_DEST' is not available! Aborting..." exit 1 else - if ! rmdir "$PREFIX" >/dev/null 2>&1; then # if not empty this will fail - echo "Install directory '$PREFIX' is not empty. Skipping Ruby installation..." + if ! rmdir "$RUBY_DEST" >/dev/null 2>&1; then # if not empty this will fail + echo "Install directory '$RUBY_DEST' is not empty. Skipping Ruby installation..." RUBY_DONE=true fi fi @@ -41,16 +37,16 @@ fi DIR="`pwd`" if [ ! $RUBY_DONE ]; then echo "This installs Ruby Enterprise edition." - echo "Your installation directory is '$PREFIX'." + 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 "Press to continue, or to abort." read cd /tmp - if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBYVER.tar.gz" | tar zxv >/dev/null 2>&1 ; then + if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" | tar zxv >/dev/null 2>&1 ; then echo "Download failed! Aborting..." exit 1 fi - sh /tmp/$RUBYVER/installer --dont-install-useful-gems --no-dev-docs --auto="$PREFIX" + sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST" fi echo @@ -61,7 +57,7 @@ echo "Press to continue, or to abort." echo -n "Enter 's' to skip this step: " read PASSENGER_SKIP if [ "$PASSENGER_SKIP" != "s" ]; then - export PATH="$PREFIX/bin:$PATH" + export PATH="$RUBY_DEST/bin:$PATH" gem sources -a "http://gemcutter.org " gem sources -r "http://rubygems.org/" echo "gem: --no-ri --no-rdoc" | tee -a $HOME/.gemrc @@ -72,7 +68,7 @@ cd "$DIR" echo echo "Preparing RUBY..." if [ ! -f $RUBY_CONF ]; then - echo "PATH=$PREFIX/bin:\$PATH" >> "$RUBY_CONF" + echo "PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF" echo "Ruby configuration has been stored in '$RUBY_CONF'." echo -n "Decide if Ruby configuration should be linked to your .bashrc ('y/n'): " read ANSWER_JAVA_CONF -- cgit v1.2.3 From 424abba2902b71ce95b07f550f2c2841d13265ee Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 12:58:21 +0200 Subject: Added config.sh --- config.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config.sh diff --git a/config.sh b/config.sh new file mode 100644 index 0000000..8eb5aff --- /dev/null +++ b/config.sh @@ -0,0 +1,16 @@ +# Dest +JAVA_CONF=$HOME/.bash_java_ot + +RUBY_VER="ruby-enterprise-1.8.7-2011.03" +RUBY_CONF=$HOME/.bash_ruby_ot +RUBY_DEST="$HOME/$RUB_YVER" + +OB_NUM_VER="2.2.3" +OB_VER="openbabel-$OB_NUM_VER" +OB_DEST="$HOME/$OB_VER" + +KL_VER="0.9-11" +KL_CONF="$HOME/.bash_R_ot" +KL_DEST="$HOME/r-packages" + +NGINX_DEST=$HOME/nginx -- cgit v1.2.3 From 78a251a002390dafd1f26271e9b8a531fb9aea14 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:06:32 +0200 Subject: Nginx fix: ENV variable --- config.sh | 2 +- kernlab.sh | 2 +- nginx.sh | 37 +++++++++++++++++++++++++++++++------ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/config.sh b/config.sh index 8eb5aff..fad153b 100644 --- a/config.sh +++ b/config.sh @@ -3,7 +3,7 @@ JAVA_CONF=$HOME/.bash_java_ot RUBY_VER="ruby-enterprise-1.8.7-2011.03" RUBY_CONF=$HOME/.bash_ruby_ot -RUBY_DEST="$HOME/$RUB_YVER" +RUBY_DEST="$HOME/$RUBY_VER" OB_NUM_VER="2.2.3" OB_VER="openbabel-$OB_NUM_VER" diff --git a/kernlab.sh b/kernlab.sh index 8da3ec6..91f6cb5 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -49,7 +49,7 @@ else fi fi if ! $R_DONE; then -cd /tmp + cd /tmp if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz">/dev/null 2>&1; then echo "Download failed! Aborting..." exit 1 diff --git a/nginx.sh b/nginx.sh index 43a4a3e..e528d8b 100755 --- a/nginx.sh +++ b/nginx.sh @@ -17,10 +17,35 @@ if [ ! -e "$PIN" ]; then fi source ./config.sh -$PIN --auto-download --auto --prefix="$NGINX_DEST" -cd $RUBY_DEST/lib/ruby/gems/1.8/gems/ -passenger=`ls -d passenger*`; -cd - -servername=`hostname`.`dnsdomainname` -sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/" ./nginx.conf > $NGINX_DEST/nginx.conf + +echo "This installs Nginx." +echo "Press to continue, or to abort." +read + +DIR="`pwd`" + +NGINX_DONE=false +mkdir "$NGINX_DEST" >/dev/null 2>&1 +if [ ! -d "$NGINX_DEST" ]; then + echo "Install directory '$KL_DEST' is not available! Aborting..." + 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..." + NGINX_DONE=true + fi +fi + +if ! $NGINX_DONE; then + $PIN --auto-download --auto --prefix="$NGINX_DEST" + cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" + passenger=`ls -d passenger*`; + cd - + servername=`hostname`.`dnsdomainname` + sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/" ./nginx.conf > $NGINX_DEST/nginx.conf +fi + +cd "$DIR" +echo +echo "Nginx installation finished." -- cgit v1.2.3 From 7a42993610fe5d828119d09cbbe2bbf527071b11 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:07:34 +0200 Subject: Nginx fix: ENV variable --- nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index e528d8b..96999f3 100755 --- a/nginx.sh +++ b/nginx.sh @@ -28,7 +28,7 @@ DIR="`pwd`" NGINX_DONE=false mkdir "$NGINX_DEST" >/dev/null 2>&1 if [ ! -d "$NGINX_DEST" ]; then - echo "Install directory '$KL_DEST' is not available! Aborting..." + echo "Install directory '$NGINX_DEST' is not available! Aborting..." exit 1 else if ! rmdir "$KL_DEST" >/dev/null 2>&1; then # if not empty this will fail -- cgit v1.2.3 From 0c127b8c425555f9aeee425c3fa390dba677831c Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:09:05 +0200 Subject: Nginx fix: ENV variable --- nginx.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nginx.sh b/nginx.sh index 96999f3..779a06f 100755 --- a/nginx.sh +++ b/nginx.sh @@ -18,7 +18,6 @@ fi source ./config.sh - echo "This installs Nginx." echo "Press to continue, or to abort." read @@ -31,8 +30,8 @@ if [ ! -d "$NGINX_DEST" ]; then echo "Install directory '$NGINX_DEST' is not available! Aborting..." 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..." + 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..." NGINX_DONE=true fi fi -- cgit v1.2.3 From 38e704e23f7f9a8a46bd022f8bdbf904768263d8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:15:06 +0200 Subject: Nginx fix: Server name replacement --- nginx.conf | 4 ++-- nginx.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index ce00e37..e6cb438 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,8 +8,8 @@ http { server_names_hash_bucket_size 256; - passenger_root /opt/ruby-enterprise-1.8.7-2010.03/lib/ruby/gems/1.8/gems/PASSENGER; - passenger_ruby /opt/ruby-enterprise-1.8.7-2010.03/bin/ruby; + passenger_root RUBY_DEST/lib/ruby/gems/1.8/gems/PASSENGER; + passenger_ruby RUBY_DEST/bin/ruby; passenger_default_user opentox; passenger_log_level 2; passenger_spawn_method conservative; diff --git a/nginx.sh b/nginx.sh index 779a06f..5cd4853 100755 --- a/nginx.sh +++ b/nginx.sh @@ -41,8 +41,8 @@ if ! $NGINX_DONE; then cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" passenger=`ls -d passenger*`; cd - - servername=`hostname`.`dnsdomainname` - sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/" ./nginx.conf > $NGINX_DEST/nginx.conf + servername=`hostname` + sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/" ./nginx.conf > $NGINX_DEST/nginx.conf fi cd "$DIR" -- cgit v1.2.3 From e23e1a7f0f04033de1872d2c2e61e244e6208d4c Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:34:25 +0200 Subject: Redis --- config.sh | 9 +++++-- redis.sh | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++----------- ruby.sh | 4 +-- 3 files changed, 78 insertions(+), 18 deletions(-) diff --git a/config.sh b/config.sh index fad153b..574552c 100644 --- a/config.sh +++ b/config.sh @@ -1,8 +1,8 @@ # Dest -JAVA_CONF=$HOME/.bash_java_ot +JAVA_CONF="$HOME/.bash_java_ot" RUBY_VER="ruby-enterprise-1.8.7-2011.03" -RUBY_CONF=$HOME/.bash_ruby_ot +RUBY_CONF="$HOME/.bash_ruby_ot" RUBY_DEST="$HOME/$RUBY_VER" OB_NUM_VER="2.2.3" @@ -14,3 +14,8 @@ KL_CONF="$HOME/.bash_R_ot" KL_DEST="$HOME/r-packages" NGINX_DEST=$HOME/nginx + +REDIS_VER="2.2.2" +REDIS_SERVER_CONF="$HOME/.redis.conf" +REDIS_CONF="$HOME/.bash_redis_ot" +REDIS_DEST="$HOME/redis-$REDIS_VER" diff --git a/redis.sh b/redis.sh index 830c6c4..4516333 100755 --- a/redis.sh +++ b/redis.sh @@ -1,16 +1,71 @@ #!/bin/sh -echo "Installing Redis database" -. /etc/profile -. ./config -dir=`pwd` -cd /tmp -wget -O - "http://redis.googlecode.com/files/redis-2.2.2.tar.gz" | tar zxv -cd redis-2.2.2 -make install -echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf -mkdir -p /opt/redis -echo "daemonize yes" > /opt/redis/redis.conf -echo "dir `pwd`" >> /opt/redis/redis.conf -redis-server /opt/redis/redis.conf -cd $dir +#!/bin/bash +# +# Installs Passenger. +# Author: Christoph Helma, Andreas Maunz. +# + +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 +fi + +# Utils +WGET="`which wget`" +if [ ! -e "$WGET" ]; then + echo "'wget' missing. Install 'wget' first. Aborting..." + exit 1 +fi + +source ./config.sh + +echo "This installs Redis." +echo "Press to continue, or to abort." +read + +DIR=`pwd` + +REDIS_DONE=FALSE +mkdir "$REDIS_DEST" >/dev/null 2>&1 +if [ ! -d "$REDIS_DEST" ]; then + echo "Install directory '$REDIS_DEST' is not available! Aborting..." + exit 1 +else + if ! rmdir "$REDIS_DEST" >/dev/null 2>&1; then # if not empty this will fail + echo "Install directory '$REDIS_DEST' is not empty. Skipping kernlab installation..." + REDIS_DONE=true + else + mkdir "$REDIS_DEST" >/dev/null 2>&1 + fi +fi + +if ! $REDIS_DONE; then + echo "Need root password: " + echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf + + cd $HOME + $WGET -O - "http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" | tar zxv + cd $REDIS_DEST + if ! make; then + echo "Build failed! Aborting..." + exit 1 + fi + echo "daemonize yes" > $REDIS_SERVER_CONF + echo "dir `pwd`" >> $REDIS_SERVER_CONF + + echo + echo "Preparing Redis..." + if [ ! -f $REDIS_CONF ]; then + echo "PATH=$REDIS_DEST/bin:\$PATH" >> "$REDIS_CONF" + echo "Redis configuration has been stored in '$REDIS_CONF'." + echo -n "Decide if Redis configuration should be linked to your .bashrc ('y/n'): " + read ANSWER_REDIS_CONF + if [ $ANSWER_REDIS_CONF = "y" ]; then + echo "source \"$REDIS_CONF\"" >> $HOME/.bashrc + fi + else + echo "It seems Redis is already configured ('$RUBY_CONF' exists)." + fi + +fi diff --git a/ruby.sh b/ruby.sh index fd00b2b..a21cfee 100755 --- a/ruby.sh +++ b/ruby.sh @@ -71,8 +71,8 @@ if [ ! -f $RUBY_CONF ]; then echo "PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF" echo "Ruby configuration has been stored in '$RUBY_CONF'." echo -n "Decide if Ruby configuration should be linked to your .bashrc ('y/n'): " - read ANSWER_JAVA_CONF - if [ $ANSWER_JAVA_CONF = "y" ]; then + read ANSWER_RUBY_CONF + if [ $ANSWER_RUBY_CONF = "y" ]; then echo "source \"$RUBY_CONF\"" >> $HOME/.bashrc fi else -- cgit v1.2.3 From 43b11aecd665e244e7957c0a83fa836db4168292 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:37:53 +0200 Subject: Redis --- redis.sh | 2 +- ruby.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/redis.sh b/redis.sh index 4516333..0a18848 100755 --- a/redis.sh +++ b/redis.sh @@ -26,7 +26,7 @@ read DIR=`pwd` -REDIS_DONE=FALSE +REDIS_DONE=false mkdir "$REDIS_DEST" >/dev/null 2>&1 if [ ! -d "$REDIS_DEST" ]; then echo "Install directory '$REDIS_DEST' is not available! Aborting..." diff --git a/ruby.sh b/ruby.sh index a21cfee..5bd8314 100755 --- a/ruby.sh +++ b/ruby.sh @@ -23,6 +23,14 @@ if [ -n "$1" ]; then RUBY_DEST="$1" fi +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 "Press to continue, or to abort." +read + +DIR="`pwd`" + mkdir "$RUBY_DEST" >/dev/null 2>&1 if [ ! -d "$RUBY_DEST" ]; then echo "Install directory '$RUBY_DEST' is not available! Aborting..." @@ -34,13 +42,7 @@ else fi fi -DIR="`pwd`" if [ ! $RUBY_DONE ]; then - 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 "Press to continue, or to abort." - read cd /tmp if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" | tar zxv >/dev/null 2>&1 ; then echo "Download failed! Aborting..." -- cgit v1.2.3 From 9a4c7117bcb85130a0bee3ed4d38ed15b12da540 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:39:18 +0200 Subject: Redis --- redis.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/redis.sh b/redis.sh index 0a18848..b3f1acd 100755 --- a/redis.sh +++ b/redis.sh @@ -1,5 +1,3 @@ -#!/bin/sh - #!/bin/bash # # Installs Passenger. -- cgit v1.2.3 From f5d0cdc361bf6081835907284006b24497da89ee Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:44:46 +0200 Subject: Redis --- base-install.sh | 4 ++-- openbabel.sh | 21 +++++---------------- redis.sh | 2 +- ruby.sh | 2 +- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/base-install.sh b/base-install.sh index a0a6c94..b654a37 100755 --- a/base-install.sh +++ b/base-install.sh @@ -99,8 +99,8 @@ if [ ! -f $JAVA_CONF ]; then exit 1 fi - echo "JAVA_HOME=$JAVA_HOME" >> "$JAVA_CONF" - echo "PATH=$JAVA_HOME:\$PATH" >> "$JAVA_CONF" + echo "export JAVA_HOME=$JAVA_HOME" >> "$JAVA_CONF" + echo "export PATH=$JAVA_HOME:\$PATH" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." echo -n "Answer 'y' if Java configuration should be linked to your .bashrc: " diff --git a/openbabel.sh b/openbabel.sh index c75ca8d..5ed15d6 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -95,22 +95,11 @@ cd "$DIR" echo echo "Preparing Openbabel..." if [ ! -f $OB_CONF ]; then - echo "PATH=$OB_DEST/bin:\$PATH" >> "$OB_CONF" - echo "if [ -z \"\$LD_LIBRARY_PATH\" ]; then \ - export LD_LIBRARY_PATH=\"$OB_DEST/lib\"; \ - else \ - export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; \ - fi" >> "$OB_CONF" - echo "if [ -z \"\$BABEL_LIBDIR\" ]; then \ - export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; \ - fi" >> "$OB_CONF" - echo "if [ -z \"\$BABEL_DATADIR\" ]; then \ - export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; \ - fi" >> "\$OB_CONF" - echo "if [ -z \"\$RUBYLIB\" ]; then \ - export RUBYLIB=\"$OB_DEST_BINDINGS\"; \ - fi" >> "$RUBY_CONF" - + echo "export PATH=$OB_DEST/bin:\$PATH" >> "$OB_CONF" + echo "if [ -z \"\$LD_LIBRARY_PATH\" ]; then export LD_LIBRARY_PATH=\"$OB_DEST/lib\"; else export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." echo -n "Decide if Openbabel configuration should be linked to your .bashrc ('y/n'): " read ANSWER_OB_CONF diff --git a/redis.sh b/redis.sh index b3f1acd..496c9b9 100755 --- a/redis.sh +++ b/redis.sh @@ -55,7 +55,7 @@ if ! $REDIS_DONE; then echo echo "Preparing Redis..." if [ ! -f $REDIS_CONF ]; then - echo "PATH=$REDIS_DEST/bin:\$PATH" >> "$REDIS_CONF" + echo "export PATH=$REDIS_DEST/src:\$PATH" >> "$REDIS_CONF" echo "Redis configuration has been stored in '$REDIS_CONF'." echo -n "Decide if Redis configuration should be linked to your .bashrc ('y/n'): " read ANSWER_REDIS_CONF diff --git a/ruby.sh b/ruby.sh index 5bd8314..f6b02cb 100755 --- a/ruby.sh +++ b/ruby.sh @@ -70,7 +70,7 @@ cd "$DIR" echo echo "Preparing RUBY..." if [ ! -f $RUBY_CONF ]; then - echo "PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF" + echo "export PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF" echo "Ruby configuration has been stored in '$RUBY_CONF'." echo -n "Decide if Ruby configuration should be linked to your .bashrc ('y/n'): " read ANSWER_RUBY_CONF -- cgit v1.2.3 From 7acd2561a4f046128fc3d93c84f5771a59c465a4 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:50:51 +0200 Subject: Fixed openbabel --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index 5ed15d6..48fde26 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -18,7 +18,7 @@ if [ ! -e "$WGET" ]; then fi # Pkg -source ./config +source ./config.sh if [ -n "$1" ]; then OB_DEST="$1" fi -- cgit v1.2.3 From 32b7c10610616d3c6321b8d28f26dbad7a6057a2 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 13:55:07 +0200 Subject: Fixed redis control flow --- redis.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/redis.sh b/redis.sh index 496c9b9..8958c7c 100755 --- a/redis.sh +++ b/redis.sh @@ -31,7 +31,7 @@ if [ ! -d "$REDIS_DEST" ]; then exit 1 else if ! rmdir "$REDIS_DEST" >/dev/null 2>&1; then # if not empty this will fail - echo "Install directory '$REDIS_DEST' is not empty. Skipping kernlab installation..." + echo "Install directory '$REDIS_DEST' is not empty. Skipping Redis installation..." REDIS_DONE=true else mkdir "$REDIS_DEST" >/dev/null 2>&1 @@ -51,19 +51,19 @@ if ! $REDIS_DONE; then fi echo "daemonize yes" > $REDIS_SERVER_CONF echo "dir `pwd`" >> $REDIS_SERVER_CONF +fi - echo - 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'." - echo -n "Decide if Redis configuration should be linked to your .bashrc ('y/n'): " - read ANSWER_REDIS_CONF - if [ $ANSWER_REDIS_CONF = "y" ]; then - echo "source \"$REDIS_CONF\"" >> $HOME/.bashrc - fi - else - echo "It seems Redis is already configured ('$RUBY_CONF' exists)." +echo +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'." + echo -n "Decide if Redis configuration should be linked to your .bashrc ('y/n'): " + read ANSWER_REDIS_CONF + if [ $ANSWER_REDIS_CONF = "y" ]; then + echo "source \"$REDIS_CONF\"" >> $HOME/.bashrc fi - +else + echo "It seems Redis is already configured ('$RUBY_CONF' exists)." fi + -- cgit v1.2.3 From 9ac9100ef477fbe3e98a5d0c57d2def5b84bdd75 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 14:07:32 +0200 Subject: opentox-webservices --- config.sh | 2 ++ opentox-webservices.sh | 62 +++++++++++++++++++++++++++++++------------------- redis.sh | 5 +++- 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/config.sh b/config.sh index 574552c..211ad6a 100644 --- a/config.sh +++ b/config.sh @@ -19,3 +19,5 @@ REDIS_VER="2.2.2" REDIS_SERVER_CONF="$HOME/.redis.conf" REDIS_CONF="$HOME/.bash_redis_ot" REDIS_DEST="$HOME/redis-$REDIS_VER" + +WWW_DEST="$HOME/www" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 294b9bf..8fe8a1f 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -1,23 +1,37 @@ -#!/bin/sh - -echo "Installing OpenTox webservices" -. ./config -# Create opentox system user -id opentox -if [ $? -ne 0 ] -then - adduser --system opentox +#!/bin/bash +# +# Installs Opentox Webservices. +# Author: Christoph Helma, Andreas Maunz. +# + +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 +fi + +# Utils +WGET="`which wget`" +if [ ! -e "$WGET" ]; then + echo "'wget' missing. Install 'wget' first. Aborting..." + exit 1 fi -dir=`pwd` -mkdir -p /var/www/opentox -cd /var/www/opentox +source ./config.sh + +echo "This installs Opentox webservices." +echo "Press to continue, or to abort." +read + +DIR=`pwd` + +mkdir -p "$WWW_DEST/opentox" +cd "$WWW_DEST/opentox" for s in compound dataset algorithm model toxcreate task; do - git clone git://github.com/opentox/$s.git $s - cd $s - git checkout -t origin/$branch - mkdir -p public - ln -s /var/www/opentox/$s/public /var/www/$s + git clone "git://github.com/opentox/$s.git" "$s" + cd "$s" + git checkout -t origin/development # AM: use development + mkdir public + ln -s "$WWW_DEST/opentox/$s/public" "$WWW_DEST/$s" cd - done @@ -30,10 +44,12 @@ done #ln -s /var/www/opentox/validation/public /var/www/validation # fminer etc -cd /var/www/opentox/algorithm -updatedb +cd $WWW_DEST/opentox/algorithm +echo "Need root password:" +sudo updatedb rake fminer:install -chown -R opentox /var/www/opentox -cp -r $HOME/.opentox /home/opentox/ -chown -R opentox /home/opentox/.opentox -cd $dir +cp -r "$HOME/.opentox" "$HOME" + +cd "$DIR" +echo +echo "Opentox installation finished." diff --git a/redis.sh b/redis.sh index 8958c7c..ddeec6e 100755 --- a/redis.sh +++ b/redis.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Installs Passenger. +# Installs Redis. # Author: Christoph Helma, Andreas Maunz. # @@ -67,3 +67,6 @@ else echo "It seems Redis is already configured ('$RUBY_CONF' exists)." fi +cd "$DIR" +echo +echo "Redis installation finished." -- cgit v1.2.3 From b4a59bb26442855916eebeea67cfc696e22c8faa Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 29 Mar 2011 15:49:38 +0200 Subject: ESCAPEDSERVERNAME substitution fixed, PASSORD removed --- aa-local.yaml | 16 ++++++++-------- aa-server.yaml | 16 ++++++++-------- config | 4 ---- opentox-ruby.sh | 5 ++--- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/aa-local.yaml b/aa-local.yaml index 593ba56..ebfd667 100644 --- a/aa-local.yaml +++ b/aa-local.yaml @@ -15,24 +15,24 @@ # Exceptions: :free_uris: #request-method for uri not controlled by A&A ? - :GET - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ ? - :GET - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/toxcreate/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/compound/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/ ? - :PUT - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ :authorize_exceptions: #request-method for uri only authenticated, no authorization ? - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/dataset" - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http\:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http\:\/\/ESCAPEDSERVE\/validation\/[a-z,A-Z,\/,_\-]*$/ diff --git a/aa-server.yaml b/aa-server.yaml index 593ba56..ebfd667 100644 --- a/aa-server.yaml +++ b/aa-server.yaml @@ -15,24 +15,24 @@ # Exceptions: :free_uris: #request-method for uri not controlled by A&A ? - :GET - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ ? - :GET - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/toxcreate/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/compound/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/ ? - :PUT - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ :authorize_exceptions: #request-method for uri only authenticated, no authorization ? - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/dataset" - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http\:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http\:\/\/ESCAPEDSERVE\/validation\/[a-z,A-Z,\/,_\-]*$/ diff --git a/config b/config index b5dabcc..e72242b 100644 --- a/config +++ b/config @@ -5,10 +5,6 @@ # Linux distribution (currently only debian) distribution=debian -# Choose a root password for the MySQL database -# Please insert the correct password if mysql-server is already installed -mysql_root=opentox - # Installation type # Options: # gem installs only the opentox-ruby gem (useful, if you want to use external services with the opentox-ruby DSL) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 6302009..70de013 100644 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -27,9 +27,8 @@ fi mkdir -p $HOME/.opentox/config mkdir -p $HOME/.opentox/log -#sed -e "s/SERVERNAME/$servername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml -sed -e "s/PASSWORD/$password/;s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml -sed -e "s/PASSWORD/$password/;s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" aa-$install.yaml >> $HOME/.opentox/config/production.yaml +sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml +sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" aa-$install.yaml >> $HOME/.opentox/config/production.yaml # checkout development version and link lib to opentox-ruby gem if [ $branch = "development" ] -- cgit v1.2.3 From 90c34fd3fbb337df8edc6318a746a520432d0a3a Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 29 Mar 2011 16:00:11 +0200 Subject: opentox-ruby --- opentox-ruby.sh | 78 +++++++++++++++++++++++++++----------------------- opentox-webservices.sh | 3 +- 2 files changed, 43 insertions(+), 38 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 6302009..c3efcb2 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -1,49 +1,55 @@ -#!/bin/sh +#!/bin/bash +# +# Installs Opentox-ruby gem. +# Author: Christoph Helma, Andreas Maunz. +# -echo "Installing opentox-ruby gem" -. /etc/profile -. ./config -gem install opentox-ruby -gem install builder # not included by spreadsheet gem - -dir=`pwd` - -# create config file -servername=`hostname`.`dnsdomainname` -escapedservername=`echo $servername|sed 's/\/\\\//'` -if [ $branch = "development" ] -then - logger=":logger: backtrace" -else - logger="" +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 fi -if [ $install = "server" ] -then - aa="https:\/\/opensso.in-silico.ch" -else - aa=nil +# Utils +GIT="`which git`" +if [ ! -e "$GIT" ]; then + echo "'git' missing. Install 'git' first. Aborting..." + exit 1 fi -mkdir -p $HOME/.opentox/config -mkdir -p $HOME/.opentox/log -#sed -e "s/SERVERNAME/$servername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml -sed -e "s/PASSWORD/$password/;s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml -sed -e "s/PASSWORD/$password/;s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" aa-$install.yaml >> $HOME/.opentox/config/production.yaml +# Pkg +source ./config.sh + + +echo "This installs the Opentox-ruby gem." +echo "Press to continue, or to abort." +read + +DIR="`pwd`" + +gem install opentox-ruby +gem install builder # not included by spreadsheet gem + +SERVERNAME="`hostname`" +ESCAPED_SERVERNAME="`echo $SERVERNAME | sed 's/\/\\\//'`" +LOGGER=":logger: backtrace" +AA="nil" + +mkdir -p "$HOME/.opentox/config" +mkdir -p "$HOME/.opentox/log" +sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml +sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" aa-$install.yaml >> $HOME/.opentox/config/production.yaml # checkout development version and link lib to opentox-ruby gem if [ $branch = "development" ] then - mkdir -p /var/www/opentox - cd /var/www/opentox - git clone http://github.com/opentox/opentox-ruby.git + mkdir -p $WWW_DEST/opentox + cd $WWW_DEST/opentox + $GIT clone http://github.com/opentox/opentox-ruby.git cd opentox-ruby - git checkout -t origin/$branch + $GIT checkout -t origin/development gem install jeweler rake install - gem_lib=`gem which opentox-ruby` - gem_lib=`echo $gem_lib | sed 's/\/opentox-ruby.rb//'` - mv $gem_lib $gem_lib~ - ln -s /var/www/opentox/opentox-ruby/lib $gem_lib + 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" fi -cd $dir diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 8fe8a1f..c7c3b78 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -48,8 +48,7 @@ cd $WWW_DEST/opentox/algorithm echo "Need root password:" sudo updatedb rake fminer:install -cp -r "$HOME/.opentox" "$HOME" cd "$DIR" echo -echo "Opentox installation finished." +echo "Opentox webservices installation finished." -- cgit v1.2.3 From 3175afdf422f54e11eadecb535a52ecc00119418 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 13:15:57 +0200 Subject: opentox-ruby --- opentox-ruby.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index c3efcb2..ae8e08e 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -16,6 +16,19 @@ if [ ! -e "$GIT" ]; then exit 1 fi +GEM="`which gem`" +if [ ! -e "$GEM" ]; then + echo "'gem' missing. Install 'gem' first. Aborting..." + exit 1 +fi + +RAKE="`which rake`" +if [ ! -e "$RAKE" ]; then + echo "'rake' missing. Install 'rake' first. Aborting..." + exit 1 +fi + + # Pkg source ./config.sh @@ -26,8 +39,8 @@ read DIR="`pwd`" -gem install opentox-ruby -gem install builder # not included by spreadsheet gem +$GEM install opentox-ruby +$GEM install builder # not included by spreadsheet gem SERVERNAME="`hostname`" ESCAPED_SERVERNAME="`echo $SERVERNAME | sed 's/\/\\\//'`" @@ -44,12 +57,14 @@ if [ $branch = "development" ] then mkdir -p $WWW_DEST/opentox cd $WWW_DEST/opentox - $GIT clone http://github.com/opentox/opentox-ruby.git + $GIT clone "http://github.com/opentox/opentox-ruby.git " cd opentox-ruby - $GIT checkout -t origin/development - gem install jeweler - rake install - GEM_LIB=`gem which opentox-ruby | sed 's/\/opentox-ruby.rb//'` + $GIT checkout -t "origin/development" + $GEM install jeweler + $RAKE install + 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" fi + +cd "$DIR" -- cgit v1.2.3 From f043da5009a8358df1b33789b288aee3d1cb9c70 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 13:18:47 +0200 Subject: opentox-ruby --- opentox-ruby.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index ae8e08e..b4156c5 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -52,19 +52,15 @@ mkdir -p "$HOME/.opentox/log" sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" aa-$install.yaml >> $HOME/.opentox/config/production.yaml -# checkout development version and link lib to opentox-ruby gem -if [ $branch = "development" ] -then - mkdir -p $WWW_DEST/opentox - cd $WWW_DEST/opentox - $GIT clone "http://github.com/opentox/opentox-ruby.git " - cd opentox-ruby - $GIT checkout -t "origin/development" - $GEM install jeweler - $RAKE install - 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" -fi +mkdir -p $WWW_DEST/opentox +cd $WWW_DEST/opentox +$GIT clone "http://github.com/opentox/opentox-ruby.git " +cd opentox-ruby +$GIT checkout -t "origin/development" +$GEM install jeweler +$RAKE install +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" cd "$DIR" -- cgit v1.2.3 From 91154152cdca07690ddd91bb4d0dd686a4c7b5e0 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 13:25:28 +0200 Subject: opentox-ruby --- opentox-ruby.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index b4156c5..d3d4c62 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -50,16 +50,18 @@ AA="nil" mkdir -p "$HOME/.opentox/config" mkdir -p "$HOME/.opentox/log" sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml -sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" aa-$install.yaml >> $HOME/.opentox/config/production.yaml +sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" "aa-local.yaml" >> $HOME/.opentox/config/production.yaml mkdir -p $WWW_DEST/opentox cd $WWW_DEST/opentox $GIT clone "http://github.com/opentox/opentox-ruby.git " cd opentox-ruby -$GIT checkout -t "origin/development" +pwd +$GIT checkout -t origin/development $GEM install jeweler $RAKE install GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` +echo "'$GEM_LIB'" mv "$GEM_LIB" "$GEM_LIB~" ln -s "$WWW_DEST/opentox/opentox-ruby/lib" "$GEM_LIB" -- cgit v1.2.3 From ddad2649a837030a19ae1338243b76ab6a8e6104 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 13:27:45 +0200 Subject: opentox-ruby --- opentox-ruby.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index d3d4c62..930d226 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -57,6 +57,8 @@ cd $WWW_DEST/opentox $GIT clone "http://github.com/opentox/opentox-ruby.git " cd opentox-ruby pwd +$GIT remote show origin +$GIT fetch $GIT checkout -t origin/development $GEM install jeweler $RAKE install -- cgit v1.2.3 From 914b26a1b03f8d3a0d8c46005dff53114b5af8ec Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 13:30:08 +0200 Subject: opentox-ruby --- opentox-ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 930d226..5ff89a0 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -59,7 +59,7 @@ cd opentox-ruby pwd $GIT remote show origin $GIT fetch -$GIT checkout -t origin/development +$GIT checkout -b development origin/development $GEM install jeweler $RAKE install GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` -- cgit v1.2.3 From 5ae9365231ce0727d28e589bfc2b9d0aeee6ceaa Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 13:34:44 +0200 Subject: opentox-ruby --- opentox-ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 5ff89a0..842c91f 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -54,7 +54,7 @@ sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGG mkdir -p $WWW_DEST/opentox cd $WWW_DEST/opentox -$GIT clone "http://github.com/opentox/opentox-ruby.git " +$GIT clone "git://github.com/opentox/opentox-ruby.git " cd opentox-ruby pwd $GIT remote show origin -- cgit v1.2.3 From 12f42b70b451254f2865a379c1bb1d2ab964e9ff Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 14:56:53 +0200 Subject: opentox-ruby --- config.sh | 52 ++++++++++++++++++++++++++++++++++++---------------- nginx.conf | 11 +++++++---- openbabel.sh | 5 ----- 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/config.sh b/config.sh index 211ad6a..c0a1d36 100644 --- a/config.sh +++ b/config.sh @@ -1,23 +1,43 @@ -# Dest -JAVA_CONF="$HOME/.bash_java_ot" +#!/bin/bash +# +# Configuration file for Opentox installer. +# Author: Christoph Helma, Andreas Maunz. +# -RUBY_VER="ruby-enterprise-1.8.7-2011.03" -RUBY_CONF="$HOME/.bash_ruby_ot" -RUBY_DEST="$HOME/$RUBY_VER" +# 1) Where all binaries are installed. +PREFIX="$HOME/opentox" +# 2) What versions to install. +RUBY_NUM_VER="1.8.7-2011.03" OB_NUM_VER="2.2.3" -OB_VER="openbabel-$OB_NUM_VER" -OB_DEST="$HOME/$OB_VER" +KL_NUM_VER="0.9-11" +REDIS_NUM_VER="2.2.2" + +# 3) What server settings. +NGINX_SERVERNAME="localhost" +WWW_DEST="$PREFIX/www" + +# 4) Done. -KL_VER="0.9-11" -KL_CONF="$HOME/.bash_R_ot" -KL_DEST="$HOME/r-packages" -NGINX_DEST=$HOME/nginx +### Nothing to gain from changes below this line. +JAVA_CONF="$PREFIX/.bash_java_ot" +RUBY_CONF="$PREFIX/.bash_ruby_ot" +REDIS_CONF="$PREFIX/.bash_redis_ot" +OB_CONF="$PREFIX/.bash_OB_ot" +KL_CONF="$PREFIX/.bash_R_ot" + +RUBY_VER="ruby-enterprise-$RUBY_NUM_VER" +OB_VER="openbabel-$OB_NUM_VER" +KL_VER="$KL_NUM_VER" +REDIS_VER="$REDIS_NUM_VER" + +RUBY_DEST="$PREFIX/$RUBY_VER" +OB_DEST="$PREFIX/$OB_VER" +OB_DEST_BINDINGS="$PREFIX/openbabel-ruby-install" +KL_DEST="$PREFIX/r-packages" +NGINX_DEST="$PREFIX/nginx" +REDIS_DEST="$PREFIX/redis-$REDIS_VER" -REDIS_VER="2.2.2" -REDIS_SERVER_CONF="$HOME/.redis.conf" -REDIS_CONF="$HOME/.bash_redis_ot" -REDIS_DEST="$HOME/redis-$REDIS_VER" +REDIS_SERVER_CONF="$REDIS_DEST/redis.conf" -WWW_DEST="$HOME/www" diff --git a/nginx.conf b/nginx.conf index e6cb438..8ce1591 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,3 +1,4 @@ +#user ist; worker_processes 10; events { @@ -7,6 +8,7 @@ events { http { server_names_hash_bucket_size 256; + include /home/ist/nginx/conf/mime.types; passenger_root RUBY_DEST/lib/ruby/gems/1.8/gems/PASSENGER; passenger_ruby RUBY_DEST/bin/ruby; @@ -15,7 +17,7 @@ http { passenger_spawn_method conservative; #passenger_use_global_queue on; - include mime.types; + include NGINX_DEST/mime.types; default_type application/octet-stream; sendfile on; @@ -26,9 +28,10 @@ http { listen 80; client_max_body_size 5000m; server_name SERVERNAME; - root /var/www/; - - passenger_enabled on; + location / { + root WWW_DEST; + passenger_enabled on; + } passenger_base_uri /compound; passenger_base_uri /dataset; passenger_base_uri /algorithm; diff --git a/openbabel.sh b/openbabel.sh index 48fde26..90e3093 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -22,11 +22,6 @@ source ./config.sh if [ -n "$1" ]; then OB_DEST="$1" fi -OB_DEST_BINDINGS="$HOME/openbabel-ruby-install" - -# Dest -OB_CONF=$HOME/.bash_OB_ot -RUBY_CONF=$HOME/.bash_ruby_ot echo "This installs Openbabel." -- cgit v1.2.3 From 32a196c74bf552a4c0e43f4fc45866cffd6caf2a Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 15:01:12 +0200 Subject: install --- install | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/install b/install index d9cd3f2..acdd503 100755 --- a/install +++ b/install @@ -6,21 +6,17 @@ echo "Opentox-ruby installation" echo "Press to continue..." read -. ./config -. ./base-install.sh $distribution # Pass as parameter -. ./ruby.sh -. ./openbabel.sh -. ./kernlab.sh -. ./opentox-ruby.sh +. "./config" +. "./base-install.sh" $distribution # Pass as parameter +. "./ruby.sh" +. "./openbabel.sh" +. "./kernlab.sh" +. "./opentox-ruby.sh" if [ $install != "gem" ] then - . ./nginx.sh - . ./redis.sh - . ./opentox-webservices.sh - #. ./mysql-setup.sh - echo "Starting Nginx" - echo "Please inspect and tune /opt/nginx/conf/nginx.conf and /home/opentox/.opentox/config/production.yaml" - /opt/nginx/sbin/nginx + . "./nginx.sh" + . "./redis.sh" + . "./opentox-webservices.sh" fi -- cgit v1.2.3 From 16cfa7f673220db44079443dcd8a7f2585a6fba5 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:04:11 +0200 Subject: base-install --- base-install.sh | 11 +++++------ install | 18 +++++++++--------- ruby.sh | 44 +++++++++++++++++++++++++++++++++++++------- 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/base-install.sh b/base-install.sh index b654a37..a61537d 100755 --- a/base-install.sh +++ b/base-install.sh @@ -10,12 +10,11 @@ if [ "$(id -u)" = "0" ]; then fi # Utils -APTITUDE="sudo `which aptitude`" +APTITUDE="`which aptitude`" APT_CACHE="`which apt-cache`" -DCSS="sudo `which debconf-set-selections`" DPKG="`which dpkg`" -if [ ! -e $APTITUDE ]; then +if [ ! -e "$APTITUDE" ]; then echo "Aptitude missing. Install aptitude first." 1>&2 exit 1 fi @@ -47,8 +46,8 @@ if [ -n "$pack_arr" ]; then echo echo "Checking availablity of missing packages..." echo -n "Updating package indices: " - $APTITUDE update -y >/dev/null 2>&1 - $APTITUDE upgrade -y >/dev/null 2>&1 + sudo $APTITUDE update -y >/dev/null 2>&1 + sudo $APTITUDE upgrade -y >/dev/null 2>&1 echo "done." fi @@ -73,7 +72,7 @@ echo "Installing missing packages, please wait..." pack_fail="" for p in $pack_arr; do echo -n "'$p': " - if $APTITUDE install "$p" -y >/dev/null 2>&1; then + if sudo $APTITUDE install "$p" -y >/dev/null 2>&1; then printf "%25s%15s\n" "'$p'" "DONE" else printf "%25s%15s\n" "'$p'" "FAIL" diff --git a/install b/install index acdd503..2285107 100755 --- a/install +++ b/install @@ -6,17 +6,17 @@ echo "Opentox-ruby installation" echo "Press to continue..." read -. "./config" -. "./base-install.sh" $distribution # Pass as parameter -. "./ruby.sh" -. "./openbabel.sh" -. "./kernlab.sh" -. "./opentox-ruby.sh" +source "./config" +source "./base-install.sh" +source "./ruby.sh" +source "./openbabel.sh" +source "./kernlab.sh" +source "./opentox-ruby.sh" if [ $install != "gem" ] then - . "./nginx.sh" - . "./redis.sh" - . "./opentox-webservices.sh" + source "./nginx.sh" + source "./redis.sh" + source "./opentox-webservices.sh" fi diff --git a/ruby.sh b/ruby.sh index f6b02cb..bbe62c7 100755 --- a/ruby.sh +++ b/ruby.sh @@ -17,15 +17,25 @@ if [ ! -e "$WGET" ]; then exit 1 fi +GEM="`which gem`" +if [ ! -e "$GEM" ]; then + echo "'gem' missing. Install 'gem' first. Aborting..." + exit 1 +fi + # Pkg source ./config.sh if [ -n "$1" ]; then RUBY_DEST="$1" fi +LOG="/tmp/`basename $0`-log.txt" + + 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 "When compilation fails, see '$LOG' for details." echo "Press to continue, or to abort." read @@ -44,11 +54,17 @@ fi if [ ! $RUBY_DONE ]; then cd /tmp - if ! $WGET -O - "http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" | tar zxv >/dev/null 2>&1 ; then - echo "Download failed! Aborting..." + URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" + if ! $WGET -O - "$URI" | tar zxv >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'Download'" "FAIL" exit 1 fi - sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST" + printf "%25s%15s\n" "'Download'" "DONE" + if ! sh /installer --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST" >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'Install'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Install'" "DONE" fi echo @@ -60,10 +76,24 @@ echo -n "Enter 's' to skip this step: " read PASSENGER_SKIP if [ "$PASSENGER_SKIP" != "s" ]; then export PATH="$RUBY_DEST/bin:$PATH" - gem sources -a "http://gemcutter.org " - gem sources -r "http://rubygems.org/" - echo "gem: --no-ri --no-rdoc" | tee -a $HOME/.gemrc - gem install passenger + if ! $GEM sources -a "http://gemcutter.org " >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'Add Gemcutter'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Add Gemcutter'" "DONE" + if ! $GEM sources -r "http://rubygems.org/" >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'Add Rubygems'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Add Rubygems'" "DONE" + echo "gem: --no-ri --no-rdoc" | tee -a $HOME/.gemrc >>$LOG 2>&1 + if ! $GEM install passenger >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'Install Passenger'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Install Passenger'" "DONE" + + fi cd "$DIR" -- cgit v1.2.3 From f76f11eaf435397607f2aa5e70496c01005d5c6b Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:22:35 +0200 Subject: base-install --- base-install.sh | 9 ++------- config.sh | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/base-install.sh b/base-install.sh index a61537d..35591a9 100755 --- a/base-install.sh +++ b/base-install.sh @@ -21,6 +21,7 @@ fi # Dest source ./config.sh +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" @@ -89,10 +90,6 @@ echo echo "Preparing JAVA..." if [ ! -f $JAVA_CONF ]; then - echo -n "Please provide a path for JAVA_HOME (hint: type echo \$JAVA_HOME as normal user): " - read USER_SUBMITTED_JAVA_HOME - JAVA_HOME="$USER_SUBMITTED_JAVA_HOME" - if [ ! -d "$JAVA_HOME" ]; then echo "Directory '$JAVA_HOME' does not exist! Aborting..." exit 1 @@ -102,9 +99,7 @@ if [ ! -f $JAVA_CONF ]; then echo "export PATH=$JAVA_HOME:\$PATH" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." - echo -n "Answer 'y' if Java configuration should be linked to your .bashrc: " - read ANSWER_JAVA_CONF - if [ $ANSWER_JAVA_CONF = "y" ]; then + if ! grep "$JAVA_CONF" $HOME/.bashrc; then echo "source \"$JAVA_CONF\"" >> $HOME/.bashrc fi diff --git a/config.sh b/config.sh index c0a1d36..aebf2d5 100644 --- a/config.sh +++ b/config.sh @@ -6,6 +6,7 @@ # 1) Where all binaries are installed. PREFIX="$HOME/opentox" +JAVA_HOME="/usr/lib/java-6-sun" # 2) What versions to install. RUBY_NUM_VER="1.8.7-2011.03" @@ -13,7 +14,7 @@ OB_NUM_VER="2.2.3" KL_NUM_VER="0.9-11" REDIS_NUM_VER="2.2.2" -# 3) What server settings. +# 3) Server settings. NGINX_SERVERNAME="localhost" WWW_DEST="$PREFIX/www" -- cgit v1.2.3 From a7449c8e38e29f390a75e6f3f39fe26096d508e3 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:23:55 +0200 Subject: Added utils.sh --- utils.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 utils.sh diff --git a/utils.sh b/utils.sh new file mode 100644 index 0000000..98893b4 --- /dev/null +++ b/utils.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function check_dest { + if ! [ -d $PREFIX ]; then + if ! mkdir -p $PREFIX; + echo "Could not create target directory '$PREFIX'! Aborting..." + exit 1 + fi + fi +} + +check_dest -- cgit v1.2.3 From 9beb2014b745b2c5fcf76d37bfeabc59f89f154d Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:24:35 +0200 Subject: utils.sh --- utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.sh b/utils.sh index 98893b4..6de9c89 100644 --- a/utils.sh +++ b/utils.sh @@ -2,7 +2,7 @@ function check_dest { if ! [ -d $PREFIX ]; then - if ! mkdir -p $PREFIX; + if ! mkdir -p $PREFIX; then echo "Could not create target directory '$PREFIX'! Aborting..." exit 1 fi -- cgit v1.2.3 From 2e04bf823ee2b9b7a6017eba4b0736fee90f0f45 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:28:17 +0200 Subject: ruby.sh --- base-install.sh | 2 +- ruby.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/base-install.sh b/base-install.sh index 35591a9..e1d8bf2 100755 --- a/base-install.sh +++ b/base-install.sh @@ -99,7 +99,7 @@ if [ ! -f $JAVA_CONF ]; then echo "export PATH=$JAVA_HOME:\$PATH" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." - if ! grep "$JAVA_CONF" $HOME/.bashrc; then + if ! grep "$JAVA_CONF" $HOME/.bashrc >/dev/null 2>&1; then echo "source \"$JAVA_CONF\"" >> $HOME/.bashrc fi diff --git a/ruby.sh b/ruby.sh index bbe62c7..202a22c 100755 --- a/ruby.sh +++ b/ruby.sh @@ -17,12 +17,6 @@ if [ ! -e "$WGET" ]; then exit 1 fi -GEM="`which gem`" -if [ ! -e "$GEM" ]; then - echo "'gem' missing. Install 'gem' first. Aborting..." - exit 1 -fi - # Pkg source ./config.sh if [ -n "$1" ]; then @@ -74,6 +68,13 @@ echo "This will modify your '~/.gemrc'." echo "Press to continue, or to abort." echo -n "Enter 's' to skip this step: " read PASSENGER_SKIP + +GEM="`which gem`" +if [ ! -e "$GEM" ]; then + echo "'gem' missing. Install 'gem' first. Aborting..." + exit 1 +fi + if [ "$PASSENGER_SKIP" != "s" ]; then export PATH="$RUBY_DEST/bin:$PATH" if ! $GEM sources -a "http://gemcutter.org " >>$LOG 2>&1 ; then -- cgit v1.2.3 From 98b129fa002bcb39261c94668322e3ac46ca5d78 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:38:37 +0200 Subject: ruby.sh --- ruby.sh | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/ruby.sh b/ruby.sh index 202a22c..5e4731c 100755 --- a/ruby.sh +++ b/ruby.sh @@ -19,10 +19,7 @@ fi # Pkg source ./config.sh -if [ -n "$1" ]; then - RUBY_DEST="$1" -fi - +source ./utils.sh LOG="/tmp/`basename $0`-log.txt" @@ -30,7 +27,7 @@ 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 "When compilation fails, see '$LOG' for details." -echo "Press to continue, or to abort." +echo -n "Press to continue, or to abort." read DIR="`pwd`" @@ -61,6 +58,28 @@ if [ ! $RUBY_DONE ]; then printf "%25s%15s\n" "'Install'" "DONE" fi +cd "$DIR" + +echo +echo "Preparing RUBY..." + +if ! [ -f "$RUBY_CONF" ]; then + + echo "export PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF" + + echo "Ruby configuration has been stored in '$RUBY_CONF'." + if ! grep "$RUBY_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then + echo "source \"$RUBY_CONF\"" >> $HOME/.bashrc + fi + +else + echo "It seems RUBY is already configured ('$RUBY_CONF' exists)." +fi + + + + + echo echo "Ruby installation done." echo "Next 'Passenger' should be installed." @@ -69,6 +88,7 @@ echo "Press to continue, or to abort." echo -n "Enter 's' to skip this step: " read PASSENGER_SKIP +source "$RUBY_CONF" GEM="`which gem`" if [ ! -e "$GEM" ]; then echo "'gem' missing. Install 'gem' first. Aborting..." @@ -87,7 +107,10 @@ if [ "$PASSENGER_SKIP" != "s" ]; then exit 1 fi printf "%25s%15s\n" "'Add Rubygems'" "DONE" - echo "gem: --no-ri --no-rdoc" | tee -a $HOME/.gemrc >>$LOG 2>&1 + GEMCONF="gem: --no-ri --no-rdoc" + if ! grep "$GEMCONF" $HOME/.gemrc >>$LOG 2>&1; then + echo "$GEMCONF" | tee -a $HOME/.gemrc >>$LOG 2>&1 + fi if ! $GEM install passenger >>$LOG 2>&1 ; then printf "%25s%15s\n" "'Install Passenger'" "FAIL" exit 1 @@ -96,21 +119,8 @@ if [ "$PASSENGER_SKIP" != "s" ]; then fi -cd "$DIR" - -echo -echo "Preparing RUBY..." -if [ ! -f $RUBY_CONF ]; then - echo "export PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF" - echo "Ruby configuration has been stored in '$RUBY_CONF'." - echo -n "Decide if Ruby configuration should be linked to your .bashrc ('y/n'): " - read ANSWER_RUBY_CONF - if [ $ANSWER_RUBY_CONF = "y" ]; then - echo "source \"$RUBY_CONF\"" >> $HOME/.bashrc - fi -else - echo "It seems RUBY is already configured ('$RUBY_CONF' exists)." -fi echo echo "Ruby Installation finished." + + -- cgit v1.2.3 From fbb092d69d0b6f37a447846bef148eb233de8a36 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:42:10 +0200 Subject: ruby.sh --- ruby.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.sh b/ruby.sh index 5e4731c..cbad10c 100755 --- a/ruby.sh +++ b/ruby.sh @@ -46,12 +46,12 @@ fi if [ ! $RUBY_DONE ]; then cd /tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - if ! $WGET -O - "$URI" | tar zxv >>$LOG 2>&1 ; then + if ! $WGET -O - "$URI" 2>$LOG | tar zxv >>$LOG 2>&1 ; then printf "%25s%15s\n" "'Download'" "FAIL" exit 1 fi printf "%25s%15s\n" "'Download'" "DONE" - if ! sh /installer --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST" >>$LOG 2>&1 ; then + if ! sh "/tmp/$RUBY_VER/installer" --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST" >>$LOG 2>&1 ; then printf "%25s%15s\n" "'Install'" "FAIL" exit 1 fi -- cgit v1.2.3 From 5fbb4de66c241de9af9719b4e66401b8275a0755 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 16:50:36 +0200 Subject: ruby.sh --- ruby.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.sh b/ruby.sh index cbad10c..63a75a1 100755 --- a/ruby.sh +++ b/ruby.sh @@ -97,12 +97,12 @@ fi if [ "$PASSENGER_SKIP" != "s" ]; then export PATH="$RUBY_DEST/bin:$PATH" - if ! $GEM sources -a "http://gemcutter.org " >>$LOG 2>&1 ; then + if ! $GEM sources -a "http://gemcutter.org" >>$LOG 2>&1 ; then printf "%25s%15s\n" "'Add Gemcutter'" "FAIL" exit 1 fi printf "%25s%15s\n" "'Add Gemcutter'" "DONE" - if ! $GEM sources -r "http://rubygems.org/" >>$LOG 2>&1 ; then + if ! $GEM sources -r "http://rubygems.org" >>$LOG 2>&1 ; then printf "%25s%15s\n" "'Add Rubygems'" "FAIL" exit 1 fi -- cgit v1.2.3 From e99d554bcd52f506cdd87f9731a37f002a6b6fc7 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 30 Mar 2011 17:00:35 +0200 Subject: ruby.sh --- ruby.sh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ruby.sh b/ruby.sh index 63a75a1..371d78d 100755 --- a/ruby.sh +++ b/ruby.sh @@ -75,20 +75,10 @@ if ! [ -f "$RUBY_CONF" ]; then else echo "It seems RUBY is already configured ('$RUBY_CONF' exists)." fi +source "$RUBY_CONF" - - -echo -echo "Ruby installation done." -echo "Next 'Passenger' should be installed." -echo "This will modify your '~/.gemrc'." -echo "Press to continue, or to abort." -echo -n "Enter 's' to skip this step: " -read PASSENGER_SKIP - -source "$RUBY_CONF" GEM="`which gem`" if [ ! -e "$GEM" ]; then echo "'gem' missing. Install 'gem' first. Aborting..." -- cgit v1.2.3 From cd7de78a22fa54d7bf7080561dae109a79ccdc61 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 08:57:53 +0200 Subject: openbabel.sh --- openbabel.sh | 98 +++++++++++++++++++++++++++++++++++++----------------------- ruby.sh | 6 ++-- 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/openbabel.sh b/openbabel.sh index 90e3093..5e5a4f1 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -19,14 +19,13 @@ fi # Pkg source ./config.sh -if [ -n "$1" ]; then - OB_DEST="$1" -fi - +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 to continue, or to abort." read @@ -42,56 +41,81 @@ else OB_DONE=true fi fi + if [ ! $OB_DONE ]; then cd /tmp - if ! $WGET -O - "http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" | tar zxv >/dev/null 2>&1; then - echo "Download failed! Aborting..." + URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" + if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1; then + printf "%25s%15s\n" "'Download'" "FAIL" exit 1 fi + printf "%25s%15s\n" "'Download'" "DONE" cd "/tmp/$OB_VER" - ./configure --prefix="$OB_DEST" - make - make install + + if ! ./configure --prefix="$OB_DEST" >>$LOG 2>&1; then + printf "%25s%15s\n" "'Configure'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Configure'" "DONE" + + if ! make >>$LOG 2>&1; then + printf "%25s%15s\n" "'Make'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Make'" "DONE" + + if ! make install >>$LOG 2>&1; then + printf "%25s%15s\n" "'Install'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Install'" "DONE" fi -echo -echo "Openbabel installation done." -echo "Next ruby bindings should be installed." -echo "Press to continue, or to abort." -echo -n "Enter 's' to skip this step: " -read RBB_SKIP -if [ "$RBB_SKIP" != "s" ]; then - OB_DONE=false - mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1 - if [ ! -d "$OB_DEST_BINDINGS" ]; then - echo "Install directory '$OB_DEST_BINDINGS' is not available! Aborting..." + + +OB_DONE=false +mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1 +if [ ! -d "$OB_DEST_BINDINGS" ]; then + echo "Install directory '$OB_DEST_BINDINGS' is not available! Aborting..." + exit 1 +else + if [ "`ls $OB_DEST_BINDINGS | wc -l`" -gt 0 ]; then + echo "Install directory '$OB_DEST_BINDINGS' is not empty. Skipping Openbabel Binding installation..." + OB_DONE=true + fi +fi + +if ! $OB_DONE ; then + cd "/tmp/$OB_VER/scripts/ruby/" + + if ! ruby extconf.rb --with-openbabel-include="$OB_DEST/include/openbabel-2.0" >>$LOG 2>&1; then + printf "%25s%15s\n" "'Bindings: Code'" "FAIL" exit 1 - else - if [ "`ls $OB_DEST_BINDINGS | wc -l`" -gt 0 ]; then - echo "Install directory '$OB_DEST_BINDINGS' is not empty. Skipping Openbabel Binding installation..." - OB_DONE=true - fi fi - if ! $OB_DONE ; then - cd "/tmp/$OB_VER/scripts/ruby/" - ruby extconf.rb --with-openbabel-include="$OB_DEST/include/openbabel-2.0" - if make ; then - cp openbabel.so $OB_DEST_BINDINGS - else - echo - echo "Make failed! Aborting..." - exit 1 - fi + printf "%25s%15s\n" "'Bindings: Code'" "DONE" + + if ! make >>$LOG 2>&1; then + printf "%25s%15s\n" "'Bindings: Make'" "FAIL" + exit 1 fi + printf "%25s%15s\n" "'Bindings: Make'" "DONE" + + if ! cp openbabel.so $OB_DEST_BINDINGS >>$LOG 2>&1; then + printf "%25s%15s\n" "'Bindings: Install'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Bindings: Install'" "DONE" + fi + cd "$DIR" echo echo "Preparing Openbabel..." if [ ! -f $OB_CONF ]; then - echo "export PATH=$OB_DEST/bin:\$PATH" >> "$OB_CONF" - echo "if [ -z \"\$LD_LIBRARY_PATH\" ]; then export LD_LIBRARY_PATH=\"$OB_DEST/lib\"; else export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" + echo "if ! [[ \"\$PATH\" =~ \"$OB_DEST\" ]]; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" + echo "if ! [[ \"\$LD_LIBRARY_PATH\" =~ \"$OB_DEST\" ]]; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" diff --git a/ruby.sh b/ruby.sh index 371d78d..7d95da9 100755 --- a/ruby.sh +++ b/ruby.sh @@ -26,7 +26,7 @@ LOG="/tmp/`basename $0`-log.txt" 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 "When compilation fails, see '$LOG' for details." +echo "Log file is '$LOG'." echo -n "Press to continue, or to abort." read @@ -46,8 +46,8 @@ fi if [ ! $RUBY_DONE ]; then cd /tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - if ! $WGET -O - "$URI" 2>$LOG | tar zxv >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Download'" "FAIL" + if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'Download'" "FAIL" exit 1 fi printf "%25s%15s\n" "'Download'" "DONE" -- cgit v1.2.3 From 0dafbab46c52ec6c376f8a6a74d1cb639b23be39 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 08:59:30 +0200 Subject: openbabel.sh --- ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.sh b/ruby.sh index 7d95da9..cfd78cc 100755 --- a/ruby.sh +++ b/ruby.sh @@ -65,7 +65,7 @@ echo "Preparing RUBY..." if ! [ -f "$RUBY_CONF" ]; then - echo "export PATH=$RUBY_DEST/bin:\$PATH" >> "$RUBY_CONF" + echo "if ! [[ \"\$PATH\" =~ \"$RUBY_DEST\" ]]; then export PATH=\"$RUBY_DEST/bin:\$PATH\"; fi" >> "$RUBY_CONF" echo "Ruby configuration has been stored in '$RUBY_CONF'." if ! grep "$RUBY_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then -- cgit v1.2.3 From e026bc2a2d45d0c895bd5ed54bacb32c3ec0c419 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:03:49 +0200 Subject: openbabel.sh --- base-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base-install.sh b/base-install.sh index e1d8bf2..23098fc 100755 --- a/base-install.sh +++ b/base-install.sh @@ -95,8 +95,8 @@ if [ ! -f $JAVA_CONF ]; then exit 1 fi - echo "export JAVA_HOME=$JAVA_HOME" >> "$JAVA_CONF" - echo "export PATH=$JAVA_HOME:\$PATH" >> "$JAVA_CONF" + echo "if ! [[ \"\$JAVA_HOME\" =~ \"$JAVA_HOME\" ]]; then export JAVA_HOME=\"$JAVA_HOME\"; fi" >> "$JAVA_CONF" + echo "if ! [[ \"\$PATH\" =~ \"$JAVA_HOME\" ]]; then export PATH=\"$JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." if ! grep "$JAVA_CONF" $HOME/.bashrc >/dev/null 2>&1; then -- cgit v1.2.3 From 3dfa712a33df34c7d605abe36f4e7ff17f251162 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:21:47 +0200 Subject: openbabel.sh --- base-install.sh | 1 + kernlab.sh | 36 ++++++++++++++++++++++++------------ openbabel.sh | 10 +++++++--- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/base-install.sh b/base-install.sh index 23098fc..0f20239 100755 --- a/base-install.sh +++ b/base-install.sh @@ -106,6 +106,7 @@ if [ ! -f $JAVA_CONF ]; then 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 91f6cb5..86f1503 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -24,12 +24,11 @@ fi # Pkg source ./config.sh -if [ -n "$1" ]; then - KL_DEST="$1" -fi - +source ./utils.sh +LOG="/tmp`basename $0`-log.txt" echo "This installs Kernlab." +echo "Log file is '$LOG'." echo "Press to continue, or to abort." read @@ -48,29 +47,42 @@ else mkdir "$KL_DEST" >/dev/null 2>&1 fi fi + + if ! $R_DONE; then cd /tmp - if ! $WGET -O - "http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz">/dev/null 2>&1; then - echo "Download failed! Aborting..." + URI="http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz" + if ! $WGET -O - "$URI">>$LOG 2>&1; then + printf "%25s%15s\n" "'Download'" "FAIL" exit 1 fi - export R_LIBS="$KL_DEST" - $R CMD INSTALL "kernlab_$KL_VER.tar.gz" + printf "%25s%15s\n" "'Download'" "DONE" + + export R_LIBS="$KL_DEST" # To install non-global + + if ! $R CMD INSTALL "kernlab_$KL_VER.tar.gz">>$LOG 2>&1; then + printf "%25s%15s\n" "'Install'" "FAIL" + fi + printf "%25s%15s\n" "'Install'" "DONE" fi + echo echo "Preparing R..." + if [ ! -f $KL_CONF ]; then - echo "export R_LIBS=\"$KL_DEST\"" >> "$KL_CONF" + + echo "if ! [[ \"\$R_LIBS\" =~ \"$KL_DEST\" ]]; then export R_LIBS=\"$KL_DEST\"; fi" >> "$KL_CONF" echo "R package destination has been stored in '$KL_CONF'." - echo -n "Decide if R configuration should be linked to your .bashrc ('y/n'): " - read ANSWER_KL_CONF - if [ $ANSWER_KL_CONF = "y" ]; then + + if ! grep "$KL_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then echo "source \"$KL_CONF\"" >> $HOME/.bashrc fi + else echo "It seems R is already configured ('$KL_CONF' exists)." fi +source "$KL_CONF" cd "$DIR" diff --git a/openbabel.sh b/openbabel.sh index 5e5a4f1..ba5db54 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -113,21 +113,25 @@ cd "$DIR" echo echo "Preparing Openbabel..." + if [ ! -f $OB_CONF ]; then + echo "if ! [[ \"\$PATH\" =~ \"$OB_DEST\" ]]; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" echo "if ! [[ \"\$LD_LIBRARY_PATH\" =~ \"$OB_DEST\" ]]; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" + echo "Openbabel configuration has been stored in '$OB_CONF'." - echo -n "Decide if Openbabel configuration should be linked to your .bashrc ('y/n'): " - read ANSWER_OB_CONF - if [ $ANSWER_OB_CONF = "y" ]; then + if ! grep "$OB_CONF" $HOME/.bashrc >/dev/null 2>&1 ; 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." -- cgit v1.2.3 From 89cadc0439892231757636fb64aeaf75d31416b8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:37:12 +0200 Subject: opentox-ruby.sh --- opentox-ruby.sh | 60 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 842c91f..07bfb7b 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -31,40 +31,50 @@ fi # Pkg 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 to continue, or to abort." read DIR="`pwd`" -$GEM install opentox-ruby -$GEM install builder # not included by spreadsheet gem - -SERVERNAME="`hostname`" -ESCAPED_SERVERNAME="`echo $SERVERNAME | sed 's/\/\\\//'`" -LOGGER=":logger: backtrace" -AA="nil" - -mkdir -p "$HOME/.opentox/config" -mkdir -p "$HOME/.opentox/log" -sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" production.yaml > $HOME/.opentox/config/production.yaml -sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVERNAME/$escapedservername/;s/LOGGER/$logger/;s/AA/$aa/" "aa-local.yaml" >> $HOME/.opentox/config/production.yaml - -mkdir -p $WWW_DEST/opentox -cd $WWW_DEST/opentox -$GIT clone "git://github.com/opentox/opentox-ruby.git " -cd opentox-ruby -pwd -$GIT remote show origin -$GIT fetch -$GIT checkout -b development origin/development -$GEM install jeweler -$RAKE install +for mygem in opentox-ruby builder jewler; do + if ! $GEM install $mygem>>$LOG 2>&1; then + printf "%25s%15s\n" "'Install $mygem'" "FAIL" + fi + printf "%25s%15s\n" "'Install $mygem'" "DONE" +done + + +servername="`hostname`" +escapedserver="`echo $servername | sed 's/\/\\\//'`" +logger=":logger: backtrace" +aa="nil" + +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 >>$LOG 2>&1 +sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/" aa-local.yaml >> $HOME/.opentox/config/production.yaml >>$LOG 2>&1 + +mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 +cd $WWW_DEST/opentox >>$LOG 2>&1 +$GIT clone "git://github.com/opentox/opentox-ruby.git " >>$LOG 2>&1 +cd opentox-ruby >>$LOG 2>&1 +$GIT checkout -b development origin/development>>$LOG 2>&1 + +if ! $RAKE install >>$LOG 2>&1; then + printf "%25s%15s\n" "'Install opentox-ruby'" "FAIL" +fi +printf "%25s%15s\n" "'Install opentox-ruby'" "DONE" + GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` -echo "'$GEM_LIB'" mv "$GEM_LIB" "$GEM_LIB~" ln -s "$WWW_DEST/opentox/opentox-ruby/lib" "$GEM_LIB" cd "$DIR" + +echo +echo "Opentox-ruby gem finished." -- cgit v1.2.3 From 6a1e6b30ca57920a461b713b2bf733ef7dbda210 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:43:28 +0200 Subject: opentox-ruby.sh --- opentox-ruby.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 07bfb7b..550a636 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -41,9 +41,10 @@ read DIR="`pwd`" -for mygem in opentox-ruby builder jewler; do +for mygem in opentox-ruby builder jeweler; do if ! $GEM install $mygem>>$LOG 2>&1; then printf "%25s%15s\n" "'Install $mygem'" "FAIL" + exit 1 fi printf "%25s%15s\n" "'Install $mygem'" "DONE" done @@ -67,6 +68,7 @@ $GIT checkout -b development origin/development>>$LOG 2>&1 if ! $RAKE install >>$LOG 2>&1; then printf "%25s%15s\n" "'Install opentox-ruby'" "FAIL" + exit 1 fi printf "%25s%15s\n" "'Install opentox-ruby'" "DONE" -- cgit v1.2.3 From 3d7eafe479f661495f7116e05955e63e143edfe8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:48:09 +0200 Subject: opentox-ruby.sh --- opentox-ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 550a636..286facb 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -62,7 +62,7 @@ sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logg mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 cd $WWW_DEST/opentox >>$LOG 2>&1 -$GIT clone "git://github.com/opentox/opentox-ruby.git " >>$LOG 2>&1 +$GIT clone git://github.com/opentox/opentox-ruby.git >>$LOG 2>&1 cd opentox-ruby >>$LOG 2>&1 $GIT checkout -b development origin/development>>$LOG 2>&1 -- cgit v1.2.3 From 5e168de67e4b69a1be8655236f8ec40f639f6882 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:54:17 +0200 Subject: nginx.sh --- aa-local.yaml | 16 ++++++++-------- aa-server.yaml | 16 ++++++++-------- config | 4 ---- nginx.sh | 13 +++++++++---- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/aa-local.yaml b/aa-local.yaml index 593ba56..71575b4 100644 --- a/aa-local.yaml +++ b/aa-local.yaml @@ -15,24 +15,24 @@ # Exceptions: :free_uris: #request-method for uri not controlled by A&A ? - :GET - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ ? - :GET - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/toxcreate/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/compound/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/ ? - :PUT - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ :authorize_exceptions: #request-method for uri only authenticated, no authorization ? - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/dataset" - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http\:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http\:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ diff --git a/aa-server.yaml b/aa-server.yaml index 593ba56..71575b4 100644 --- a/aa-server.yaml +++ b/aa-server.yaml @@ -15,24 +15,24 @@ # Exceptions: :free_uris: #request-method for uri not controlled by A&A ? - :GET - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ ? - :GET - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/toxcreate/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ - - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/compound/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ + - !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/ ? - :PUT - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/task/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ :authorize_exceptions: #request-method for uri only authenticated, no authorization ? - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVERNAME\/algorithm/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - "http://SERVERNAME/dataset" - "http://SERVERNAME/model" - "http://SERVERNAME/validation" - - !ruby/regexp /http\:\/\/ESCAPEDSERVERNAME\/validation\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http\:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ diff --git a/config b/config index b5dabcc..e72242b 100644 --- a/config +++ b/config @@ -5,10 +5,6 @@ # Linux distribution (currently only debian) distribution=debian -# Choose a root password for the MySQL database -# Please insert the correct password if mysql-server is already installed -mysql_root=opentox - # Installation type # Options: # gem installs only the opentox-ruby gem (useful, if you want to use external services with the opentox-ruby DSL) diff --git a/nginx.sh b/nginx.sh index 5cd4853..7b0e2ba 100755 --- a/nginx.sh +++ b/nginx.sh @@ -17,6 +17,7 @@ if [ ! -e "$PIN" ]; then fi source ./config.sh +source ./utils.sh echo "This installs Nginx." echo "Press to continue, or to abort." @@ -37,12 +38,16 @@ else fi if ! $NGINX_DONE; then - $PIN --auto-download --auto --prefix="$NGINX_DEST" - cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" + if ! $PIN --auto-download --auto --prefix="$NGINX_DEST">>$LOG 2>&1 + printf "%25s%15s\n" "'Install'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Install'" "DONE" + cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" >>$LOG 2>&1 passenger=`ls -d passenger*`; - cd - + cd - >>$LOG 2>&1 servername=`hostname` - sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/" ./nginx.conf > $NGINX_DEST/nginx.conf + sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/" ./nginx.conf > $NGINX_DEST/nginx.conf 2>>$LOG fi cd "$DIR" -- cgit v1.2.3 From e943f5be6060e73da2f410e8a109488be70c081f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:54:49 +0200 Subject: nginx.sh --- nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index 7b0e2ba..cace46e 100755 --- a/nginx.sh +++ b/nginx.sh @@ -38,7 +38,7 @@ else fi if ! $NGINX_DONE; then - if ! $PIN --auto-download --auto --prefix="$NGINX_DEST">>$LOG 2>&1 + if ! $PIN --auto-download --auto --prefix="$NGINX_DEST">>$LOG 2>&1; then printf "%25s%15s\n" "'Install'" "FAIL" exit 1 fi -- cgit v1.2.3 From c267edd214646089fb70ae0eb6ae7db8d757252a Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:55:21 +0200 Subject: nginx.sh --- nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index cace46e..22350e2 100755 --- a/nginx.sh +++ b/nginx.sh @@ -38,7 +38,7 @@ else fi if ! $NGINX_DONE; then - if ! $PIN --auto-download --auto --prefix="$NGINX_DEST">>$LOG 2>&1; then + if ! $PIN --auto-download --auto --prefix="$NGINX_DEST" >>$LOG 2>&1; then printf "%25s%15s\n" "'Install'" "FAIL" exit 1 fi -- cgit v1.2.3 From 4ca4cb3419b92237f2cc88a6ca87c4ef8511b046 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:55:46 +0200 Subject: nginx.sh --- nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index 22350e2..4b48ba9 100755 --- a/nginx.sh +++ b/nginx.sh @@ -38,7 +38,7 @@ else fi if ! $NGINX_DONE; then - if ! $PIN --auto-download --auto --prefix="$NGINX_DEST" >>$LOG 2>&1; then + if ! $PIN --auto-download --auto --prefix=$NGINX_DEST >>$LOG 2>&1; then printf "%25s%15s\n" "'Install'" "FAIL" exit 1 fi -- cgit v1.2.3 From 7824725e782d7a188a7c226756f916bcbb06cd06 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:57:14 +0200 Subject: nginx.sh --- nginx.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index 4b48ba9..2fdeda8 100755 --- a/nginx.sh +++ b/nginx.sh @@ -38,7 +38,8 @@ else fi if ! $NGINX_DONE; then - if ! $PIN --auto-download --auto --prefix=$NGINX_DEST >>$LOG 2>&1; then + CMD="$PIN --auto-download --auto --prefix=$NGINX_DEST" + if ! eval "$CMD" >>$LOG 2>&1; then printf "%25s%15s\n" "'Install'" "FAIL" exit 1 fi -- cgit v1.2.3 From 44e59e1b113b460d32850dfb0ed1fef772bf305c Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:58:06 +0200 Subject: nginx.sh --- nginx.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx.sh b/nginx.sh index 2fdeda8..012a7d7 100755 --- a/nginx.sh +++ b/nginx.sh @@ -18,6 +18,7 @@ fi source ./config.sh source ./utils.sh +LOG="/tmp`basename $0`-log.txt" echo "This installs Nginx." echo "Press to continue, or to abort." -- cgit v1.2.3 From 2b13f5bd12c4d52cc1758ef5a16ff249c7703c18 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 09:58:22 +0200 Subject: nginx.sh --- nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index 012a7d7..0b7d983 100755 --- a/nginx.sh +++ b/nginx.sh @@ -18,7 +18,7 @@ fi source ./config.sh source ./utils.sh -LOG="/tmp`basename $0`-log.txt" +LOG="/tmp/`basename $0`-log.txt" echo "This installs Nginx." echo "Press to continue, or to abort." -- cgit v1.2.3 From 326fa74cecf8fc9befb44ff56e7816df03eebd31 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:08:43 +0200 Subject: redis.sh --- redis.sh | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/redis.sh b/redis.sh index ddeec6e..54ab601 100755 --- a/redis.sh +++ b/redis.sh @@ -17,6 +17,8 @@ if [ ! -e "$WGET" ]; then fi source ./config.sh +source ./utils.sh +LOG="/tmp/`basename $0`-log.txt" echo "This installs Redis." echo "Press to continue, or to abort." @@ -43,14 +45,26 @@ if ! $REDIS_DONE; then echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf cd $HOME - $WGET -O - "http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" | tar zxv - cd $REDIS_DEST - if ! make; then - echo "Build failed! Aborting..." + URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" + if ! $WGET -O - "$URI" | tar zxv >>$LOG 2>&1; then + printf "%25s%15s\n" "'Download'" "FAIL" + fi + printf "%25s%15s\n" "'Download'" "DONE" + + cd $REDIS_DEST >>$LOG 2>&1 + if ! make>>$LOG 2>&1; then + printf "%25s%15s\n" "'Make'" "FAIL" exit 1 fi - echo "daemonize yes" > $REDIS_SERVER_CONF - echo "dir `pwd`" >> $REDIS_SERVER_CONF + printf "%25s%15s\n" "'Make'" "DONE" + + if ! grep "daemonize yes" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then + echo "daemonize yes" > $REDIS_SERVER_CONF 2>$LOG + fi + + if ! grep "dir `pwd`" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then + echo "dir `pwd`" >> $REDIS_SERVER_CONF 2>$LOG + fi fi echo @@ -58,11 +72,11 @@ 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'." - echo -n "Decide if Redis configuration should be linked to your .bashrc ('y/n'): " - read ANSWER_REDIS_CONF - if [ $ANSWER_REDIS_CONF = "y" ]; then + + if ! grep "source \"$REDIS_CONF\"" $HOME/.bashrc; then echo "source \"$REDIS_CONF\"" >> $HOME/.bashrc fi + else echo "It seems Redis is already configured ('$RUBY_CONF' exists)." fi -- cgit v1.2.3 From 8c5f9af72f31a97bdbecb68f8d34b372e6b61077 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:09:36 +0200 Subject: redis.sh --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index 54ab601..9746e9f 100755 --- a/redis.sh +++ b/redis.sh @@ -46,7 +46,7 @@ if ! $REDIS_DONE; then cd $HOME URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! $WGET -O - "$URI" | tar zxv >>$LOG 2>&1; then + if ! $WGET -O - "$URI" 2>$LOG | tar zxv ; then printf "%25s%15s\n" "'Download'" "FAIL" fi printf "%25s%15s\n" "'Download'" "DONE" -- cgit v1.2.3 From 39a31cb4be71b191a1fdc40617359e03cb844bc5 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:11:07 +0200 Subject: redis.sh --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index 9746e9f..4fa7920 100755 --- a/redis.sh +++ b/redis.sh @@ -46,7 +46,7 @@ if ! $REDIS_DONE; then cd $HOME URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! $WGET -O - "$URI" 2>$LOG | tar zxv ; then + if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2 >&1 ; then printf "%25s%15s\n" "'Download'" "FAIL" fi printf "%25s%15s\n" "'Download'" "DONE" -- cgit v1.2.3 From 9e4087a79e5b9b4d1c88653f35a5f2c4330745f7 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:12:37 +0200 Subject: redis.sh --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index 4fa7920..be9a088 100755 --- a/redis.sh +++ b/redis.sh @@ -46,7 +46,7 @@ if ! $REDIS_DONE; then cd $HOME URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2 >&1 ; then + if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2 >&1; then printf "%25s%15s\n" "'Download'" "FAIL" fi printf "%25s%15s\n" "'Download'" "DONE" -- cgit v1.2.3 From deeb51ccd22ee90754e05cdb469d0f6b9b842270 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:13:45 +0200 Subject: redis.sh --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index be9a088..0dc1f19 100755 --- a/redis.sh +++ b/redis.sh @@ -46,7 +46,7 @@ if ! $REDIS_DONE; then cd $HOME URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2 >&1; then + if ! $WGET -O - "$URI" | tar zxv >>$LOG 2 >&1; then printf "%25s%15s\n" "'Download'" "FAIL" fi printf "%25s%15s\n" "'Download'" "DONE" -- cgit v1.2.3 From 366740686f20cac6b69e161b7cd628b51351cfb9 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:14:55 +0200 Subject: redis.sh --- redis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis.sh b/redis.sh index 0dc1f19..99e96c9 100755 --- a/redis.sh +++ b/redis.sh @@ -42,11 +42,11 @@ fi if ! $REDIS_DONE; then echo "Need root password: " - echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf + echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 cd $HOME URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! $WGET -O - "$URI" | tar zxv >>$LOG 2 >&1; then + if ! $WGET -O - "$URI" | tar zxv >>$LOG 2>&1; then printf "%25s%15s\n" "'Download'" "FAIL" fi printf "%25s%15s\n" "'Download'" "DONE" -- cgit v1.2.3 From e8eb03a9b2489b06e843a44a653fdfa347de80cc Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:16:57 +0200 Subject: redis.sh --- redis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis.sh b/redis.sh index 99e96c9..5cef1bc 100755 --- a/redis.sh +++ b/redis.sh @@ -44,9 +44,9 @@ if ! $REDIS_DONE; then echo "Need root password: " echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 - cd $HOME + cd $PREFIX URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! $WGET -O - "$URI" | tar zxv >>$LOG 2>&1; then + if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1; then printf "%25s%15s\n" "'Download'" "FAIL" fi printf "%25s%15s\n" "'Download'" "DONE" -- cgit v1.2.3 From b63ed2a6443ba77269b5ec4190658c80a027c7ed Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:24:42 +0200 Subject: redis.sh --- redis.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/redis.sh b/redis.sh index 5cef1bc..b66fa6f 100755 --- a/redis.sh +++ b/redis.sh @@ -44,20 +44,27 @@ if ! $REDIS_DONE; then echo "Need root password: " echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 - cd $PREFIX + cd /tmp URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1; then printf "%25s%15s\n" "'Download'" "FAIL" fi printf "%25s%15s\n" "'Download'" "DONE" - cd $REDIS_DEST >>$LOG 2>&1 - if ! make>>$LOG 2>&1; then + cd redis-$REDIS_VER >>$LOG 2>&1 + if ! make "PREFIX=$REDIS_DEST" >>$LOG 2>&1; then printf "%25s%15s\n" "'Make'" "FAIL" exit 1 fi printf "%25s%15s\n" "'Make'" "DONE" + if ! make install >>$LOG 2>&1; then + printf "%25s%15s\n" "'Install'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Install'" "DONE" + + if ! grep "daemonize yes" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then echo "daemonize yes" > $REDIS_SERVER_CONF 2>$LOG fi @@ -67,6 +74,8 @@ if ! $REDIS_DONE; then fi fi +cd "$DIR" + echo echo "Preparing Redis..." if [ ! -f $REDIS_CONF ]; then -- cgit v1.2.3 From 30b74a7113969952f4e67406052f91c03816d693 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:25:51 +0200 Subject: redis.sh --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index b66fa6f..bc7096b 100755 --- a/redis.sh +++ b/redis.sh @@ -87,7 +87,7 @@ if [ ! -f $REDIS_CONF ]; then fi else - echo "It seems Redis is already configured ('$RUBY_CONF' exists)." + echo "It seems Redis is already configured ('$REDIS_CONF' exists)." fi cd "$DIR" -- cgit v1.2.3 From ac0179b4059bd702a67a8c386769f0579493786b Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:39:50 +0200 Subject: redis.sh --- redis.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/redis.sh b/redis.sh index bc7096b..f70fb8b 100755 --- a/redis.sh +++ b/redis.sh @@ -44,7 +44,7 @@ if ! $REDIS_DONE; then echo "Need root password: " echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 - cd /tmp + cd $REDIS_DEST URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1; then printf "%25s%15s\n" "'Download'" "FAIL" @@ -52,19 +52,12 @@ if ! $REDIS_DONE; then printf "%25s%15s\n" "'Download'" "DONE" cd redis-$REDIS_VER >>$LOG 2>&1 - if ! make "PREFIX=$REDIS_DEST" >>$LOG 2>&1; then + if ! make >>$LOG 2>&1; then printf "%25s%15s\n" "'Make'" "FAIL" exit 1 fi printf "%25s%15s\n" "'Make'" "DONE" - if ! make install >>$LOG 2>&1; then - printf "%25s%15s\n" "'Install'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install'" "DONE" - - if ! grep "daemonize yes" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then echo "daemonize yes" > $REDIS_SERVER_CONF 2>$LOG fi -- cgit v1.2.3 From d94a37976020ba9a142522b8da2a09a87577be6f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:41:34 +0200 Subject: redis.sh --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index f70fb8b..8c9a06c 100755 --- a/redis.sh +++ b/redis.sh @@ -44,7 +44,7 @@ if ! $REDIS_DONE; then echo "Need root password: " echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 - cd $REDIS_DEST + cd $PREFIX URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1; then printf "%25s%15s\n" "'Download'" "FAIL" -- cgit v1.2.3 From 409c38da02f6ad65aa41fedf8e8e28a8922e97d7 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:43:26 +0200 Subject: opentox-webservices.sh --- opentox-webservices.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index c7c3b78..6f82096 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -17,6 +17,8 @@ if [ ! -e "$WGET" ]; then fi source ./config.sh +source ./utils.sh +LOG="/tmp/`basename $0`-log.txt" echo "This installs Opentox webservices." echo "Press to continue, or to abort." @@ -24,7 +26,7 @@ read DIR=`pwd` -mkdir -p "$WWW_DEST/opentox" +mkdir -p "$WWW_DEST/opentox" >>$LOG 2>&1 cd "$WWW_DEST/opentox" for s in compound dataset algorithm model toxcreate task; do git clone "git://github.com/opentox/$s.git" "$s" @@ -44,10 +46,10 @@ done #ln -s /var/www/opentox/validation/public /var/www/validation # fminer etc -cd $WWW_DEST/opentox/algorithm +cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 echo "Need root password:" -sudo updatedb -rake fminer:install +sudo updatedb >>$LOG 2>&1 +rake fminer:install >>$LOG 2>&1 cd "$DIR" echo -- cgit v1.2.3 From 811111e8120218b5751e06b5ee31cef112ada3b5 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:54:31 +0200 Subject: opentox-webservices.sh --- opentox-ruby.sh | 4 ++-- opentox-webservices.sh | 40 ++++++++++++++++++++++++++++++++-------- redis.sh | 1 + 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 286facb..2404e5d 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -57,8 +57,8 @@ aa="nil" 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 >>$LOG 2>&1 -sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/" aa-local.yaml >> $HOME/.opentox/config/production.yaml >>$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 +sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/" aa-local.yaml >> $HOME/.opentox/config/production.yaml 2>$LOG mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 cd $WWW_DEST/opentox >>$LOG 2>&1 diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 6f82096..d70bffe 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -21,20 +21,32 @@ source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "This installs Opentox webservices." +echo "Log file is '$LOG'." echo "Press to continue, or to abort." read DIR=`pwd` +echo "Checking out webservices..." mkdir -p "$WWW_DEST/opentox" >>$LOG 2>&1 -cd "$WWW_DEST/opentox" +cd "$WWW_DEST/opentox" >>$LOG 2>&1 for s in compound dataset algorithm model toxcreate task; do - git clone "git://github.com/opentox/$s.git" "$s" - cd "$s" - git checkout -t origin/development # AM: use development - mkdir public - ln -s "$WWW_DEST/opentox/$s/public" "$WWW_DEST/$s" - cd - + git clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 + + cd "$s" >>$LOG 2>&1 + + git checkout -t origin/development >>$LOG 2>&1 +# AM: use development + mkdir public >>$LOG 2>&1 + + if ln -s "$WWW_DEST/opentox/$s/public" "$WWW_DEST/$s" >>$LOG 2>&1; then + printf "%25s%15s\n" "'Linking $s'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'Linking $s'" "DONE" + + cd - >>$LOG 2>&1 + done # validation service @@ -46,10 +58,22 @@ done #ln -s /var/www/opentox/validation/public /var/www/validation # fminer etc +echo "Compiling Fminer..." + +if ! [ -f $HOME/.opentox/production.yaml ]; then + printf "%25s%15s\n" "'Config present'" "N" + exit 1 +fi +printf "%25s%15s\n" "'Config present'" "Y" + cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 echo "Need root password:" sudo updatedb >>$LOG 2>&1 -rake fminer:install >>$LOG 2>&1 +if ! rake fminer:install >>$LOG 2>&1; then + printf "%25s%15s\n" "'Make'" "FAIL" + exit 1 +fi +printf "%25s%15s\n" "'Make'" "FAIL" cd "$DIR" echo diff --git a/redis.sh b/redis.sh index 8c9a06c..932d4ce 100755 --- a/redis.sh +++ b/redis.sh @@ -21,6 +21,7 @@ source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "This installs Redis." +echo "Log file is '$LOG'." echo "Press to continue, or to abort." read -- cgit v1.2.3 From be4c94b29fc76904b279056b6a0af234e7cf1f4e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 10:58:42 +0200 Subject: config.sh --- config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.sh b/config.sh index aebf2d5..af806e2 100644 --- a/config.sh +++ b/config.sh @@ -6,7 +6,7 @@ # 1) Where all binaries are installed. PREFIX="$HOME/opentox" -JAVA_HOME="/usr/lib/java-6-sun" +JAVA_HOME="/usr/lib/jvm/java-6-sun" # 2) What versions to install. RUBY_NUM_VER="1.8.7-2011.03" -- cgit v1.2.3 From 312d93bcc322fa5aca38f38cd266569aaf18b621 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 11:56:47 +0200 Subject: all --- base-install.sh | 26 ++++++++++---------------- kernlab.sh | 19 ++++++++----------- nginx.sh | 9 +++------ openbabel.sh | 26 +++++++++----------------- opentox-ruby.sh | 19 +++++++++++-------- opentox-webservices.sh | 31 ++++++++++++++++--------------- redis.sh | 6 +----- ruby.sh | 9 +++++---- utils.sh | 1 + 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 to continue or 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 to continue, or 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 to continue, or 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 to continue, or 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 to continue, or 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 to continue, or 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 to continue, or 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 to continue, or 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 -- cgit v1.2.3 From 59f6d70df510eb5e009f71a15ccbf20053ec7975 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 12:42:16 +0200 Subject: all --- base-install.sh | 6 +----- kernlab.sh | 5 +++-- nginx.sh | 5 +++-- openbabel.sh | 9 +++++---- opentox-ruby.sh | 5 +++-- opentox-webservices.sh | 5 +++-- redis.sh | 5 +++-- ruby.sh | 49 +++++++++++-------------------------------------- utils.sh | 12 ++++++++++++ 9 files changed, 44 insertions(+), 57 deletions(-) diff --git a/base-install.sh b/base-install.sh index 27b895a..ea26dea 100755 --- a/base-install.sh +++ b/base-install.sh @@ -73,11 +73,7 @@ fi pack_fail="" for p in $pack_arr; do echo -n "'$p': " - if sudo $APTITUDE install "$p" -y >/dev/null 2>&1; then - printf "%25s%15s\n" "'$p'" "DONE" - else - printf "%25s%15s\n" "'$p'" "FAIL" - fi + cmd="sudo $APTITUDE install $p" && run_cmd "$cmd" "$p" done if [ -n "$pack_fail" ]; then diff --git a/kernlab.sh b/kernlab.sh index 5426744..20aea16 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -23,8 +26,6 @@ if [ ! -e "$R" ]; then fi # Pkg -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Kernlab ('$LOG')." diff --git a/nginx.sh b/nginx.sh index 6ccf914..27ddb05 100755 --- a/nginx.sh +++ b/nginx.sh @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -16,8 +19,6 @@ if [ ! -e "$PIN" ]; then exit 1 fi -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Nginx ('$LOG')." diff --git a/openbabel.sh b/openbabel.sh index b30d916..bd607c6 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -5,6 +5,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -18,12 +21,10 @@ if [ ! -e "$WGET" ]; then fi # Pkg -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" -echo "Openbabel ('$OB_DEST', '$LOG')" - +echo +echo "Openbabel ('$OB_DEST', '$LOG'):" DIR="`pwd`" diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 00bf8f1..0939635 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -30,8 +33,6 @@ fi # Pkg -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Opentox-ruby ('$LOG'):" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index ac0f95b..3dbcf4e 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -16,8 +19,6 @@ if [ ! -e "$WGET" ]; then exit 1 fi -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Webservices ('$LOG'):" diff --git a/redis.sh b/redis.sh index 6f84316..b536f42 100755 --- a/redis.sh +++ b/redis.sh @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -16,8 +19,6 @@ if [ ! -e "$WGET" ]; then exit 1 fi -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "This installs Redis." diff --git a/ruby.sh b/ruby.sh index c4377b7..9035d1c 100755 --- a/ruby.sh +++ b/ruby.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Installs Ruby enterprise edition and passenger gem. +# A configuration file is created and included in your '~.bashrc'. # Pass a ruby version string as first argument to install a specific version (blank for default). # Author: Christoph Helma, Andreas Maunz. # @@ -22,11 +23,8 @@ source ./config.sh source ./utils.sh LOG="/tmp/`basename $0`-log.txt" - -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 +echo "Ruby Enterprise edition ('$RUBY_DEST', '$LOG')." DIR="`pwd`" @@ -42,26 +40,18 @@ else fi echo -echo "Installing Ruby:" +echo "Installing:" if [ ! $RUBY_DONE ]; then cd /tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Download'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Download'" "DONE" - if ! sh "/tmp/$RUBY_VER/installer" --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST" >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Install'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install'" "DONE" + cmd="$WGET -O - $URI" && run_cmd "$cmd" "Download" + cmd="sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" fi cd "$DIR" echo -echo "Preparing Ruby:" +echo "Preparing:" if ! [ -f "$RUBY_CONF" ]; then @@ -79,7 +69,7 @@ source "$RUBY_CONF" echo -echo "Installing Passenger:" +echo "Passenger:" GEM="`which gem`" if [ ! -e "$GEM" ]; then echo "'gem' missing. Install 'gem' first. Aborting..." @@ -88,30 +78,13 @@ fi if [ "$PASSENGER_SKIP" != "s" ]; then export PATH="$RUBY_DEST/bin:$PATH" - if ! $GEM sources -a "http://gemcutter.org" >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Add Gemcutter'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Add Gemcutter'" "DONE" - if ! $GEM sources -r "http://rubygems.org" >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Add Rubygems'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Add Rubygems'" "DONE" + cmd="$GEM sources -a http://gemcutter.org" && run_cmd "$cmd" "Add Gemcutter" + cmd="$GEM sources -a http://rubygems.org" && run_cmd "$cmd" "Add Rubygems" GEMCONF="gem: --no-ri --no-rdoc" if ! grep "$GEMCONF" $HOME/.gemrc >>$LOG 2>&1; then echo "$GEMCONF" | tee -a $HOME/.gemrc >>$LOG 2>&1 fi - if ! $GEM install passenger >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Install Passenger'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install Passenger'" "DONE" - + cmd="$GEM install passenger" && run_cmd "$cmd" "Install Passenger" fi -echo -echo "Ruby Installation finished." - - diff --git a/utils.sh b/utils.sh index cefd0fa..0cdbc69 100644 --- a/utils.sh +++ b/utils.sh @@ -9,5 +9,17 @@ function check_dest { fi } +function run_cmd { + local cmd=$1 + local title=$2 + + if ! eval $cmd >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'$title'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'$title'" "DONE" + +} + check_dest source ~/.bashrc -- cgit v1.2.3 From ac2854eb48294aa36f096a8cd6b3a6769c6bec00 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 13:04:48 +0200 Subject: all --- ruby.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruby.sh b/ruby.sh index 9035d1c..724d224 100755 --- a/ruby.sh +++ b/ruby.sh @@ -44,7 +44,8 @@ echo "Installing:" if [ ! $RUBY_DONE ]; then cd /tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - cmd="$WGET -O - $URI" && run_cmd "$cmd" "Download" + cmd="$WGET $URI" && run_cmd "$cmd" "Download" + cmd="tar xzf $RUBY_VER.tar.gz" && run_cmd "$cmd" "Unpack" cmd="sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" fi -- cgit v1.2.3 From 6bcb46de198aff22039eeb40f2a4392421c823d8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 13:56:31 +0200 Subject: all --- kernlab.sh | 12 ++---------- nginx.sh | 7 +------ openbabel.sh | 50 ++++++++------------------------------------------ opentox-ruby.sh | 21 +++++---------------- opentox-webservices.sh | 30 +++++++++++------------------- redis.sh | 13 +++---------- 6 files changed, 30 insertions(+), 103 deletions(-) diff --git a/kernlab.sh b/kernlab.sh index 20aea16..b620ade 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -53,18 +53,10 @@ 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 "$URI" >>$LOG 2>&1; then - printf "%25s%15s\n" "'Download'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Download'" "DONE" + cmd="$WGET $URI" && run_cmd "$cmd" "Download" export R_LIBS="$KL_DEST" # To install non-global - - if ! $R CMD INSTALL "kernlab_$KL_VER.tar.gz">>$LOG 2>&1; then - printf "%25s%15s\n" "'Install'" "FAIL" - fi - printf "%25s%15s\n" "'Install'" "DONE" + cmd="$R CMD INSTALL kernlab_$KL_VER.tar.gz" && run_cmd "$cmd" "Install" fi diff --git a/nginx.sh b/nginx.sh index 27ddb05..1ce1dbe 100755 --- a/nginx.sh +++ b/nginx.sh @@ -38,12 +38,7 @@ else fi if ! $NGINX_DONE; then - CMD="$PIN --auto-download --auto --prefix=$NGINX_DEST" - if ! eval "$CMD" >>$LOG 2>&1; then - printf "%25s%15s\n" "'Install'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install'" "DONE" + cmd="$PIN --auto-download --auto --prefix=$NGINX_DEST" && run_cmd "$cmd" "Install" cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" >>$LOG 2>&1 passenger=`ls -d passenger*`; cd - >>$LOG 2>&1 diff --git a/openbabel.sh b/openbabel.sh index bd607c6..5b16a1b 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -44,30 +44,13 @@ 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" - if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1; then - printf "%25s%15s\n" "'Download'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Download'" "DONE" + cmd="$WGET $URI" && run_cmd "$cmd" "Download" + cmd="tar zxf $OB_VER.tar.gz" && run_cmd "$cmd" "Unpack" cd "/tmp/$OB_VER" - if ! ./configure --prefix="$OB_DEST" >>$LOG 2>&1; then - printf "%25s%15s\n" "'Configure'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Configure'" "DONE" - - if ! make >>$LOG 2>&1; then - printf "%25s%15s\n" "'Make'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Make'" "DONE" - - if ! make install >>$LOG 2>&1; then - printf "%25s%15s\n" "'Install'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install'" "DONE" + cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" + cmd="make" && run_cmd "$cmd" "Make" + cmd="make install" && run_cmd "$cmd" "Install" fi echo @@ -86,28 +69,11 @@ fi if ! $OB_DONE ; then cd "/tmp/$OB_VER/scripts/ruby/" - - if ! ruby extconf.rb --with-openbabel-include="$OB_DEST/include/openbabel-2.0" >>$LOG 2>&1; then - printf "%25s%15s\n" "'Bindings: Code'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Bindings: Code'" "DONE" - - if ! make >>$LOG 2>&1; then - printf "%25s%15s\n" "'Bindings: Make'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Bindings: Make'" "DONE" - - if ! cp openbabel.so $OB_DEST_BINDINGS >>$LOG 2>&1; then - printf "%25s%15s\n" "'Bindings: Install'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Bindings: Install'" "DONE" - + cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0" && run_cmd "$cmd" "Bindings: Code" + cmd="make" && run_cmd "$cmd" "Make" + cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Bindings: Install" fi - cd "$DIR" echo diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 0939635..45bcd3c 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -39,13 +39,9 @@ echo "Opentox-ruby ('$LOG'):" DIR="`pwd`" echo -echo "Installing gem to pull dependencies:" +echo "Gems:" for mygem in opentox-ruby builder jeweler; do - if ! $GEM install $mygem>>$LOG 2>&1; then - printf "%25s%15s\n" "'Install $mygem'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install $mygem'" "DONE" + cmd="$GEM install $mygem" && run_cmd "$cmd" "$mygem" done @@ -68,19 +64,12 @@ $GIT clone git://github.com/opentox/opentox-ruby.git >>$LOG 2>&1 cd opentox-ruby >>$LOG 2>&1 $GIT checkout -b development origin/development>>$LOG 2>&1 -if ! $RAKE install >>$LOG 2>&1; then - printf "%25s%15s\n" "'Install opentox-ruby'" "FAIL" - exit 1 -fi -printf "%25s%15s\n" "'Install opentox-ruby'" "DONE" +cmd="$RAKE install" && run_cmd "$cmd" "Install" GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` -mv "$GEM_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" +mv "$GEM_LIB" "$GEM_LIB~" >>$LOG 2>&1 +cmd="ln -s $WWW_DEST/opentox/opentox-ruby/lib" && run_cmd "$cmd" "Linking back" cd "$DIR" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 3dbcf4e..00c747a 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -19,6 +19,12 @@ if [ ! -e "$WGET" ]; then exit 1 fi +RAKE="`which rake`" +if [ ! -e "$RAKE" ]; then + echo "'rake' missing. Install 'rake' first. Aborting..." + exit 1 +fi + LOG="/tmp/`basename $0`-log.txt" echo "Webservices ('$LOG'):" @@ -39,14 +45,9 @@ for s in compound dataset algorithm model toxcreate task; do rm -rf public >>$LOG 2>&1 mkdir public >>$LOG 2>&1 - 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 - printf "%25s%15s\n" "'Linking $s'" "DONE" + mypath_from="$WWW_DEST/opentox/$s/public" + mypath_to="$WWW_DEST/$s" + cmd="ln -sf \"$mypath_from\" \"$mypath_to\"" && run_cmd "$cmd" "Linking $s" cd - >>$LOG 2>&1 @@ -63,20 +64,11 @@ done # fminer etc echo "Fminer:" -if ! [ -f $HOME/.opentox/config/production.yaml ]; then - printf "%25s%15s\n" "'Config present'" "FAIL" - exit 1 -fi -printf "%25s%15s\n" "'Config present'" "DONE" - +cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present" cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 echo "Need root password:" sudo updatedb >>$LOG 2>&1 -if ! rake fminer:install >>$LOG 2>&1; then - printf "%25s%15s\n" "'Make'" "FAIL" - exit 1 -fi -printf "%25s%15s\n" "'Make'" "DONE" +cmd="$RAKE fminer:install" && run_cmd "$cmd" "Make" cd "$DIR" diff --git a/redis.sh b/redis.sh index b536f42..4de3cfd 100755 --- a/redis.sh +++ b/redis.sh @@ -46,17 +46,10 @@ if ! $REDIS_DONE; then cd $PREFIX URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1; then - printf "%25s%15s\n" "'Download'" "FAIL" - fi - printf "%25s%15s\n" "'Download'" "DONE" - + cmd="$WGET -O - $URI" && run_cmd "$cmd" "Download" + cmd="tar zxf redis-$REDIS_VER.tar.gz" && run_cmd "$cmd" "Unpack" cd redis-$REDIS_VER >>$LOG 2>&1 - if ! make >>$LOG 2>&1; then - printf "%25s%15s\n" "'Make'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Make'" "DONE" + cmd="make" && run_cmd "$cmd" "Make" if ! grep "daemonize yes" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then echo "daemonize yes" > $REDIS_SERVER_CONF 2>$LOG -- cgit v1.2.3 From d5879ae995bb516ccf8ef4ecdfa6ebd85cab2246 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 14:06:27 +0200 Subject: all --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index 5b16a1b..61711e0 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -45,7 +45,7 @@ if [ ! $OB_DONE ]; then cd /tmp URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" cmd="$WGET $URI" && run_cmd "$cmd" "Download" - cmd="tar zxf $OB_VER.tar.gz" && run_cmd "$cmd" "Unpack" + cmd="tar zxf $OB_VER.tar.gz*" && run_cmd "$cmd" "Unpack" cd "/tmp/$OB_VER" cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" -- cgit v1.2.3 From b0725f09bbf9d47d1612ccfa4dd0f9c04f5e9610 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 14:07:48 +0200 Subject: all --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index 61711e0..c868b2b 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -45,7 +45,7 @@ if [ ! $OB_DONE ]; then cd /tmp URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" cmd="$WGET $URI" && run_cmd "$cmd" "Download" - cmd="tar zxf $OB_VER.tar.gz*" && run_cmd "$cmd" "Unpack" + cmd="tar zxf $OB_VER.tar.gz $OB_VER" && run_cmd "$cmd" "Unpack" cd "/tmp/$OB_VER" cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" -- cgit v1.2.3 From 08e5eb420efea1b7d84ef2291bf2bea67b5387fb Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 14:09:24 +0200 Subject: all --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index c868b2b..adffa9a 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -45,7 +45,7 @@ if [ ! $OB_DONE ]; then cd /tmp URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" cmd="$WGET $URI" && run_cmd "$cmd" "Download" - cmd="tar zxf $OB_VER.tar.gz $OB_VER" && run_cmd "$cmd" "Unpack" + cmd="tar zxf $OB_VER.tar.gz?use_mirror=kent $OB_VER" && run_cmd "$cmd" "Unpack" cd "/tmp/$OB_VER" cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" -- cgit v1.2.3 From 7578e353de1cde367e7fd08235e23b6e499c1197 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 14:44:24 +0200 Subject: all --- kernlab.sh | 8 -------- nginx.sh | 3 ++- openbabel.sh | 5 ----- opentox-ruby.sh | 7 +------ opentox-webservices.sh | 4 ---- redis.sh | 4 ---- ruby.sh | 9 --------- 7 files changed, 3 insertions(+), 37 deletions(-) diff --git a/kernlab.sh b/kernlab.sh index b620ade..9ab2556 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -47,9 +47,6 @@ 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" @@ -60,9 +57,6 @@ if ! $R_DONE; then fi -echo -echo "Preparing:" - if [ ! -f $KL_CONF ]; then echo "if ! [[ \"\$R_LIBS\" =~ \"$KL_DEST\" ]]; then export R_LIBS=\"$KL_DEST\"; fi" >> "$KL_CONF" @@ -72,8 +66,6 @@ if [ ! -f $KL_CONF ]; then echo "source \"$KL_CONF\"" >> $HOME/.bashrc fi -else - echo "It seems R is already configured ('$KL_CONF' exists)." fi cd "$DIR" diff --git a/nginx.sh b/nginx.sh index 1ce1dbe..9838d69 100755 --- a/nginx.sh +++ b/nginx.sh @@ -21,7 +21,8 @@ fi LOG="/tmp/`basename $0`-log.txt" -echo "Nginx ('$LOG')." +echo +echo "Nginx ('$LOG'):" DIR="`pwd`" diff --git a/openbabel.sh b/openbabel.sh index adffa9a..6b5491b 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -39,8 +39,6 @@ else 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" @@ -76,9 +74,6 @@ fi cd "$DIR" -echo -echo "Preparing:" - if [ ! -f $OB_CONF ]; then echo "if ! [[ \"\$PATH\" =~ \"$OB_DEST\" ]]; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 45bcd3c..843bfed 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -38,8 +38,6 @@ LOG="/tmp/`basename $0`-log.txt" echo "Opentox-ruby ('$LOG'):" DIR="`pwd`" -echo -echo "Gems:" for mygem in opentox-ruby builder jeweler; do cmd="$GEM install $mygem" && run_cmd "$cmd" "$mygem" done @@ -50,9 +48,6 @@ 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 @@ -69,7 +64,7 @@ cmd="$RAKE install" && run_cmd "$cmd" "Install" GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` mv "$GEM_LIB" "$GEM_LIB~" >>$LOG 2>&1 -cmd="ln -s $WWW_DEST/opentox/opentox-ruby/lib" && run_cmd "$cmd" "Linking back" +cmd="ln -sf $WWW_DEST/opentox/opentox-ruby/lib $GEM_LIB" && run_cmd "$cmd" "Linking back" cd "$DIR" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 00c747a..9386655 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -31,8 +31,6 @@ echo "Webservices ('$LOG'):" DIR=`pwd` -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 @@ -62,8 +60,6 @@ done #ln -s /var/www/opentox/validation/public /var/www/validation # fminer etc -echo "Fminer:" - cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present" cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 echo "Need root password:" diff --git a/redis.sh b/redis.sh index 4de3cfd..3781b7a 100755 --- a/redis.sh +++ b/redis.sh @@ -62,8 +62,6 @@ fi cd "$DIR" -echo -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'." @@ -72,8 +70,6 @@ if [ ! -f $REDIS_CONF ]; then echo "source \"$REDIS_CONF\"" >> $HOME/.bashrc fi -else - echo "It seems Redis is already configured ('$REDIS_CONF' exists)." fi cd "$DIR" diff --git a/ruby.sh b/ruby.sh index 724d224..cf43b5c 100755 --- a/ruby.sh +++ b/ruby.sh @@ -39,8 +39,6 @@ else fi fi -echo -echo "Installing:" if [ ! $RUBY_DONE ]; then cd /tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" @@ -51,8 +49,6 @@ fi cd "$DIR" -echo -echo "Preparing:" if ! [ -f "$RUBY_CONF" ]; then @@ -62,15 +58,10 @@ if ! [ -f "$RUBY_CONF" ]; then if ! grep "$RUBY_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then echo "source \"$RUBY_CONF\"" >> $HOME/.bashrc fi - -else - echo "It seems RUBY is already configured ('$RUBY_CONF' exists)." fi source "$RUBY_CONF" -echo -echo "Passenger:" GEM="`which gem`" if [ ! -e "$GEM" ]; then echo "'gem' missing. Install 'gem' first. Aborting..." -- cgit v1.2.3 From 2e0651a4b6da1bbae8f9556bab2d9330988b1dc8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 31 Mar 2011 15:19:52 +0200 Subject: all --- install | 8 +++++--- openbabel.sh | 4 ++-- opentox-ruby.sh | 1 + opentox-webservices.sh | 1 - redis.sh | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/install b/install index 2285107..d6422a5 100755 --- a/install +++ b/install @@ -2,9 +2,11 @@ # Main Opentox-ruby install script # Author: Christoph Helma, Andreas Maunz -echo "Opentox-ruby installation" -echo "Press to continue..." -read +LOG="/tmp/`basename $0`-log.txt" +source ./utils.sh +echo "Opentox-ruby installation." +echo "You may need to give root password for some privileged actions right now:" +cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" source "./config" source "./base-install.sh" diff --git a/openbabel.sh b/openbabel.sh index 6b5491b..58b47b4 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -67,9 +67,9 @@ fi if ! $OB_DONE ; then cd "/tmp/$OB_VER/scripts/ruby/" - cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0" && run_cmd "$cmd" "Bindings: Code" + cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0" && run_cmd "$cmd" "Code" cmd="make" && run_cmd "$cmd" "Make" - cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Bindings: Install" + cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Install" fi cd "$DIR" diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 843bfed..9f482a5 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -35,6 +35,7 @@ fi # Pkg LOG="/tmp/`basename $0`-log.txt" +echo echo "Opentox-ruby ('$LOG'):" DIR="`pwd`" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 9386655..9ae2376 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -62,7 +62,6 @@ done # fminer etc cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present" cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 -echo "Need root password:" sudo updatedb >>$LOG 2>&1 cmd="$RAKE fminer:install" && run_cmd "$cmd" "Make" diff --git a/redis.sh b/redis.sh index 3781b7a..f8ba1d0 100755 --- a/redis.sh +++ b/redis.sh @@ -41,12 +41,11 @@ else fi if ! $REDIS_DONE; then - echo "Need root password: " echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 cd $PREFIX URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - cmd="$WGET -O - $URI" && run_cmd "$cmd" "Download" + cmd="$WGET $URI" && run_cmd "$cmd" "Download" cmd="tar zxf redis-$REDIS_VER.tar.gz" && run_cmd "$cmd" "Unpack" cd redis-$REDIS_VER >>$LOG 2>&1 cmd="make" && run_cmd "$cmd" "Make" -- cgit v1.2.3 From 74a3e988302218b8b2196b3700a848df26aec156 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 12:58:34 +0200 Subject: all --- README | 3 +++ base-install.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README b/README index 3c85262..784b79e 100644 --- a/README +++ b/README @@ -1,3 +1,6 @@ +It is assumed that your system is configured for sudo to gain root privileges. +It is assumed that your system is configured for using non-free packages. + Installer for OpenTox IST/ALU Services ====================================== diff --git a/base-install.sh b/base-install.sh index ea26dea..76025a0 100755 --- a/base-install.sh +++ b/base-install.sh @@ -66,14 +66,14 @@ if [ -n "$pack_fail" ]; then fi echo -if [ -n $pack_arr ]; then +if [ -n "$pack_arr" ]; then echo "Installing missing packages:" fi pack_fail="" for p in $pack_arr; do echo -n "'$p': " - cmd="sudo $APTITUDE install $p" && run_cmd "$cmd" "$p" + cmd="sudo $APTITUDE -y install $p" && run_cmd "$cmd" "$p" done if [ -n "$pack_fail" ]; then -- cgit v1.2.3 From 0b0dafd700dce8ab635038dac68255be1897eb04 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 13:08:57 +0200 Subject: all --- base-install.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/base-install.sh b/base-install.sh index 76025a0..b10f2d9 100755 --- a/base-install.sh +++ b/base-install.sh @@ -65,23 +65,17 @@ if [ -n "$pack_fail" ]; then read fi +echo sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true | sudo /usr/bin/debconf-set-selections echo if [ -n "$pack_arr" ]; then echo "Installing missing packages:" fi -pack_fail="" for p in $pack_arr; do echo -n "'$p': " cmd="sudo $APTITUDE -y install $p" && run_cmd "$cmd" "$p" done -if [ -n "$pack_fail" ]; then - echo - echo "WARNING: At least one missing package could not be installed. Press to continue or to abort." - read -fi - echo echo "Preparing JAVA:" if [ ! -f $JAVA_CONF ]; then -- cgit v1.2.3 From de9c1794db7419da642398ac41975a282ca92dd1 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 14:03:51 +0200 Subject: all --- base-install.sh | 3 --- openbabel.sh | 38 +++++++++++++++++++++----------------- redis.sh | 6 ++++-- ruby.sh | 6 ++++-- utils.sh | 23 +++++++++++++++++------ 5 files changed, 46 insertions(+), 30 deletions(-) diff --git a/base-install.sh b/base-install.sh index b10f2d9..c7f19d4 100755 --- a/base-install.sh +++ b/base-install.sh @@ -43,10 +43,8 @@ done if [ -n "$pack_arr" ]; then echo echo "Checking availablity:" - echo -n "Updating package indices: " sudo $APTITUDE update -y >/dev/null 2>&1 sudo $APTITUDE upgrade -y >/dev/null 2>&1 - echo "done." fi for p in $pack_arr; do @@ -72,7 +70,6 @@ if [ -n "$pack_arr" ]; then fi for p in $pack_arr; do - echo -n "'$p': " cmd="sudo $APTITUDE -y install $p" && run_cmd "$cmd" "$p" done diff --git a/openbabel.sh b/openbabel.sh index 58b47b4..a28796d 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -42,8 +42,10 @@ fi if [ ! $OB_DONE ]; then cd /tmp URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" - cmd="$WGET $URI" && run_cmd "$cmd" "Download" - cmd="tar zxf $OB_VER.tar.gz?use_mirror=kent $OB_VER" && run_cmd "$cmd" "Unpack" + 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" cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" @@ -51,9 +53,25 @@ if [ ! $OB_DONE ]; then cmd="make install" && run_cmd "$cmd" "Install" fi +if [ ! -f "$OB_CONF" ]; then + + echo "if ! [[ \"\$PATH\" =~ \"$OB_DEST\" ]]; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" + echo "if ! [[ \"\$LD_LIBRARY_PATH\" =~ \"$OB_DEST\" ]]; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" + + echo "Openbabel configuration has been stored in '$OB_CONF'." + if ! grep "$OB_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then + echo "source \"$OB_CONF\"" >> $HOME/.bashrc + fi + +fi + echo echo "Bindings:" OB_DONE=false +source "$HOME/.bashrc" mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1 if [ ! -d "$OB_DEST_BINDINGS" ]; then echo "Install directory '$OB_DEST_BINDINGS' is not available! Aborting..." @@ -67,25 +85,11 @@ fi if ! $OB_DONE ; then cd "/tmp/$OB_VER/scripts/ruby/" - cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0" && run_cmd "$cmd" "Code" + cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0 --with-openbabel-lib=$OB_DEST/lib" && run_cmd "$cmd" "Code" cmd="make" && run_cmd "$cmd" "Make" cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Install" fi cd "$DIR" -if [ ! -f $OB_CONF ]; then - - echo "if ! [[ \"\$PATH\" =~ \"$OB_DEST\" ]]; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" - echo "if ! [[ \"\$LD_LIBRARY_PATH\" =~ \"$OB_DEST\" ]]; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" - echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" - echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" - echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" - - echo "Openbabel configuration has been stored in '$OB_CONF'." - if ! grep "$OB_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then - echo "source \"$OB_CONF\"" >> $HOME/.bashrc - fi - -fi diff --git a/redis.sh b/redis.sh index f8ba1d0..6d94029 100755 --- a/redis.sh +++ b/redis.sh @@ -45,8 +45,10 @@ if ! $REDIS_DONE; then cd $PREFIX URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - cmd="$WGET $URI" && run_cmd "$cmd" "Download" - cmd="tar zxf redis-$REDIS_VER.tar.gz" && run_cmd "$cmd" "Unpack" + if ! [ -d "redis-$REDIS_VER" ]; then + cmd="$WGET $URI" && run_cmd "$cmd" "Download" + cmd="tar zxf redis-$REDIS_VER.tar.gz" && run_cmd "$cmd" "Unpack" + fi cd redis-$REDIS_VER >>$LOG 2>&1 cmd="make" && run_cmd "$cmd" "Make" diff --git a/ruby.sh b/ruby.sh index cf43b5c..9d53662 100755 --- a/ruby.sh +++ b/ruby.sh @@ -42,8 +42,10 @@ fi if [ ! $RUBY_DONE ]; then cd /tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - cmd="$WGET $URI" && run_cmd "$cmd" "Download" - cmd="tar xzf $RUBY_VER.tar.gz" && run_cmd "$cmd" "Unpack" + if ! [ -d "/tmp/$RUBY_VER" ]; then + cmd="$WGET $URI" && run_cmd "$cmd" "Download" + cmd="tar xzf $RUBY_VER.tar.gz" && run_cmd "$cmd" "Unpack" + fi cmd="sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" fi diff --git a/utils.sh b/utils.sh index 0cdbc69..07d8d73 100644 --- a/utils.sh +++ b/utils.sh @@ -1,17 +1,19 @@ #!/bin/bash -function check_dest { - if ! [ -d $PREFIX ]; then - if ! mkdir -p $PREFIX; then +check_dest() +{ + if ! [ -d "$PREFIX" ]; then + if ! mkdir -p "$PREFIX"; then echo "Could not create target directory '$PREFIX'! Aborting..." exit 1 fi fi } -function run_cmd { - local cmd=$1 - local title=$2 +run_cmd () +{ + local cmd="$1" + local title="$2" if ! eval $cmd >>$LOG 2>&1 ; then printf "%25s%15s\n" "'$title'" "FAIL" @@ -21,5 +23,14 @@ function run_cmd { } +abs_path() +{ + local path="$1" + case "$path" in + /*) absolute=1 ;; + *) absolute=0 ;; + esac +} + check_dest source ~/.bashrc -- cgit v1.2.3 From c13ecd56442d5d9f6aea71e86f2413bd5560531f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 14:36:07 +0200 Subject: Using master by default --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 9ae2376..5f9f635 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -38,7 +38,7 @@ 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/master>>$LOG 2>&1 rm -rf public >>$LOG 2>&1 mkdir public >>$LOG 2>&1 -- cgit v1.2.3 From 674f6cd24b6ee37465c27b3643ea702ca5343bb0 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 14:43:55 +0200 Subject: Inserting Correct headers --- opentox-webservices.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 5f9f635..f69cc04 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -63,6 +63,9 @@ done cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present" cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 sudo updatedb >>$LOG 2>&1 +for mylib in bbrc last; do + sed -i "s/INCLUDE_OB.*/INCLUDE_OB\ =\ $OB_DEST/include/g" $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile +done cmd="$RAKE fminer:install" && run_cmd "$cmd" "Make" cd "$DIR" -- cgit v1.2.3 From aae109a81e53aa10e720cdb4cfa5c05a3ccb31dd Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:03:46 +0200 Subject: Merged config --- config | 19 ------------------- config.sh | 11 ++++++++--- 2 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 config diff --git a/config b/config deleted file mode 100644 index e72242b..0000000 --- a/config +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Configuration options for OpenTox installations (sets shell variables for installation scripts) - -# Linux distribution (currently only debian) -distribution=debian - -# Installation type -# Options: -# gem installs only the opentox-ruby gem (useful, if you want to use external services with the opentox-ruby DSL) -# local local installation (authentication and authorisation disabled) -# server inter or intranet server (authentication and authorisation enabled) -install=server - -# Git branch of services -# Options: master development -# "master" installs the current stable version -branch=master - diff --git a/config.sh b/config.sh index af806e2..72c3fec 100644 --- a/config.sh +++ b/config.sh @@ -4,17 +4,22 @@ # Author: Christoph Helma, Andreas Maunz. # -# 1) Where all binaries are installed. +# 1) Base setup +OT_DIST="debian" # Linux distribution (debian) +OT_INSTALL="local" # Type (gem, local, server) +OT_BRANCH="master" # Maturity (development, master) + +# 2) Where all binaries are installed. PREFIX="$HOME/opentox" JAVA_HOME="/usr/lib/jvm/java-6-sun" -# 2) What versions to install. +# 3) What versions to install. RUBY_NUM_VER="1.8.7-2011.03" OB_NUM_VER="2.2.3" KL_NUM_VER="0.9-11" REDIS_NUM_VER="2.2.2" -# 3) Server settings. +# 4) Server settings. NGINX_SERVERNAME="localhost" WWW_DEST="$PREFIX/www" -- cgit v1.2.3 From 7c90da9c5ec90a27e5a33c311ac66db44f101cec Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:05:32 +0200 Subject: Modifying INCLUDEs --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index f69cc04..304c8b2 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -64,7 +64,7 @@ cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config pr cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 sudo updatedb >>$LOG 2>&1 for mylib in bbrc last; do - sed -i "s/INCLUDE_OB.*/INCLUDE_OB\ =\ $OB_DEST/include/g" $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile + cmd="sed -i \'s/INCLUDE_OB.*/INCLUDE_OB\ =\ $OB_DEST/include/g\' $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done cmd="$RAKE fminer:install" && run_cmd "$cmd" "Make" -- cgit v1.2.3 From 1bca6beb732e7f5d19a1c49187fc56210b61bae0 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:16:40 +0200 Subject: re-introduced branch check --- opentox-ruby.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 9f482a5..1ba8523 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -40,32 +40,40 @@ echo "Opentox-ruby ('$LOG'):" DIR="`pwd`" for mygem in opentox-ruby builder jeweler; do - cmd="$GEM install $mygem" && run_cmd "$cmd" "$mygem" + if ! $GEM list | grep "$mygem" >/dev/null 2>&1; then + cmd="$GEM install $mygem" && run_cmd "$cmd" "$mygem" + fi done servername="`hostname`" +serverdomain="`dnsdomainname`" +if [ -n "$serverdomain" ]; then + servername="$servername"."$serverdomain" +fi escapedserver="`echo $servername | sed 's/\/\\\//'`" logger=":logger: backtrace" aa="nil" 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 -sed -e "s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/" aa-local.yaml >> $HOME/.opentox/config/production.yaml 2>$LOG - -mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 -cd $WWW_DEST/opentox >>$LOG 2>&1 -$GIT clone git://github.com/opentox/opentox-ruby.git >>$LOG 2>&1 -cd opentox-ruby >>$LOG 2>&1 -$GIT checkout -b development origin/development>>$LOG 2>&1 - -cmd="$RAKE install" && run_cmd "$cmd" "Install" -GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` -mv "$GEM_LIB" "$GEM_LIB~" >>$LOG 2>&1 - -cmd="ln -sf $WWW_DEST/opentox/opentox-ruby/lib $GEM_LIB" && run_cmd "$cmd" "Linking back" +cmd="sed -e \"s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" +cmd="sed -e \"s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/\" aa-local.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 2" + +if [ $OT_BRANCH = "development" ]; then + mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 + cd $WWW_DEST/opentox >>$LOG 2>&1 + rm -rf opentox-ruby >>$LOG 2>&1 + $GIT clone git://github.com/opentox/opentox-ruby.git >>$LOG 2>&1 + cd opentox-ruby >>$LOG 2>&1 + $GIT checkout -t origin/$OT_BRANCH >>$LOG 2>&1 + cmd="$RAKE install" && run_cmd "$cmd" "Install" + GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` + rm -rf "$GEM_LIB~" >>$LOG 2>&1 + mv "$GEM_LIB" "$GEM_LIB~" >>$LOG 2>&1 + cmd="ln -sf $WWW_DEST/opentox/opentox-ruby/lib $GEM_LIB" && run_cmd "$cmd" "Linking back" +fi cd "$DIR" -- cgit v1.2.3 From 457b352dc5cdb01f8f7ff0e1587a4e0df0a4eb93 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:19:04 +0200 Subject: Removing existing dirs --- opentox-webservices.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 304c8b2..0cb69c2 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -34,21 +34,16 @@ DIR=`pwd` 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 + rm -rf "$s" >>$LOG 2>&1 git clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 - cd "$s" >>$LOG 2>&1 - - git checkout -t origin/master>>$LOG 2>&1 - + git checkout -t origin/$OT_BRANCH >>$LOG 2>&1 rm -rf public >>$LOG 2>&1 mkdir public >>$LOG 2>&1 - mypath_from="$WWW_DEST/opentox/$s/public" mypath_to="$WWW_DEST/$s" cmd="ln -sf \"$mypath_from\" \"$mypath_to\"" && run_cmd "$cmd" "Linking $s" - cd - >>$LOG 2>&1 - done # validation service -- cgit v1.2.3 From 9767c31849d79666becaf0a6882a4ad1e9412b13 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:23:16 +0200 Subject: Guarding passenger install --- ruby.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruby.sh b/ruby.sh index 9d53662..4aa438f 100755 --- a/ruby.sh +++ b/ruby.sh @@ -78,7 +78,9 @@ if [ "$PASSENGER_SKIP" != "s" ]; then if ! grep "$GEMCONF" $HOME/.gemrc >>$LOG 2>&1; then echo "$GEMCONF" | tee -a $HOME/.gemrc >>$LOG 2>&1 fi - cmd="$GEM install passenger" && run_cmd "$cmd" "Install Passenger" + if ! $GEM list | grep passenger >/dev/null 2>&1; then + cmd="$GEM install passenger" && run_cmd "$cmd" "Install Passenger" + fi fi -- cgit v1.2.3 From 8f6e83bb4202ee936b1efe9d45984158a91d140e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:24:10 +0200 Subject: Removed config --- install | 1 - 1 file changed, 1 deletion(-) diff --git a/install b/install index d6422a5..036e477 100755 --- a/install +++ b/install @@ -8,7 +8,6 @@ echo "Opentox-ruby installation." echo "You may need to give root password for some privileged actions right now:" cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" -source "./config" source "./base-install.sh" source "./ruby.sh" source "./openbabel.sh" -- cgit v1.2.3 From b69506cc0d7b3b2336444b6458cde7507388a8ca Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:28:49 +0200 Subject: Removed sourcing of config.sh --- base-install.sh | 1 - kernlab.sh | 1 - nginx.sh | 1 - openbabel.sh | 1 - opentox-ruby.sh | 1 - opentox-webservices.sh | 1 - redis.sh | 1 - ruby.sh | 1 - utils.sh | 3 ++- 9 files changed, 2 insertions(+), 9 deletions(-) diff --git a/base-install.sh b/base-install.sh index c7f19d4..f3ed3e8 100755 --- a/base-install.sh +++ b/base-install.sh @@ -21,7 +21,6 @@ if [ ! -e "$APTITUDE" ]; then fi # Dest -source ./config.sh source ./utils.sh # Pkgs diff --git a/kernlab.sh b/kernlab.sh index 9ab2556..73353a6 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -4,7 +4,6 @@ # Author: Christoph Helma, Andreas Maunz. # -source ./config.sh source ./utils.sh if [ "$(id -u)" = "0" ]; then diff --git a/nginx.sh b/nginx.sh index 9838d69..863b405 100755 --- a/nginx.sh +++ b/nginx.sh @@ -4,7 +4,6 @@ # Author: Christoph Helma, Andreas Maunz. # -source ./config.sh source ./utils.sh if [ "$(id -u)" = "0" ]; then diff --git a/openbabel.sh b/openbabel.sh index a28796d..0bcd148 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -5,7 +5,6 @@ # Author: Christoph Helma, Andreas Maunz. # -source ./config.sh source ./utils.sh if [ "$(id -u)" = "0" ]; then diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 1ba8523..63fa158 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -4,7 +4,6 @@ # Author: Christoph Helma, Andreas Maunz. # -source ./config.sh source ./utils.sh if [ "$(id -u)" = "0" ]; then diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 0cb69c2..9756c51 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -4,7 +4,6 @@ # Author: Christoph Helma, Andreas Maunz. # -source ./config.sh source ./utils.sh if [ "$(id -u)" = "0" ]; then diff --git a/redis.sh b/redis.sh index 6d94029..ea85c3b 100755 --- a/redis.sh +++ b/redis.sh @@ -4,7 +4,6 @@ # Author: Christoph Helma, Andreas Maunz. # -source ./config.sh source ./utils.sh if [ "$(id -u)" = "0" ]; then diff --git a/ruby.sh b/ruby.sh index 4aa438f..b3cb32d 100755 --- a/ruby.sh +++ b/ruby.sh @@ -19,7 +19,6 @@ if [ ! -e "$WGET" ]; then fi # Pkg -source ./config.sh source ./utils.sh LOG="/tmp/`basename $0`-log.txt" diff --git a/utils.sh b/utils.sh index 07d8d73..45cdbba 100644 --- a/utils.sh +++ b/utils.sh @@ -32,5 +32,6 @@ abs_path() esac } -check_dest source ~/.bashrc +source .config.sh +check_dest -- cgit v1.2.3 From 7dacb96c5c4c46f8fd0c76bd26e5d37319bb5eb1 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:37:43 +0200 Subject: all --- base-install.sh | 8 ++++++-- kernlab.sh | 5 ++--- nginx.sh | 5 ++--- openbabel.sh | 8 ++++---- opentox-ruby.sh | 4 ++-- opentox-webservices.sh | 4 ++-- redis.sh | 6 ++---- ruby.sh | 7 ++++--- utils.sh | 4 ++-- 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 -- cgit v1.2.3 From dac77af34f7ed10223b1fe31d658df0c2b64c23f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:39:29 +0200 Subject: all --- install | 2 +- kernlab.sh | 1 + openbabel.sh | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index 036e477..2101702 100755 --- a/install +++ b/install @@ -14,7 +14,7 @@ source "./openbabel.sh" source "./kernlab.sh" source "./opentox-ruby.sh" -if [ $install != "gem" ] +if [ "$install" != "gem" ] then source "./nginx.sh" source "./redis.sh" diff --git a/kernlab.sh b/kernlab.sh index 2716b66..21fc642 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -28,6 +28,7 @@ fi # Pkg LOG="/tmp/`basename $0`-log.txt" +echo echo "Kernlab ('$LOG')." R_DONE=false diff --git a/openbabel.sh b/openbabel.sh index 94ff981..5cc9629 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -67,7 +67,6 @@ if [ ! -f "$OB_CONF" ]; then fi -echo echo "Bindings:" OB_DONE=false source "$HOME/.bashrc" -- cgit v1.2.3 From 230943e83ce1741fb87c6a556795a2ff7a2e561e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:41:23 +0200 Subject: Fixed fminer Makefile injection --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 1fce812..cc59045 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -58,7 +58,7 @@ cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config pr cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 sudo updatedb >>$LOG 2>&1 for mylib in bbrc last; do - cmd="sed -i \'s/INCLUDE_OB.*/INCLUDE_OB\ =\ $OB_DEST/include/g\' $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's/INCLUDE_OB.*/INCLUDE_OB\ =\ $OB_DEST/include/g' $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done cmd="$RAKE fminer:install" && run_cmd "$cmd" "Make" -- cgit v1.2.3 From aed19c4491d6713e4ea75d4a8febef57752203d9 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:43:14 +0200 Subject: all --- kernlab.sh | 1 - nginx.sh | 1 - openbabel.sh | 1 - redis.sh | 1 - ruby.sh | 1 - 5 files changed, 5 deletions(-) diff --git a/kernlab.sh b/kernlab.sh index 21fc642..395d49a 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -38,7 +38,6 @@ 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' not empty. Skipping kernlab installation." R_DONE=true else mkdir "$KL_DEST" >/dev/null 2>&1 diff --git a/nginx.sh b/nginx.sh index d049500..f226dce 100755 --- a/nginx.sh +++ b/nginx.sh @@ -31,7 +31,6 @@ 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' not empty. Skipping nginx installation." NGINX_DONE=true fi fi diff --git a/openbabel.sh b/openbabel.sh index 5cc9629..f18ee65 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -76,7 +76,6 @@ if [ ! -d "$OB_DEST_BINDINGS" ]; then exit 1 else if [ "`ls $OB_DEST_BINDINGS | wc -l`" -gt 0 ]; then - echo "Install directory '$OB_DEST_BINDINGS' is not empty. Skipping Openbabel Binding installation..." OB_DONE=true fi fi diff --git a/redis.sh b/redis.sh index a6fdc30..8412143 100755 --- a/redis.sh +++ b/redis.sh @@ -32,7 +32,6 @@ if [ ! -d "$REDIS_DEST" ]; then exit 1 else if ! rmdir "$REDIS_DEST" >/dev/null 2>&1; then # if not empty this will fail - echo "Install directory '$REDIS_DEST' is not empty. Skipping Redis installation..." REDIS_DONE=true else mkdir "$REDIS_DEST" >/dev/null 2>&1 diff --git a/ruby.sh b/ruby.sh index 8c3361a..2c073db 100755 --- a/ruby.sh +++ b/ruby.sh @@ -34,7 +34,6 @@ if [ ! -d "$RUBY_DEST" ]; then exit 1 else if ! rmdir "$RUBY_DEST" >/dev/null 2>&1; then # if not empty this will fail - echo "Install directory '$RUBY_DEST' is not empty. Skipping Ruby installation..." RUBY_DONE=true fi fi -- cgit v1.2.3 From 02f97cd5a1152f25d91dc72fe8b71766f9a59561 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:44:39 +0200 Subject: all --- nginx.sh | 2 +- redis.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/nginx.sh b/nginx.sh index f226dce..fb0bc9b 100755 --- a/nginx.sh +++ b/nginx.sh @@ -4,7 +4,7 @@ # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`./utils.sh" +source "`pwd`/utils.sh" DIR="`pwd`" if [ "$(id -u)" = "0" ]; then diff --git a/redis.sh b/redis.sh index 8412143..d71c0c4 100755 --- a/redis.sh +++ b/redis.sh @@ -21,8 +21,7 @@ fi LOG="/tmp/`basename $0`-log.txt" -echo "This installs Redis." -echo "Log file is '$LOG'." +echo "Redis ('$LOG'):" REDIS_DONE=false -- cgit v1.2.3 From bd42d2f31d370648610fe76e1e9ca9c45ad57517 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:46:36 +0200 Subject: all --- base-install.sh | 2 -- openbabel.sh | 1 - opentox-webservices.sh | 2 +- redis.sh | 1 + 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/base-install.sh b/base-install.sh index ac200c6..18d8170 100755 --- a/base-install.sh +++ b/base-install.sh @@ -74,8 +74,6 @@ for p in $pack_arr; do cmd="sudo $APTITUDE -y install $p" && run_cmd "$cmd" "$p" done -echo -echo "Preparing JAVA:" if [ ! -f $JAVA_CONF ]; then if [ ! -d "$JAVA_HOME" ]; then diff --git a/openbabel.sh b/openbabel.sh index f18ee65..4f8c2ee 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -33,7 +33,6 @@ 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." OB_DONE=true fi fi diff --git a/opentox-webservices.sh b/opentox-webservices.sh index cc59045..7141d3c 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -27,9 +27,9 @@ fi LOG="/tmp/`basename $0`-log.txt" +echo echo "Webservices ('$LOG'):" - 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 diff --git a/redis.sh b/redis.sh index d71c0c4..b669bee 100755 --- a/redis.sh +++ b/redis.sh @@ -21,6 +21,7 @@ fi LOG="/tmp/`basename $0`-log.txt" +echo echo "Redis ('$LOG'):" -- cgit v1.2.3 From 59aeec7630a6487d4f067915692c834722349ba5 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:48:11 +0200 Subject: all --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 7141d3c..02558ab 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -58,7 +58,7 @@ cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config pr cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 sudo updatedb >>$LOG 2>&1 for mylib in bbrc last; do - cmd="sed -i 's/INCLUDE_OB.*/INCLUDE_OB\ =\ $OB_DEST/include/g' $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's,INCLUDE_OB.*,INCLUDE_OB\ =\ $OB_DEST/include,g' $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done cmd="$RAKE fminer:install" && run_cmd "$cmd" "Make" -- cgit v1.2.3 From 2db8689b25e8ec6ff7c2d6472787ba2bdd98ef38 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 15:58:44 +0200 Subject: all --- opentox-webservices.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 02558ab..8c73724 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -55,12 +55,18 @@ done # fminer etc cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present" -cd $WWW_DEST/opentox/algorithm >>$LOG 2>&1 -sudo updatedb >>$LOG 2>&1 +cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1 +cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" +cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do - cmd="sed -i 's,INCLUDE_OB.*,INCLUDE_OB\ =\ $OB_DEST/include,g' $WWW_DEST/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's,INCLUDE_OB.*,INCLUDE_OB\ =\ $OB_DEST/include,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done -cmd="$RAKE fminer:install" && run_cmd "$cmd" "Make" +cd "libfminer/libbbrc">>$LOG 2>&1 +cmd="make ruby" && run_cmd "$cmd" "Make BBRC" +cd ->>$LOG 2>&1 +cd "libfminer/liblast">>$LOG 2>&1 +cmd="make ruby" && run_cmd "$cmd" "Make BBRC" +cd ->>$LOG 2>&1 cd "$DIR" -- cgit v1.2.3 From 37e80affbe795902209667797524849c7018c8fa Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 16:02:07 +0200 Subject: all --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 8c73724..0354602 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -59,7 +59,7 @@ cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1 cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do - cmd="sed -i 's,INCLUDE_OB.*,INCLUDE_OB\ =\ $OB_DEST/include,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's,INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done cd "libfminer/libbbrc">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" -- cgit v1.2.3 From 46f1e1d85f296d453a9f5489488aae5988169498 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 16:04:04 +0200 Subject: all --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 0354602..f64a0c4 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -59,7 +59,7 @@ cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1 cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do - cmd="sed -i 's,INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done cd "libfminer/libbbrc">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" -- cgit v1.2.3 From 33aa00252c0dee34cc2fe6694104049f4e950de3 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 16:06:55 +0200 Subject: all --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index f64a0c4..baa7c3d 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -59,7 +59,7 @@ cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1 cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do - cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done cd "libfminer/libbbrc">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" -- cgit v1.2.3 From 753e365d55c2285cdcd29f2431fab0236c20844e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 16:10:44 +0200 Subject: ot-ws.sh --- opentox-webservices.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index baa7c3d..2fc6841 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -60,6 +60,7 @@ cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/i686-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" done cd "libfminer/libbbrc">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" -- cgit v1.2.3 From 94090051d00b329559ce6ccfbbcb7b00f4509c7d Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 16:15:52 +0200 Subject: ot-ws.sh --- opentox-webservices.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 2fc6841..cbb9fd3 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -59,8 +59,8 @@ cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1 cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do - cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" - cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/i686-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib" + cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile; sed -i 's,^LDFLAGS_OB.*,LDFLAGS_OB\ =\ -L$OB_DEST/lib,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (OB)" + cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/i686-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (RB)" done cd "libfminer/libbbrc">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" -- cgit v1.2.3 From 6e15685c0992a720507209c2c9b43a9c561ade5e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 16:27:53 +0200 Subject: Removed bashismsh --- base-install.sh | 10 +++++----- config.sh | 2 +- kernlab.sh | 6 +++--- nginx.sh | 4 ++-- openbabel.sh | 8 ++++---- opentox-ruby.sh | 4 ++-- opentox-webservices.sh | 4 ++-- redis.sh | 8 ++++---- ruby.sh | 8 ++++---- utils.sh | 6 +++--- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/base-install.sh b/base-install.sh index 18d8170..7fdb824 100755 --- a/base-install.sh +++ b/base-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Installs base packages for Ubuntu # Author: Andreas Maunz @@ -6,7 +6,7 @@ # Your installed packages are safe and will not be updated. # A Java configuration is created and included in your '~.bashrc'. -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR="`pwd`" if [ "$(id -u)" = "0" ]; then @@ -60,8 +60,8 @@ done if [ -n "$pack_fail" ]; then echo echo "WARNING: At least one missing package has no suitable installation candidate." - echo "Press to continue or to abort." - read + echo "Press to abort (5 sec)." + sleep 5 fi echo sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true | sudo /usr/bin/debconf-set-selections @@ -86,7 +86,7 @@ if [ ! -f $JAVA_CONF ]; then echo "Java configuration has been stored in '$JAVA_CONF'." if ! grep "$JAVA_CONF" $HOME/.bashrc >/dev/null 2>&1; then - echo "source \"$JAVA_CONF\"" >> $HOME/.bashrc + echo ". \"$JAVA_CONF\"" >> $HOME/.bashrc fi fi diff --git a/config.sh b/config.sh index 72c3fec..244ab37 100644 --- a/config.sh +++ b/config.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Configuration file for Opentox installer. # Author: Christoph Helma, Andreas Maunz. diff --git a/kernlab.sh b/kernlab.sh index 395d49a..10141e2 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Installs Kernlab. # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR="`pwd`" if [ "$(id -u)" = "0" ]; then @@ -61,7 +61,7 @@ if [ ! -f $KL_CONF ]; then echo "R package destination has been stored in '$KL_CONF'." if ! grep "$KL_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then - echo "source \"$KL_CONF\"" >> $HOME/.bashrc + echo ". \"$KL_CONF\"" >> $HOME/.bashrc fi fi diff --git a/nginx.sh b/nginx.sh index fb0bc9b..3aefac0 100755 --- a/nginx.sh +++ b/nginx.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Installs Passenger. # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR="`pwd`" if [ "$(id -u)" = "0" ]; then diff --git a/openbabel.sh b/openbabel.sh index 4f8c2ee..9e16b1d 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -1,11 +1,11 @@ -#!/bin/bash +#!/bin/sh # # Installs Openbabel. # A configuration file is created and included in your '~.bashrc'. # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR="`pwd`" if [ "$(id -u)" = "0" ]; then @@ -61,14 +61,14 @@ if [ ! -f "$OB_CONF" ]; then echo "Openbabel configuration has been stored in '$OB_CONF'." if ! grep "$OB_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then - echo "source \"$OB_CONF\"" >> $HOME/.bashrc + echo ". \"$OB_CONF\"" >> $HOME/.bashrc fi fi echo "Bindings:" OB_DONE=false -source "$HOME/.bashrc" +. "$HOME/.bashrc" mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1 if [ ! -d "$OB_DEST_BINDINGS" ]; then echo "Install directory '$OB_DEST_BINDINGS' is not available! Aborting..." diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 492a167..f7a470d 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Installs Opentox-ruby gem. # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR="`pwd`" if [ "$(id -u)" = "0" ]; then diff --git a/opentox-webservices.sh b/opentox-webservices.sh index cbb9fd3..583ea7c 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Installs Opentox Webservices. # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR=`pwd` if [ "$(id -u)" = "0" ]; then diff --git a/redis.sh b/redis.sh index b669bee..503cfca 100755 --- a/redis.sh +++ b/redis.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Installs Redis. # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR=`pwd` if [ "$(id -u)" = "0" ]; then @@ -63,8 +63,8 @@ if [ ! -f $REDIS_CONF ]; then echo "export PATH=$REDIS_DEST/src:\$PATH" >> "$REDIS_CONF" echo "Redis configuration has been stored in '$REDIS_CONF'." - if ! grep "source \"$REDIS_CONF\"" $HOME/.bashrc; then - echo "source \"$REDIS_CONF\"" >> $HOME/.bashrc + if ! grep ". \"$REDIS_CONF\"" $HOME/.bashrc; then + echo ". \"$REDIS_CONF\"" >> $HOME/.bashrc fi fi diff --git a/ruby.sh b/ruby.sh index 2c073db..87e87b7 100755 --- a/ruby.sh +++ b/ruby.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Installs Ruby enterprise edition and passenger gem. # A configuration file is created and included in your '~.bashrc'. @@ -6,7 +6,7 @@ # Author: Christoph Helma, Andreas Maunz. # -source "`pwd`/utils.sh" +. "`pwd`/utils.sh" DIR="`pwd`" if [ "$(id -u)" = "0" ]; then @@ -56,10 +56,10 @@ if ! [ -f "$RUBY_CONF" ]; then echo "Ruby configuration has been stored in '$RUBY_CONF'." if ! grep "$RUBY_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then - echo "source \"$RUBY_CONF\"" >> $HOME/.bashrc + echo ". \"$RUBY_CONF\"" >> $HOME/.bashrc fi fi -source "$RUBY_CONF" +. "$RUBY_CONF" GEM="`which gem`" diff --git a/utils.sh b/utils.sh index b49e6fc..8c3d633 100644 --- a/utils.sh +++ b/utils.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh check_dest() { @@ -32,6 +32,6 @@ abs_path() esac } -source "$HOME/.bashrc" -source "`pwd`/config.sh" +. "$HOME/.bashrc" +. "`pwd`/config.sh" check_dest -- cgit v1.2.3 From ed920f0ae3676d7fee9b3471cdb483ba222a16a1 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 1 Apr 2011 16:35:18 +0200 Subject: Re-enabled variable branching --- opentox-ruby.sh | 16 +++++++++++++--- opentox-webservices.sh | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index f7a470d..b27ef85 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -51,8 +51,18 @@ if [ -n "$serverdomain" ]; then servername="$servername"."$serverdomain" fi escapedserver="`echo $servername | sed 's/\/\\\//'`" -logger=":logger: backtrace" -aa="nil" + +if [ "$OT_BRANCH" = "development" ]; then + logger=":logger: backtrace" +else + logger="" +fi + +if [ "$OT_INSTALL" = "server" ]; then + aa="https:\/\/opensso.in-silico.ch" +else + aa=nil +fi mkdir -p "$HOME/.opentox/config" >>$LOG 2>&1 mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 @@ -60,7 +70,7 @@ mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 cmd="sed -e \"s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" cmd="sed -e \"s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/\" aa-local.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 2" -if [ $OT_BRANCH = "development" ]; then +if [ "$OT_BRANCH" = "development" ]; then mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 cd $WWW_DEST/opentox >>$LOG 2>&1 rm -rf opentox-ruby >>$LOG 2>&1 diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 583ea7c..71bef01 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -27,6 +27,10 @@ fi LOG="/tmp/`basename $0`-log.txt" +if ! id opentox; then + cmd="sudo adduser --system opentox" && run_cmd "$cmd" "User 'opentox'" +fi + echo echo "Webservices ('$LOG'):" -- cgit v1.2.3 From 29ebfc2eb3612d57ec9ef6b1aa1fddee8acebff3 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 00:01:17 -0700 Subject: removed source --- install | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) mode change 100755 => 100644 install diff --git a/install b/install old mode 100755 new mode 100644 index 2101702..00f72e0 --- a/install +++ b/install @@ -3,21 +3,21 @@ # Author: Christoph Helma, Andreas Maunz LOG="/tmp/`basename $0`-log.txt" -source ./utils.sh +. "./utils.sh" echo "Opentox-ruby installation." echo "You may need to give root password for some privileged actions right now:" cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" -source "./base-install.sh" -source "./ruby.sh" -source "./openbabel.sh" -source "./kernlab.sh" -source "./opentox-ruby.sh" +. "./base-install.sh" +. "./ruby.sh" +. "./openbabel.sh" +. "./kernlab.sh" +. "./opentox-ruby.sh" if [ "$install" != "gem" ] then - source "./nginx.sh" - source "./redis.sh" - source "./opentox-webservices.sh" + . "./nginx.sh" + . "./redis.sh" + . "./opentox-webservices.sh" fi -- cgit v1.2.3 From b2d9ab87690a05ed6356c5b5413ef1e65c929c9d Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 00:01:39 -0700 Subject: Correct shebang --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 00f72e0..a43e507 100644 --- a/install +++ b/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Main Opentox-ruby install script # Author: Christoph Helma, Andreas Maunz -- cgit v1.2.3 From fbc7e27e66bddfb402824813e996e1c41ed421c4 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 00:02:21 -0700 Subject: Edited ruby.sh via GitHub --- ruby.sh | 1 - 1 file changed, 1 deletion(-) mode change 100755 => 100644 ruby.sh diff --git a/ruby.sh b/ruby.sh old mode 100755 new mode 100644 index 87e87b7..fede4cb --- a/ruby.sh +++ b/ruby.sh @@ -2,7 +2,6 @@ # # Installs Ruby enterprise edition and passenger gem. # A configuration file is created and included in your '~.bashrc'. -# Pass a ruby version string as first argument to install a specific version (blank for default). # Author: Christoph Helma, Andreas Maunz. # -- cgit v1.2.3 From 438de29fbd0ddf20c0b4acac1fa70d7ce58a62b8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 00:10:05 -0700 Subject: Edited README via GitHub --- README | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README b/README index 784b79e..5e7d483 100644 --- a/README +++ b/README @@ -11,12 +11,7 @@ tested with Debian Squeeze, might work for Ubuntu and other Debian based distrib git clone http://github.com/opentox/install.git cd install - vi config - sudo ./install + vi config.sh + ./install -Adjusting for other distributions ---------------------------------- -- Create a script {distribution}.sh that installs all dependencies and libraries -- Set {distribution} in config -- Run sudo ./install -- cgit v1.2.3 From c3496282449215855acb5c083c20a1782803617a Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 15:32:29 +0200 Subject: Replaced substring matching by grep --- base-install.sh | 6 +++--- kernlab.sh | 2 +- openbabel.sh | 4 ++-- opentox-webservices.sh | 2 +- ruby.sh | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/base-install.sh b/base-install.sh index 7fdb824..60e4715 100755 --- a/base-install.sh +++ b/base-install.sh @@ -26,7 +26,7 @@ fi # 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" +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 libreadline-5.dev" echo echo "Base Packages:" @@ -81,8 +81,8 @@ if [ ! -f $JAVA_CONF ]; then exit 1 fi - echo "if ! [[ \"\$JAVA_HOME\" =~ \"$JAVA_HOME\" ]]; then export JAVA_HOME=\"$JAVA_HOME\"; fi" >> "$JAVA_CONF" - echo "if ! [[ \"\$PATH\" =~ \"$JAVA_HOME\" ]]; then export PATH=\"$JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" + echo "if echo \"\$JAVA_HOME\" | grep -v \"$JAVA_HOME\">/dev/null 2>&1; then export JAVA_HOME=\"$JAVA_HOME\"; fi" >> "$JAVA_CONF" + echo "if echo \"\$PATH\" | grep -v \"$JAVA_HOME\"; then export PATH=\"$JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." if ! grep "$JAVA_CONF" $HOME/.bashrc >/dev/null 2>&1; then diff --git a/kernlab.sh b/kernlab.sh index 10141e2..4267a86 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -57,7 +57,7 @@ fi if [ ! -f $KL_CONF ]; then - echo "if ! [[ \"\$R_LIBS\" =~ \"$KL_DEST\" ]]; then export R_LIBS=\"$KL_DEST\"; fi" >> "$KL_CONF" + echo "if echo \"\$R_LIBS\" | grep -v \"$KL_DEST\">/dev/null 2>&1; then export R_LIBS=\"$KL_DEST\"; fi" >> "$KL_CONF" echo "R package destination has been stored in '$KL_CONF'." if ! grep "$KL_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then diff --git a/openbabel.sh b/openbabel.sh index 9e16b1d..cbc0f01 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -53,8 +53,8 @@ fi if [ ! -f "$OB_CONF" ]; then - echo "if ! [[ \"\$PATH\" =~ \"$OB_DEST\" ]]; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" - echo "if ! [[ \"\$LD_LIBRARY_PATH\" =~ \"$OB_DEST\" ]]; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" + echo "if echo \"\$PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" + echo "if echo \"\$LD_LIBRARY_PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 71bef01..fb733e8 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -27,7 +27,7 @@ fi LOG="/tmp/`basename $0`-log.txt" -if ! id opentox; then +if ! id opentox >>$LOG 2>&1; then cmd="sudo adduser --system opentox" && run_cmd "$cmd" "User 'opentox'" fi diff --git a/ruby.sh b/ruby.sh index fede4cb..bb7ee90 100644 --- a/ruby.sh +++ b/ruby.sh @@ -50,8 +50,7 @@ fi if ! [ -f "$RUBY_CONF" ]; then - - echo "if ! [[ \"\$PATH\" =~ \"$RUBY_DEST\" ]]; then export PATH=\"$RUBY_DEST/bin:\$PATH\"; fi" >> "$RUBY_CONF" + echo "if echo \"\$PATH\" | grep -v \"$RUBY_DEST\">/dev/null 2>&1; then export PATH=\"$RUBY_DEST/bin:\$PATH\"; fi" >> "$RUBY_CONF" echo "Ruby configuration has been stored in '$RUBY_CONF'." if ! grep "$RUBY_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then -- cgit v1.2.3 From 2b7c51c0099cce073800bd99a422288e3ee83023 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 15:39:40 +0200 Subject: Replaced substring matching by grep --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 5e7d483..737c42e 100644 --- a/README +++ b/README @@ -8,6 +8,7 @@ Usage ----- tested with Debian Squeeze, might work for Ubuntu and other Debian based distributions +For Ubuntu Carmic, you need to install refblas3-dev first. git clone http://github.com/opentox/install.git cd install -- cgit v1.2.3 From 8ef129b07d8ed645c1666a2a746e9b8e6f81f08f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 15:49:43 +0200 Subject: Fixed package names --- README | 2 +- base-install.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README b/README index 737c42e..e4d2f1c 100644 --- a/README +++ b/README @@ -8,7 +8,7 @@ Usage ----- tested with Debian Squeeze, might work for Ubuntu and other Debian based distributions -For Ubuntu Carmic, you need to install refblas3-dev first. +For Ubuntu Carmic, you need to install libblas-dev first. git clone http://github.com/opentox/install.git cd install diff --git a/base-install.sh b/base-install.sh index 60e4715..93f241a 100755 --- a/base-install.sh +++ b/base-install.sh @@ -24,9 +24,10 @@ if [ ! -e "$APTITUDE" ]; then exit 1 fi +touch $HOME/.bashrc # 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 libreadline-5.dev" +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 libreadline5-dev" echo echo "Base Packages:" -- cgit v1.2.3 From f657928be127410deac8140bdaae6621ecc702ff Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 07:34:37 -0700 Subject: libgfortran2 libblas-dev --- base-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 base-install.sh diff --git a/base-install.sh b/base-install.sh old mode 100755 new mode 100644 index 93f241a..5377a1c --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $HOME/.bashrc # 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 libreadline5-dev" +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 libreadline5-dev libgfortran2 libblas-dev" echo echo "Base Packages:" -- cgit v1.2.3 From e039686fcff84af4980ed67e29cd7b52bec8d06e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 07:35:32 -0700 Subject: Edited README via GitHub --- README | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README b/README index e4d2f1c..3aa4274 100644 --- a/README +++ b/README @@ -7,8 +7,7 @@ Installer for OpenTox IST/ALU Services Usage ----- -tested with Debian Squeeze, might work for Ubuntu and other Debian based distributions -For Ubuntu Carmic, you need to install libblas-dev first. +tested with Debian Squeeze, might work for Ubuntu and other Debian based distributions. git clone http://github.com/opentox/install.git cd install -- cgit v1.2.3 From 112bb64ae66c852797d5c305df7e1823bca10117 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 07:41:39 -0700 Subject: Fixed link to libgfortran --- kernlab.sh | 1 + 1 file changed, 1 insertion(+) mode change 100755 => 100644 kernlab.sh diff --git a/kernlab.sh b/kernlab.sh old mode 100755 new mode 100644 index 4267a86..20ebaca --- a/kernlab.sh +++ b/kernlab.sh @@ -51,6 +51,7 @@ if ! $R_DONE; then cmd="$WGET $URI" && run_cmd "$cmd" "Download" export R_LIBS="$KL_DEST" # To install non-global + sudo ln -s /usr/lib/libgfortran.so.3 /usr/lib/libgfortran.so>$LOG 2>&1 # may fail, but nevermind cmd="$R CMD INSTALL kernlab_$KL_VER.tar.gz" && run_cmd "$cmd" "Install" fi -- cgit v1.2.3 From 96aeb7ce95c6dd89bac01d5f41fe57309ca4da8f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 07:45:18 -0700 Subject: r-base-dev --- base-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index 5377a1c..b64cad1 100644 --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $HOME/.bashrc # 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 libreadline5-dev libgfortran2 libblas-dev" +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 libreadline5-dev r-base-dev " echo echo "Base Packages:" -- cgit v1.2.3 From 5c21b981aafde20c6af4bcd9bd002b359c7b311d Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 07:48:46 -0700 Subject: rm touch --- base-install.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/base-install.sh b/base-install.sh index b64cad1..36ced0e 100644 --- a/base-install.sh +++ b/base-install.sh @@ -24,8 +24,6 @@ if [ ! -e "$APTITUDE" ]; then exit 1 fi -touch $HOME/.bashrc - # 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 libreadline5-dev r-base-dev " -- cgit v1.2.3 From 6658fc2ba50d25fd636772201a20b464bce21311 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 07:50:42 -0700 Subject: touch .bashrc --- install | 1 + 1 file changed, 1 insertion(+) diff --git a/install b/install index a43e507..e5bf991 100644 --- a/install +++ b/install @@ -3,6 +3,7 @@ # Author: Christoph Helma, Andreas Maunz LOG="/tmp/`basename $0`-log.txt" +touch $HOME/.bashrc . "./utils.sh" echo "Opentox-ruby installation." echo "You may need to give root password for some privileged actions right now:" -- cgit v1.2.3 From d1cda0647404a6a83e5a9b93e3c2789cc5123537 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 08:49:05 -0700 Subject: removed ln -s again --- kernlab.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/kernlab.sh b/kernlab.sh index 20ebaca..4267a86 100644 --- a/kernlab.sh +++ b/kernlab.sh @@ -51,7 +51,6 @@ if ! $R_DONE; then cmd="$WGET $URI" && run_cmd "$cmd" "Download" export R_LIBS="$KL_DEST" # To install non-global - sudo ln -s /usr/lib/libgfortran.so.3 /usr/lib/libgfortran.so>$LOG 2>&1 # may fail, but nevermind cmd="$R CMD INSTALL kernlab_$KL_VER.tar.gz" && run_cmd "$cmd" "Install" fi -- cgit v1.2.3 From 5db1dc96ddf9f144b8c5a34404a46f9059f9c64e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sat, 2 Apr 2011 08:55:06 -0700 Subject: Removed target dir creation --- redis.sh | 2 -- 1 file changed, 2 deletions(-) mode change 100755 => 100644 redis.sh diff --git a/redis.sh b/redis.sh old mode 100755 new mode 100644 index 503cfca..c92d9d9 --- a/redis.sh +++ b/redis.sh @@ -33,8 +33,6 @@ if [ ! -d "$REDIS_DEST" ]; then else if ! rmdir "$REDIS_DEST" >/dev/null 2>&1; then # if not empty this will fail REDIS_DONE=true - else - mkdir "$REDIS_DEST" >/dev/null 2>&1 fi fi -- cgit v1.2.3 From a8df41cf1642134e467642658ffe3b1548612e4f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sun, 3 Apr 2011 05:13:43 -0700 Subject: Nicer format --- utils.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils.sh b/utils.sh index 8c3d633..cc50716 100644 --- a/utils.sh +++ b/utils.sh @@ -14,12 +14,16 @@ run_cmd () { local cmd="$1" local title="$2" + local len=`echo "$title" | wc -c` + len=$((40-$len)) + local format = "%""$len""s" - if ! eval $cmd >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'$title'" "FAIL" + echo -n "$title" + if ! eval $cmd >>$LOG 2>&1 ; then + printf "$format\n" "'$title'" "FAIL" exit 1 fi - printf "%25s%15s\n" "'$title'" "DONE" + printf "$format\n" "'$title'" "DONE" } -- cgit v1.2.3 From 74f0cf426d88a08e916fe5b8c69489cd6ce36567 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sun, 3 Apr 2011 05:18:38 -0700 Subject: Nicer format2 --- utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.sh b/utils.sh index cc50716..19b047a 100644 --- a/utils.sh +++ b/utils.sh @@ -20,7 +20,7 @@ run_cmd () echo -n "$title" if ! eval $cmd >>$LOG 2>&1 ; then - printf "$format\n" "'$title'" "FAIL" + printf "%$(len)s\n" "'$title'" "FAIL" exit 1 fi printf "$format\n" "'$title'" "DONE" -- cgit v1.2.3 From b31f88768ca16b1a7947e4ec8a314ab855fe7ee2 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sun, 3 Apr 2011 05:19:24 -0700 Subject: Nicer format --- utils.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/utils.sh b/utils.sh index 19b047a..a2b9153 100644 --- a/utils.sh +++ b/utils.sh @@ -16,7 +16,6 @@ run_cmd () local title="$2" local len=`echo "$title" | wc -c` len=$((40-$len)) - local format = "%""$len""s" echo -n "$title" if ! eval $cmd >>$LOG 2>&1 ; then -- cgit v1.2.3 From 9a7e1a42db5cc0ab55837560dc0c8f341231655f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sun, 3 Apr 2011 05:20:40 -0700 Subject: Nicer format 4 --- utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.sh b/utils.sh index a2b9153..a9d6d66 100644 --- a/utils.sh +++ b/utils.sh @@ -22,7 +22,7 @@ run_cmd () printf "%$(len)s\n" "'$title'" "FAIL" exit 1 fi - printf "$format\n" "'$title'" "DONE" + printf "%$(len)s\n" "'$title'" "DONE" } -- cgit v1.2.3 From eb936c2d958e3ac2422bcecd073c8e0ef1a60abf Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sun, 3 Apr 2011 05:23:32 -0700 Subject: Nicer layout 6 --- utils.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/utils.sh b/utils.sh index a9d6d66..ee75d32 100644 --- a/utils.sh +++ b/utils.sh @@ -14,15 +14,13 @@ run_cmd () { local cmd="$1" local title="$2" - local len=`echo "$title" | wc -c` - len=$((40-$len)) - echo -n "$title" + printf "%15s" "'$title'" if ! eval $cmd >>$LOG 2>&1 ; then - printf "%$(len)s\n" "'$title'" "FAIL" + printf "%25s\n" "FAIL" exit 1 fi - printf "%$(len)s\n" "'$title'" "DONE" + printf "%25s\n" "DONE" } -- cgit v1.2.3 From f1b3c4ae8fad84b70ed996758925a3d1ad31b6a3 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 08:40:06 +0200 Subject: Changed exec status --- config.sh | 4 ++-- install | 0 ruby.sh | 0 utils.sh | 0 4 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 config.sh mode change 100644 => 100755 install mode change 100644 => 100755 ruby.sh mode change 100644 => 100755 utils.sh diff --git a/config.sh b/config.sh old mode 100644 new mode 100755 index 244ab37..6d568d9 --- a/config.sh +++ b/config.sh @@ -23,7 +23,7 @@ REDIS_NUM_VER="2.2.2" NGINX_SERVERNAME="localhost" WWW_DEST="$PREFIX/www" -# 4) Done. +# Done. ### Nothing to gain from changes below this line. @@ -46,4 +46,4 @@ NGINX_DEST="$PREFIX/nginx" REDIS_DEST="$PREFIX/redis-$REDIS_VER" REDIS_SERVER_CONF="$REDIS_DEST/redis.conf" - +OT_UI_CONF="$HOME/.opentox-ui.sh" diff --git a/install b/install old mode 100644 new mode 100755 diff --git a/ruby.sh b/ruby.sh old mode 100644 new mode 100755 diff --git a/utils.sh b/utils.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From e8dc762a04a5559392ec6fa8bdd055bd6557acc7 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 08:42:19 +0200 Subject: Using separate rc file for installer --- base-install.sh | 6 +++--- kernlab.sh | 4 ++-- openbabel.sh | 6 +++--- redis.sh | 4 ++-- ruby.sh | 4 ++-- utils.sh | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/base-install.sh b/base-install.sh index 93f241a..22edce9 100755 --- a/base-install.sh +++ b/base-install.sh @@ -24,7 +24,7 @@ if [ ! -e "$APTITUDE" ]; then exit 1 fi -touch $HOME/.bashrc +touch $OT_UI_CONF # 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 libreadline5-dev" @@ -86,8 +86,8 @@ if [ ! -f $JAVA_CONF ]; then echo "if echo \"\$PATH\" | grep -v \"$JAVA_HOME\"; then export PATH=\"$JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." - if ! grep "$JAVA_CONF" $HOME/.bashrc >/dev/null 2>&1; then - echo ". \"$JAVA_CONF\"" >> $HOME/.bashrc + if ! grep "$JAVA_CONF" $OT_UI_CONF >/dev/null 2>&1; then + echo ". \"$JAVA_CONF\"" >> $OT_UI_CONF fi fi diff --git a/kernlab.sh b/kernlab.sh index 4267a86..a49635f 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -60,8 +60,8 @@ if [ ! -f $KL_CONF ]; then echo "if echo \"\$R_LIBS\" | grep -v \"$KL_DEST\">/dev/null 2>&1; then export R_LIBS=\"$KL_DEST\"; fi" >> "$KL_CONF" echo "R package destination has been stored in '$KL_CONF'." - if ! grep "$KL_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then - echo ". \"$KL_CONF\"" >> $HOME/.bashrc + if ! grep "$KL_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then + echo ". \"$KL_CONF\"" >> $OT_UI_CONF fi fi diff --git a/openbabel.sh b/openbabel.sh index cbc0f01..31c3596 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -60,15 +60,15 @@ if [ ! -f "$OB_CONF" ]; then echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." - if ! grep "$OB_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then - echo ". \"$OB_CONF\"" >> $HOME/.bashrc + if ! grep "$OB_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then + echo ". \"$OB_CONF\"" >> $OT_UI_CONF fi fi echo "Bindings:" OB_DONE=false -. "$HOME/.bashrc" +. "$OT_UI_CONF" mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1 if [ ! -d "$OB_DEST_BINDINGS" ]; then echo "Install directory '$OB_DEST_BINDINGS' is not available! Aborting..." diff --git a/redis.sh b/redis.sh index 503cfca..330bfa4 100755 --- a/redis.sh +++ b/redis.sh @@ -63,8 +63,8 @@ if [ ! -f $REDIS_CONF ]; then echo "export PATH=$REDIS_DEST/src:\$PATH" >> "$REDIS_CONF" echo "Redis configuration has been stored in '$REDIS_CONF'." - if ! grep ". \"$REDIS_CONF\"" $HOME/.bashrc; then - echo ". \"$REDIS_CONF\"" >> $HOME/.bashrc + if ! grep ". \"$REDIS_CONF\"" $OT_UI_CONF; then + echo ". \"$REDIS_CONF\"" >> $OT_UI_CONF fi fi diff --git a/ruby.sh b/ruby.sh index bb7ee90..0a773bd 100755 --- a/ruby.sh +++ b/ruby.sh @@ -53,8 +53,8 @@ if ! [ -f "$RUBY_CONF" ]; then echo "if echo \"\$PATH\" | grep -v \"$RUBY_DEST\">/dev/null 2>&1; then export PATH=\"$RUBY_DEST/bin:\$PATH\"; fi" >> "$RUBY_CONF" echo "Ruby configuration has been stored in '$RUBY_CONF'." - if ! grep "$RUBY_CONF" $HOME/.bashrc >/dev/null 2>&1 ; then - echo ". \"$RUBY_CONF\"" >> $HOME/.bashrc + if ! grep "$RUBY_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then + echo ". \"$RUBY_CONF\"" >> $OT_UI_CONF fi fi . "$RUBY_CONF" diff --git a/utils.sh b/utils.sh index 8c3d633..cff99da 100755 --- a/utils.sh +++ b/utils.sh @@ -32,6 +32,6 @@ abs_path() esac } -. "$HOME/.bashrc" +. "$OT_UI_CONF" . "`pwd`/config.sh" check_dest -- cgit v1.2.3 From 721feafdb56c18fb7424d505377abe80d78f4e7b Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 08:47:14 +0200 Subject: Nginx Dest Conf fixed --- nginx.conf | 3 +-- nginx.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 8ce1591..a8a2b55 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,7 +8,6 @@ events { http { server_names_hash_bucket_size 256; - include /home/ist/nginx/conf/mime.types; passenger_root RUBY_DEST/lib/ruby/gems/1.8/gems/PASSENGER; passenger_ruby RUBY_DEST/bin/ruby; @@ -17,7 +16,7 @@ http { passenger_spawn_method conservative; #passenger_use_global_queue on; - include NGINX_DEST/mime.types; + include NGINX_DEST/conf/mime.types; default_type application/octet-stream; sendfile on; diff --git a/nginx.sh b/nginx.sh index 3aefac0..6fb14dc 100755 --- a/nginx.sh +++ b/nginx.sh @@ -41,7 +41,7 @@ if ! $NGINX_DONE; then passenger=`ls -d passenger*`; cd - >>$LOG 2>&1 servername=`hostname` - sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/" ./nginx.conf > $NGINX_DEST/nginx.conf 2>>$LOG + sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/;s/NGINX_DEST/$NGINX_DEST/" ./nginx.conf > $NGINX_DEST/nginx.conf 2>>$LOG fi cd "$DIR" -- cgit v1.2.3 From b0f1776e091c596f548c45ce568f548d8f39efb8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 08:55:05 +0200 Subject: Added correct config path in header --- base-install.sh | 2 +- openbabel.sh | 2 +- ruby.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base-install.sh b/base-install.sh index 03512fe..13d0dd3 100644 --- a/base-install.sh +++ b/base-install.sh @@ -4,7 +4,7 @@ # Author: Andreas Maunz # # Your installed packages are safe and will not be updated. -# A Java configuration is created and included in your '~.bashrc'. +# A Java configuration is created and included in your '$OT_UI_CONF'. . "`pwd`/utils.sh" DIR="`pwd`" diff --git a/openbabel.sh b/openbabel.sh index 31c3596..4fc5679 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -1,7 +1,7 @@ #!/bin/sh # # Installs Openbabel. -# A configuration file is created and included in your '~.bashrc'. +# A configuration file is created and included in your '$OT_UI_CONF'. # Author: Christoph Helma, Andreas Maunz. # diff --git a/ruby.sh b/ruby.sh index 0a773bd..a1b8cbe 100755 --- a/ruby.sh +++ b/ruby.sh @@ -1,7 +1,7 @@ #!/bin/sh # # Installs Ruby enterprise edition and passenger gem. -# A configuration file is created and included in your '~.bashrc'. +# A configuration file is created and included in your '$OT_UI_CONF'. # Author: Christoph Helma, Andreas Maunz. # -- cgit v1.2.3 From 26a6fb6e8fe83a3f2526025c812b87cf61a326ab Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 09:01:59 +0200 Subject: Fixed hints --- install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install b/install index e5bf991..bb0da33 100755 --- a/install +++ b/install @@ -22,3 +22,9 @@ then . "./opentox-webservices.sh" fi +echo +echo "Installation finished and configured." +echo +echo "IMPORTANT:" +echo "Include the file '$OT_UI_CONF' in your shell or system startup to have it automatically configured." +echo -- cgit v1.2.3 From 1307fdcb4a3b52d02adad017a654911bfe973991 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 09:10:22 +0200 Subject: Fixed RUBYLIB --- README | 11 ++++++----- openbabel.sh | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README b/README index 3aa4274..bd05d0e 100644 --- a/README +++ b/README @@ -1,13 +1,14 @@ -It is assumed that your system is configured for sudo to gain root privileges. -It is assumed that your system is configured for using non-free packages. +POSIX compatible Installer for OpenTox IST/ALU Services +======================================================= -Installer for OpenTox IST/ALU Services -====================================== +A) It is assumed that your system is configured for sudo to gain root privileges. +B) It is assumed that your system is configured for using non-free packages. Usage ----- -tested with Debian Squeeze, might work for Ubuntu and other Debian based distributions. +Tested with Debian Squeeze (6.0.1), might work for Ubuntu and other Debian based distributions. + git clone http://github.com/opentox/install.git cd install diff --git a/openbabel.sh b/openbabel.sh index 4fc5679..40c34ec 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -57,7 +57,7 @@ if [ ! -f "$OB_CONF" ]; then echo "if echo \"\$LD_LIBRARY_PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" - echo "if [ -z \"\$RUBYLIB\" ]; then export RUBYLIB=\"$OB_DEST_BINDINGS\"; fi" >> "$RUBY_CONF" + echo "if echo \"\$RUBYLIB | grep -v \"$OB_DEST_BINDINGS\">/dev/null 2>&1; then export RUBYLIB=\"$OB_DEST_BINDINGS:\$RUBYLIB\"; fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." if ! grep "$OB_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then -- cgit v1.2.3 From 2cce008585e5236a61e94a6571afcc3c110b6512 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 09:13:37 +0200 Subject: Fixed install include --- install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install b/install index bb0da33..903dd67 100755 --- a/install +++ b/install @@ -3,7 +3,8 @@ # Author: Christoph Helma, Andreas Maunz LOG="/tmp/`basename $0`-log.txt" -touch $HOME/.bashrc +touch "$OT_UI_CONF" + . "./utils.sh" echo "Opentox-ruby installation." echo "You may need to give root password for some privileged actions right now:" -- cgit v1.2.3 From 1cb34e7d9fba5517b9a9ce9636fc926d73af7cb9 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 09:15:40 +0200 Subject: Fixed install include --- install | 4 ++-- utils.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install b/install index 903dd67..81c7853 100755 --- a/install +++ b/install @@ -3,9 +3,9 @@ # Author: Christoph Helma, Andreas Maunz LOG="/tmp/`basename $0`-log.txt" -touch "$OT_UI_CONF" - . "./utils.sh" +touch "$OT_UI_CONF" +echo echo "Opentox-ruby installation." echo "You may need to give root password for some privileged actions right now:" cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" diff --git a/utils.sh b/utils.sh index 2a17452..6505e71 100755 --- a/utils.sh +++ b/utils.sh @@ -33,6 +33,6 @@ abs_path() esac } -. "$OT_UI_CONF" . "`pwd`/config.sh" +. "$OT_UI_CONF" check_dest -- cgit v1.2.3 From ade43a6a3c16388b7571bff236e686e1e6f91f35 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 09:16:59 +0200 Subject: Fixed install include --- install | 1 - utils.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 81c7853..fb94096 100755 --- a/install +++ b/install @@ -4,7 +4,6 @@ LOG="/tmp/`basename $0`-log.txt" . "./utils.sh" -touch "$OT_UI_CONF" echo echo "Opentox-ruby installation." echo "You may need to give root password for some privileged actions right now:" diff --git a/utils.sh b/utils.sh index 6505e71..656a993 100755 --- a/utils.sh +++ b/utils.sh @@ -34,5 +34,6 @@ abs_path() } . "`pwd`/config.sh" +touch "$OT_UI_CONF" . "$OT_UI_CONF" check_dest -- cgit v1.2.3 From ae03b88f5c116c079f647bf1a5ba55e0ed387685 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:06:44 +0200 Subject: Fixed JAVA_HOME --- base-install.sh | 16 ++++++++-------- config.sh | 28 ++++++++++++++-------------- install | 4 ++-- openbabel.sh | 2 +- redis.sh | 2 +- utils.sh | 12 ++++++------ 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/base-install.sh b/base-install.sh index 13d0dd3..524283a 100644 --- a/base-install.sh +++ b/base-install.sh @@ -35,9 +35,9 @@ echo "Base Packages:" pack_arr="" for p in $packs; do if $DPKG -s "$p" >/dev/null 2>&1; then - printf "%25s%15s\n" "'$p'" "Y" + printf "%50s%30s\n" "'$p'" "Y" else - printf "%25s%15s\n" "'$p'" "N" + printf "%50s%30s\n" "'$p'" "N" pack_arr="$pack_arr $p" fi done @@ -51,9 +51,9 @@ fi for p in $pack_arr; do if [ -n "`$APT_CACHE search $p`" ] ; then - printf "%25s%15s\n" "'$p'" "Y" + printf "%50s%30s\n" "'$p'" "Y" else - printf "%25s%15s\n" "'$p'" "N" + printf "%50s%30s\n" "'$p'" "N" pack_fail="$pack_fail $p" fi done @@ -77,13 +77,13 @@ done if [ ! -f $JAVA_CONF ]; then - if [ ! -d "$JAVA_HOME" ]; then - echo "Directory '$JAVA_HOME' does not exist! Aborting..." + if [ ! -d "$OT_JAVA_HOME" ]; then + echo "Directory '$OT_JAVA_HOME' does not exist! Aborting..." exit 1 fi - echo "if echo \"\$JAVA_HOME\" | grep -v \"$JAVA_HOME\">/dev/null 2>&1; then export JAVA_HOME=\"$JAVA_HOME\"; fi" >> "$JAVA_CONF" - echo "if echo \"\$PATH\" | grep -v \"$JAVA_HOME\"; then export PATH=\"$JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" + echo "if echo \"\$JAVA_HOME\" | grep -v \"$OT_JAVA_HOME\">/dev/null 2>&1; then export JAVA_HOME=\"$OT_JAVA_HOME\"; fi" >> "$JAVA_CONF" + echo "if echo \"\$PATH\" | grep -v \"$OT_JAVA_HOME\"; then export PATH=\"$OT_JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." if ! grep "$JAVA_CONF" $OT_UI_CONF >/dev/null 2>&1; then diff --git a/config.sh b/config.sh index 6d568d9..1e0bb79 100755 --- a/config.sh +++ b/config.sh @@ -10,8 +10,8 @@ OT_INSTALL="local" # Type (gem, local, server) OT_BRANCH="master" # Maturity (development, master) # 2) Where all binaries are installed. -PREFIX="$HOME/opentox" -JAVA_HOME="/usr/lib/jvm/java-6-sun" +OT_PREFIX="$HOME/opentox" +OT_JAVA_HOME="/usr/lib/jvm/java-6-sun" # 3) What versions to install. RUBY_NUM_VER="1.8.7-2011.03" @@ -21,29 +21,29 @@ REDIS_NUM_VER="2.2.2" # 4) Server settings. NGINX_SERVERNAME="localhost" -WWW_DEST="$PREFIX/www" +WWW_DEST="$OT_PREFIX/www" # Done. ### Nothing to gain from changes below this line. -JAVA_CONF="$PREFIX/.bash_java_ot" -RUBY_CONF="$PREFIX/.bash_ruby_ot" -REDIS_CONF="$PREFIX/.bash_redis_ot" -OB_CONF="$PREFIX/.bash_OB_ot" -KL_CONF="$PREFIX/.bash_R_ot" +JAVA_CONF="$OT_PREFIX/.bash_java_ot" +RUBY_CONF="$OT_PREFIX/.bash_ruby_ot" +REDIS_CONF="$OT_PREFIX/.bash_redis_ot" +OB_CONF="$OT_PREFIX/.bash_OB_ot" +KL_CONF="$OT_PREFIX/.bash_R_ot" RUBY_VER="ruby-enterprise-$RUBY_NUM_VER" OB_VER="openbabel-$OB_NUM_VER" KL_VER="$KL_NUM_VER" REDIS_VER="$REDIS_NUM_VER" -RUBY_DEST="$PREFIX/$RUBY_VER" -OB_DEST="$PREFIX/$OB_VER" -OB_DEST_BINDINGS="$PREFIX/openbabel-ruby-install" -KL_DEST="$PREFIX/r-packages" -NGINX_DEST="$PREFIX/nginx" -REDIS_DEST="$PREFIX/redis-$REDIS_VER" +RUBY_DEST="$OT_PREFIX/$RUBY_VER" +OB_DEST="$OT_PREFIX/$OB_VER" +OB_DEST_BINDINGS="$OT_PREFIX/openbabel-ruby-install" +KL_DEST="$OT_PREFIX/r-packages" +NGINX_DEST="$OT_PREFIX/nginx" +REDIS_DEST="$OT_PREFIX/redis-$REDIS_VER" REDIS_SERVER_CONF="$REDIS_DEST/redis.conf" OT_UI_CONF="$HOME/.opentox-ui.sh" diff --git a/install b/install index fb94096..37b86d1 100755 --- a/install +++ b/install @@ -6,7 +6,7 @@ LOG="/tmp/`basename $0`-log.txt" . "./utils.sh" echo echo "Opentox-ruby installation." -echo "You may need to give root password for some privileged actions right now:" +echo "You may need to give root password for some privileged actions right now and later:" cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" . "./base-install.sh" @@ -23,7 +23,7 @@ then fi echo -echo "Installation finished and configured." +echo "Installation to '$OT_DEST' finished and configured." echo echo "IMPORTANT:" echo "Include the file '$OT_UI_CONF' in your shell or system startup to have it automatically configured." diff --git a/openbabel.sh b/openbabel.sh index 40c34ec..a806862 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -57,7 +57,7 @@ if [ ! -f "$OB_CONF" ]; then echo "if echo \"\$LD_LIBRARY_PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" - echo "if echo \"\$RUBYLIB | grep -v \"$OB_DEST_BINDINGS\">/dev/null 2>&1; then export RUBYLIB=\"$OB_DEST_BINDINGS:\$RUBYLIB\"; fi" >> "$RUBY_CONF" + echo "if echo \"\$RUBYLIB\" | grep -v \"$OB_DEST_BINDINGS\">/dev/null 2>&1; then export RUBYLIB=\"$OB_DEST_BINDINGS:\$RUBYLIB\"; fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." if ! grep "$OB_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then diff --git a/redis.sh b/redis.sh index d4d2f05..2dc97a5 100644 --- a/redis.sh +++ b/redis.sh @@ -39,7 +39,7 @@ fi if ! $REDIS_DONE; then echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 - cd $PREFIX + cd $OT_PREFIX URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" if ! [ -d "redis-$REDIS_VER" ]; then cmd="$WGET $URI" && run_cmd "$cmd" "Download" diff --git a/utils.sh b/utils.sh index 656a993..1bead39 100755 --- a/utils.sh +++ b/utils.sh @@ -2,9 +2,9 @@ check_dest() { - if ! [ -d "$PREFIX" ]; then - if ! mkdir -p "$PREFIX"; then - echo "Could not create target directory '$PREFIX'! Aborting..." + if ! [ -d "$OT_PREFIX" ]; then + if ! mkdir -p "$OT_PREFIX"; then + echo "Could not create target directory '$OT_PREFIX'! Aborting..." exit 1 fi fi @@ -15,12 +15,12 @@ run_cmd () local cmd="$1" local title="$2" - printf "%15s" "'$title'" + printf "%30s" "'$title'" if ! eval $cmd >>$LOG 2>&1 ; then - printf "%25s\n" "FAIL" + printf "%50s\n" "FAIL" exit 1 fi - printf "%25s\n" "DONE" + printf "%50s\n" "DONE" } -- cgit v1.2.3 From 2140505b9ee2b2b30886dd1b9c5bbf344a708b49 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:12:47 +0200 Subject: Fixed include file names --- config.sh | 10 +++++----- install | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config.sh b/config.sh index 1e0bb79..428c621 100755 --- a/config.sh +++ b/config.sh @@ -27,11 +27,11 @@ WWW_DEST="$OT_PREFIX/www" ### Nothing to gain from changes below this line. -JAVA_CONF="$OT_PREFIX/.bash_java_ot" -RUBY_CONF="$OT_PREFIX/.bash_ruby_ot" -REDIS_CONF="$OT_PREFIX/.bash_redis_ot" -OB_CONF="$OT_PREFIX/.bash_OB_ot" -KL_CONF="$OT_PREFIX/.bash_R_ot" +JAVA_CONF="$OT_PREFIX/.sh_java_ot" +RUBY_CONF="$OT_PREFIX/.sh_ruby_ot" +REDIS_CONF="$OT_PREFIX/.sh_redis_ot" +OB_CONF="$OT_PREFIX/.sh_OB_ot" +KL_CONF="$OT_PREFIX/.sh_R_ot" RUBY_VER="ruby-enterprise-$RUBY_NUM_VER" OB_VER="openbabel-$OB_NUM_VER" diff --git a/install b/install index 37b86d1..5180254 100755 --- a/install +++ b/install @@ -7,6 +7,7 @@ LOG="/tmp/`basename $0`-log.txt" echo echo "Opentox-ruby installation." echo "You may need to give root password for some privileged actions right now and later:" +echo cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" . "./base-install.sh" -- cgit v1.2.3 From 9346772a7eefac2f3d582e438320665be019a3b8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:14:07 +0200 Subject: Fixed missing output deletion --- base-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index 524283a..30d7d0f 100644 --- a/base-install.sh +++ b/base-install.sh @@ -83,7 +83,7 @@ if [ ! -f $JAVA_CONF ]; then fi echo "if echo \"\$JAVA_HOME\" | grep -v \"$OT_JAVA_HOME\">/dev/null 2>&1; then export JAVA_HOME=\"$OT_JAVA_HOME\"; fi" >> "$JAVA_CONF" - echo "if echo \"\$PATH\" | grep -v \"$OT_JAVA_HOME\"; then export PATH=\"$OT_JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" + echo "if echo \"\$PATH\" | grep -v \"$OT_JAVA_HOME\">/dev/null 2>&1; then export PATH=\"$OT_JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." if ! grep "$JAVA_CONF" $OT_UI_CONF >/dev/null 2>&1; then -- cgit v1.2.3 From 9685dad196274640d56d9407f4576620c65f6d64 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:18:58 +0200 Subject: Added better hint text --- install | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install b/install index 5180254..d332838 100755 --- a/install +++ b/install @@ -24,8 +24,9 @@ then fi echo -echo "Installation to '$OT_DEST' finished and configured." -echo -echo "IMPORTANT:" -echo "Include the file '$OT_UI_CONF' in your shell or system startup to have it automatically configured." +echo "Installation finished and system configured." +echo "Destination: '$OT_PREFIX'" +echo "Nginx: '$NGINX_DEST'" +echo "Redis: '$REDIS_DEST'" +echo "IMPORTANT: Include the file '$OT_UI_CONF' in your shell or system startup to have the system automatically configured." echo -- cgit v1.2.3 From f7ec0751f99cded4101fac5daf8a24c36d018e8e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:23:47 +0200 Subject: Fixed nginx.conf --- nginx.conf | 1 - nginx.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index a8a2b55..d3a8324 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,4 +1,3 @@ -#user ist; worker_processes 10; events { diff --git a/nginx.sh b/nginx.sh index 6fb14dc..2e52f62 100755 --- a/nginx.sh +++ b/nginx.sh @@ -41,7 +41,7 @@ if ! $NGINX_DONE; then passenger=`ls -d passenger*`; cd - >>$LOG 2>&1 servername=`hostname` - sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/;s/NGINX_DEST/$NGINX_DEST/" ./nginx.conf > $NGINX_DEST/nginx.conf 2>>$LOG + sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/;s/NGINX_DEST/$NGINX_DEST/" "./nginx.conf" > $NGINX_DEST/conf/nginx.conf 2>>$LOG fi cd "$DIR" -- cgit v1.2.3 From 71d47a343cfaa5dc8f00ea0cea3374b6cadc7cb6 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:25:30 +0200 Subject: Fixed make output --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index fb733e8..df7a07d 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -70,7 +70,7 @@ cd "libfminer/libbbrc">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" cd ->>$LOG 2>&1 cd "libfminer/liblast">>$LOG 2>&1 -cmd="make ruby" && run_cmd "$cmd" "Make BBRC" +cmd="make ruby" && run_cmd "$cmd" "Make LAST" cd ->>$LOG 2>&1 cd "$DIR" -- cgit v1.2.3 From d002a2770a99e7e8b36bf98618575ecc13f86cd0 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:42:49 +0200 Subject: Fixed nginx conf --- nginx.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nginx.sh b/nginx.sh index 2e52f62..776acf0 100755 --- a/nginx.sh +++ b/nginx.sh @@ -38,10 +38,11 @@ fi if ! $NGINX_DONE; then cmd="$PIN --auto-download --auto --prefix=$NGINX_DEST" && run_cmd "$cmd" "Install" cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" >>$LOG 2>&1 - passenger=`ls -d passenger*`; + passenger=`ls -d passenger*` cd - >>$LOG 2>&1 servername=`hostname` - sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/;s/NGINX_DEST/$NGINX_DEST/" "./nginx.conf" > $NGINX_DEST/conf/nginx.conf 2>>$LOG + cmd="sed -i -e \"s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/;s/NGINX_DEST/$NGINX_DEST/\" ./nginx.conf" && run_cmd "$cmd" "Config" + cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" fi cd "$DIR" -- cgit v1.2.3 From 0c4a69141869c4573b5a27ec3a49d19a289e9a1b Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:50:31 +0200 Subject: Fixed nginx conf --- nginx.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index 776acf0..498dd0b 100755 --- a/nginx.sh +++ b/nginx.sh @@ -41,7 +41,9 @@ if ! $NGINX_DONE; then passenger=`ls -d passenger*` cd - >>$LOG 2>&1 servername=`hostname` - cmd="sed -i -e \"s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$RUBY_DEST/;s/NGINX_DEST/$NGINX_DEST/\" ./nginx.conf" && run_cmd "$cmd" "Config" + ruby_dest=`echo $RUBY_DEST | sed 's/\//\\\//g'` + nginx_dest=`echo $NGINX_DEST | sed 's/\//\\\//g'` + cmd="sed -i -e \"s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$ruby_dest/;s/NGINX_DEST/$nginx_dest/\" ./nginx.conf" && run_cmd "$cmd" "Config" cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" fi -- cgit v1.2.3 From b476edbdf243996f0ccdd21f8675f6fc81edeb84 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:51:47 +0200 Subject: Fixed nginx conf --- nginx.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nginx.sh b/nginx.sh index 498dd0b..31e4842 100755 --- a/nginx.sh +++ b/nginx.sh @@ -37,15 +37,16 @@ fi if ! $NGINX_DONE; then cmd="$PIN --auto-download --auto --prefix=$NGINX_DEST" && run_cmd "$cmd" "Install" - cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" >>$LOG 2>&1 - passenger=`ls -d passenger*` - cd - >>$LOG 2>&1 - servername=`hostname` - ruby_dest=`echo $RUBY_DEST | sed 's/\//\\\//g'` - nginx_dest=`echo $NGINX_DEST | sed 's/\//\\\//g'` - cmd="sed -i -e \"s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$ruby_dest/;s/NGINX_DEST/$nginx_dest/\" ./nginx.conf" && run_cmd "$cmd" "Config" - cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" fi +cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" >>$LOG 2>&1 +passenger=`ls -d passenger*` +cd - >>$LOG 2>&1 +servername=`hostname` +ruby_dest=`echo $RUBY_DEST | sed 's/\//\\\//g'` +nginx_dest=`echo $NGINX_DEST | sed 's/\//\\\//g'` +cmd="sed -i -e \"s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$ruby_dest/;s/NGINX_DEST/$nginx_dest/\" ./nginx.conf" && run_cmd "$cmd" "Config" +cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" + cd "$DIR" -- cgit v1.2.3 From 9e87646fd61457d8f8a904dcf481f02fc87fff6b Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 10:57:12 +0200 Subject: Fixed nginx conf --- nginx.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nginx.sh b/nginx.sh index 31e4842..1c87d05 100755 --- a/nginx.sh +++ b/nginx.sh @@ -43,9 +43,7 @@ cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" >>$LOG 2>&1 passenger=`ls -d passenger*` cd - >>$LOG 2>&1 servername=`hostname` -ruby_dest=`echo $RUBY_DEST | sed 's/\//\\\//g'` -nginx_dest=`echo $NGINX_DEST | sed 's/\//\\\//g'` -cmd="sed -i -e \"s/PASSENGER/$passenger/;s/SERVERNAME/$servername/;s/RUBY_DEST/$ruby_dest/;s/NGINX_DEST/$nginx_dest/\" ./nginx.conf" && run_cmd "$cmd" "Config" +cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" cd "$DIR" -- cgit v1.2.3 From 1d8064845db4d459ec32c18c3aa0ebfae7708e36 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 11:10:16 +0200 Subject: Fixed nginx conf --- base-install.sh | 2 +- nginx.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index 30d7d0f..a713928 100644 --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $OT_UI_CONF # 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 libreadline5-dev r-base-dev " +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 libreadline5-dev r-base-dev git" echo echo "Base Packages:" diff --git a/nginx.sh b/nginx.sh index 1c87d05..b312e5e 100755 --- a/nginx.sh +++ b/nginx.sh @@ -19,6 +19,13 @@ if [ ! -e "$PIN" ]; then exit 1 fi +GIT="`which git`" +if [ ! -e "$GIT" ]; then + echo "'git' missing. Install 'git' first. Aborting..." + exit 1 +fi + + LOG="/tmp/`basename $0`-log.txt" echo @@ -43,6 +50,7 @@ cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/" >>$LOG 2>&1 passenger=`ls -d passenger*` cd - >>$LOG 2>&1 servername=`hostname` +$GIT checkout nginx.conf>>$LOG 2>&1 cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" -- cgit v1.2.3 From 1fd85dafaa64d0b40e0dc58e8d5bec05444a5105 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 11:17:38 +0200 Subject: Fixed packages --- base-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index a713928..5e00708 100644 --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $OT_UI_CONF # 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 libreadline5-dev r-base-dev git" +packs="binutils git git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-dev sun-java6-jdk wget zlib1g-dev" echo echo "Base Packages:" -- cgit v1.2.3 From 1e43bd895e9e46bd1570cd80840f6f8cf18761ed Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 15:45:59 +0200 Subject: Fixed replacing WWW_DEST --- nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.sh b/nginx.sh index b312e5e..e7ba87f 100755 --- a/nginx.sh +++ b/nginx.sh @@ -51,7 +51,7 @@ passenger=`ls -d passenger*` cd - >>$LOG 2>&1 servername=`hostname` $GIT checkout nginx.conf>>$LOG 2>&1 -cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" +cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST;s,WWW_DEST,$WWW_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" cd "$DIR" -- cgit v1.2.3 From 1e9174342a0bae9b7e00c6d81a8271934a90baf7 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 7 Apr 2011 16:31:38 +0200 Subject: Fixed replacing WWW_DEST --- opentox-ruby.sh | 4 ++-- production.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index b27ef85..692cc61 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -67,8 +67,8 @@ fi mkdir -p "$HOME/.opentox/config" >>$LOG 2>&1 mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 -cmd="sed -e \"s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" -cmd="sed -e \"s/SERVERNAME/$servername/;s/ESCAPEDSERVER/$escapedserver/;s/LOGGER/$logger/;s/AA/$aa/\" aa-local.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 2" +cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" +cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" aa-$OT_INSTALL.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" if [ "$OT_BRANCH" = "development" ]; then mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 diff --git a/production.yaml b/production.yaml index 0e77ddd..35dd577 100644 --- a/production.yaml +++ b/production.yaml @@ -1,4 +1,4 @@ -:base_dir: /var/www/opentox/ +:base_dir: WWW_DEST :services: # make sure to enter a full uri (including training slash) -- cgit v1.2.3 From fdb3a13ccfed12e143d0ceb5eb9bd89ed8355c61 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 8 Apr 2011 12:30:14 +0200 Subject: Fixed redis idempotency --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index 2dc97a5..fa1b696 100644 --- a/redis.sh +++ b/redis.sh @@ -58,7 +58,7 @@ if ! $REDIS_DONE; then fi if [ ! -f $REDIS_CONF ]; then - echo "export PATH=$REDIS_DEST/src:\$PATH" >> "$REDIS_CONF" + echo "if ! echo \"\$PATH\" | grep \"$REDIS_DEST\"; then export PATH=$REDIS_DEST/src:\$PATH; fi" >> "$REDIS_CONF" echo "Redis configuration has been stored in '$REDIS_CONF'." if ! grep ". \"$REDIS_CONF\"" $OT_UI_CONF; then -- cgit v1.2.3 From 870e891a6f5e1030fe38458de75b7784ce0f9b26 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 8 Apr 2011 12:31:52 +0200 Subject: Fixed redis idempotency --- redis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.sh b/redis.sh index fa1b696..6790fed 100644 --- a/redis.sh +++ b/redis.sh @@ -58,7 +58,7 @@ if ! $REDIS_DONE; then fi if [ ! -f $REDIS_CONF ]; then - echo "if ! echo \"\$PATH\" | grep \"$REDIS_DEST\"; then export PATH=$REDIS_DEST/src:\$PATH; fi" >> "$REDIS_CONF" + echo "if ! echo \"\$PATH\" | grep \"$REDIS_DEST\">/dev/null 2>&1; then export PATH=$REDIS_DEST/src:\$PATH; fi" >> "$REDIS_CONF" echo "Redis configuration has been stored in '$REDIS_CONF'." if ! grep ". \"$REDIS_CONF\"" $OT_UI_CONF; then -- cgit v1.2.3 From c354967f7794a4115b12a00bbf879ba284c02b9c Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 8 Apr 2011 13:14:54 +0200 Subject: Fixed OB LIBDIR version string --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index a806862..0b06885 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -55,7 +55,7 @@ if [ ! -f "$OB_CONF" ]; then echo "if echo \"\$PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" echo "if echo \"\$LD_LIBRARY_PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" - echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/2.3.0\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/$OB_NUM_VER\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" echo "if echo \"\$RUBYLIB\" | grep -v \"$OB_DEST_BINDINGS\">/dev/null 2>&1; then export RUBYLIB=\"$OB_DEST_BINDINGS:\$RUBYLIB\"; fi" >> "$RUBY_CONF" -- cgit v1.2.3 From 71634bcd25321761d79119971d703a67b0ac5d9f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Fri, 8 Apr 2011 15:08:40 +0200 Subject: Fixed OB LIBDIR version string --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbabel.sh b/openbabel.sh index 0b06885..d4c635f 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -56,7 +56,7 @@ if [ ! -f "$OB_CONF" ]; then echo "if echo \"\$PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" echo "if echo \"\$LD_LIBRARY_PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/$OB_NUM_VER\"; fi" >> "$OB_CONF" - echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/2.3.0\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/$OB_NUM_VER\"; fi" >> "$OB_CONF" echo "if echo \"\$RUBYLIB\" | grep -v \"$OB_DEST_BINDINGS\">/dev/null 2>&1; then export RUBYLIB=\"$OB_DEST_BINDINGS:\$RUBYLIB\"; fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." -- cgit v1.2.3 From e2da541cecd308ee314267b33476c052f31e3204 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Mon, 11 Apr 2011 09:10:00 +0200 Subject: Guarding dirs, Linking OB LIB to site_ruby --- base-install.sh | 1 + config.sh | 2 +- kernlab.sh | 1 + nginx.sh | 2 +- openbabel.sh | 8 ++++++++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/base-install.sh b/base-install.sh index 5e00708..2a4afb5 100644 --- a/base-install.sh +++ b/base-install.sh @@ -84,6 +84,7 @@ if [ ! -f $JAVA_CONF ]; then echo "if echo \"\$JAVA_HOME\" | grep -v \"$OT_JAVA_HOME\">/dev/null 2>&1; then export JAVA_HOME=\"$OT_JAVA_HOME\"; fi" >> "$JAVA_CONF" echo "if echo \"\$PATH\" | grep -v \"$OT_JAVA_HOME\">/dev/null 2>&1; then export PATH=\"$OT_JAVA_HOME:\$PATH\"; fi" >> "$JAVA_CONF" + echo "if ! [ -d \"\$JAVA_HOME\" ]; then echo \"\$0: '\$OT_JAVA_HOME' is not a directory!\"; fi" >> "$JAVA_CONF" echo "Java configuration has been stored in '$JAVA_CONF'." if ! grep "$JAVA_CONF" $OT_UI_CONF >/dev/null 2>&1; then diff --git a/config.sh b/config.sh index 428c621..7fe4006 100755 --- a/config.sh +++ b/config.sh @@ -10,7 +10,7 @@ OT_INSTALL="local" # Type (gem, local, server) OT_BRANCH="master" # Maturity (development, master) # 2) Where all binaries are installed. -OT_PREFIX="$HOME/opentox" +OT_PREFIX="$HOME/opentox-ruby" OT_JAVA_HOME="/usr/lib/jvm/java-6-sun" # 3) What versions to install. diff --git a/kernlab.sh b/kernlab.sh index a49635f..2fba2a8 100644 --- a/kernlab.sh +++ b/kernlab.sh @@ -58,6 +58,7 @@ fi if [ ! -f $KL_CONF ]; then echo "if echo \"\$R_LIBS\" | grep -v \"$KL_DEST\">/dev/null 2>&1; then export R_LIBS=\"$KL_DEST\"; fi" >> "$KL_CONF" + echo "if ! [ -d \"$KL_DEST\" ]; then echo \"\$0: '$KL_DEST' is not a directory!\"; fi" >> "$KL_CONF" echo "R package destination has been stored in '$KL_CONF'." if ! grep "$KL_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then diff --git a/nginx.sh b/nginx.sh index e7ba87f..36a84df 100755 --- a/nginx.sh +++ b/nginx.sh @@ -51,7 +51,7 @@ passenger=`ls -d passenger*` cd - >>$LOG 2>&1 servername=`hostname` $GIT checkout nginx.conf>>$LOG 2>&1 -cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST;s,WWW_DEST,$WWW_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" +cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST,;s,WWW_DEST,$WWW_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" cd "$DIR" diff --git a/openbabel.sh b/openbabel.sh index d4c635f..6cd4889 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -55,9 +55,16 @@ if [ ! -f "$OB_CONF" ]; then echo "if echo \"\$PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export PATH=\"$OB_DEST/bin:\$PATH\"; fi" >> "$OB_CONF" echo "if echo \"\$LD_LIBRARY_PATH\" | grep -v \"$OB_DEST\">/dev/null 2>&1; then export LD_LIBRARY_PATH=\"$OB_DEST/lib:\$LD_LIBRARY_PATH\"; fi" >> "$OB_CONF" + echo "if ! [ -d \"$OB_DEST\" ]; then echo \"\$0: '$OB_DEST' is not a directory!\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_LIBDIR\" ]; then export BABEL_LIBDIR=\"$OB_DEST/lib/openbabel/$OB_NUM_VER\"; fi" >> "$OB_CONF" + echo "if ! [ -d \"\$BABEL_LIBDIR\" ]; then echo \"\$0: '\$BABEL_LIBDIR' is not a directory!\"; fi" >> "$OB_CONF" + echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/$OB_NUM_VER\"; fi" >> "$OB_CONF" + echo "if ! [ -d \"\$BABEL_DATADIR\" ]; then echo \"\$0: '\$BABEL_DATADIR' is not a directory!\"; fi" >> "$OB_CONF" + echo "if echo \"\$RUBYLIB\" | grep -v \"$OB_DEST_BINDINGS\">/dev/null 2>&1; then export RUBYLIB=\"$OB_DEST_BINDINGS:\$RUBYLIB\"; fi" >> "$RUBY_CONF" + echo "if ! [ -d \"$OB_DEST_BINDINGS\" ]; then echo \"\$0: '$OB_DEST_BINDINGS' is not a directory!\"; fi" >> "$RUBY_CONF" echo "Openbabel configuration has been stored in '$OB_CONF'." if ! grep "$OB_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then @@ -84,6 +91,7 @@ if ! $OB_DONE ; then cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0 --with-openbabel-lib=$OB_DEST/lib" && run_cmd "$cmd" "Code" cmd="make" && run_cmd "$cmd" "Make" cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Install" + cmd="ln -s $OB_DEST_BINDINGS/openbabel.so $RUBY_DEST/lib/ruby/site_ruby/1.8/i686-linux/" && run_cmd "$cmd" "Link" fi cd "$DIR" -- cgit v1.2.3 From 65bb8707e41e48c58377657ee10c2f3360152e46 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Mon, 11 Apr 2011 09:52:22 +0200 Subject: Cleaning temp files --- install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install b/install index d332838..ce76e87 100755 --- a/install +++ b/install @@ -23,6 +23,9 @@ then . "./opentox-webservices.sh" fi +echo "Cleaning up temp files." +sudo rm -rf /tmp/openbabel* /tmp/kernlab* /tmp/ruby* /tmp/passenger* + echo echo "Installation finished and system configured." echo "Destination: '$OT_PREFIX'" -- cgit v1.2.3 From 2fe0ffa04440906b8b1d4062e24674b9d3f0b5ee Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Mon, 11 Apr 2011 10:02:27 +0200 Subject: REDME --- README | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/README b/README index bd05d0e..98c760d 100644 --- a/README +++ b/README @@ -4,15 +4,25 @@ POSIX compatible Installer for OpenTox IST/ALU Services A) It is assumed that your system is configured for sudo to gain root privileges. B) It is assumed that your system is configured for using non-free packages. -Usage ------ +This is a POSIX-compliant (not limited to a particular shell) Opentox installer. Please report bugs always via GitHub. -Tested with Debian Squeeze (6.0.1), might work for Ubuntu and other Debian based distributions. +Here are some of my goals when writing the installer: +- Safe (existence of all the binaries will be checked before running, apart from GNU Core Utils) +- idempotent (multiple execution does not change a thing) +- Atomic (return value of each non-elemtary action is asserted to be TRUE) +- Encapsulated (everything is installed in a sub-directory in $HOME) +- Logged (all non-elemtary actions are logged) +Even if we officially support only *one* distro (currently Debian 6.0.1), I tested the installer successfully on various Ubuntus. In the README at the top are the requirements of the installer. By default, everything is installed to $HOME/opentox-ruby (=OT_PREFIX). The configs go OT_PREFIX/.sh__ot.sh for each package. - git clone http://github.com/opentox/install.git - cd install - vi config.sh - ./install +After running the installer, configure the operating system by editing the startup file of your favorite shell (in my case, BASH with to the file ~ /. bashrc) include file ~/.opentox-ui.sh (in my case with 'source ...'). This file is the only one that the installer creates outside OT_PREFIX. Thus, the system is fully configured: If you open a new shell, all environment variables adjusted. +To start the system I run the following (but that is not part of the installer): +Edit ~/.opentox/config/production.yaml and change ": server: nil" to "server" (once) +sudo nohup ~/opentox-ruby/redis-2.2.2/src/redis-server ~/opentox-ruby/redis-2.2.2/redis.conf & +sudo nohup ~/opentox-ruby/nginx/sbin/nginx -c ~/opentox-ruby/nginx/conf/nginx.conf & + +To uninstall the system simply delete the link from the startup file: Done. I guarantee that no configuration remains. To save disc space delete directory OT_PREFIX. + +Anyone who wants can run multiple Opentox versions on the same machine: Just install again, but to a different OT_PREFIX. The switch works manually: Include the sh__ot.sh files from the desired OT_PREFIX in ~/opentox-ui.sh (only one installation may be activated at any time). -- cgit v1.2.3 From d6d37c36feafac194b0ccbbbd20f0c8c14d946a8 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Mon, 11 Apr 2011 03:14:50 -0700 Subject: Edited README via GitHub --- README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README b/README index 98c760d..adb12ed 100644 --- a/README +++ b/README @@ -13,12 +13,13 @@ Here are some of my goals when writing the installer: - Encapsulated (everything is installed in a sub-directory in $HOME) - Logged (all non-elemtary actions are logged) -Even if we officially support only *one* distro (currently Debian 6.0.1), I tested the installer successfully on various Ubuntus. In the README at the top are the requirements of the installer. By default, everything is installed to $HOME/opentox-ruby (=OT_PREFIX). The configs go OT_PREFIX/.sh__ot.sh for each package. +Even if we officially support only *one* distro (currently Debian 6.0.1), I tested the installer successfully on various Ubuntus. In the README at the top are the requirements of the installer. By default, everything is installed to $HOME/opentox-ruby (=OT_PREFIX). The configs go to OT_PREFIX/.sh__ot.sh for each package. -After running the installer, configure the operating system by editing the startup file of your favorite shell (in my case, BASH with to the file ~ /. bashrc) include file ~/.opentox-ui.sh (in my case with 'source ...'). This file is the only one that the installer creates outside OT_PREFIX. Thus, the system is fully configured: If you open a new shell, all environment variables adjusted. +After running the installer, configure the system by editing the startup file of your favorite shell (in my case, BASH with the file ~ /. bashrc) to include ~/.opentox-ui.sh (in my case with 'source ...'). This file is the only one that the installer creates outside OT_PREFIX. Thus, the system is fully configured: If you open a new shell, all environment variables will be adjusted. + +Edit ~/.opentox/config/production.yaml and change ": server: nil" to "server" (once). To start the system I run the following (but that is not part of the installer): -Edit ~/.opentox/config/production.yaml and change ": server: nil" to "server" (once) sudo nohup ~/opentox-ruby/redis-2.2.2/src/redis-server ~/opentox-ruby/redis-2.2.2/redis.conf & sudo nohup ~/opentox-ruby/nginx/sbin/nginx -c ~/opentox-ruby/nginx/conf/nginx.conf & -- cgit v1.2.3 From af04398a95f2eb04dc01648921eb7e040bbe2b65 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 12 Apr 2011 12:06:27 +0200 Subject: Fixed switching to master --- opentox-webservices.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index df7a07d..1b71653 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -25,6 +25,12 @@ if [ ! -e "$RAKE" ]; then exit 1 fi +GIT="`which git`" +if [ ! -e "$GIT" ]; then + echo "'git' missing. Install 'git' first. Aborting..." + exit 1 +fi + LOG="/tmp/`basename $0`-log.txt" if ! id opentox >>$LOG 2>&1; then @@ -38,9 +44,9 @@ 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 rm -rf "$s" >>$LOG 2>&1 - git clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 + $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 cd "$s" >>$LOG 2>&1 - git checkout -t origin/$OT_BRANCH >>$LOG 2>&1 + $GIT checkout -t origin/$OT_BRANCH >>$LOG 2>&1 rm -rf public >>$LOG 2>&1 mkdir public >>$LOG 2>&1 mypath_from="$WWW_DEST/opentox/$s/public" @@ -60,16 +66,20 @@ done # fminer etc cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present" cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1 -cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" -cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" +cmd="$GIT submodule init" && run_cmd "$cmd" "Fminer Init" +cmd="$GIT submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile; sed -i 's,^LDFLAGS_OB.*,LDFLAGS_OB\ =\ -L$OB_DEST/lib,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (OB)" cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/i686-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (RB)" done cd "libfminer/libbbrc">>$LOG 2>&1 +$GIT checkout master >>$LOG 2>&1 +$GIT pull >>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" cd ->>$LOG 2>&1 cd "libfminer/liblast">>$LOG 2>&1 +$GIT checkout master >>$LOG 2>&1 +$GIT pull >>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make LAST" cd ->>$LOG 2>&1 -- cgit v1.2.3 From fcaa3e224b61ee65756bc06f98c7010ba5398137 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 12 Apr 2011 12:12:43 +0200 Subject: Fixed last-utils master checkout --- opentox-webservices.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 1b71653..0b16ef3 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -82,6 +82,9 @@ $GIT checkout master >>$LOG 2>&1 $GIT pull >>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make LAST" cd ->>$LOG 2>&1 +cd "last-utils">>$LOG 2>&1 +$GIT checkout master >>$LOG 2>&1 +$GIT pull >>$LOG 2>&1 cd "$DIR" -- cgit v1.2.3 From 2c8a2f1865d023670f2f766b00f3def1961b3e45 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Mon, 18 Apr 2011 02:35:46 -0700 Subject: Removed deletion of 'public' directory --- opentox-webservices.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 opentox-webservices.sh diff --git a/opentox-webservices.sh b/opentox-webservices.sh old mode 100755 new mode 100644 index 0b16ef3..b398df2 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -47,8 +47,8 @@ for s in compound dataset algorithm model toxcreate task; do $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 cd "$s" >>$LOG 2>&1 $GIT checkout -t origin/$OT_BRANCH >>$LOG 2>&1 - rm -rf public >>$LOG 2>&1 - mkdir public >>$LOG 2>&1 + #rm -rf public >>$LOG 2>&1 + #mkdir public >>$LOG 2>&1 mypath_from="$WWW_DEST/opentox/$s/public" mypath_to="$WWW_DEST/$s" cmd="ln -sf \"$mypath_from\" \"$mypath_to\"" && run_cmd "$cmd" "Linking $s" -- cgit v1.2.3 From 88295381838bb14cdb6ae9f61816f53d5e8ce489 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 19 Apr 2011 00:38:13 -0700 Subject: Fixed arch --- opentox-webservices.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-webservices.sh b/opentox-webservices.sh index b398df2..ed37206 100644 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -70,7 +70,7 @@ cmd="$GIT submodule init" && run_cmd "$cmd" "Fminer Init" cmd="$GIT submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile; sed -i 's,^LDFLAGS_OB.*,LDFLAGS_OB\ =\ -L$OB_DEST/lib,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (OB)" - cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/i686-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (RB)" + cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/`uname -m`-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (RB)" done cd "libfminer/libbbrc">>$LOG 2>&1 $GIT checkout master >>$LOG 2>&1 -- cgit v1.2.3 From 328ffada8289770693f554f341c5bb58e9efd69f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 19 Apr 2011 00:45:04 -0700 Subject: Fixed arch --- openbabel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 openbabel.sh diff --git a/openbabel.sh b/openbabel.sh old mode 100755 new mode 100644 index 6cd4889..3257146 --- a/openbabel.sh +++ b/openbabel.sh @@ -91,7 +91,7 @@ if ! $OB_DONE ; then cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0 --with-openbabel-lib=$OB_DEST/lib" && run_cmd "$cmd" "Code" cmd="make" && run_cmd "$cmd" "Make" cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Install" - cmd="ln -s $OB_DEST_BINDINGS/openbabel.so $RUBY_DEST/lib/ruby/site_ruby/1.8/i686-linux/" && run_cmd "$cmd" "Link" + cmd="ln -s $OB_DEST_BINDINGS/openbabel.so $RUBY_DEST/lib/ruby/site_ruby/1.8/`uname -m`-linux/" && run_cmd "$cmd" "Link" fi cd "$DIR" -- cgit v1.2.3 From 4d32162313c574c908ce87723ad4fb900e690a08 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 19 Apr 2011 10:46:05 +0200 Subject: Removed wrong package: git --- base-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index 2a4afb5..80bcff5 100644 --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $OT_UI_CONF # Pkgs -packs="binutils git git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-dev sun-java6-jdk wget zlib1g-dev" +packs="binutils git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-dev sun-java6-jdk wget zlib1g-dev" echo echo "Base Packages:" -- cgit v1.2.3 From d5044c3a4ff041da62e144496fb6ef9e5969804e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 27 Apr 2011 14:59:49 +0200 Subject: Changed exec status --- base-install.sh | 0 kernlab.sh | 0 openbabel.sh | 0 opentox-webservices.sh | 0 redis.sh | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 base-install.sh mode change 100644 => 100755 kernlab.sh mode change 100644 => 100755 openbabel.sh mode change 100644 => 100755 opentox-webservices.sh mode change 100644 => 100755 redis.sh diff --git a/base-install.sh b/base-install.sh old mode 100644 new mode 100755 diff --git a/kernlab.sh b/kernlab.sh old mode 100644 new mode 100755 diff --git a/openbabel.sh b/openbabel.sh old mode 100644 new mode 100755 diff --git a/opentox-webservices.sh b/opentox-webservices.sh old mode 100644 new mode 100755 diff --git a/redis.sh b/redis.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From b59d27e35c220180c8e9717b98a39073ecc6a55e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 27 Apr 2011 16:08:37 +0200 Subject: Requiring build-essential --- base-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index 80bcff5..9795813 100755 --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $OT_UI_CONF # Pkgs -packs="binutils git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-dev sun-java6-jdk wget zlib1g-dev" +packs="binutils build-essential git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-dev sun-java6-jdk wget zlib1g-dev" echo echo "Base Packages:" -- cgit v1.2.3 From e2dc50e08e9245e401ab5726f04706c825e9deaf Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 27 Apr 2011 17:14:09 +0200 Subject: Fixed some issues --- base-install.sh | 2 +- config.sh | 1 + nginx.sh | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index 9795813..4f554fc 100755 --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $OT_UI_CONF # Pkgs -packs="binutils build-essential git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-dev sun-java6-jdk wget zlib1g-dev" +packs="binutils build-essential git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-core r-base-dev sun-java6-jdk wget zlib1g-dev" echo echo "Base Packages:" diff --git a/config.sh b/config.sh index 7fe4006..5a13b3a 100755 --- a/config.sh +++ b/config.sh @@ -30,6 +30,7 @@ WWW_DEST="$OT_PREFIX/www" JAVA_CONF="$OT_PREFIX/.sh_java_ot" RUBY_CONF="$OT_PREFIX/.sh_ruby_ot" REDIS_CONF="$OT_PREFIX/.sh_redis_ot" +NGINX_CONF="$OT_PREFIX/.sh_nginx_ot" OB_CONF="$OT_PREFIX/.sh_OB_ot" KL_CONF="$OT_PREFIX/.sh_R_ot" diff --git a/nginx.sh b/nginx.sh index 36a84df..6b10a5c 100755 --- a/nginx.sh +++ b/nginx.sh @@ -54,5 +54,16 @@ $GIT checkout nginx.conf>>$LOG 2>&1 cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST,;s,WWW_DEST,$WWW_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" +if [ ! -f $NGINX_CONF ]; then + echo "if ! echo \"\$PATH\" | grep \"$NGINX_DEST\">/dev/null 2>&1; then export PATH=$NGINX_DEST/sbin:\$PATH; fi" >> "$NGINX_CONF" + echo "Nginx configuration has been stored in '$NGINX_CONF'." + + if ! grep ". \"$NGINX_CONF\"" $OT_UI_CONF; then + echo ". \"$NGINX_CONF\"" >> $OT_UI_CONF + fi + +fi + + cd "$DIR" -- cgit v1.2.3 From 7b37b2c92dc746446b6110eab2038254bd704a11 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 28 Apr 2011 12:48:20 +0200 Subject: Fixed checkout usage --- opentox-ruby.sh | 2 +- opentox-webservices.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 3811484..607cf18 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -76,7 +76,7 @@ if [ "$OT_BRANCH" = "development" ]; then rm -rf opentox-ruby >>$LOG 2>&1 $GIT clone git://github.com/opentox/opentox-ruby.git >>$LOG 2>&1 cd opentox-ruby >>$LOG 2>&1 - $GIT checkout -t origin/$OT_BRANCH >>$LOG 2>&1 + $GIT checkout -b $OT_BRANCH origin/$OT_BRANCH >>$LOG 2>&1 cmd="$RAKE install" && run_cmd "$cmd" "Install" GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` rm -rf "$GEM_LIB~" >>$LOG 2>&1 diff --git a/opentox-webservices.sh b/opentox-webservices.sh index ed37206..7e904ad 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -46,7 +46,7 @@ for s in compound dataset algorithm model toxcreate task; do rm -rf "$s" >>$LOG 2>&1 $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 cd "$s" >>$LOG 2>&1 - $GIT checkout -t origin/$OT_BRANCH >>$LOG 2>&1 + $GIT checkout -b $OT_BRANCH origin/$OT_BRANCH >>$LOG 2>&1 #rm -rf public >>$LOG 2>&1 #mkdir public >>$LOG 2>&1 mypath_from="$WWW_DEST/opentox/$s/public" -- cgit v1.2.3 From 456c8cc1448a7f4d83bf5790236d79ebbe9525d9 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 28 Apr 2011 13:45:33 +0200 Subject: Added tools to README --- README | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README b/README index adb12ed..97becf2 100644 --- a/README +++ b/README @@ -27,3 +27,30 @@ To uninstall the system simply delete the link from the startup file: Done. I gu Anyone who wants can run multiple Opentox versions on the same machine: Just install again, but to a different OT_PREFIX. The switch works manually: Include the sh__ot.sh files from the desired OT_PREFIX in ~/opentox-ui.sh (only one installation may be activated at any time). + +Some useful scripts to put in your ~/.bashrc in case you are using bash (assuming OT_PREFIX is '~/opentox-ruby'): +# Load server config +alias otconfig='source ~/.opentox-ui.sh' + +# Start the server +otstart() { + sudo killall nginx redis-server>/dev/null 2>&1 + sudo env PATH=$PATH nohup redis-server ~/opentox-ruby/redis-2.2.2/redis.conf >/dev/null 2>&1 & + sudo env PATH=$PATH nohup nginx -c ~/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 & + sleep 2 + if ! pgrep nginx>/dev/null 2>&1; then echo "Failed to start nginx."; fi + if ! pgrep redis-server>/dev/null 2>&1; then echo "Failed to start redis."; fi +} + +# Reload the server +alias otreload='sudo env PATH=$PATH nginx -s reload' + +# Kill the server +alias otkill='sudo killall nginx redis-server' + +# Display log +alias otless='less /home/am/.opentox/log/production.log' + +# Tail log +alias ottail='tail -f /home/am/.opentox/log/production.log' + -- cgit v1.2.3 From 8e98ba83791c01b826f4cd5f36edaf6a6d0b8e90 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Tue, 3 May 2011 14:14:54 +0200 Subject: adding validation to installer --- base-install.sh | 2 +- opentox-webservices.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base-install.sh b/base-install.sh index 4f554fc..fbf0689 100755 --- a/base-install.sh +++ b/base-install.sh @@ -27,7 +27,7 @@ fi touch $OT_UI_CONF # Pkgs -packs="binutils build-essential git-core hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-core r-base-dev sun-java6-jdk wget zlib1g-dev" +packs="binutils build-essential git-core gnuplot hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libxslt1-dev lsb-release pwgen raptor-utils r-base r-base-core r-base-dev sqlite3 sun-java6-jdk wget xsltproc zlib1g-dev" echo echo "Base Packages:" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 7e904ad..23af311 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -42,7 +42,7 @@ echo "Webservices ('$LOG'):" 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 +for s in compound dataset algorithm model toxcreate task validation; do rm -rf "$s" >>$LOG 2>&1 $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 cd "$s" >>$LOG 2>&1 -- cgit v1.2.3 From 5c4240c295466fe56dea73b26710a9798c8570e6 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Tue, 3 May 2011 14:21:48 +0200 Subject: replace nil with empty-string when aa is not used in yaml-config --- opentox-ruby.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 607cf18..d101600 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -8,7 +8,7 @@ DIR="`pwd`" if [ "$(id -u)" = "0" ]; then - echo "This script must be run as non-root." 1>&2 + echo "This script must be run as non-root." 1>&264 exit 1 fi @@ -61,7 +61,7 @@ fi if [ "$OT_INSTALL" = "server" ]; then aa="https:\/\/opensso.in-silico.ch" else - aa=nil + aa="" fi mkdir -p "$HOME/.opentox/config" >>$LOG 2>&1 -- cgit v1.2.3 From 76dd98a2fcfa07bab5424b9ce74bf8825d4b5a8c Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 3 May 2011 14:25:33 +0200 Subject: Fixed redirection --- opentox-ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index d101600..5fcff1c 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -8,7 +8,7 @@ DIR="`pwd`" if [ "$(id -u)" = "0" ]; then - echo "This script must be run as non-root." 1>&264 + echo "This script must be run as non-root." 1>&2 exit 1 fi -- cgit v1.2.3 From 985728e30a1b05e43b322fe3410bf2663b54dbfc Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 3 May 2011 15:01:21 +0200 Subject: add local validation to production.yaml --- production.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production.yaml b/production.yaml index 35dd577..f3eee2c 100644 --- a/production.yaml +++ b/production.yaml @@ -8,7 +8,7 @@ opentox-model: "http://SERVERNAME/model/" opentox-task: "http://SERVERNAME/task/" opentox-toxcreate: "http://SERVERNAME/toxcreate/" - opentox-validation: "http://opentox.informatik.uni-freiburg.de/validation/" + opentox-validation: "http://SERVERNAME/validation/" :yaml_hosts: - "localhost" -- cgit v1.2.3 From f6085064817740351aad5cd37aa1aa7c19be4361 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 3 May 2011 15:37:51 +0200 Subject: Fixed forced upgrade and tail of log in case of error --- base-install.sh | 2 +- utils.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base-install.sh b/base-install.sh index fbf0689..0a13c68 100755 --- a/base-install.sh +++ b/base-install.sh @@ -46,7 +46,7 @@ if [ -n "$pack_arr" ]; then echo echo "Checking availablity:" sudo $APTITUDE update -y >/dev/null 2>&1 - sudo $APTITUDE upgrade -y >/dev/null 2>&1 +# sudo $APTITUDE upgrade -y >/dev/null 2>&1 fi for p in $pack_arr; do diff --git a/utils.sh b/utils.sh index 1bead39..880028c 100755 --- a/utils.sh +++ b/utils.sh @@ -18,6 +18,8 @@ run_cmd () printf "%30s" "'$title'" if ! eval $cmd >>$LOG 2>&1 ; then printf "%50s\n" "FAIL" + echo "Last 10 lines of log:" + tail -10 "$LOG" exit 1 fi printf "%50s\n" "DONE" -- cgit v1.2.3 From cbdcb44f572b96f49323879202573e194c868069 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 3 May 2011 16:58:41 +0200 Subject: Fixed redis save --- redis.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redis.sh b/redis.sh index 6790fed..2f55539 100755 --- a/redis.sh +++ b/redis.sh @@ -55,6 +55,10 @@ if ! $REDIS_DONE; then if ! grep "dir `pwd`" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then echo "dir `pwd`" >> $REDIS_SERVER_CONF 2>$LOG fi + + if ! grep "save 900 1" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then + echo "save 900 1" >> $REDIS_SERVER_CONF 2>$LOG + fi fi if [ ! -f $REDIS_CONF ]; then -- cgit v1.2.3 From 9eff6bcba2ffb30fa6acda136af654498c422d01 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 3 May 2011 17:01:09 +0200 Subject: Fixed otkill --- README | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README b/README index 97becf2..9da8acb 100644 --- a/README +++ b/README @@ -46,7 +46,10 @@ otstart() { alias otreload='sudo env PATH=$PATH nginx -s reload' # Kill the server -alias otkill='sudo killall nginx redis-server' +otkill() { + killall nginx + redis-cli shutdown +} # Display log alias otless='less /home/am/.opentox/log/production.log' -- cgit v1.2.3 From 49bbb98c1e402a487bc9029ee247be4f8c306a2b Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 3 May 2011 10:44:00 -0700 Subject: Edited README via GitHub --- README | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/README b/README index 9da8acb..70d222f 100644 --- a/README +++ b/README @@ -8,25 +8,21 @@ This is a POSIX-compliant (not limited to a particular shell) Opentox installer Here are some of my goals when writing the installer: - Safe (existence of all the binaries will be checked before running, apart from GNU Core Utils) -- idempotent (multiple execution does not change a thing) +- Idempotent (multiple execution does not change a thing) - Atomic (return value of each non-elemtary action is asserted to be TRUE) - Encapsulated (everything is installed in a sub-directory in $HOME) - Logged (all non-elemtary actions are logged) Even if we officially support only *one* distro (currently Debian 6.0.1), I tested the installer successfully on various Ubuntus. In the README at the top are the requirements of the installer. By default, everything is installed to $HOME/opentox-ruby (=OT_PREFIX). The configs go to OT_PREFIX/.sh__ot.sh for each package. -After running the installer, configure the system by editing the startup file of your favorite shell (in my case, BASH with the file ~ /. bashrc) to include ~/.opentox-ui.sh (in my case with 'source ...'). This file is the only one that the installer creates outside OT_PREFIX. Thus, the system is fully configured: If you open a new shell, all environment variables will be adjusted. - -Edit ~/.opentox/config/production.yaml and change ": server: nil" to "server" (once). +After running the installer, configure the system by editing the startup file of your favorite shell (in my case, BASH with the file ~ /. bashrc) to include ~/.opentox-ui.sh (in my case with 'source ...'). This file is the only one that the installer creates outside OT_PREFIX. Thus, the system is fully configured: If you now open a new shell, all environment variables will be adjusted. To start the system I run the following (but that is not part of the installer): sudo nohup ~/opentox-ruby/redis-2.2.2/src/redis-server ~/opentox-ruby/redis-2.2.2/redis.conf & sudo nohup ~/opentox-ruby/nginx/sbin/nginx -c ~/opentox-ruby/nginx/conf/nginx.conf & -To uninstall the system simply delete the link from the startup file: Done. I guarantee that no configuration remains. To save disc space delete directory OT_PREFIX. - -Anyone who wants can run multiple Opentox versions on the same machine: Just install again, but to a different OT_PREFIX. The switch works manually: Include the sh__ot.sh files from the desired OT_PREFIX in ~/opentox-ui.sh (only one installation may be activated at any time). - +To uninstall the system simply delete the link from the startup file: Done. To save disc space delete directory OT_PREFIX. +Anyone can run multiple Opentox versions on the same machine: Just install again, but to a different OT_PREFIX. The switch works manually: Include the sh__ot.sh files from the desired OT_PREFIX in ~/opentox-ui.sh (only one installation may be activated at any time). Some useful scripts to put in your ~/.bashrc in case you are using bash (assuming OT_PREFIX is '~/opentox-ruby'): # Load server config @@ -34,7 +30,8 @@ alias otconfig='source ~/.opentox-ui.sh' # Start the server otstart() { - sudo killall nginx redis-server>/dev/null 2>&1 + sudo killall nginx>/dev/null 2>&1 + sudo env PATH=$PATH redis-cli shutdown sudo env PATH=$PATH nohup redis-server ~/opentox-ruby/redis-2.2.2/redis.conf >/dev/null 2>&1 & sudo env PATH=$PATH nohup nginx -c ~/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 & sleep 2 @@ -47,13 +44,12 @@ alias otreload='sudo env PATH=$PATH nginx -s reload' # Kill the server otkill() { - killall nginx - redis-cli shutdown + sudo killall nginx + sudo redis-cli shutdown } # Display log alias otless='less /home/am/.opentox/log/production.log' # Tail log -alias ottail='tail -f /home/am/.opentox/log/production.log' - +alias ottail='tail -f /home/am/.opentox/log/production.log' \ No newline at end of file -- cgit v1.2.3 From 75f63a15daa01f02ee8c6ed797dbb44f2f90f948 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 4 May 2011 17:42:58 +0200 Subject: Updated tools in hint --- README | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/README b/README index 9da8acb..039b227 100644 --- a/README +++ b/README @@ -29,31 +29,35 @@ Anyone who wants can run multiple Opentox versions on the same machine: Just ins Some useful scripts to put in your ~/.bashrc in case you are using bash (assuming OT_PREFIX is '~/opentox-ruby'): + # Load server config -alias otconfig='source ~/.opentox-ui.sh' +otconfig() { + source ~/.opentox-ui.sh +} # Start the server otstart() { - sudo killall nginx redis-server>/dev/null 2>&1 - sudo env PATH=$PATH nohup redis-server ~/opentox-ruby/redis-2.2.2/redis.conf >/dev/null 2>&1 & - sudo env PATH=$PATH nohup nginx -c ~/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 & + otkill + sudo bash -c "source ~/.opentox-ui.sh; nohup redis-server ~/opentox-ruby/redis-2.2.2/redis.conf >/dev/null 2>&1 &" + sudo bash -c "source ~/.opentox-ui.sh; nohup nginx -c ~/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 &" sleep 2 if ! pgrep nginx>/dev/null 2>&1; then echo "Failed to start nginx."; fi if ! pgrep redis-server>/dev/null 2>&1; then echo "Failed to start redis."; fi } +# Display log +alias otless='less ~/.opentox/log/production.log' + +# Tail log +alias ottail='tail -f ~/.opentox/log/production.log' + # Reload the server -alias otreload='sudo env PATH=$PATH nginx -s reload' +otreload() { + sudo bash -c "source ~/.opentox-ui.sh; nginx -s reload" +} # Kill the server otkill() { - killall nginx - redis-cli shutdown + sudo killall nginx >/dev/null 2>&1 + sudo bash -c "source ~/.opentox-ui.sh; redis-cli shutdown >/dev/null 2>&1" } - -# Display log -alias otless='less /home/am/.opentox/log/production.log' - -# Tail log -alias ottail='tail -f /home/am/.opentox/log/production.log' - -- cgit v1.2.3 From 2a9154ab9115f86d5824e5424d164c98624a6545 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 17 May 2011 01:19:19 -0700 Subject: Supporting release branch for backlinking --- opentox-ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 opentox-ruby.sh diff --git a/opentox-ruby.sh b/opentox-ruby.sh old mode 100755 new mode 100644 index 5fcff1c..08c37ef --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -70,7 +70,7 @@ mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" aa-$OT_INSTALL.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" -if [ "$OT_BRANCH" = "development" ]; then +if [ "$OT_BRANCH" = "development" ] || expr match "$OT_BRANCH" "release"; then mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 cd $WWW_DEST/opentox >>$LOG 2>&1 rm -rf opentox-ruby >>$LOG 2>&1 -- cgit v1.2.3 From a198d10ba86c08d84d707704654cf206c42fb040 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 17 May 2011 01:20:07 -0700 Subject: Supporting backlinking for release branches. --- opentox-ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 opentox-ruby.sh diff --git a/opentox-ruby.sh b/opentox-ruby.sh old mode 100755 new mode 100644 index 5fcff1c..08c37ef --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -70,7 +70,7 @@ mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" aa-$OT_INSTALL.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" -if [ "$OT_BRANCH" = "development" ]; then +if [ "$OT_BRANCH" = "development" ] || expr match "$OT_BRANCH" "release"; then mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 cd $WWW_DEST/opentox >>$LOG 2>&1 rm -rf opentox-ruby >>$LOG 2>&1 -- cgit v1.2.3 From 7b6f2234bd52d129e1f29bd60a2e1e2b2bd8be88 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 18 May 2011 09:21:44 +0200 Subject: Fixed checkout development as git@..., root check at beginning of install --- install | 11 ++++++++--- opentox-webservices.sh | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/install b/install index ce76e87..daa7d57 100755 --- a/install +++ b/install @@ -2,6 +2,11 @@ # Main Opentox-ruby install script # Author: Christoph Helma, Andreas Maunz +if [ "$(id -u)" = "0" ]; then + echo "This script must not be run as root" 1>&2 + exit 1 +fi + LOG="/tmp/`basename $0`-log.txt" . "./utils.sh" echo @@ -18,9 +23,9 @@ cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" if [ "$install" != "gem" ] then - . "./nginx.sh" - . "./redis.sh" - . "./opentox-webservices.sh" + . "./nginx.sh" + . "./redis.sh" + . "./opentox-webservices.sh" fi echo "Cleaning up temp files." diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 23af311..91d402e 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -44,7 +44,7 @@ mkdir -p "$WWW_DEST/opentox" >>$LOG 2>&1 cd "$WWW_DEST/opentox" >>$LOG 2>&1 for s in compound dataset algorithm model toxcreate task validation; do rm -rf "$s" >>$LOG 2>&1 - $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 + $GIT clone "git@github.com:opentox/$s.git" "$s" >>$LOG 2>&1 cd "$s" >>$LOG 2>&1 $GIT checkout -b $OT_BRANCH origin/$OT_BRANCH >>$LOG 2>&1 #rm -rf public >>$LOG 2>&1 -- cgit v1.2.3 From 197f021a1beb04f1fd07ef8ae7d90440f693a01d Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 18 May 2011 09:22:33 +0200 Subject: Cleaning temp files at the beginning --- install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install b/install index daa7d57..101f1ba 100755 --- a/install +++ b/install @@ -15,6 +15,9 @@ echo "You may need to give root password for some privileged actions right now a echo cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" +echo "Cleaning up temp files." +sudo rm -rf /tmp/openbabel* /tmp/kernlab* /tmp/ruby* /tmp/passenger* + . "./base-install.sh" . "./ruby.sh" . "./openbabel.sh" -- cgit v1.2.3 From 12e9b288603f389dbc50e8fadb4e6c35ec1223dc Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 18 May 2011 09:25:24 +0200 Subject: Moved temp file cleaning to start --- install | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/install b/install index 101f1ba..6a1e84f 100755 --- a/install +++ b/install @@ -15,7 +15,7 @@ echo "You may need to give root password for some privileged actions right now a echo cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" -echo "Cleaning up temp files." +echo "Cleaning up /tmp files." sudo rm -rf /tmp/openbabel* /tmp/kernlab* /tmp/ruby* /tmp/passenger* . "./base-install.sh" @@ -31,9 +31,6 @@ then . "./opentox-webservices.sh" fi -echo "Cleaning up temp files." -sudo rm -rf /tmp/openbabel* /tmp/kernlab* /tmp/ruby* /tmp/passenger* - echo echo "Installation finished and system configured." echo "Destination: '$OT_PREFIX'" -- cgit v1.2.3 From 7d7ed42d8700c4980c767d2904cd6696cd80a3b2 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 18 May 2011 09:29:09 +0200 Subject: Checking out production.yaml as template --- opentox-ruby.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 5fcff1c..adccf4d 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -67,6 +67,9 @@ fi mkdir -p "$HOME/.opentox/config" >>$LOG 2>&1 mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 +$GIT checkout production.yaml >>$LOG 2>&1 +$GIT checkout aa-$OT_INSTALL.yaml >>$LOG 2>&1 + cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" aa-$OT_INSTALL.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" -- cgit v1.2.3