From 1910c611c564ed0618b20105b341790f4f9db1730b67e221556b1d7ddf2e2dc3 Mon Sep 17 00:00:00 2001 From: Todd R Date: Thu, 27 Apr 2017 16:34:12 +0000 Subject: [PATCH] Accepting request 491648 from home:TheBlackCat:branches:devel:languages:python - Implement update-alternatives to avoid conflict with html2text package. OBS-URL: https://build.opensuse.org/request/show/491648 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html2text?expand=0&rev=22 --- python-html2text.changes | 6 ++++++ python-html2text.spec | 23 +++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/python-html2text.changes b/python-html2text.changes index 01de2bb..917b3ab 100644 --- a/python-html2text.changes +++ b/python-html2text.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 27 16:33:29 UTC 2017 - toddrme2178@gmail.com + +- Implement update-alternatives to avoid conflict with html2text + package. + ------------------------------------------------------------------- Wed Apr 12 19:18:13 UTC 2017 - toddrme2178@gmail.com diff --git a/python-html2text.spec b/python-html2text.spec index 00354ff..748456e 100644 --- a/python-html2text.spec +++ b/python-html2text.spec @@ -56,23 +56,30 @@ sed -i '/^#!/d' html2text/__init__.py %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} -%python_clone -a %{buildroot}%{_bindir}/html2text + +# To avoid conflicts with the rst2html5 package +mv %{buildroot}%{_bindir}/html2text %{buildroot}%{_bindir}/html2text-python +ln -s -f %{_sysconfdir}/alternatives/html2text %{buildroot}%{_bindir}/html2text + +%post +update-alternatives --install %{_bindir}/html2text html2text %{_bindir}/html2text-python 15 + +%preun +if [ ! -f %{_bindir}/html2text-python ] ; then + update-alternatives --remove html2text %{_bindir}/html2text-python +fi %if %{with tests} %check %python_exec setup.py test %endif -%post -%python_install_alternative html2text - -%preun -%python_uninstall_alternative html2text - %files %python_files %defattr(-,root,root,-) %doc COPYING README.md AUTHORS.rst ChangeLog.rst -%python_alternative %{_bindir}/html2text +%python3_only %{_bindir}/html2text +%python3_only %{_bindir}/html2text-python +%python3_only %ghost %{_sysconfdir}/alternatives/html2text %{python_sitelib}/* %changelog