python2.sh 808 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. PY2_ROOT=$IROOT/py2
  3. RETCODE=$(fw_exists ${PY2_ROOT}.installed)
  4. [ ! "$RETCODE" == 0 ] || { \
  5. source $PY2_ROOT.installed
  6. return 0; }
  7. fw_get http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
  8. fw_untar Python-2.7.9.tgz
  9. cd Python-2.7.9
  10. ./configure --prefix=${IROOT}/py2 --disable-shared --quiet
  11. make -j4 --quiet 2>&1 | tee $IROOT/python-install.log | awk '{ if (NR%100 == 0) printf "."}'
  12. make install --quiet 2>&1 | tee -a $IROOT/python-install.log | awk '{ if (NR%100 == 0) printf "."}'
  13. cd ..
  14. $PY2_ROOT/bin/python -m ensurepip -U
  15. $PY2_ROOT/bin/pip install -U setuptools pip
  16. echo "export PY2_ROOT=${PY2_ROOT}" > $PY2_ROOT.installed
  17. echo "export PYTHONHOME=${PY2_ROOT}" >> $PY2_ROOT.installed
  18. echo -e "export PATH=${PY2_ROOT}/bin:\$PATH" >> $PY2_ROOT.installed
  19. source $PY2_ROOT.installed