From 531d1772e930d345ee1a53cf1d6f3e259630ae82b6fd2012a84d4f9ba2ceba6b Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Thu, 18 Jul 2013 10:09:01 +0000 Subject: [PATCH 1/2] - Use update-alternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=42 --- python-setuptools.changes | 5 +++++ python-setuptools.spec | 23 +++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/python-setuptools.changes b/python-setuptools.changes index 6295612..c74c5f5 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 18 10:11:58 UTC 2013 - speilicke@suse.com + +- Use update-alternatives + ------------------------------------------------------------------- Tue Jun 25 08:57:08 UTC 2013 - speilicke@suse.com diff --git a/python-setuptools.spec b/python-setuptools.spec index d8042e5..f14af75 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -11,7 +11,7 @@ # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -29,6 +29,8 @@ Source2: zpl.txt Patch1: setuptools-0.6c9-create-sitedir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel +Requires(post): update-alternatives +Requires(postun): update-alternatives # NOTE(saschpe): Distribute was merged into 0.7.x, so even though distribute # obsoletes setuptools < 0.6.45, current setuptools obsoletes distribute again Provides: python-distribute = %{version} @@ -54,14 +56,31 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +rm %{buildroot}%{_bindir}/easy_install +ln -s %{_bindir}/easy_install-%{py_ver} %{buildroot}%{_bindir}/easy_install %check python setup.py test +%pre +# Since /usr/bin/easy_install became ghosted to be used with update-alternatives, +# we have to get rid of the old binary: +[[ ! -L %{_bindir}/easy_install ]] && rm -f %{_bindir}/easy_install +exit 0 + +%post +update-alternatives \ + --install %{_bindir}/easy_install easy_install %{_bindir}/easy_install-%{py_ver} 20 + +%preun +if [ $1 -eq 0 ] ; then + update-alternatives --remove easy_install %{_bindir}/easy_install-%{py_ver} +fi + %files %defattr(-,root,root,-) %doc CHANGES.txt README.txt -%{_bindir}/easy_install +%ghost %{_bindir}/easy_install %{_bindir}/easy_install-%{py_ver} %{python_sitelib}/_markerlib %{python_sitelib}/setuptools From 9d1be47f102edb524677aeb8f2e543f7c196b04537185056bb3960589b6ef91f Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Thu, 18 Jul 2013 10:10:23 +0000 Subject: [PATCH 2/2] - Use update-alternatives to be parallel-installable with python3-setuptools OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=43 --- python-setuptools.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-setuptools.changes b/python-setuptools.changes index c74c5f5..daca474 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Thu Jul 18 10:11:58 UTC 2013 - speilicke@suse.com -- Use update-alternatives +- Use update-alternatives to be parallel-installable with python3-setuptools ------------------------------------------------------------------- Tue Jun 25 08:57:08 UTC 2013 - speilicke@suse.com