diff --git a/python-virtualenv.changes b/python-virtualenv.changes index 278c691..7ea2be6 100644 --- a/python-virtualenv.changes +++ b/python-virtualenv.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 29 14:39:38 UTC 2013 - speilicke@suse.com + +- Use update-alternatives for parallel-installability with Python3 version + ------------------------------------------------------------------- Mon Jul 29 14:29:55 UTC 2013 - speilicke@suse.com diff --git a/python-virtualenv.spec b/python-virtualenv.spec index 9a02f2d..c56641b 100644 --- a/python-virtualenv.spec +++ b/python-virtualenv.spec @@ -30,6 +30,8 @@ BuildRequires: python-devel BuildRequires: python-Sphinx Requires: python-pip Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %else @@ -64,15 +66,31 @@ rm virtualenv_support/*.gz # Remove in-tree libraries that are available as pac %build python setup.py build -python setup.py build_sphinx +python setup.py build_sphinx && rm build/sphinx/html/.buildinfo %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%pre +# Since /usr/bin/virtualenv became ghosted to be used with update-alternatives, we have to +# get rid of the old binary resulting from the non-update-alternativies-ified package: +[[ ! -L %{_bindir}/virtualenv ]] && rm -f %{_bindir}/virtualenv +exit 0 + +%post +update-alternatives \ + --install %{_bindir}/virtualenv virtualenv %{_bindir}/virtualenv-%{py_ver} 20 + +%preun +if [ $1 -eq 0 ] ; then + update-alternatives --remove virtualenv %{_bindir}/virtualenv-%{py_ver} +fi + %files %defattr(-,root,root,-) %doc LICENSE.txt README.rst build/sphinx/html -%{_bindir}/virtualenv* +%ghost %{_bindir}/virtualenv +%{_bindir}/virtualenv-%{py_ver} %{python_sitelib}/virtualenv* %changelog