15
0

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
This commit is contained in:
Todd R
2017-04-27 16:34:12 +00:00
committed by Git OBS Bridge
parent d52fcd3006
commit 1910c611c5
2 changed files with 21 additions and 8 deletions

View File

@@ -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