2010-12-21 16:05:53 +00:00
|
|
|
#
|
2024-03-19 07:01:53 +00:00
|
|
|
# spec file for package python-html2text
|
2010-12-21 16:05:53 +00:00
|
|
|
#
|
2024-03-19 07:01:53 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
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
|
|
|
|
2018-12-04 13:32:16 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-12-21 16:05:53 +00:00
|
|
|
#
|
|
|
|
|
|
2013-10-24 11:06:39 +00:00
|
|
|
|
2018-08-13 08:39:20 +00:00
|
|
|
%define upname html2text
|
2019-12-16 12:43:11 +00:00
|
|
|
%define skip_python2 1
|
2023-06-21 17:27:29 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2018-08-13 08:39:20 +00:00
|
|
|
Name: python-%{upname}
|
2024-03-19 07:01:53 +00:00
|
|
|
Version: 2024.2.26
|
2011-09-21 09:30:47 +00:00
|
|
|
Release: 0
|
2018-08-16 10:36:47 +00:00
|
|
|
Summary: Python script for turning HTML into Markdown 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
|
2019-09-12 08:55:43 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2017-04-19 14:07:51 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2018-08-13 08:39:20 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
|
Requires(post): update-alternatives
|
2024-03-19 07:01:53 +00:00
|
|
|
Requires(preun): update-alternatives
|
2021-10-07 15:36:20 +00:00
|
|
|
Provides: html2text = %{version}-%{release}
|
|
|
|
|
Obsoletes: html2text < %{version}-%{release}
|
2017-04-19 14:07:51 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
%python_subpackages
|
2010-12-21 16:05:53 +00:00
|
|
|
|
|
|
|
|
%description
|
2018-08-16 10:36:47 +00:00
|
|
|
html2text is a Python script that converts a page of HTML into
|
|
|
|
|
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}
|
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
|
|
|
|
2020-08-20 07:27:17 +00:00
|
|
|
# remove executable bits from egg files
|
|
|
|
|
rm -r *.egg-info/
|
|
|
|
|
|
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
|
|
|
|
2018-08-13 11:48:24 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/%{upname}
|
2018-08-13 08:39:20 +00:00
|
|
|
|
2017-04-19 14:07:51 +00:00
|
|
|
%post
|
2018-08-13 11:48:24 +00:00
|
|
|
%python_install_alternative html2text
|
2017-04-19 14:07:51 +00:00
|
|
|
|
2018-08-13 11:48:24 +00:00
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative html2text
|
2017-04-27 16:34:12 +00:00
|
|
|
|
|
|
|
|
%check
|
2019-12-16 12:43:11 +00:00
|
|
|
# otherwise python 3.6 does not automatically select UTF-8 for console output
|
|
|
|
|
export LANG=en_US.UTF-8
|
2019-09-12 08:55:43 +00:00
|
|
|
%pytest
|
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
|
2018-08-13 11:48:24 +00:00
|
|
|
%python_alternative %{_bindir}/%{upname}
|
2011-11-09 19:00:18 +00:00
|
|
|
%{python_sitelib}/*
|
2020-08-20 07:27:17 +00:00
|
|
|
%{python_sitelib}/*.egg-info/
|
2010-12-21 16:05:53 +00:00
|
|
|
|
|
|
|
|
%changelog
|