You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
907 B

  1. #!/bin/bash
  2. set -eux # -x for verbose logging to juju debug-log
  3. VERSION="2.7.5"
  4. ##
  5. ## INSTALL Python
  6. ##
  7. apt-get install wget bzip2 build-essential -y --force-yes
  8. apt-get install libreadline-dev libbz2-dev libz-dev libssl-dev libsqlite3-dev libgdbm-dev libldap2-dev -y --force-yes
  9. cd /tmp
  10. wget http://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.bz2
  11. tar xjf Python-$VERSION.tar.bz2
  12. cd Python-$VERSION
  13. ./configure --prefix=/opt/apps/python-$VERSION
  14. make
  15. make install
  16. ##
  17. ## INSTALL DISTRIBUTE/PIP/VIRTUALENV
  18. ##
  19. PYTHON_BASE="/opt/apps/python-$VERSION"
  20. PYTHON_BIN="$PYTHON_BASE/bin"
  21. cd /tmp
  22. wget http://python-distribute.org/distribute_setup.py
  23. "$PYTHON_BIN"/python ./distribute_setup.py
  24. "$PYTHON_BIN"/easy_install pip
  25. "$PYTHON_BIN"/pip install virtualenv
  26. ##
  27. ## MAKE A DEFAULT VIRTUAL ENV
  28. ##
  29. cd /srv
  30. mkdir -p /srv/virtualenv
  31. $PYTHON_BIN/virtualenv /srv/virtualenv/default --no-site-packages