forked from pool/python-html2text
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user