## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global pypi_name PyMuPDF %global module_name pymupdf %global module_name_compat fitz %bcond docs %{defined fedora} Name: python-%{pypi_name} Version: 1.25.1 Release: %autorelease Summary: Python binding for MuPDF - a lightweight PDF and XPS viewer License: AGPL-3.0-or-later URL: https://github.com/pymupdf/PyMuPDF Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz Patch: 0001-fix-test_-font.patch Patch: 0001-test_pixmap-adjust-to-turbojpeg.patch Patch: 0001-adjust-tesseract-tessdata-path-to-Fedora-default.patch Patch: 0001-setup.py-do-not-require-libclang-and-swig.patch # test dependencies not picked up by generator BuildRequires: python3dist(pillow) BuildRequires: python3dist(pytest) BuildRequires: python3dist(psutil) BuildRequires: tesseract-langpack-eng %if %{with docs} BuildRequires: python3-sphinx BuildRequires: python3-sphinx-copybutton BuildRequires: python3-sphinx-notfound-page BuildRequires: python3-furo BuildRequires: rst2pdf %endif BuildRequires: gcc gcc-c++ BuildRequires: swig BuildRequires: zlib-devel BuildRequires: mupdf-devel mupdf-cpp-devel BuildRequires: freetype-devel BuildRequires: python3-mupdf %global _description %{expand: This is PyMuPDF, a Python binding for MuPDF - a lightweight PDF and XPS viewer. MuPDF can access files in PDF, XPS, OpenXPS, epub, comic and fiction book formats, and it is known for its top performance and high rendering quality. With PyMuPDF you therefore can also access files with extensions *.pdf, *.xps, *.oxps, *.epub, *.cbz or *.fb2 from your Python scripts.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} # provide the importable module: %py_provides python3-%{module_name} %py_provides python3-%{module_name_compat} # upstream pyproject.toml is borked so add manually: Requires: python3-mupdf %description -n python3-%{pypi_name} %_description %if %{with docs} %package doc Summary: Documentation for python-%{pypi_name} BuildArch: noarch %description doc python-%{pypi_name}-doc contains documentation and examples for PyMuPDF %endif %prep %autosetup -n %{pypi_name}-%{version} -p 1 # disable google analytics for installed doc sed -i -e "s/,'sphinxcontrib.googleanalytics'//" docs/conf.py %generate_buildrequires %pyproject_buildrequires -R %build # generate debug symbols export PYMUPDF_SETUP_MUPDF_BUILD_TYPE='debug' # build against system mupdf: export PYMUPDF_SETUP_MUPDF_BUILD='' # build rebased implementation only: export PYMUPDF_SETUP_IMPLEMENTATIONS='b' # build breaks on F39/EL9 with limited API, and we depend on py version anyways: export PYMUPDF_SETUP_PY_LIMITED_API=0 CFLAGS="$CFLAGS -I/usr/include -I/usr/include/freetype2 -I/usr/include/mupdf" LDFLAGS="$LDFLAGS -lfreetype -lmupdf" %pyproject_wheel %if %{with docs} sphinx-build docs docs_built %endif %install %pyproject_install %pyproject_save_files -L %{module_name} %{module_name_compat} %check # linters have no place in distro build tests SKIP="not test_codespell and not test_pylint" # test_fontarchives tries to download special module via pip SKIP="$SKIP and not test_fontarchive" # flake8 has no place in downstream packaging SKIP="$SKIP and not test_flake8" # test_2791 fails sporadically with its empiric bounds SKIP="$SKIP and not test_2791" # test_3050 is known to fail for distribution builds SKIP="$SKIP and not test_3050" # test_subset_fonts needs pymupdf_fonts SKIP="$SKIP and not test_subset_fonts" # test_fit_springer depends on font library version (harfbuzz etc) SKIP="$SKIP and not test_fit_springer" %ifarch s390 s390x # test_3087 crashes on s390 s390x (bigendian mask problem?) SKIP="$SKIP and not test_3087" # test_htmlbox1 fails on s390 s390x (bigendian unicode problem?) SKIP="$SKIP and not test_htmlbox1" %endif # spuriously failing tests (several archs) SKIP="$SKIP and not test_insert and not test_3087" export PYMUPDF_SYSINSTALL_TEST=1 %pytest -k "$SKIP" %files -n python3-%{pypi_name} -f %{pyproject_files} %license COPYING %{_bindir}/pymupdf %if %{with docs} %files doc %doc docs_built/* README.md %endif %changelog ## START: Generated by rpmautospec * Sun Dec 22 2024 Michael J Gruber - 1.25.1-1 - Update to new upstream release 1.25.1 (rhbz#2300000) - Various accumulated fixes - adjust to tesseract package split - remove now optional fonttools dependency * Wed Nov 13 2024 Sandro Mani - 1.24.8-4 - BR: python3-setuptools * Tue Nov 12 2024 Sandro Mani - 1.24.8-3 - Rebuild (tesseract) * Thu Aug 15 2024 Michael J Gruber - 1.24.8-2 - Use more pyproject macros * Tue Jul 23 2024 Michael J Gruber - 1.24.8-1 - Update to new upstream release 1.24.8 (rhbz#2299417) - Fix subset font name extraction (regression in 1.24.6 and 1.24.7). - Other minor fixes. * Fri Jul 19 2024 Fedora Release Engineering - 1.24.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Wed Jul 10 2024 Michael J Gruber - 1.24.7-1 - Update to new upstream release 1.24.7 (rhbz#2295693) - Various fixes. * Sun Jun 09 2024 Python Maint - 1.24.5-2 - Rebuilt for Python 3.13 * Fri May 31 2024 Michael J Gruber - 1.24.5-1 - Update to new upstream release 1.24.5 (rhbz#2280912) - Various fixes. - Removed/disabled some unnecessary diagnostics. * Wed May 29 2024 Michael J Gruber - 1.24.4-2 - Rebuild for RPM 4.20 regression * Fri May 17 2024 Michael J Gruber - 1.24.4-1 - Update to new upstream release 1.24.4 (rhbz#2280912) - Various fixes (1.24.3, 1.24.4) - The Python module is now (1.24.3 and up) called `pymupdf`. `fitz` is still supported for backwards compatibility. * Fri Apr 19 2024 Michael J Gruber - 1.24.2-1 - Update to new upstream release 1.24.2 (rhbz#2276014) - `Document.bake()`: new, make annotations / fields permanent content. - `Page.cluster_drawings()`: new, identifies drawing items that belong together based on their geometrical vicinity. - `Page.apply_redactions()`: added new parameter `text`. - `Document.subset_fonts()`: use MuPDF's `pdf_subset_fonts()` instead of PyMuPDF code. - The `Document` class now supports page numbers specified as slices. - various fixes * Thu Apr 11 2024 Michael J Gruber - 1.24.1-2 - skip flaky test_2791 * Wed Apr 03 2024 Michael J Gruber - 1.24.1-1 - Update to new upstream release 1.24.1 (rhbz#2272970) - support ObjStm Compression - some fixes around annotations and links * Fri Mar 22 2024 Michael J Gruber - 1.24.0-1 - Update to new upstream release 1.24.0 (rhbz#2270926) - support for redacting vector graphics - several fixes for table module - various other fixes * Sat Mar 02 2024 Michael J Gruber - 1.23.26-1 - Update to new upstream release 1.23.26 (rhbz#2267405) - new command pymupdf as shortcut for using PyMuPDF/fitz as command - various fixes around tables * Wed Feb 21 2024 Michael J Gruber - 1.23.25-1 - Update to new upstream release 1.23.25 (rhbz#2265290) - 3 minor bug fixes * Tue Feb 20 2024 Michael J Gruber - 1.23.24-1 - Update to new upstream release 1.23.24 (rhbz#2256708) - various fixes around tables - various fixes around Document * Sat Feb 17 2024 Michael J Gruber - 1.23.22-2 - Allow to build without docs * Sat Feb 17 2024 Michael J Gruber - 1.23.22-1 - Update to new upstream release 1.23.22 (rhbz#2256708) - minor fixes - interoperability with mupdf 1.23.x * Sat Feb 17 2024 Michael J Gruber - 1.23.21-1 - Update to new upstream release 1.23.21 (rhbz#2256708) - various fixes, especially in the rebased implementation - build with rebased implementation * Tue Feb 06 2024 Michael J Gruber - 1.23.8-7 - Rebuild against mupdf 1.23.10 * Fri Feb 02 2024 Michael J Gruber - 1.23.8-6 - Build against mupdf shared library * Sun Jan 28 2024 Sandro Mani - 1.23.8-4 - Rebuild (tesseract) * Fri Jan 26 2024 Fedora Release Engineering - 1.23.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 1.23.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Dec 20 2023 Michael J Gruber - 1.23.8-1 - Update to new upstream release 1.23.8 (rhbz#2252504) * Sat Dec 02 2023 Michael J Gruber - 1.23.7-1 - Update to new upstream release 1.23.7 (rhbz#2252504) * Mon Nov 06 2023 Michael J Gruber - 1.23.6-1 - Update to new upstream release 1.23.6 (rhbz#2244148) * Mon Nov 06 2023 Michael J Gruber - 1.23.5-1 - Update to new upstream release 1.23.5 (rhbz#2244148) * Wed Oct 11 2023 Michael J Gruber - 1.23.4-2 - Rebuild for mupdf 1.23.4 * Tue Oct 10 2023 Michael J Gruber - 1.23.4-1 - Update to new upstream release 1.23.4 (rhbz#2241098) * Tue Oct 10 2023 Michael J Gruber - 1.23.3-3 - Adjust tesseract tessdata path to Fedora default * Sat Oct 07 2023 Sandro Mani - 1.23.3-2 - Rebuild (tesseract) * Mon Sep 04 2023 Michael J Gruber - 1.23.3-1 - Update to new upstream release 1.23.3 (rhbz#2231206) - Switch to new pyproject packaging macros * Fri Jul 21 2023 Fedora Release Engineering - 1.22.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Fri Jul 14 2023 Sandro Mani - 1.22.5-3 - Rebuild (tesseract) * Thu Jun 29 2023 Python Maint - 1.22.5-2 - Rebuilt for Python 3.12 * Thu Jun 22 2023 Michael J Gruber - 1.22.5-1 - Update to new upstream release 1.22.5 (rhbz#2216869) * Thu May 11 2023 Michael J Gruber - 1.22.3-2 - Reenable test suite where possible * Thu May 11 2023 Michael J Gruber - 1.22.3-1 - Update to new upstream release 1.22.3 (rhbz#2186919) * Fri Apr 28 2023 Michael J Gruber - 1.22.2-1 - Update to new upstream release 1.22.2 (rhbz#2186919) * Mon Apr 24 2023 Michael J Gruber - 1.22.1-1 - Update to new upstream release 1.22.1 (rhbz#2186919) - Minor bug fixes * Sat Apr 15 2023 Michael J Gruber - 1.22.0-1 - Update to new upstream release 1.22.0 (rhbz#2186919) - Text extraction now includes glyphs that overlap with clip rect, not just those contained entirely. - Compatibility with mupdf 1.22.0, various bug fixes. * Thu Apr 06 2023 Sandro Mani - 1.21.1-6 - Rebuild (tesseract) * Fri Jan 20 2023 Fedora Release Engineering - 1.21.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Dec 23 2022 Sandro Mani - 1.21.1-4 - Rebuild (tesseract) * Wed Dec 21 2022 Sandro Mani - 1.21.1-3 - Rebuild (leptonica) * Sat Dec 17 2022 Michael J Gruber - 1.21.1-2 - SPDX migration * Tue Dec 13 2022 Michael J Gruber - 1.21.1-1 - Update to new upstream release 1.21.1 (rhbz#2152969) * Tue Nov 08 2022 Michael J Gruber - 1.21.0-1 - Update to new upstream release 1.21.0 (rhbz#2139246) * Fri Aug 12 2022 Michael J Gruber - 1.20.2-1 - Update to new upstream release 1.20.2 (#2118056) * Thu Jul 28 2022 Scott Talbert - 1.20.1-1 - Update to new upstream release 1.20.1 (#2101869) * Fri Jul 22 2022 Fedora Release Engineering - 1.20.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Fri Jul 08 2022 Sandro Mani - 1.20.0-2 - Rebuild (tesseract) * Fri Jun 17 2022 Michael J Gruber - 1.20.0-1 - Update to new upstream release 1.20.0 (bz #2097589) * Wed Jun 15 2022 Python Maint - 1.19.6-4 - Rebuilt for Python 3.11 * Fri May 20 2022 Sandro Mani - 1.19.6-3 - Rebuild for gdal-3.5.0 and/or openjpeg-2.5.0 * Thu Mar 10 2022 Sandro Mani - 1.19.6-2 - Rebuild for tesseract 5.1.0 * Tue Mar 08 2022 Scott Talbert - 1.19.6-1 - Update to new upstream release 1.19.6 (#2061128) * Fri Feb 25 2022 Sandro Mani - 1.19.5-2 - Rebuild (leptonica) * Fri Feb 18 2022 Scott Talbert - 1.19.5-1 - Update to new upstream release 1.19.5 (#2050691) * Fri Jan 21 2022 Fedora Release Engineering - 1.19.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Mon Jan 03 2022 Scott Talbert - 1.19.4-1 - Update to new upstream release 1.19.4 (#2036460) * Sun Dec 19 2021 Sandro Mani - 1.19.3-3 - Rebuild (tesseract) * Tue Dec 14 2021 Sandro Mani - 1.19.3-2 - Rebuild (tesseract) * Tue Dec 14 2021 Scott Talbert - 1.19.3-1 - Update to new upstream release 1.19.3 (#2031602) * Sun Nov 21 2021 Scott Talbert - 1.19.2-1 - Update to new upstream release 1.19.2 (#2025180) * Sun Oct 24 2021 Michael J Gruber - 1.19.1-1 - Update to new upstream release 1.19.1 - Enable OCR with the leptonica/tesseract engine * Sun Oct 17 2021 Michael J Gruber - 1.19.0-1 - Update to new upstream release 1.19.0 (#2014860) * Fri Sep 17 2021 Scott Talbert - 1.18.19-1 - Update to new upstream release 1.18.19 (#2005248) * Sun Sep 12 2021 Scott Talbert - 1.18.17-1 - Update to new upstream release 1.18.17 (#1997388) * Mon Aug 09 2021 Scott Talbert - 1.18.16-1 - Update to new upstream release 1.18.16 (#1991265) * Fri Jul 23 2021 Fedora Release Engineering - 1.18.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Mon Jul 12 2021 Scott Talbert - 1.18.15-1 - Update to new upstream release 1.18.15 (#1981087) * Tue Jun 15 2021 Scott Talbert - 1.18.14-1 - Update to new upstream release 1.18.14 (#1967360) * Fri Jun 04 2021 Python Maint - 1.18.13-2 - Rebuilt for Python 3.10 * Thu May 06 2021 Scott Talbert - 1.18.13-1 - Update to new upstream release 1.18.13 (#1957559) * Sat Apr 17 2021 Scott Talbert - 1.18.11-1 - Update to new upstream release 1.18.11 (#1948243) * Thu Mar 25 2021 Scott Talbert - 1.18.10-1 - Update to new upstream release 1.18.10 (#1933388) * Wed Feb 24 2021 Michael J Gruber - 1.18.8-2 - rebuild for mupdf CVE-2021-3407 * Sat Feb 06 2021 Scott Talbert - 1.18.8-1 - Update to new upstream release 1.18.8 (#1924379) * Wed Jan 27 2021 Fedora Release Engineering - 1.18.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sat Jan 9 2021 Scott Talbert - 1.18.6-1 - Update to new upstream release 1.18.6 (#1913766) * Sun Dec 20 14:22:47 EST 2020 Scott Talbert - 1.18.5-1 - Update to new upstream release 1.18.5 (#1908813) * Fri Nov 20 20:19:08 EST 2020 Scott Talbert - 1.18.4-1 - Update to new upstream release 1.18.4 (#1900148) * Mon Nov 9 19:43:10 EST 2020 Scott Talbert - 1.18.3-1 - Update to new upstream release 1.18.3 (#1896141) * Sun Nov 8 09:38:33 EST 2020 Scott Talbert - 1.18.2-1 - Update to new upstream release 1.18.2 (#1892160) * Mon Oct 26 2020 Scott Talbert - 1.18.1-1 - Update to new upstream release 1.18.1 (#1889179) * Thu Oct 08 2020 Michael J Gruber - 1.18.0-1 - Update to new upstream release 1.18.0 * Fri Sep 18 2020 Michael J Gruber - 1.17.4-2 - rebuild with jbig2dec 0.19 * Tue Jul 28 2020 Scott Talbert - 1.17.4-1 - Update to new upstream release 1.17.4 (#1860498) * Tue Jul 28 2020 Fedora Release Engineering - 1.17.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Wed Jul 08 2020 Scott Talbert - 1.17.3-1 - Update to new upstream release 1.17.3 (#1854562) * Fri Jun 26 2020 Scott Talbert - 1.17.2-1 - Update to new upstream release 1.17.2 (#1850817) * Thu Jun 18 2020 Scott Talbert - 1.17.1-1 - Update to new upstream release 1.17.1 (#1848770) * Tue May 26 2020 Miro Hrončok - 1.17.0-2 - Rebuilt for Python 3.9 * Thu May 21 2020 Michael J Gruber - 1.17.0-1 - Update to new upstream release 1.17.0 (#1838287) * Mon May 04 2020 Scott Talbert - 1.16.18-1 - Update to new upstream release 1.16.18 (#1822800) * Sun Mar 29 2020 Scott Talbert - 1.16.16-1 - Update to new upstream release 1.16.16 (#1818610) * Thu Mar 26 2020 Scott Talbert - 1.16.14-1 - Update to new upstream release 1.16.14 (#1817211) * Wed Mar 18 2020 Scott Talbert - 1.16.13-1 - Update to new upstream release 1.16.13 (#1814049) * Fri Mar 13 2020 Scott Talbert - 1.16.12-1 - Update to new upstream release 1.16.12 (#1812963) * Tue Feb 25 2020 Scott Talbert - 1.16.11-1 - Update to new upstream release 1.16.11 (#1806372) * Thu Jan 30 2020 Fedora Release Engineering - 1.16.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Tue Jan 07 2020 Scott Talbert - 1.16.10-1 - Update to new upstream release 1.16.10 (#1785875) * Thu Dec 12 2019 Scott Talbert - 1.16.9-1 - Update to new upstream release 1.16.9 (#1773810) * Tue Nov 12 2019 Scott Talbert - 1.16.7-1 - Update to new upstream release 1.16.7 (#1771130) * Thu Nov 07 2019 Scott Talbert - 1.16.6-1 - Update to new upstream release 1.16.6 (#1768266) * Tue Oct 15 2019 Scott Talbert - 1.16.5-1 - Update to new upstream release 1.16.5 (#1761164) * Sat Sep 14 2019 Scott Talbert - 1.16.2-1 - Update to new upstream release 1.16.2 (#1751945) * Wed Sep 04 2019 Scott Talbert - 1.16.1-1 - Update to new upstream release 1.16.1 (#1747043) * Mon Aug 19 2019 Miro Hrončok - 1.14.20-2 - Rebuilt for Python 3.8 * Sat Aug 17 2019 Scott Talbert - 1.14.20-1 - Update to new upstream release 1.14.20 (#1742123) * Fri Jul 26 2019 Fedora Release Engineering - 1.14.17-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Tue Jul 09 2019 Scott Talbert - 1.14.17-1 - Update to new upstream release 1.14.17 (#1727474) * Thu Jun 13 2019 Scott Talbert - 1.14.16-1 - Update to new upstream release 1.14.16 (#1713110) * Wed Jun 12 2019 Scott Talbert - 1.14.14-3 - Temporarily build our own copy of mupdf to fix FTBFS (#1716518) * Tue May 07 2019 Scott Talbert - 1.14.14-2 - Restore linking with harfbuzz (#1706753) * Thu Apr 18 2019 Scott Talbert - 1.14.14-1 - New upstream release 1.14.14 * Mon Apr 08 2019 Scott Talbert - 1.14.13-1 - New upstream release 1.14.13 * Fri Mar 22 2019 Scott Talbert - 1.14.12-1 - New upstream release 1.14.12 * Tue Mar 12 2019 Scott Talbert - 1.14.10-1 - New upstream release 1.14.10 * Fri Mar 08 2019 Scott Talbert - 1.14.9-1 - New upstream release 1.14.9 * Thu Jan 31 2019 Scott Talbert - 1.14.8-1 - New upstream release 1.14.8 * Fri Jan 25 2019 Scott Talbert - 1.14.7-1 - New upstream release 1.14.7 * Tue Nov 20 2018 Scott Talbert - 1.14.1-1 - New upstream release 1.14.1 * Wed Oct 17 2018 Zbigniew Jędrzejewski-Szmek - 1.13.20-2 - Subpackage python2-PyMuPDF has been removed See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal * Fri Sep 14 2018 Scott Talbert - 1.13.20-1 - New upstream release 1.13.20 * Sat Aug 04 2018 Scott Talbert - 1.13.16-1 - New upstream release 1.13.16 * Tue Jul 31 2018 Florian Weimer - 1.13.15-2 - Rebuild with fixed binutils * Sat Jul 28 2018 Scott Talbert - 1.13.15-1 - New upstream release 1.13.15 * Fri Jul 20 2018 Scott Talbert - 1.13.14-1 - New upstream release 1.13.14 * Fri Jul 13 2018 Fedora Release Engineering - 1.13.13-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Jul 11 2018 Scott Talbert - 1.13.13-1 - New upstream release 1.13.13 * Wed Jun 27 2018 Scott Talbert - 1.13.12-1 - New upstream release 1.13.12 * Tue Jun 26 2018 Scott Talbert - 1.13.11-1 - New upstream release 1.13.11 * Tue Jun 19 2018 Miro Hrončok - 1.13.10-2 - Rebuilt for Python 3.7 * Fri Jun 15 2018 Scott Talbert - 1.13.10-1 - New upstream release 1.13.10 * Sun Jun 10 2018 Scott Talbert - 1.13.9-1 - Initial package. ## END: Generated by rpmautospec