From d160e3050b3e46fdbb9b5244c882eac490afec87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 29 May 2016 09:46:13 +0200 Subject: [PATCH] - fixed bogus version test and removed unnecessary dep - rel 5 --- python-pisa.spec | 5 +++-- reportlab3.patch | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 reportlab3.patch diff --git a/python-pisa.spec b/python-pisa.spec index e1ac508..2d5f013 100644 --- a/python-pisa.spec +++ b/python-pisa.spec @@ -3,11 +3,12 @@ Summary: HTML/XML/CSS to PDF converter using the ReportLab toolkit Summary(pl.UTF-8): Konwerter formatów HTML/XML/CSS do PDF korzystający z narzędzi ReportLab Name: python-%{module} Version: 3.0.33 -Release: 4 +Release: 5 License: Apache v2.0 Group: Libraries/Python Source0: http://pypi.python.org/packages/source/p/pisa/%{module}-%{version}.tar.gz # Source0-md5: e2040b12211303d065bc4ae2470d2700 +Patch0: reportlab3.patch URL: http://www.xhtml2pdf.com/ BuildRequires: python-devel >= 1:2.5 BuildRequires: python-html5lib @@ -16,7 +17,6 @@ BuildRequires: rpmbuild(macros) >= 1.710 BuildRequires: sed >= 4.0 Requires: python Requires: python-PIL -Requires: python-ReportLab < 3.0 Requires: python-ReportLab >= 2.2 Requires: python-html5lib Requires: python-pyPdf @@ -32,6 +32,7 @@ ReportLab. %prep %setup -q -n %{module}-%{version} +%patch0 -p1 %build %py_build diff --git a/reportlab3.patch b/reportlab3.patch new file mode 100644 index 0000000..bbcccf6 --- /dev/null +++ b/reportlab3.patch @@ -0,0 +1,15 @@ +--- pisa-3.0.33/sx/pisa3/pisa_util.py~ 2010-06-16 15:43:35.000000000 +0200 ++++ pisa-3.0.33/sx/pisa3/pisa_util.py 2016-05-29 09:40:20.286049651 +0200 +@@ -51,10 +51,10 @@ + + rgb_re = re.compile("^.*?rgb[(]([0-9]+).*?([0-9]+).*?([0-9]+)[)].*?[ ]*$") + +-if not(reportlab.Version[0] == "2" and reportlab.Version[2] >= "1"): ++if not(reportlab.Version[0] == "3" or (reportlab.Version[0] == "2" and reportlab.Version[2] >= "1")): + raise ImportError("Reportlab Version 2.1+ is needed!") + +-REPORTLAB22 = (reportlab.Version[0] == "2" and reportlab.Version[2] >= "2") ++REPORTLAB22 = (reportlab.Version[0] == "3" or (reportlab.Version[0] == "2" and reportlab.Version[2] >= "2")) + # print "***", reportlab.Version, REPORTLAB22, reportlab.__file__ + + import logging -- 2.44.0