Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 152 lines (134 sloc) 3.688 kb
763cf84 refactored cumulus to use autconf for installation. should make creatio...
BuzzTroll authored
1 #! /bin/bash
2
3 if ([ "X$1" == "X--help" ] || [ "X$1" == "X-h" ]); then
237381b ready to push
BuzzTroll authored
4 echo "cumulus-install.sh <installation directory> [<path to python install directory>]"
5 echo " The python path should be the path to the install. ./bin/python and ./bin/pip will be appened."
6 echo " If not path to python is specified a virtual environment will be created"
763cf84 refactored cumulus to use autconf for installation. should make creatio...
BuzzTroll authored
7 exit 0
8 fi
9
10 installdir=$1
11 start_dir=`pwd`
12 source_dir=`dirname $0`
d2b43c7 yet another refactor.
BuzzTroll authored
13 cd $source_dir
14 source_dir=`pwd`
15
722a0f4 mo code, mo problems.
BuzzTroll authored
16 # if no
17 if [ "X$2" == "X" ]; then
785e35e adding pierre's patchs to the cumulus test suite for for OSX.
BuzzTroll authored
18 PYTHON=`which python`
19
20 $PYTHON -c "import sys; sys.exit(sys.version_info < (2,5))"
21 if [ $? -ne 0 ]; then
22 echo "ERROR: Your system must have Python version 2.5 or later."
23 exit 1
24 fi
763cf84 refactored cumulus to use autconf for installation. should make creatio...
BuzzTroll authored
25
722a0f4 mo code, mo problems.
BuzzTroll authored
26 if [ "X$PYTHON" == "X" ]; then
785e35e adding pierre's patchs to the cumulus test suite for for OSX.
BuzzTroll authored
27 echo "you must have python in your system path for installation"
722a0f4 mo code, mo problems.
BuzzTroll authored
28 exit 1
29 fi
763cf84 refactored cumulus to use autconf for installation. should make creatio...
BuzzTroll authored
30
722a0f4 mo code, mo problems.
BuzzTroll authored
31 if [ -e $installdir ]; then
32 echo "----- WARNING -----"
33 echo "Target directory already exists"
34 bkup_dir="$installdir".`date +%s`
35 echo "moving existing directory to $bkup_dir"
36 mv $installdir $bkup_dir
37 fi
763cf84 refactored cumulus to use autconf for installation. should make creatio...
BuzzTroll authored
38
f7b03a5 @timf install output cleanup/normalization
timf authored
39 echo "Making the Python virtual environment."
40 echo ""
722a0f4 mo code, mo problems.
BuzzTroll authored
41 $PYTHON $source_dir/virtualenv.py -p $PYTHON $installdir
7564e38 bug creeped in causing installation errors when ~/.nimbus did not alread...
BuzzTroll authored
42 if [ $? -ne 0 ]; then
43 echo "The virtural env installation failed"
44 exit 1
722a0f4 mo code, mo problems.
BuzzTroll authored
45 fi
d2b43c7 yet another refactor.
BuzzTroll authored
46
722a0f4 mo code, mo problems.
BuzzTroll authored
47 PYVE=$installdir/bin/python
e8eb01a building pip as part of cumuus isntall process
BuzzTroll authored
48 PYVEDIR=$installdir
237381b ready to push
BuzzTroll authored
49 PIP=$installdir/bin/pip
722a0f4 mo code, mo problems.
BuzzTroll authored
50 else
51 use_py=$2
f7b03a5 @timf install output cleanup/normalization
timf authored
52 echo "Using provided Python environment: $use_py"
53 echo ""
722a0f4 mo code, mo problems.
BuzzTroll authored
54
b15125d new user programs must use the VE python
BuzzTroll authored
55 PYVEDIR=$use_py
237381b ready to push
BuzzTroll authored
56 PYVE=$use_py/bin/python
57 PIP=$use_py/bin/pip
58 $PYVE -c "import sys; sys.exit(sys.version_info < (2,5))"
722a0f4 mo code, mo problems.
BuzzTroll authored
59 if [ $? -ne 0 ]; then
237381b ready to push
BuzzTroll authored
60 echo $use_py
61 $use_py --version
722a0f4 mo code, mo problems.
BuzzTroll authored
62 echo "ERROR: Your system must have Python version 2.5 or later."
63 exit 1
64 fi
e8eb01a building pip as part of cumuus isntall process
BuzzTroll authored
65 fi
722a0f4 mo code, mo problems.
BuzzTroll authored
66
e8eb01a building pip as part of cumuus isntall process
BuzzTroll authored
67 source $PYVEDIR/bin/activate
68
5abcf49 cumulus install extracted pip before getting it
BuzzTroll authored
69 cd $source_dir/deps
70 if [ $? -ne 0 ]; then
71 echo "Could not change to the deps directory"
72 exit 1
73 fi
74 ./get-em.sh
75 if [ $? -ne 0 ]; then
76 echo "get-em failed"
77 exit 1
78 fi
e8eb01a building pip as part of cumuus isntall process
BuzzTroll authored
79
80 if [ ! -e $PIP ]; then
78f240b more pip mods
BuzzTroll authored
81 cd $source_dir
e8eb01a building pip as part of cumuus isntall process
BuzzTroll authored
82 tar -zxf pip-0.7.2.tar.gz
83 if [ $? -ne 0 ]; then
84 echo "unable to untar pip-0.7.2.tar.gz"
85 exit 1
86 fi
78f240b more pip mods
BuzzTroll authored
87 cd $source_dir/pip-0.7.2
e8eb01a building pip as part of cumuus isntall process
BuzzTroll authored
88 $PYVE setup.py install
89 if [ $? -ne 0 ]; then
90 echo "pip was not installed correctly"
91 exit 1
92 fi
763cf84 refactored cumulus to use autconf for installation. should make creatio...
BuzzTroll authored
93 fi
94
f7b03a5 @timf install output cleanup/normalization
timf authored
95 echo ""
96 echo "-----------------------------------------------------------------"
97 echo "Installing Cumulus dependencies"
98 echo "-----------------------------------------------------------------"
99 echo ""
d2b43c7 yet another refactor.
BuzzTroll authored
100 # install deps
c1a26e7 refactored authzdb module
BuzzTroll authored
101 cd $source_dir
237381b ready to push
BuzzTroll authored
102 $PIP install --requirement=reqs.txt
d2b43c7 yet another refactor.
BuzzTroll authored
103 if [ $? -ne 0 ]; then
237381b ready to push
BuzzTroll authored
104 echo "$PIP failed to install deps"
d2b43c7 yet another refactor.
BuzzTroll authored
105 exit 1
106 fi
107
861909c changing the way that cumulus install uses pip so that NMI can build pro...
BuzzTroll authored
108 echo "installing authz"
109 echo "----------------"
110 cd authz
111 $PYVE setup.py install
112 if [ $? -ne 0 ]; then
113 echo "$PIP failed to install authz"
114 exit 1
115 fi
116 cd $source_dir
117 echo "installing cb"
118 echo "-------------"
119 cd cb
120 $PYVE setup.py install
121 if [ $? -ne 0 ]; then
122 echo "$PIP failed to install authz"
123 exit 1
124 fi
125
126
f7b03a5 @timf install output cleanup/normalization
timf authored
127 echo ""
128 echo "-----------------------------------------------------------------"
d2b43c7 yet another refactor.
BuzzTroll authored
129 echo "Configuring the environment"
f7b03a5 @timf install output cleanup/normalization
timf authored
130 echo "-----------------------------------------------------------------"
131 echo ""
d2b43c7 yet another refactor.
BuzzTroll authored
132 cd $source_dir/conf
b15125d new user programs must use the VE python
BuzzTroll authored
133 ./configure --prefix=$installdir --with-ve=$PYVEDIR
722a0f4 mo code, mo problems.
BuzzTroll authored
134 if [ $? -ne 0 ]; then
135 echo "configure failed"
136 exit 1
137 fi
763cf84 refactored cumulus to use autconf for installation. should make creatio...
BuzzTroll authored
138 make install
722a0f4 mo code, mo problems.
BuzzTroll authored
139 if [ $? -ne 0 ]; then
140 echo "make install failed"
141 exit 1
142 fi
d2b43c7 yet another refactor.
BuzzTroll authored
143
f7b03a5 @timf install output cleanup/normalization
timf authored
144 echo ""
145 echo "-----------------------------------------------------------------"
146 echo "Finalizing the Cumulus install"
147 echo "-----------------------------------------------------------------"
148 echo ""
d2b43c7 yet another refactor.
BuzzTroll authored
149 cd $source_dir
150 cp -r $source_dir/tests $installdir
151 cp -r $source_dir/docs $installdir
Something went wrong with that request. Please try again.