forked from eea/land.copernicus.plonebuildout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·82 lines (63 loc) · 2.89 KB
/
install.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
set -e
#set -x
FINDLINKS='http://eggrepo.eea.europa.eu/simple'
INDEX='http://pypi.python.org/simple'
SETUPTOOLS=`curl -s https://raw.github.com/olimpiurob/eea.plonebuildout.core/master/versions.cfg | grep "setuptools\s*\=\s*" | sed 's/ *$//g' | sed 's/=$//g' | sed 's/\s*=\s*/==/g'`
ZCBUILDOUT=`curl -s https://raw.github.com/olimpiurob/eea.plonebuildout.core/master/versions.cfg | grep "zc\.buildout\s*=\s*" | sed 's/\s*=\s*/==/g'`
if [ -z "$SETUPTOOLS" ]; then
SETUPTOOLS="setuptools"
fi
if [ -z "$ZCBUILDOUT" ]; then
ZCBUILDOUT="zc.buildout"
fi
if [ -z "$PYTHON" ]; then
PYTHON="/usr/bin/env python2.6"
fi
# Make sure python is 2.6 or later
PYTHON_OK=`$PYTHON -c 'import sys
print (sys.version_info >= (2, 6) and "1" or "0")'`
if [ "$PYTHON_OK" = '0' ]; then
echo "Python 2.6 or later is required"
echo "EXAMPLE: PYTHON=/path/to/python-2.6 ./install.sh"
exit 0
fi
echo "Using Python: "
echo `$PYTHON --version`
if [ -s "bin/activate" -a -s "bin/easy_install" ]; then
echo "Updating setuptools: ./bin/easy_install -i $INDEX -f $FINDLINKS -U $SETUPTOOLS"
./bin/easy_install -i $INDEX -f $FINDLINKS -U $SETUPTOOLS
echo "Updating zc.buildout: ./bin/easy_install -i $INDEX -f $FINDLINKS -U $ZCBUILDOUT"
./bin/easy_install -i $INDEX -f $FINDLINKS -U $ZCBUILDOUT
echo ""
echo "============================================================="
echo "Buildout is already installed."
echo "Please remove bin/activate if you want to re-run this script."
echo "============================================================="
echo ""
exit 0
fi
echo "Installing virtualenv"
# NOTE: virtualenv now doesn't download anything by default, so we need to provide setuptools
curl -o "setuptools-0.9.8.tar.gz" -k "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.8.tar.gz#md5=243076241781935f7fcad370195a4291"
curl -o "/tmp/virtualenv.py" -k "https://raw.github.com/pypa/virtualenv/master/virtualenv.py"
echo "Running: $PYTHON /tmp/virtualenv.py --clear ."
$PYTHON "/tmp/virtualenv.py" --clear .
rm /tmp/virtualenv.py*
echo "Updating setuptools: ./bin/easy_install -i $INDEX -f FINDLINKS -U $SETUPTOOLS"
./bin/easy_install -i $INDEX -f $FINDLINKS -U $SETUPTOOLS
echo "Installing zc.buildout: $ ./bin/easy_install -i $INDEX -f $FINDLINKS -U $ZCBUILDOUT"
./bin/easy_install -i $INDEX -f $FINDLINKS -U $ZCBUILDOUT
echo "Disabling the SSL CERTIFICATION for git"
git config --global http.sslVerify false
# Copy templates from .core master
TMP_CHECKOUT="/tmp/eea.plonebuildout.core"
git clone https://github.com/eea/eea.plonebuildout.core.git $TMP_CHECKOUT
mkdir -p ./buildout-configs/templates
cp -r -n $TMP_CHECKOUT/buildout-configs/templates ./buildout-configs/
rm -rf $TMP_CHECKOUT
echo ""
echo "==========================================================="
echo "All set. Now you can run ./bin/buildout or ./bin/develop rb"
echo "==========================================================="
echo ""