2010-12-21 16:05:53 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-html2text
|
|
|
|
|
#
|
2018-08-13 08:39:20 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-12-21 16:05:53 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
2013-10-24 11:06:39 +00:00
|
|
|
|
2010-12-21 16:05:53 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
|
#
|
|
|
|
|
|
2013-10-24 11:06:39 +00:00
|
|
|
|
2018-08-13 08:39:20 +00:00
|
|
|
#
|
|
|
|
|
%define upname html2text
|
2017-04-19 14:07:51 +00:00
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2018-08-13 08:39:20 +00:00
|
|
|
%bcond_without tests
|
|
|
|
|
Name: python-%{upname}
|
2017-04-19 14:07:51 +00:00
|
|
|
Version: 2016.9.19
|
2011-09-21 09:30:47 +00:00
|
|
|
Release: 0
|
|
|
|
|
Summary: Turn HTML into equivalent Markdown-structured text
|
2018-08-13 08:39:20 +00:00
|
|
|
License: GPL-3.0-only
|
2010-12-21 16:05:53 +00:00
|
|
|
Group: Development/Languages/Python
|
2018-08-13 08:39:20 +00:00
|
|
|
URL: https://github.com/Alir3z4/html2text/
|
|
|
|
|
Source: https://files.pythonhosted.org/packages/source/h/%{upname}/%{upname}-%{version}.tar.gz
|
|
|
|
|
Patch0: remove_unittest2.patch
|
2017-04-19 14:07:51 +00:00
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2018-08-13 08:39:20 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
|
Requires(preun): update-alternatives
|
2017-04-19 14:07:51 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
%python_subpackages
|
2010-12-21 16:05:53 +00:00
|
|
|
|
|
|
|
|
%description
|
2015-04-20 12:59:54 +00:00
|
|
|
html2text is a Python script that converts a page of HTML into clean,
|
|
|
|
|
easy-to-read plain ASCII text. Better yet, that ASCII also happens to
|
|
|
|
|
be valid Markdown (a text-to-HTML format).
|
2010-12-21 16:05:53 +00:00
|
|
|
|
|
|
|
|
%prep
|
2018-08-13 08:39:20 +00:00
|
|
|
%setup -q -n %{upname}-%{version}
|
|
|
|
|
%patch0 -p1
|
2015-04-20 12:59:54 +00:00
|
|
|
# remove useless shebang
|
2018-08-13 08:39:20 +00:00
|
|
|
sed -i '/^#!/d' %{upname}/__init__.py
|
2010-12-21 16:05:53 +00:00
|
|
|
|
|
|
|
|
%build
|
2017-04-19 14:07:51 +00:00
|
|
|
%python_build
|
2010-12-21 16:05:53 +00:00
|
|
|
|
|
|
|
|
%install
|
2017-04-19 14:07:51 +00:00
|
|
|
%python_install
|
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2015-04-20 12:59:54 +00:00
|
|
|
|
2017-04-27 16:34:12 +00:00
|
|
|
# To avoid conflicts with the rst2html5 package
|
2018-08-13 08:39:20 +00:00
|
|
|
mv %{buildroot}%{_bindir}/%{upname} %{buildroot}%{_bindir}/%{upname}-python
|
|
|
|
|
ln -s -f %{_sysconfdir}/alternatives/%{upname} %{buildroot}%{_bindir}/%{upname}
|
|
|
|
|
|
|
|
|
|
# remove executable bits from egg files
|
|
|
|
|
%python_expand chmod -x %{buildroot}%{$python_sitelib}/%{upname}-*.egg-info/*
|
2017-04-19 14:07:51 +00:00
|
|
|
|
|
|
|
|
%post
|
2018-08-13 08:39:20 +00:00
|
|
|
update-alternatives --install %{_bindir}/%{upname} %{upname} %{_bindir}/%{upname}-python 15
|
2017-04-19 14:07:51 +00:00
|
|
|
|
|
|
|
|
%preun
|
2018-08-13 08:39:20 +00:00
|
|
|
if [ ! -f %{_bindir}/%{upname}-python ] ; then
|
|
|
|
|
update-alternatives --remove %{upname} %{_bindir}/%{upname}-python
|
2017-04-27 16:34:12 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
|
%check
|
|
|
|
|
%python_exec setup.py test
|
|
|
|
|
%endif
|
2010-12-21 16:05:53 +00:00
|
|
|
|
2018-08-13 08:39:20 +00:00
|
|
|
%files %{python_files}
|
|
|
|
|
%license COPYING
|
|
|
|
|
%doc README.md AUTHORS.rst ChangeLog.rst
|
|
|
|
|
%python3_only %{_bindir}/%{upname}
|
|
|
|
|
%python3_only %{_bindir}/%{upname}-python
|
|
|
|
|
%python3_only %ghost %{_sysconfdir}/alternatives/%{upname}
|
2011-11-09 19:00:18 +00:00
|
|
|
%{python_sitelib}/*
|
2010-12-21 16:05:53 +00:00
|
|
|
|
|
|
|
|
%changelog
|