python2.sh 823 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. RETCODE=$(fw_exists ${IROOT}/py2.installed)
  3. [ ! "$RETCODE" == 0 ] || { \
  4. source $IROOT/py2.installed
  5. return 0; }
  6. PY2_ROOT=$IROOT/py2
  7. fw_get -O http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
  8. fw_untar Python-2.7.10.tgz
  9. cd Python-2.7.10
  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}" > $IROOT/py2.installed
  17. echo -e "export PYTHONHOME=\$PY2_ROOT" >> $IROOT/py2.installed
  18. echo -e "export PATH=\$PY2_ROOT/bin:\$PATH" >> $IROOT/py2.installed
  19. source $IROOT/py2.installed