Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 141 lines (123 sloc) 3.686 kb
#! /bin/bash
if ([ "X$1" == "X--help" ] || [ "X$1" == "X-h" ]); then
echo "cumulus-install.sh <installation directory> [<path to python install directory>]"
echo " The python path should be the path to the install. ./bin/python and ./bin/pip will be appened."
echo " If not path to python is specified a virtual environment will be created"
exit 0
fi
installdir=$1
start_dir=`pwd`
source_dir=`dirname $0`
cd $source_dir
source_dir=`pwd`
# if no
if [ "X$2" == "X" ]; then
PYTHON=`which python`
$PYTHON -c "import sys; sys.exit(sys.version_info < (2,5))"
if [ $? -ne 0 ]; then
echo "ERROR: Your system must have Python version 2.5 or later."
exit 1
fi
if [ "X$PYTHON" == "X" ]; then
echo "you must have python in your system path for installation"
exit 1
fi
if [ -e $installdir ]; then
echo "----- WARNING -----"
echo "Target directory already exists"
bkup_dir="$installdir".`date +%s`
echo "moving existing directory to $bkup_dir"
mv $installdir $bkup_dir
fi
echo "Making the Python virtual environment."
echo ""
$PYTHON $source_dir/virtualenv.py -p $PYTHON $installdir
if [ $? -ne 0 ]; then
echo "The virtural env installation failed"
exit 1
fi
PYVEDIR=$installdir
PYVE=$installdir/bin/python
PIP=$installdir/bin/pip
else
use_py=$2
echo "Using provided Python environment: $use_py"
echo ""
PYVEDIR=$use_py
PYVE=$use_py/bin/python
PIP=$use_py/bin/pip
$PYVE -c "import sys; sys.exit(sys.version_info < (2,5))"
if [ $? -ne 0 ]; then
echo $use_py
$use_py --version
echo "ERROR: Your system must have Python version 2.5 or later."
exit 1
fi
fi
if [ -e $HOME/.nimbus ]; then
if [ ! -d $HOME/.nimbus ]; then
echo "~/.nimbus exists but it is a regular file, not a directory."
echo "This installation program needs to create the directory ~/.nimbus."
echo "please rename your existing file"
exit 1
fi
fi
if [ ! -e $HOME/.nimbus ]; then
mkdir $HOME/.nimbus
if [ $? -ne 0 ]; then
echo "mkdir ~/.nimbus failed"
exit 1
fi
fi
if [ -e $HOME/.nimbus/cumulus.ini ]; then
echo "----- WARNING -----"
bkup=$HOME/.nimbus/cumulus.ini.`date +%s`
echo "$HOME/.nimbus/cumulus.ini exists, moving it to $bkup"
mv $HOME/.nimbus/cumulus.ini $bkup
fi
cd $source_dir/deps
if [ $? -ne 0 ]; then
echo "Could not change to the deps directory"
exit 1
fi
./get-em.sh
if [ $? -ne 0 ]; then
echo "get-em failed"
exit 1
fi
echo ""
echo "-----------------------------------------------------------------"
echo "Installing Cumulus dependencies"
echo "-----------------------------------------------------------------"
echo ""
# install deps
cd $source_dir
$PIP install --requirement=reqs.txt
if [ $? -ne 0 ]; then
echo "$PIP failed to install deps"
exit 1
fi
echo ""
echo "-----------------------------------------------------------------"
echo "Configuring the environment"
echo "-----------------------------------------------------------------"
echo ""
cd $source_dir/conf
./configure --prefix=$installdir --with-ve=$PYVEDIR
if [ $? -ne 0 ]; then
echo "configure failed"
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "make install failed"
exit 1
fi
echo ""
echo "-----------------------------------------------------------------"
echo "Finalizing the Cumulus install"
echo "-----------------------------------------------------------------"
echo ""
cd $source_dir
cp -r $source_dir/tests $installdir
cp -r $source_dir/docs $installdir
Jump to Line
Something went wrong with that request. Please try again.