Last active
December 24, 2016 20:43
-
-
Save abepark01/4e6ef056e2c6ae691f2af3ce72a106b4 to your computer and use it in GitHub Desktop.
Downloads and builds Python 3.5.2 locally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Description: downloads and installs python 3.5.2 locally | |
PYTHON_VERSION=3.5.2 | |
PREFIX=$HOME/.local | |
WORK_DIR=$HOME/src | |
TMP_DIR=$HOME/tmp/python | |
LD_RUN_PATH=$PREFIX/lib | |
SRC_DIR=$WORK_DIR/Python-${PYTHON_VERSION} | |
# Setup folders | |
mkdir -p $PREFIX | |
mkdir -p $WORK_DIR | |
mkdir -p $TMP_DIR | |
# Download the source files | |
if [ ! -d ${SRC_DIR} ] | |
then | |
cd $WORK_DIR | |
wget -q https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | |
tar xvf Python-${PYTHON_VERSION}.tgz | |
fi | |
# Build | |
cd $TMP_DIR | |
${SRC_DIR}/configure \ | |
--enable-shared \ | |
--prefix=${PREFIX} \ | |
LDFLAGS="-W1, -rpath ${LD_RUN_PATH}" | |
make | |
make install | |
# Cleanup | |
if [ ! -z "$TMP_DIR"] | |
then | |
rm -fr $TMP_DIR | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment