14
0
Files
python-PyMuPDF/python-PyMuPDF.spec
Matej Cepl 7b05a7d1ac - Update to v1.19.6
* Fixed #1620. The TextPage created by Page.get_textpage() will
    now be freed correctly (removed memory leak).
  * Fixed #1601. Document open errors should now be more concise
    and easier to interpret. In the course of this, two
    PyMuPDF-specific Python exceptions have been added:
    EmptyFileError – raised when trying to create a Document
    (fitz.open()) from an empty file or zero-length memory.
    FileDataError – raised when MuPDF encounters irrecoverable
    document structure issues.
  * Added Page.load_widget() given a PDF field’s xref.
  * Added Dictionary pdfcolor which provide the about 500 colors
    defined as PDF color values with the lower case color name as
    key.
  * Added algebra functionality to the Quad class. These objects
    can now also be added and subtracted among themselves, and be
    multiplied by numbers and matrices.
  * Added new constants defining the default text extraction flags
    for more comfortable handling. Their naming convention is like
    TEXTFLAGS_WORDS for page.get_text("words"). See Text Extraction
    Flags Defaults.
  * Changed Page.annots() and Page.widgets() to detect and prevent
    reloading the page (illegally) inside the iterator loops via
    Document.reload_page(). Doing this brings down the interpretor.
    Documented clean ways to do annotation and widget mass updates
    within properly designed loops.
  * Changed several internal utility functions to become
    standalone (“SWIG inline”) as opposed to be part of the Tools
    class. This, among other things, increases the performance of
    geometry object creation.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyMuPDF?expand=0&rev=41
2022-05-10 00:11:10 +00:00

79 lines
2.5 KiB
RPMSpec

#
# spec file
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Python 2 build fails always
%define skip_python2 1
%define pypi_name PyMuPDF
Name: python-%{pypi_name}
Version: 1.19.6
Release: 0
Summary: Python binding for MuPDF, a PDF and XPS viewer
License: AGPL-3.0-only
Group: Development/Libraries/Python
URL: https://github.com/pymupdf/PyMuPDF
Source: https://files.pythonhosted.org/packages/source/P/PyMuPDF/PyMuPDF-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: gcc
BuildRequires: jbig2dec-devel
BuildRequires: mupdf-devel-static < 1.19.0
BuildRequires: mupdf-devel-static >= 1.18.0
BuildRequires: openSUSE-release
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: swig
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(gumbo)
BuildRequires: pkgconfig(harfbuzz)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(libpng16)
BuildRequires: pkgconfig(zlib)
%python_subpackages
%description
This is PyMuPDF, a Python binding for MuPDF, a PDF and XPS viewer.
MuPDF can access files in PDF, XPS, OpenXPS, epub, comic and fiction
book formats. PyMuPDF can also access files with extensions *.pdf,
*.xps, *.oxps, *.epub, *.cbz or *.fb2 from Python scripts.
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
%build
export CFLAGS="%{optflags} -I/usr/include/freetype2"
%python_build
%install
%python_install
rm %{buildroot}%{_prefix}/{COPYING,README.md,changes.rst}
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
cd /tmp
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -c 'import fitz'
%files %{python_files}
%license COPYING
%doc README.md changes.rst
%{python_sitearch}/*
%changelog