File python-reportlab.spec of Package python-reportlab

# spec file for package python-reportlab
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%bcond_without tests

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name:           python-reportlab
Version:        3.4.0
Release:        0
Summary:        The Reportlab Toolkit
License:        BSD-3-Clause
Group:          Development/Languages/Python
Patch0:         reportlab-missing-includes.patch
# PATCH-FIX-UPSTREAM drop unneeded requirements
Patch1:         drop-requirements.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  %{python_module Pillow}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module xml}
BuildRequires:  fdupes
BuildRequires:  freetype2-devel
BuildRequires:  python-rpm-macros
Requires:       python-Pillow
Obsoletes:      %{oldpython}-ReportLab < %{version}
Provides:       %{oldpython}-ReportLab = %{version}
Provides:       python3-ReportLab = %{version}
Obsoletes:      python3-ReportLab < %{version}

The ReportLab Toolkit. An Open Source Python library for generating PDFs and graphics.

%setup -q -n reportlab-%{version}
%patch1 -p1
sed -i "1d" src/reportlab/lib/{formatters,fonts,corp,units,pagesizes,__init__,randomtext,logger,normalDate}.py
sed -i "1d" src/reportlab/graphics/{widgets/table,barcode/test,testdrawings,testshapes}.py # Fix non-executable bits

export CFLAGS="%{optflags}"

%python_expand %fdupes %{buildroot}%{$python_sitearch}

%if %{with tests}
export LANG=en_US.UTF-8
%python_exec tests

%files %{python_files}
%doc LICENSE.txt
%doc README.txt

openSUSE Build Service is sponsored by