# remirepo/fedora spec file for wkhtmltopdf-opt
#
# Copyright (c) 2017 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global debug_package %{nil}
%global __debug_install_post /bin/true
%if 0%{?fedora} >= 27
%global _build_id_links none
%endif
%global gh_owner wkhtmltopdf
%global gh_project wkhtmltopdf
%global upstream_version 0.12.4
#global upstream_prever RC1
Name: %{gh_project}-opt
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
Release: 1%{?dist}
Group: System Environment/Libraries
Summary: Tools and library to render HTML into PDF
License: LGPLv3
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{url}/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
Source1: %{url}/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-i386.tar.xz
Source2: %{url}/blob/master/LICENSE
# Filter shared private - always as not in standard library path
%{?filter_provides_in: %filter_provides_in /opt/%{gh_project}/%{_lib}/.*$}
%{?filter_from_requires: %filter_from_requires /wkhtmltox/d}
%{?filter_setup}
%description
wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF
and various image formats using the QT Webkit rendering engine. These run
entirely "headless" and do not require a display or display service.
This package provides upstream binaries, statically built against a patch QT
version to drop the need of an running X11 server.
All files are installed in /opt/%{gh_project}.
%prep
%setup -qcT
%ifarch x86_64
tar xf %{SOURCE0}
mv wkhtmltox/lib wkhtmltox/%{_lib}
%else
tar xf %{SOURCE1}
%endif
cp %{SOURCE2} LICENSE
%build
# We use upstream binary
%install
mkdir -p %{buildroot}/opt
cp -pr wkhtmltox %{buildroot}/opt/%{gh_project}
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
/opt/%{gh_project}
%changelog
* Sun Nov 12 2017 Remi Collet - 0.12.4-1
- initial package