From c5743255a6becb50d15a41f7ce1e878e60b1b7140c07d1a22811403f3423d4e7 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 12 Apr 2016 11:20:48 +0000 Subject: [PATCH] Accepting request 387867 from home:anubisg1:branches:devel:languages:python created update alternatives. Please forward to factory and add into Staging:adi:36 so that SR #380661 can be finally unlocked OBS-URL: https://build.opensuse.org/request/show/387867 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-websocket-client?expand=0&rev=14 --- python-websocket-client.changes | 5 +++++ python-websocket-client.spec | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/python-websocket-client.changes b/python-websocket-client.changes index f4efd68..1d3f286 100644 --- a/python-websocket-client.changes +++ b/python-websocket-client.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 12 07:57:30 UTC 2016 - andrea@opensuse.org + +- added update-alternatives to allow the python3 version to be installed + ------------------------------------------------------------------- Wed Oct 21 16:56:55 UTC 2015 - dmueller@suse.com diff --git a/python-websocket-client.spec b/python-websocket-client.spec index 6973d68..b7dabc7 100644 --- a/python-websocket-client.spec +++ b/python-websocket-client.spec @@ -37,6 +37,8 @@ BuildRequires: python-six Requires: %backports Requires: python Requires: python-six +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} && 0%{?suse_version} <= 1110 BuildRequires: python-argparse @@ -70,19 +72,36 @@ python setup.py build python setup.py install --prefix=%{_prefix} --root=%{buildroot} # Use the system certs rm %{buildroot}/%{python_sitelib}/websocket/cacert.pem +# update alternatives +mv %{buildroot}%{_bindir}/wsdump.py %{buildroot}%{_bindir}/wsdump.py-%{py_ver} +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/wsdump.py +ln -sf %{_sysconfdir}/alternatives/wsdump.py %{buildroot}/%{_bindir}/wsdump.py %check python websocket/tests/test_websocket.py +%post +update-alternatives \ + --install %{_bindir}/wsdump.py wsdump.py %{_bindir}/wsdump.py-%{py_ver} 20 + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove wsdump.py %{_bindir}/wsdump.py-%{py_ver} +fi + + %files %defattr(-,root,root,-) %doc LICENSE README.rst %dir %{python_sitelib}/websocket %dir %{python_sitelib}/websocket_client-%{version}-py*.egg-info %{_bindir}/wsdump.py +%{_bindir}/wsdump.py-%{py_ver} %exclude %{python_sitelib}/websocket/tests/ %{python_sitelib}/websocket/* %{python_sitelib}/*egg-info/* +%ghost %{_sysconfdir}/alternatives/wsdump.py %files test %defattr(-,root,root,-)