File python-pisa.spec of Package python-pisa
#
# spec file for package python-pisa
#
# Copyright (c) 2016 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 http://bugs.opensuse.org/
#
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define mod_name pisa
Name: python-%{mod_name}
Version: 3.0.33
Release: 0
Url: http://www.xhtml2pdf.com
Summary: PDF Generator Using HTML and CSS
License: Apache-2.0
Group: Development/Languages/Python
Source: %{mod_name}-%{version}.tar.bz2
Patch: no_optimize.patch
Patch1: issue65.patch
#FIX-UPSTREAM: proper version detection for reportlab, copied from Debian
Patch2: 0002-Fix-reportlab-version-detection-for-versions-greater.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires: python-setuptools
BuildRequires: python-imaging
Requires: python-imaging
BuildRequires: python-pypdf
Requires: python-pypdf
BuildRequires: python-html5lib
Requires: python-html5lib
%if 0%{?suse_version}
%py_requires
%if 0%{?suse_version} > 1110
BuildArch: noarch
%endif
%endif
%description
pisa is a html2pdf converter using the ReportLab Toolkit,
the HTML5lib and pyPdf. It supports HTML 5 and CSS 2.1 (and some of CSS 3).
It is completely written in pure Python so it is platform independent.
The main benefit of this tool that a user with Web skills like HTML and CSS
is able to generate PDF templates very quickly without learning new
technologies. Easy integration into Python frameworks like CherryPy,
KID Templating, TurboGears, Django, Zope, Plone, Google AppEngine (GAE) etc.
(see 'demo' folder for examples)
Authors:
--------
Dirk Holtwick <dirk.holtwick@gmail.com>
%prep
%setup -q -n %{mod_name}-%{version}
%patch
%patch1
%patch2 -p1
find . -type f -name ".*" -exec rm '{}' \;
%build
export CFLAGS="%{optflags}"
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc demo doc CHANGELOG.txt LICENSE.txt README.txt
/usr/bin/pisa
/usr/bin/xhtml2pdf
%python_sitelib/ho
%python_sitelib/sx
%python_sitelib/%{mod_name}*
%changelog