Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
e5b6700480 add direct requirement for python3-cairocffi (#1685654)
Actually python3-cairocffi should have that dependency (see bug 1698217) but
for now just add the requirement here.
2019-05-28 09:08:09 +02:00
187a0737cb avoid dependency on /usr/bin/python33
The custom patch + find/sed stepped on each other's toes so we ended up with
weird shebangs like /usr/bin/python33 and even /usr/bin/python333 so the
generated RPM required /usr/bin/python33 (which is not available in Fedora).

Instead just use pathfix.py which does the job without having to update
patch files manually for each release.
2019-05-28 09:08:09 +02:00
1bf0e3476d remove test code before installation
This saves about 1.4 MB for each install.
2019-05-28 09:08:09 +02:00
7e7014eae6 use macros %autosetup and %pypi_source to simplify spec file 2019-05-28 09:08:09 +02:00

View file

@ -1,17 +1,15 @@
Name: weasyprint
Version: 0.39
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Utility to render HTML and CSS to PDF
License: BSD
URL: http://weasyprint.org/
BuildArch: noarch
Source0: https://github.com/Kozea/WeasyPrint/archive/v%{version}/%{name}-%{version}.tar.gz
# Fedora specific patch to remove use of /usr/bin/env in shebang in scripts
Patch0: weasyprint-0.39-shebang.patch
Source0: %pypi_source
Requires: python3-weasyprint = %{version}-%{release}
BuildRequires: python3-devel python3-setuptools
BuildRequires: /usr/bin/pathfix.py
%description
WeasyPrint can render HTML and CSS to PDF. It aims to support web standards
@ -29,6 +27,10 @@ Requires: python3-lxml >= 3.0
Requires: python3-pyphen >= 0.8
Requires: python3-setuptools
Requires: python3-tinycss2 >= 0.5
# workaround for bug 1685654
# actually python3-cairocffi should have that dependency (see bug 1698217) but
# for now just add the requirement here.
Requires: python3-xcffib
# Weasyprint will fail if no fonts are installed. There's no way to know
# what fonts the user would actually want, but require a few common ones
# that might be useful:
@ -42,13 +44,13 @@ The WeasyPrint Python library is a rendering engine for HTML and CSS that
can export to PDF. It aims to support web standards for printing.
%prep
%setup -q -n WeasyPrint-%{version}
%patch0 -p1 -b .shebang
find . -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
%autosetup -p1 -n WeasyPrint-%{version}
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" .
%build
%py3_build
# do not ship tests
rm -rf weasyprint/tests
%install
%py3_install
@ -66,6 +68,10 @@ chmod +x %{buildroot}%{python3_sitelib}/weasyprint/tests/test_web/run.py
%{python3_sitelib}/weasyprint/
%changelog
* Tue May 28 2019 Felix Schwarz <fschwarz@fedoraproject.org> 0.39-2
- avoid dependency on Python 3.3
- require python3-xcffib directly (#1685654)
* Tue Apr 30 2019 Eric Smith <brouhaha@fedoraproject.org> 0.39-1
- Update to newer (but not latest) upstream.