summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbase-install.sh2
-rwxr-xr-xkernlab.sh40
-rwxr-xr-xnginx.sh27
-rwxr-xr-xopenbabel.sh54
-rwxr-xr-xruby.sh28
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 <Return> to continue, or <Ctrl+C> 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 <Return> to continue, or <Ctrl+C> 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 <Return> to continue, or <Ctrl+C> 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