-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild_python.sh
More file actions
52 lines (40 loc) · 1.49 KB
/
build_python.sh
File metadata and controls
52 lines (40 loc) · 1.49 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
#!/bin/sh
########################################################################################
#
# Install JDK Script
#
# Shawn Ma
#
########################################################################################
# Define
TARGET=Python-2.7.3.tar.bz2
SOURCE=http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
# Create a build directory
mkdir -p /opt/install/python && cd /opt/install/python
# Prepare for compilation source
curl -o $TARGET $SOURCE
mkdir -p tmp && tar -xvf $TARGET -C tmp
# Install build dependencies
yum install -y gcc gcc-c++ make cmake autoconf automake
yum install -y ncurses-devel openssl-devel readline-devel
# Create a User Group
# Compile and deploy
mv tmp/* source && cd source
./configure \
--prefix=/opt/environment/python/2.7.3
make
make install
cd ..
curl -O http://python-distribute.org/distribute_setup.py
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
/opt/environment/python/2.7.3/bin/python2.7 distribute_setup.py
/opt/environment/python/2.7.3/bin/python2.7 get-pip.py
# Postinstallation setup
export PATH=$PATH:/opt/environment/python/2.7.3/bin
# Configuration
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install -y mysql-devel --enablerepo=remi
/opt/environment/python/2.7.3/bin/pip install MySQL-python tornado torndb
# Additional
#sed -i '/export PATH=/a\export PATH=$PATH:\/opt\/environment\/python\/2.7.3\/bin' /etc/profile