3 # - tests fail: raise RuntimeError('Failed to initialize API')
6 %bcond_with tests # do not perform "make test"
7 %bcond_without python2 # CPython 2.x module
8 %bcond_without python3 # CPython 3.x module
10 %define module tesserocr
11 %define egg_name tesserocr
12 %define pypi_name tesserocr
13 Summary: A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
14 Name: python-%{pypi_name}
18 Group: Libraries/Python
19 Source0: https://files.pythonhosted.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
20 # Source0-md5: e6c9c8f6f6720e16cd612146e20e7feb
21 URL: https://github.com/sirfz/tesserocr
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: tesseract-devel >= 3.04
26 BuildRequires: python-Cython
27 BuildRequires: python-devel
28 BuildRequires: python-pillow
29 BuildRequires: python-setuptools
32 BuildRequires: python3-Cython
33 BuildRequires: python3-devel
34 BuildRequires: python3-pillow
35 BuildRequires: python3-setuptools
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 tesserocr integrates directly with Tesseract's C++ API using Cython
41 which allows for a simple Pythonic and easy-to-read source code. It
42 enables real concurrent execution when used with Python's threading
43 module by releasing the GIL while processing an image in tesseract.
45 tesserocr is designed to be Pillow-friendly but can also be used with
48 %package -n python3-%{pypi_name}
49 Summary: A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
50 Group: Libraries/Python
52 %description -n python3-%{pypi_name}
53 tesserocr integrates directly with Tesseract's C++ API using Cython
54 which allows for a simple Pythonic and easy-to-read source code. It
55 enables real concurrent execution when used with Python's threading
56 module by releasing the GIL while processing an image in tesseract.
58 tesserocr is designed to be Pillow-friendly but can also be used with
62 %setup -q -n %{pypi_name}-%{version}
64 # Remove bundled egg-info
65 %{__rm} -r %{egg_name}.egg-info
69 %py_build %{?with_tests:test}
73 %py3_build %{?with_tests:test}
77 rm -rf $RPM_BUILD_ROOT
88 rm -rf $RPM_BUILD_ROOT
92 %defattr(644,root,root,755)
94 %attr(755,root,root) %{py_sitedir}/%{module}.so
95 %{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
99 %files -n python3-%{pypi_name}
100 %defattr(644,root,root,755)
102 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
103 %{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info