forked from conwetlab/wstore
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresolve-basic-dep.sh
More file actions
executable file
·116 lines (95 loc) · 3.23 KB
/
resolve-basic-dep.sh
File metadata and controls
executable file
·116 lines (95 loc) · 3.23 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
# Define variables used in all scripts if not already set
if [[ -z "$WORKSPACE" ]]
then
export WORKSPACE=`pwd`
fi
# Check the system distribution
DIST=""
if [ -f "/etc/issue" ]; then
# This file can exist in Debian and centos
CONTENT=$(cat /etc/issue)
if [[ $CONTENT == *CentOS* ]]; then
DIST="rhel"
elif [[ $CONTENT == *Ubuntu* || $CONTENT == *Debian* ]]; then
DIST="deb"
fi
elif [ -f "/etc/centos-release" ]; then
DIST="rhel"
fi
# Install the different packages depending on the distribution
if [[ $DIST == "deb" ]]; then
# Debian/Ubuntu
echo "Debian/Ubuntu system"
apt-get update
apt-get install python python-pip
apt-get install mongodb
apt-get install wkhtmltopdf
apt-get install xvfb
# Install lxml dependencies
apt-get install gcc
apt-get install libxml2-dev libxslt1-dev zlib1g-dev python-dev
# Install virtualenv
pip install virtualenv
elif [[ $DIST == "rhel" ]]; then
# CentOS 6
echo "CentOS system. Note that only CentOS 6 is supported"
ARCH=$(uname -m)
# Install python 2.7 which is required
# Install dependencies
yum groupinstall "Development tools"
yum install zlib-devel
yum install bzip2-devel
yum install openssl-devel
yum install ncurses-devel
# Download and compile python 2.7
cd /opt
wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-shared
make && make altinstall
echo "/usr/local/lib" >> /etc/ld.so.conf
/sbin/ldconfig
# Install python 2.7 setup tools
cd /opt
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo /usr/local/bin/python2.7 ez_setup.py
sudo /usr/local/bin/easy_install-2.7 pip
ln -s /usr/local/bin/python2.7 /usr/bin/python2.7
ln -s /usr/local/bin/pip2.7 /usr/bin/pip2.7
yum install libxml2-devel libxslt-devel python-devel
# Install MongoDB repository
if [[ $ARCH == "x86_64" ]]; then
echo "[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1" > /etc/yum.repos.d/mongodb.repo
else
echo "[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/
gpgcheck=0
enabled=1" > /etc/yum.repos.d/mongodb.repo
fi
yum install -y mongodb-org
# Start mongodb
service mongod start
# Get wkhtmltopdf package download version 0.12.1
if [[ $ARCH == "x86_64" ]]; then
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-centos6-amd64.rpm
rpm -ivh wkhtmltox-0.12.1_linux-centos6-amd64.rpm
else
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-centos6-i386.rpm
rpm -ivh wkhtmltox-0.12.1_linux-centos6-i386.rpm
fi
yum install xorg-x11-server-Xvfb
# Install virtualenv
pip2.7 install virtualenv
cd $WORKSPACE
else
echo "Your system is not supported by this script. This script supports Ubuntu/Debian and CentOS"
echo "Tested under: Ubuntu 12.04, Ubuntu 13.10, Ubuntu 14.04, CentOS 6.3, CentOS 6.5"
exit 1
fi