summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--python-html2text.spec67
-rw-r--r--sources2
3 files changed, 57 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 4bad3b0..4476808 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1 @@
-html2text-2.38.py
-/python-html2text-3.02.tar.gz
-/aaronsw-html2text-3.02-77-gc368b14.tar.gz
+3.200.3.1.tar.gz
diff --git a/python-html2text.spec b/python-html2text.spec
index 88694c0..8e2c2e5 100644
--- a/python-html2text.spec
+++ b/python-html2text.spec
@@ -1,24 +1,40 @@
-# sitelib for noarch packages, sitearch for others (remove the unneeded one)
+# %bcond is not available on
+%if 0%{?rhel} > 0 && 0%{?rhel} <= 6
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%endif
-%global tardirname aaronsw-html2text-c368b14
+%bcond_without python3
-Name: python-html2text
-Version: 3.200.3
-Release: 3%{?dist}
+%global upstream_name html2text
+
+%if %{with python3}
+%global __python3 /usr/bin/python3
+%{!?python3_sitelib: %define python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%endif
+
+
+
+Name: python-%{upstream_name}
+Version: 3.200.3.1
+Release: 1%{?dist}
Summary: Converts a page of HTML into clean, easy-to-read plain ASCII text
Group: Development/Languages
License: GPLv3
URL: http://www.aaronsw.com/2002/html2text/
#Source0: https://github.com/aaronsw/html2text/tarball/%{version}/%{name}-%{version}.tar.gz
-Source0: aaronsw-html2text-3.02-77-gc368b14.tar.gz
+Source0: https://github.com/mcepl/html2text/archive/%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-
BuildRequires: python
-BuildRequires: python-setuptools-devel
+%if 0%{?rhel} > 0 && 0%{?rhel} <= 6
+BuildRequires: python-unittest2
+%endif
+%if %{with python3}
+BuildRequires: python3
+%endif
+
%description
html2text is a Python script that convers a page of HTML into clean,
@@ -27,8 +43,18 @@ be valid Markdown (a text-to-HTML format).
Also known as: THE ASCIINATOR, html to text, htm to txt, htm2txt, ...
+%if %{with python3}
+%package -n python3-html2text
+Summary: Python3 version of %{name}
+Group: Development/Libraries
+
+%description -n python3-html2text
+python3 version of the %{name}.
+%endif
+
+
%prep
-%setup -q -n %{tardirname}
+%setup -q -n %{upstream_name}-%{version}
%build
@@ -37,13 +63,21 @@ echo Nothing to build
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install --root $RPM_BUILD_ROOT
+%{__python} setup.py install --root $RPM_BUILD_ROOT
+
+%if %{with python3}
+%{__python3} setup.py install --root $RPM_BUILD_ROOT
+%endif
+
# TODO: conflicts with package' html2text' obviously
rm $RPM_BUILD_ROOT/usr/bin/html2text
+
%check
-cd test
-PYTHONPATH=${RPM_BUILD_ROOT}%{python_sitelib} %{__python} run_tests.py
+PYTHONPATH=${RPM_BUILD_ROOT}%{python_sitelib} %{__python} test/test_html2text.py -v
+%if %{with python3}
+PYTHONPATH=${RPM_BUILD_ROOT}%{python3_sitelib} %{__python3} test/test_html2text.py -v
+%endif
%clean
@@ -55,8 +89,17 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/*
%doc COPYING
+%if %{with python3}
+%files -n python3-html2text
+%defattr(-,root,root,-)
+%{python3_sitelib}/*
+%endif
+
%changelog
+* Thu Mar 14 2013 Matěj Cepl <mcepl@redhat.com> - 3.200.3.1-1
+- New upstream experimental package supporting python3 fully.
+
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.200.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
diff --git a/sources b/sources
index 7c8eba3..b1ee834 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-5aab989207988e8ec1ebbf43ed1d84a4 aaronsw-html2text-3.02-77-gc368b14.tar.gz
+73f7ddedddd82b0296df3b198fa61a8e 3.200.3.1.tar.gz