diff --git a/0fbf25e4857423f6a38ca7f5aeee1c84acaa3fc1.patch b/0fbf25e4857423f6a38ca7f5aeee1c84acaa3fc1.patch deleted file mode 100644 index 0170e447e661d46101813e27d68add41d6ee3ed6..0000000000000000000000000000000000000000 --- a/0fbf25e4857423f6a38ca7f5aeee1c84acaa3fc1.patch +++ /dev/null @@ -1,19 +0,0 @@ -# HG changeset patch -# User robin -# Date 1495525707 -3600 -# Node ID 0fbf25e4857423f6a38ca7f5aeee1c84acaa3fc1 -# Parent 0f6004ec2916b76cfbd0444de6f551bcb1949781 -fix bitbucket issue 113 - -diff --git a/setup.py b/setup.py ---- a/setup.py -+++ b/setup.py -@@ -539,7 +539,7 @@ - ], - - #this probably only works for setuptools, but distutils seems to ignore it -- install_requires=['pillow>=2.4.0','pip>=1.4.1', 'setuptools>=2.2'], -+ install_requires=['pillow>=2.4.0'], - ) - print() - print('########## SUMMARY INFO #########') diff --git a/CVE-2019-17626.patch b/CVE-2019-17626.patch deleted file mode 100644 index 590e1c3d97810008a5c1b1db25cf6d091fc69557..0000000000000000000000000000000000000000 --- a/CVE-2019-17626.patch +++ /dev/null @@ -1,81 +0,0 @@ -# HG changeset patch -# User mkasik@redhat.com -# Date 1580132768 -3600 -# Mon Jan 27 14:46:08 2020 +0100 -# Node ID b47055e78d8b3e49e7bb5b9cdaa55d449b996764 -# Parent 9bb6ebf1b8473e3dc11740cbdce0d5dc1a1afae2 -Parse input string of toColor.__call__ for color classes - -It constructs respective object from the string then. -This currently supports CMYKColor, PCMYKColor, CMYKColorSep -and PCMYKColorSep. - ---- a/src/reportlab/lib/colors.py -+++ b/src/reportlab/lib/colors.py -@@ -833,6 +833,53 @@ class cssParse: - - cssParse=cssParse() - -+def parseColorClassFromString(arg): -+ '''Parses known classes which holds color information from string -+ and constructs respective object. -+ It constructs CMYKColor, PCMYKColor, CMYKColorSep and PCMYKColorSep now. -+ ''' -+ -+ # Strips input string and splits it with {'(', ')', ','} delimiters -+ splitted = "".join(arg.split()).replace('(', ',').replace(')','').split(',') -+ -+ # Creates a "fingerprint" of given string made of {'(', ')', ','} characters only. -+ fingerprint = ''.join(c for c in arg if c in set('(,)')) -+ -+ if (len(splitted) > 0): -+ if (splitted[0] == 'Color'): -+ if (fingerprint == '(,,,)'): -+ try: -+ return Color(*list(map(float, splitted[1:5]))) -+ except: -+ return None -+ elif (fingerprint == '(,,)'): -+ try: -+ return Color(*list(map(float, splitted[1:4]))) -+ except: -+ return None -+ elif (splitted[0] == 'CMYKColor' and fingerprint == '(,,,)'): -+ try: -+ return CMYKColor(*list(map(float, splitted[1:5]))) -+ except: -+ return None -+ elif (splitted[0] == 'PCMYKColor' and fingerprint == '(,,,)'): -+ try: -+ return PCMYKColor(*list(map(float, splitted[1:5]))) -+ except: -+ return None -+ elif (splitted[0] == 'CMYKColorSep' and fingerprint == '(,,,)'): -+ try: -+ return CMYKColorSep(*list(map(float, splitted[1:5]))) -+ except: -+ return None -+ elif (splitted[0] == 'PCMYKColorSep' and fingerprint == '(,,,)'): -+ try: -+ return PCMYKColorSep(*list(map(float, splitted[1:5]))) -+ except: -+ return None -+ else: -+ return None -+ - class toColor: - - def __init__(self): -@@ -858,10 +905,8 @@ class toColor: - C = getAllNamedColors() - s = arg.lower() - if s in C: return C[s] -- try: -- return toColor(eval(arg)) -- except: -- pass -+ parsedColor = parseColorClassFromString(arg) -+ if (parsedColor): return parsedColor - - try: - return HexColor(arg) diff --git a/fix_cannot_import_error.patch b/fix_cannot_import_error.patch deleted file mode 100644 index 6272d178b0d36ff5e7acba77353ba8ec741d4ccd..0000000000000000000000000000000000000000 --- a/fix_cannot_import_error.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur reportlab-3.4.0/src/reportlab/lib/utils.py ../reportlab-3.4.0/src/reportlab/lib/utils.py ---- reportlab-3.4.0/src/reportlab/lib/utils.py 2017-03-07 18:17:00.000000000 +0800 -+++ reportlab-3.4.0/src/reportlab/lib/utils.py 2022-01-12 16:37:55.914924400 +0800 -@@ -5,7 +5,7 @@ - __doc__='''Gazillions of miscellaneous internal utility functions''' - - import os, sys, imp, time, types --from base64 import decodestring as base64_decodestring, encodestring as base64_encodestring -+from base64 import decodebytes as base64_decodestring, encodebytes as base64_encodestring - from reportlab import isPy3 - from reportlab.lib.logger import warnOnce - from reportlab.lib.rltempfile import get_rl_tempfile, get_rl_tempdir, _rl_getuid diff --git a/python-reportlab.spec b/python-reportlab.spec index f274bfb2f7679a65cf4a41875ee4305bc270c3f8..1aaa83577a7be314c6eb7e18a6c855fca101e16d 100644 --- a/python-reportlab.spec +++ b/python-reportlab.spec @@ -1,15 +1,15 @@ %global cmapdir %(echo `rpm -qls ghostscript | grep CMap | awk '{print $2}'`) + +%bcond_without tests Name: python-reportlab -Version: 3.4.0 -Release: 14 +Version: 3.6.10 +Release: 1 Summary: ReportLab library to create PDF documents and graphic License: BSD URL: https://www.reportlab.com/ Source0: https://pypi.python.org/packages/source/r/reportlab/reportlab-%{version}.tar.gz -Patch0001: 0fbf25e4857423f6a38ca7f5aeee1c84acaa3fc1.patch -Patch0002: CVE-2019-17626.patch -Patch0003: fix_cannot_import_error.patch +BuildRequires: libart_lgpl-devel freetype-devel %description The ReportLab Toolkit. An Open Source Python library for generating PDFs and graphics. @@ -41,16 +41,27 @@ find src -name '*.py' | xargs sed -i -e '/^#!\//d' sed -i '/\~\/\.local\/share\/fonts\/CMap/i''\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ '\'"%{cmapdir}"\''\,' \ src/reportlab/rl_settings.py -%build -CFLAGS="%{optflags}" %py3_build +rm -rf src/reportlab.egg-info + +rm -rf src/rl_addons/renderPM/libart_lgpl -PYTHONPATH="`pwd`/`ls -d build/lib*`" %{__python3} docs/genAll.py +%build +CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS} -Isrc/rl_addons/renderPM -I%{_includedir}/libart-2.0}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\ + %{__python3} setup.py --use-system-libart --no-download-t1-files build --executable="%{__python3} -s" %install -%py3_install +CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS} -Isrc/rl_addons/renderPM -I%{_includedir}/libart-2.0}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\ + %{__python3} setup.py --use-system-libart --no-download-t1-files install -O1 --skip-build --root ${RPM_BUILD_ROOT} +%if %{with tests} %check +# Tests need in-build compiled Python modules to be executed +# Tests pre-generate userguide PDF +cp -a build/lib.%{python3_platform}-%{python3_version}/reportlab tests/ +cp -a build/lib.%{python3_platform}-%{python3_version}/reportlab docs/ +cp -a build/lib.%{python3_platform}-%{python3_version}/reportlab docs/userguide/ %{__python3} setup.py tests +%endif %files -n python3-reportlab %doc README.txt CHANGES.md @@ -61,6 +72,9 @@ PYTHONPATH="`pwd`/`ls -d build/lib*`" %{__python3} docs/genAll.py %doc demos/ tools/ %changelog +* Thu Jun 23 2022 SimpleUpdate Robot - 3.6.10-1 +- Upgrade to version 3.6.10 + * Wed Jan 12 2022 Chengshaowei - 3.4.0-14 - Fix can not import error diff --git a/reportlab-3.4.0.tar.gz b/reportlab-3.4.0.tar.gz deleted file mode 100644 index 21bf7431adaade1b065eac4294372f08992bd03a..0000000000000000000000000000000000000000 Binary files a/reportlab-3.4.0.tar.gz and /dev/null differ diff --git a/reportlab-3.6.10.tar.gz b/reportlab-3.6.10.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c44fdbb4e271dcc57bf41278fc90d2dd05c838b2 Binary files /dev/null and b/reportlab-3.6.10.tar.gz differ