require_distro() { if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then { echo colorize 1 "WARNING" echo ": The binary distribution of PyPy is built for $1." echo "installed binary may not run expectedly on other platforms." echo } >&2 return 1 fi } case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true install_package "pypy-2.0.1" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.0.1-linux.tar.bz2#8d11952e0356ea751321e7d2a1d4f17a" "pypy" verify_py27 ;; "linux64" ) require_distro "Ubuntu 12.04" || true install_package "pypy-2.0.1" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.0.1-linux64.tar.bz2#5c11d727579443d0834caadb4dfe53e3" "pypy" verify_py27 ;; "osx64" ) install_package "pypy-2.0.1" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.0.1-linux.tar.bz2#e666450bcfbd936b016a2dd7312f9853" "pypy" verify_py27 ;; "win32" ) # FIXME: never tested on Windows install_zip "pypy-2.0.1" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.0.1-win32.zip#4c40b19ea1ec5c8c8c2a1f94f59bdf02" "pypy" verify_py27 ;; * ) { echo colorize 1 "ERROR" echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)." echo "try 'pypy-2.0.1-src' to build from soruce." echo } >&2 exit 1 ;; esac install_package "setuptools-3.6" "https://pypi.python.org/packages/source/s/setuptools/setuptools-3.6.tar.gz#8f3a1dcdc14313c8334eb6af4f66ea0a" python install_package "pip-1.5.6" "https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#01026f87978932060cc86c1dc527903e" python