forked from metashare/META-SHARE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-dependencies.sh
executable file
·47 lines (39 loc) · 1.26 KB
/
install-dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
CURRENTDIR=$(pwd)
BASEDIR=$(cd $(dirname .gitignore) ; pwd)
echo "This will install dependencies required by META-SHARE."
echo "Checking python version..."
EXPECTED_PYTHON_VERSION="Python 2.7"
# Check which python version to use
if [ -e $BASEDIR/opt/bin/python ] ; then
PYTHON=$BASEDIR/opt/bin/python
echo "Using locally installed python version $PYTHON"
else
PYTHON=python
fi
PYTHON_VERSION=$($PYTHON --version 2>&1)
PREFIX_MATCH=$(expr "$PYTHON_VERSION" : "\($EXPECTED_PYTHON_VERSION\)")
if [ "$PREFIX_MATCH" != "" ] ; then
echo "$PYTHON_VERSION found, OK."
else
if [ "$PYTHON" == "python" ] ; then
echo "expected $EXPECTED_PYTHON_VERSION, but found $PYTHON_VERSION"
echo "trying to install a local version in $BASEDIR/opt"
cd $BASEDIR/installable-packages
tar xjf Python-2.7.2.tar.bz2
cd Python-2.7.2
./configure --prefix=$BASEDIR/opt
make
make install
else
echo "expected $EXPECTED_PYTHON_VERSION, but found $PYTHON_VERSION in local install"
echo "something is messed up, aborting."
exit 1
fi
fi
echo
echo
echo "Installation of META-SHARE dependencies complete."
if [ "$PYTHON" != "python" ] ; then
echo "Python was installed locally -- make sure to include $BASEDIR/opt/bin at the beginning of your PATH!"
fi