1a762ba
%global pypi_name PyMuPDF
1a762ba
%global desc This is PyMuPDF, a Python binding for MuPDF - a lightweight PDF and XPS\
1a762ba
viewer.  MuPDF can access files in PDF, XPS, OpenXPS, epub, comic and fiction\
1a762ba
book formats, and it is known for its top performance and high rendering\
1a762ba
quality.  With PyMuPDF you therefore can also access files with extensions\
1a762ba
*.pdf, *.xps, *.oxps, *.epub, *.cbz or *.fb2 from your Python scripts.
1a762ba
1a762ba
Name:           python-%{pypi_name}
1a762ba
Version:        1.13.9
1a762ba
Release:        1%{?dist}
1a762ba
Summary:        Python binding for MuPDF - a lightweight PDF and XPS viewer
1a762ba
1a762ba
# PyMuPDF itself is GPLv3+.  MuPDF (statically linked) is AGPLv3+.
1a762ba
License:        GPLv3+ and AGPLv3+
1a762ba
URL:            https://github.com/rk700/PyMuPDF
1a762ba
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
1a762ba
# Can be removed if mupdf provides a shared library
1a762ba
Patch0:         fix-library-linking.patch
1a762ba
1a762ba
BuildRequires:  python2-devel python3-devel
1a762ba
BuildRequires:  gcc
1a762ba
BuildRequires:  zlib-devel mupdf-static
1a762ba
# Can be removed if mupdf provides a shared library
1a762ba
BuildRequires:  libjpeg-devel openjpeg2-devel jbig2dec-devel freetype-devel harfbuzz-devel
1a762ba
1a762ba
%description
1a762ba
%{desc}
1a762ba
1a762ba
%package -n     python2-%{pypi_name}
1a762ba
Summary:        %{summary}
1a762ba
%{?python_provide:%python_provide python2-%{pypi_name}}
1a762ba
1a762ba
%description -n python2-%{pypi_name}
1a762ba
%{desc}
1a762ba
1a762ba
%package -n     python3-%{pypi_name}
1a762ba
Summary:        %{summary}
1a762ba
%{?python_provide:%python_provide python3-%{pypi_name}}
1a762ba
1a762ba
%description -n python3-%{pypi_name}
1a762ba
%{desc}
1a762ba
1a762ba
%package        doc
1a762ba
Summary:        Documentation for python-%{pypi_name}
1a762ba
BuildArch:      noarch
1a762ba
1a762ba
%description    doc
1a762ba
python-%{pypi_name}-doc contains documentation and examples for PyMuPDF
1a762ba
1a762ba
%prep
1a762ba
%autosetup -n %{pypi_name}-%{version}
1a762ba
1a762ba
%build
1a762ba
%py2_build
1a762ba
%py3_build
1a762ba
1a762ba
%install
1a762ba
%py2_install
1a762ba
%py3_install
1a762ba
1a762ba
1a762ba
%files -n python2-%{pypi_name}
1a762ba
%license COPYING "GNU AFFERO GPL V3"
1a762ba
%{python2_sitearch}/fitz/
1a762ba
%{python2_sitearch}/PyMuPDF*
1a762ba
1a762ba
%files -n python3-%{pypi_name}
1a762ba
%license COPYING "GNU AFFERO GPL V3"
1a762ba
%{python3_sitearch}/fitz/
1a762ba
%{python3_sitearch}/PyMuPDF*
1a762ba
1a762ba
%files doc
1a762ba
%doc demo doc/PyMuPDF.pdf examples README.md
1a762ba
1a762ba
%changelog
1a762ba
* Sun Jun 10 2018 Scott Talbert <swt@techie.net> - 1.13.9-1
1a762ba
- Initial package.