diff --git a/python-xhtml2pdf.changes b/python-xhtml2pdf.changes
index 3e1ca03..2b8fa41 100644
--- a/python-xhtml2pdf.changes
+++ b/python-xhtml2pdf.changes
@@ -1,3 +1,11 @@
+-------------------------------------------------------------------
+Fri Dec 15 13:34:51 UTC 2017 - tchvatal@suse.com
+
+- Cleanup a bit
+- Update the requirements to match the upstream recommendations
+- Run the tests
+- Really enable the python3
+
-------------------------------------------------------------------
Tue Dec 14 16:30:32 UTC 2017 - opensuse@dstoecker.de
diff --git a/python-xhtml2pdf.spec b/python-xhtml2pdf.spec
index 194ce1d..6f9ae99 100644
--- a/python-xhtml2pdf.spec
+++ b/python-xhtml2pdf.spec
@@ -17,29 +17,33 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%define skip_python3 1
Name: python-xhtml2pdf
Version: 0.2b
Release: 0
Summary: PDF Generator Using HTML and CSS
License: Apache-2.0
Group: Development/Languages/Python
-Url: https://github.com/xhtml2pdf/
+Url: https://github.com/xhtml2pdf/xhtml2pdf
Source: http://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-%{version}.tar.gz
# PATCH-FIX-OPENSUSE no_optimize.patch - Don't generate .pyo files during build
Patch0: no_optimize.patch
-BuildRequires: %{python_module nose}
+BuildRequires: %{python_module Pillow >= 2.0}
+BuildRequires: %{python_module PyPDF2 >= 1.26}
+BuildRequires: %{python_module html5lib >= 1.0b10}
+BuildRequires: %{python_module httplib2 >= 0.7.6}
+BuildRequires: %{python_module nose >= 1.3.3}
+BuildRequires: %{python_module reportlab >= 3.0}
BuildRequires: %{python_module setuptools}
-BuildRequires: python-devel
+BuildRequires: %{python_module six}
+BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-Pillow
-Requires: python-PyPDF2
-Requires: python-html5lib == 1.0b10
-Requires: python-httplib2
+Requires: python-Pillow >= 2.0
+Requires: python-PyPDF2 >= 1.26
+Requires: python-html5lib >= 1.0b10
+Requires: python-httplib2 >= 0.7.6
Requires: python-reportlab >= 3.0
Requires: python-six
Conflicts: python-pisa
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
@@ -55,18 +59,27 @@ able to generate PDF templates very quickly without learning new technologies.
%prep
%setup -q -n xhtml2pdf-%{version}
%patch0 -p1
+# sed out hardcoded html5lib require
+sed -i \
+ -e 's:==1.0b10::g' \
+ setup.py
+# remove turbogears module (broken)
+rm -rf xhtml2pdf/turbogears.py
%build
%python_build
%install
%python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
+
+%check
+%python_exec setup.py test
%files %python_files
-%defattr(-,root,root,-)
%doc LICENSE.txt README.rst
%{python_sitelib}/*
-%{_bindir}/pisa
-%{_bindir}/xhtml2pdf
+%python3_only %{_bindir}/pisa
+%python3_only %{_bindir}/xhtml2pdf
%changelog