# distribute doesn't allow itself to be replaced by setuptools
# so we manually have to delete it
# (pip actually can uninstall setuptools but we may not have pip
# install yet)
rm -rf "$SAGE_LOCAL"/lib/python*/site-packages/setuptools*
rm -rf "$SAGE_LOCAL"/lib/python*/site-packages/distribute*

export PYTHON_EGG_CACHE="$DOT_SAGE/.python-eggs"

cd src

# Prevent setuptools from installing itself with easy_install
for vers in 2 3; do
    python${vers} setup.py --no-user-cfg install \
            --single-version-externally-managed --root="$SAGE_DESTDIR" || \
        sdh_die "Error building / installing setuptools for Python ${vers}"
done
