Terry.Li-彬

虚其心,可解天下之问;专其心,可治天下之学;静其心,可悟天下之理;恒其心,可成天下之业。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  143 随笔 :: 344 文章 :: 130 评论 :: 0 Trackbacks
https://github.com/fly2wind/TSShellScript

#!/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

# Additional
sed -i '/export PATH=/a\export PATH=$PATH:\/opt\/environment\/python\/2.7.3\/bin' /etc/profile


posted on 2013-01-09 15:00 礼物 阅读(852) 评论(0)  编辑  收藏 所属分类: Linux