#
# spec file for package python-rst2pdf
#
# Copyright (c) 2015 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/
#


Name:           python-rst2pdf
Version:        0.93
Release:        6.2
Summary:        Tool for transforming reStructuredText to PDF using ReportLab
License:        MIT
Group:          Development/Libraries/Python
Source:         https://rst2pdf.googlecode.com/files/rst2pdf-%{version}.tar.gz
Url:            http://code.google.com/p/rst2pdf/
# PATCH-FIX-UPSTREAM fix logging to work properly https://code.google.com/p/rst2pdf/issues/detail?id=509&q=log
Patch0:         rst2pdf-0.93-fix-logging.patch
BuildRequires:  dos2unix
BuildRequires:  python-setuptools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       python-Pygments
Requires:       python-docutils
Requires:       python-imaging
Requires:       python-pdfrw
Requires:       python-pygments
Requires:       python-reportlab >= 2.6
Requires:       python-svg2rlg
Recommends:     python-wordaxe
%{py_requires}
%if 0%{?suse_version} && 0%{?suse_version} > 1110
BuildArch:      noarch
%endif

%description
The usual way of creating PDF from reStructuredText is by going through LaTeX.
This tool provides an alternative by producing PDF directly using the ReportLab library.

%prep
%setup -q -n rst2pdf-%{version}
%patch0
rm -f rst2pdf/tests/input/charter.afm
# fix dos encodings
find -name '*.py' -exec dos2unix {} +

sed -i -e '1{/^#!/d}' \
	rst2pdf/smartypants.py \
	rst2pdf/findfonts.py \
	rst2pdf/dumpstyle.py

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} 

%files
%defattr(-,root,root)
%doc CHANGES.txt LICENSE.txt README.txt doc/*.pdf
%{_bindir}/rst2pdf
%dir  %{python_sitelib}/rst2pdf
%{python_sitelib}/rst2pdf/*
%{python_sitelib}/rst2pdf-%{version}.*-py%{py_ver}.egg-info

%changelog
* Tue Jul 28 2015 olaf@aepfle.de
- Relax path to egg-info to fix build in Leap
* Mon Jul 13 2015 toddrme2178@gmail.com
- Fix building on SLES 11
* Fri Aug 15 2014 sfalken@opensuse.org
- Fixed filename error in spec file, which was leading to buildfailure
* Sat Nov  9 2013 tchvatal@suse.com
- Wordaxe was supposed to stay.
* Sat Nov  9 2013 tchvatal@suse.com
- Update the runtime dependencies to reflect reality.
  Previous content was not right at all.
- Add patch to fix logging:
  * rst2pdf-0.93-fix-logging.patch
* Wed Oct 23 2013 tchvatal@suse.com
- Cleanup the spec to reduce rpmlint errors.
* Wed Oct 23 2013 tchvatal@suse.com
- Remove tests/input/character.afm as recomended by legal.
* Mon Jan 21 2013 p.drouand@gmail.com
- Clean specfile and some improvements
- Remove shebangs
* Mon Jan 21 2013 p.drouand@gmail.com
- Update to version 0.93:
  * Fixed Issue 447: Double-sided always starts on the right (By Rob Ludwick)
  - Removed --first-page-even as it was not used anywhere.
  - Added --first-page-on-right
  * Fixed Issue 464: support alignment via :class: in image directives.
  * Fixed Issue 482: Line blocks with indented parts get extraneous spacing
  * Fixed Issue 470: Support for :target: in figures.
  * New style "image" to be applied to image directives.
  * Fixed Issue 485: Better styling support for figures/images (spaceBefore/After)
  * Support rst2pdf [inf [outf]] syntax to be more compatible with rst2*
  * Implemented Issue 389: New --strip-element-with-class option
  * Fixed Issue 474: CellStyle1 is not there in reportlab 2.6
  * Removed default padding from DelayedTable, which looked bad
    on headers/footers.
  * Improvements to the math directive (font color and size)
  * Better support for styling literals.
  * Fixed Issue 454 (Splitting failure)
  * Regressed Issue 374 (some literal blocks get oversplit)
  * Switched from svglib to svg2rlg
  * Removed uniconvertor support
  * Fixed Issue 477: Sink footnote separator (patch by asermax)
  * Fixed Issue 473: Support "code" directive like an alias of code-block.
  * Fixed Issue 472: Implemented MyImage._unRestrictSize
  * Fixed Issue 471: Respect class in lineblocks.
  * Fixed Issue 455: New pisa/xhtml2pdf has very different imports
  * Marked Issue 358 as fixed.
  * Fixed Issue 410: always include full lines in code-blocks (mmueller patch)
* Fri Dec 31 2010 nix@opensuse.org
- Update to 0.16
* Fri May 14 2010 nix@opensuse.org
- Recommend python-wordaxe
* Fri May 14 2010 nix@opensuse.org
- Recommend python-pypdf
* Thu May 13 2010 nix@opensuse.org
- Fix build on SLES9
* Thu May 13 2010 nix@opensuse.org
- Update to version 0.15