]> git.pld-linux.org Git - packages/python-tesserocr.git/blame - python-tesserocr.spec
rebuild with python 3.10
[packages/python-tesserocr.git] / python-tesserocr.spec
CommitLineData
16bee122 1#
2002dbb2
ER
2# TODO
3# - tests fail: raise RuntimeError('Failed to initialize API')
4
16bee122 5# Conditional build:
2002dbb2 6%bcond_with tests # do not perform "make test"
16bee122
ER
7%bcond_without python2 # CPython 2.x module
8%bcond_without python3 # CPython 3.x module
9
b02afae5
JR
10%define module tesserocr
11%define egg_name tesserocr
16bee122
ER
12%define pypi_name tesserocr
13Summary: A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
14Name: python-%{pypi_name}
b02afae5 15Version: 2.3.1
c132d5d0 16Release: 5
16bee122
ER
17License: MIT
18Group: Libraries/Python
19Source0: https://files.pythonhosted.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
b02afae5
JR
20# Source0-md5: 99e2001affe861ae3a5aa2e9f233e2d7
21Patch0: tesseract4.patch
16bee122
ER
22URL: https://github.com/sirfz/tesserocr
23BuildRequires: rpm-pythonprov
24BuildRequires: rpmbuild(macros) >= 1.714
25BuildRequires: tesseract-devel >= 3.04
26%if %{with python2}
2002dbb2 27BuildRequires: python-Cython
16bee122 28BuildRequires: python-devel
2002dbb2 29BuildRequires: python-pillow
16bee122
ER
30BuildRequires: python-setuptools
31%endif
32%if %{with python3}
2002dbb2 33BuildRequires: python3-Cython
16bee122 34BuildRequires: python3-devel
2002dbb2 35BuildRequires: python3-pillow
16bee122
ER
36BuildRequires: python3-setuptools
37%endif
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
41tesserocr integrates directly with Tesseract's C++ API using Cython
42which allows for a simple Pythonic and easy-to-read source code. It
43enables real concurrent execution when used with Python's threading
44module by releasing the GIL while processing an image in tesseract.
45
46tesserocr is designed to be Pillow-friendly but can also be used with
47image files instead.
48
49%package -n python3-%{pypi_name}
50Summary: A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
51Group: Libraries/Python
52
53%description -n python3-%{pypi_name}
54tesserocr integrates directly with Tesseract's C++ API using Cython
55which allows for a simple Pythonic and easy-to-read source code. It
56enables real concurrent execution when used with Python's threading
57module by releasing the GIL while processing an image in tesseract.
58
59tesserocr is designed to be Pillow-friendly but can also be used with
60image files instead.
61
62%prep
63%setup -q -n %{pypi_name}-%{version}
b02afae5 64%patch0 -p1
16bee122
ER
65
66# Remove bundled egg-info
67%{__rm} -r %{egg_name}.egg-info
68
69%build
70%if %{with python2}
71%py_build %{?with_tests:test}
72%endif
73
74%if %{with python3}
75%py3_build %{?with_tests:test}
76%endif
77
78%install
79rm -rf $RPM_BUILD_ROOT
80%if %{with python2}
81%py_install
82%py_postclean
83%endif
84
85%if %{with python3}
86%py3_install
87%endif
88
89%clean
90rm -rf $RPM_BUILD_ROOT
91
92%if %{with python2}
93%files
94%defattr(644,root,root,755)
95%doc README.rst
96%attr(755,root,root) %{py_sitedir}/%{module}.so
97%{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
98%endif
99
100%if %{with python3}
101%files -n python3-%{pypi_name}
102%defattr(644,root,root,755)
103%doc README.rst
104%attr(755,root,root) %{py3_sitedir}/%{module}.*.so
105%{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info
106%endif
This page took 0.114473 seconds and 4 git commands to generate.