15
0

Accepting request 489324 from home:TheBlackCat:branches:devel:languages:python

- update to version 2016.9.19.
- Implement single-spec version.

OBS-URL: https://build.opensuse.org/request/show/489324
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html2text?expand=0&rev=21
This commit is contained in:
Todd R
2017-04-19 14:07:51 +00:00
committed by Git OBS Bridge
parent 653f5bbb51
commit d52fcd3006
4 changed files with 62 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-html2text
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,23 +16,29 @@
#
%bcond_without tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-html2text
Version: 2015.11.4
Version: 2016.9.19
Release: 0
Url: https://github.com/Alir3z4/html2text/
Summary: Turn HTML into equivalent Markdown-structured text
License: GPL-3.0
Group: Development/Languages/Python
Source: https://pypi.python.org/packages/source/h/html2text/html2text-%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/h/html2text/html2text-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: python-unittest2
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
%if %{with tests}
BuildRequires: python2-unittest2
%endif
Requires(post): update-alternatives
Requires(preun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
html2text is a Python script that converts a page of HTML into clean,
@@ -45,19 +51,28 @@ be valid Markdown (a text-to-HTML format).
sed -i '/^#!/d' html2text/__init__.py
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
mv %{buildroot}%{_bindir}/html2text %{buildroot}%{_bindir}/html2text-python%{py_ver}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/html2text
%if %{with tests}
%check
python setup.py test
%python_exec setup.py test
%endif
%files
%post
%python_install_alternative html2text
%preun
%python_uninstall_alternative html2text
%files %python_files
%defattr(-,root,root,-)
%doc COPYING README.md AUTHORS.rst ChangeLog.rst
%{_bindir}/html2text-python%{py_ver}
%python_alternative %{_bindir}/html2text
%{python_sitelib}/*
%changelog