-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·85 lines (63 loc) · 2.29 KB
/
setup.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
83
84
85
#!/bin/bash
#########################################################
# utility functions
#########################################################
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
log_dir=`pwd`
# logging function
log() {
echo -e "[$(date)] [$BASH_SOURCE: $BASH_LINENO] : $*"
echo -e "[$(date)] [$BASH_SOURCE: $BASH_LINENO] : $*" >> $log_dir/setup.log
}
#########################################################
# BEGIN
#########################################################
log "BEGIN setup.sh"
#########################################################
# Install yum tools
#########################################################
log "Install needed yum tools"
yum groupinstall -y 'development tools'
log "dev tools install ?"
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel xz-libs wget libffi-devel cyrus-sasl-devel epel-release
yum install -y python-pip
#########################################################
# Install isolated version of python v. 3.6.9
#########################################################
log "Install python3.6 from source"
# create directory
mkdir -p /usr/local/downloads
# change to dir
cd /usr/local/downloads
# download source
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
# unzip and untar this file:
xz -d Python-3.6.9.tar.xz
tar -xvf Python-3.6.9.tar
# change dir
cd Python-3.6.9
# build from source and install
./configure --prefix=/usr/local
# If you want a release build with all stable optimizations active (PGO, etc),
# please run ./configure --enable-optimizations
make
make altinstall
#########################################################
# Update pip
#########################################################
log "upgrade pip"
pip install --upgrade pip
#########################################################
# Update PATH and re-initialize
#########################################################
log "Update PATH"
sed -i '/^PATH=/ s/$/:\/usr\/local\/bin/' ~/.bash_profile
#log "source bash_profile"
source ~/.bash_profile
# make path visible
. ~/.bash_profile
#########################################################
#########################################################
# end
#########################################################
#########################################################