Notification time stamped 2023-06-30 19:03:01 UTC
From f72e43dc043ba2b6df61967b7204b6377f5145c1 Mon Sep 17 00:00:00 2001
From: Iztok Fister Jr <iztok(a)iztok-jr-fister.eu>
Date: Jun 30 2023 19:02:52 +0000
Subject: Initial import (fedora#2188273).
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1985ce8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/pdf2image-v.1.16.3.tar.gz
diff --git a/269.patch b/269.patch
new file mode 100644
index 0000000..1c1a46f
--- /dev/null
+++ b/269.patch
@@ -0,0 +1,33 @@
+From 0c0835dfdf22c9a45f1394fa8ae0dc367ee77f38 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code(a)musicinmybrain.net>
+Date: Wed, 31 May 2023 17:13:11 -0400
+Subject: [PATCH] Import memory_profiler only when it is enabled
+
+This removes the test dependency on
+https://pypi.org/project/memory-profiler/ when the PROFILE_MEMORY
+environment variable is not set.
+---
+ tests.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests.py b/tests.py
+index ae421f6..260f30c 100644
+--- a/tests.py
++++ b/tests.py
+@@ -11,7 +11,6 @@
+ from subprocess import Popen, PIPE
+ from tempfile import TemporaryDirectory
+ from multiprocessing.dummy import Pool
+-from memory_profiler import profile as profile_memory
+
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
"..")))
+
+@@ -31,6 +30,8 @@
+ from functools import wraps
+
+ PROFILE_MEMORY = os.environ.get("PROFILE_MEMORY", False)
++if PROFILE_MEMORY:
++ from memory_profiler import profile as profile_memory
+
+ try:
+ subprocess.call(
diff --git a/python-pdf2image.spec b/python-pdf2image.spec
new file mode 100644
index 0000000..9c4e246
--- /dev/null
+++ b/python-pdf2image.spec
@@ -0,0 +1,97 @@
+%bcond_without tests
+# Sphinx-generated HTML documentation is not suitable for packaging; see
+#
https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
+#
+# We would like to generate PDF documentation as a substitute, but have not
+# been able to successfully build the Sphinx-generated LaTeX for this
+# particular package.
+%bcond_without doc_pdf
+
+Name: python-pdf2image
+Version: 1.16.3
+Release: 1%{?dist}
+Summary: Convert PDF to PIL Image object
+
+License: MIT
+URL:
https://github.com/Belval/pdf2image
+Source: %{url}/archive/v.%{version}/pdf2image-v.%{version}.tar.gz
+
+# Import memory_profiler only when it is enabled
+#
https://github.com/Belval/pdf2image/pull/269
+Patch: %{url}/pull/269.patch
+
+BuildArch: noarch
+
+%global _description %{expand:
+A wrapper around the pdftoppm and pdftocairo
+command line tools to convert PDF to a PIL
+Image list.}
+
+%description %_description
+
+%package -n python3-pdf2image
+Summary: %{summary}
+BuildRequires: python3-devel
+Requires: poppler
+
+%if %{with tests}
+BuildRequires: python3dist(pytest) >= 3.7.1
+BuildRequires: poppler
+%endif
+
+%description -n python3-pdf2image %_description
+
+%package doc
+Summary: Documentation and examples for %{name}
+
+%if %{with doc_pdf}
+BuildRequires: make
+BuildRequires: python3-sphinx
+BuildRequires: python3-sphinx_rtd_theme
+BuildRequires: python3-sphinx-latex
+BuildRequires: python3-recommonmark
+BuildRequires: latexmk
+BuildRequires: tex-xetex-bin
+%endif
+
+%description doc
+%{summary}.
+
+Full HTML documentation is available at
+https://belval.github.io/pdf2image/
+
+%prep
+%autosetup -n pdf2image-v.%{version} -p1
+
+%generate_buildrequires
+%pyproject_buildrequires
+
+%build
+%pyproject_wheel
+
+%if %{with doc_pdf}
+PYTHONPATH="${PWD}" %make_build -C docs latex
SPHINXOPTS='-j%{?_smp_build_ncpus}'
+%make_build -C docs/_build/latex LATEXMKOPTS='-quiet -f'
+%endif
+
+%install
+%pyproject_install
+%pyproject_save_files pdf2image
+
+%check
+%if %{with tests}
+%pytest tests.py
+%endif
+
+%files -n python3-pdf2image -f %{pyproject_files}
+%doc README.md
+
+%files doc
+%license LICENSE
+%if %{with doc_pdf}
+%doc docs/_build/latex/pdf2image.pdf
+%endif
+
+%changelog
+* Mon Apr 17 2023 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 1.16.3-1
+- Initial package
diff --git a/sources b/sources
new file mode 100644
index 0000000..1f87708
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (pdf2image-v.1.16.3.tar.gz) =
8c724307fcb7b7d1e577ac5ed76a54393a283eb3e7378762506862123af25f0ed9fda7f0309140456aab493bd75405c54195579d1d2bbaec4502861f2731e506
https://src.fedoraproject.org/rpms/python-pdf2image/c/f72e43dc043ba2b6df6...