Files
python-ocrmypdf/python-ocrmypdf.spec
Matej Cepl 091bc7660a - Update to 16.6.0:
- Fixed an issue where damaged PDFs would fail with --redo-ocr.
    :issue:`1403`
  - Fixed an error that prevented JBIG2 optimization on Windows
    if the image was optimized in an earlier step. :issue:`1396`
  - Fixed an error detecting the version of unpaper 7.0.0.
    :issue:`1409`
  - Fixed a performance regression when scanning pages.
    :issue:`1378`. Thanks @aliemjay.
  - Fixed Alpine Docker image by enforcing Alpine 3.19. Alpine
    3.20 includes a defective version of Tesseract OCR and so is
    not usable.
  - Upgraded Ubuntu Docker image to use Ubuntu 24.04.
  - Build and test scripts/actions switched to uv.
  - When running in a container, we now remind the user that
    temporary folders are inside the container and may not be
    accessible.
  - Fixed Linux test coverage matrix, which was missing some key
    versions.
- Update to 16.5.0:
  - Fixed issue with interpreting PDFs that have images with
    array masks. :issue:`1377`
  - Enabled testing on Python 3.13.
  - Fixed a test that did not work correctly but still passed.
    :issue:`1382`
  - Improved "PDF/A conversion failed" warning message to better
    describe implications.
  - Updated documentation to better explain OCR_JSON_SETTINGS in
    batch processing.
  - Build backend changed from setuptools to hatchling.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ocrmypdf?expand=0&rev=2
2024-11-06 16:22:16 +00:00

158 lines
5.4 KiB
RPMSpec

#
# spec file for package python-ocrmypdf
#
# Copyright (c) 2024 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/
#
%define skip_python39 1
%{?sle15_python_module_pythons}
Name: python-ocrmypdf
Version: 16.6.0
Release: 0
Summary: OCRmyPDF adds an OCR text layer to scanned PDF files
License: MPL-2.0
Group: Development/Languages/Python
URL: https://github.com/ocrmypdf/OCRmyPDF
Source: https://files.pythonhosted.org/packages/source/o/ocrmypdf/ocrmypdf-%{version}.tar.gz
BuildRequires: %{python_module base >= 3.10}
BuildRequires: %{python_module hatch-vcs}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module deprecation >= 2.1.0}
BuildRequires: %{python_module Pillow >= 10.0.1}
BuildRequires: %{python_module coverage >= 6.2}
BuildRequires: %{python_module hypothesis >= 6.36.0}
BuildRequires: %{python_module img2pdf >= 0.5}
BuildRequires: %{python_module packaging >= 20}
BuildRequires: %{python_module pdfminer.six >= 20220319}
BuildRequires: %{python_module pikepdf >= 8.10.1}
BuildRequires: %{python_module pluggy >= 1}
BuildRequires: %{python_module pytest >= 6.2.5}
BuildRequires: %{python_module pytest-cov >= 3.0.0}
BuildRequires: %{python_module pytest-xdist >= 2.5.0}
BuildRequires: %{python_module python-xmp-toolkit == 2.0.1}
BuildRequires: %{python_module reportlab >= 3.6.8}
BuildRequires: %{python_module rich >= 13}
BuildRequires: %{python_module types-Pillow}
BuildRequires: %{python_module types-humanfriendly}
BuildRequires: tesseract-ocr >= 5.3.2
BuildRequires: tesseract-ocr-traineddata-eng >= 4.1.0
# upstream use BuildRequires: ghostscript >= 10.02.1
BuildRequires: ghostscript >= 9.55
# /SECTION
BuildRequires: fdupes
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires: python-Pillow >= 10.0.1
Requires: python-deprecation >= 2.1.0
Requires: python-img2pdf >= 0.5
Requires: python-packaging >= 20
Requires: python-pdfminer.six >= 20220319
Requires: python-pikepdf >= 8.10.1
Requires: python-pluggy >= 1
Requires: python-reportlab >= 3.6.8
Requires: python-rich >= 13
Requires: tesseract-ocr >= 5.3.2
Requires: tesseract-ocr-traineddata-deu >= 4.1.0
Requires: tesseract-ocr-traineddata-eng >= 4.1.0
# upstream use Requires: ghostscript >= 10.01.2
Requires: ghostscript >= 9.55
Suggests: python-sphinx
Suggests: python-sphinx-issues
Suggests: python-sphinx-rtd-theme
Suggests: python-PyMuPDF >= 1.19.1
Suggests: python-watchdog >= 1.0.2
Suggests: python-typer
Suggests: python-python-dotenv
Suggests: python-Flask >= 2.0.1
BuildArch: noarch
%python_subpackages
%description
OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
%prep
%autosetup -p1 -n ocrmypdf-%{version}
# rpmlintrc
# Cleanup shebang and executable bits.
for f in src/ocrmypdf/*.py src/ocrmypdf/*/*.py; do
sed -e '1{\@^#!/usr/bin/env python@d}' $f > $f.new &&
touch -r $f $f.new &&
mv $f.new $f
chmod -x $f
done
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/ocrmypdf
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
donttest="test_acroform_and_redo"
donttest+=" or test_blank_input_pdf"
donttest+=" or test_decompression_bomb_error"
donttest+=" or test_force_ocr"
donttest+=" or test_graft"
donttest+=" or test_image_input"
donttest+=" or test_input_file_not_found"
donttest+=" or test_input_file_not_readable"
donttest+=" or test_invalid_input_pdf"
donttest+=" or test_jbig2_passthrough"
donttest+=" or test_maximum_options"
donttest+=" or test_ocr_timeout"
donttest+=" or test_oversample"
donttest+=" or test_pagesegmode"
donttest+=" or test_pagesize_consistency"
donttest+=" or test_pdfa"
donttest+=" or test_quick"
donttest+=" or test_redo_ocr"
donttest+=" or test_repeat_ocr"
donttest+=" or test_rotate_deskew_ocr_timeout"
donttest+=" or test_sidecar_nonempty"
donttest+=" or test_sidecar_pagecount"
donttest+=" or test_skip_big"
donttest+=" or test_skip_ocr"
donttest+=" or test_tesseract_config_valid"
donttest+=" or test_tesseract_crash_autorotate"
donttest+=" or test_tesseract_crash"
donttest+=" or test_tesseract_oem"
donttest+=" or test_tesseract_thresholding"
donttest+=" or test_user_words_ocr"
donttest+=" or test_very_high_dpi"
# gh#ocrmypdf/OCRmyPDF#1423
donttest+=" or test_malformed_docinfo"
%pytest -k "not ($donttest)"
%post
%python_install_alternative ocrmypdf
%postun
%python_uninstall_alternative ocrmypdf
%files %{python_files}
%doc README.md
%license LICENSE LICENSES
%{python_sitelib}/ocrmypdf
%{python_sitelib}/ocrmypdf-%{version}.dist-info
%python_alternative %{_bindir}/ocrmypdf
%changelog