diff --git a/python2-setuptools.changes b/python2-setuptools.changes index 9c78ec1..ce377d0 100644 --- a/python2-setuptools.changes +++ b/python2-setuptools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 7 08:39:25 UTC 2020 - Tomáš Chvátal + +- Provide easy-install with update-alternatives code to not conflict + with python3 variant + ------------------------------------------------------------------- Mon Apr 6 17:12:04 UTC 2020 - Matej Cepl diff --git a/python2-setuptools.spec b/python2-setuptools.spec index 2243ff8..bc7a4f4 100644 --- a/python2-setuptools.spec +++ b/python2-setuptools.spec @@ -26,15 +26,18 @@ Source: https://files.pythonhosted.org/packages/source/s/setuptools/setu Patch0: sort-for-reproducibility.patch Patch1: importlib.patch BuildRequires: fdupes +BuildRequires: python-rpm-macros BuildRequires: python2-base BuildRequires: unzip -Requires: python2-base -BuildArch: noarch # The dependency download feature may require SSL, which is in python3-base and python(2) -Requires: python +Requires: python2 +Requires: python2-base +Requires(post): update-alternatives +Requires(postun): update-alternatives Recommends: ca-certificates-mozilla Provides: python-distribute = %{version} Obsoletes: python-distribute < %{version} +BuildArch: noarch %description setuptools is a collection of enhancements to the Python distutils that @@ -50,16 +53,23 @@ sed -r -i '1s@^#!/.*$@@' setuptools/command/easy_install.py \ pkg_resources/_vendor/appdirs.py %build -python2 setup.py build '--executable=%{_bindir}/python2 -s' +%python2_build %install -python2 setup.py install -O1 --skip-build --force --root %{buildroot} --prefix %{_prefix} +%python2_install +%prepare_alternative easy_install %fdupes %{buildroot}%{python2_sitelib} +%post +%python_install_alternative easy_install + +%postun +%python_uninstall_alternative easy_install + %files %license LICENSE %doc CHANGES.rst README.rst -%{_bindir}/easy_install* +%python_alternative %{_bindir}/easy_install %{python2_sitelib}/setuptools %{python2_sitelib}/setuptools-%{version}-py*.egg-info %{python2_sitelib}/easy_install.py*