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