]> git.pld-linux.org Git - packages/python-tesserocr.git/blob - python-tesserocr.spec
f39e1f419987f1169d1660cf341259bafb7a04d9
[packages/python-tesserocr.git] / python-tesserocr.spec
1 #
2 # TODO
3 # - tests fail: raise RuntimeError('Failed to initialize API')
4
5 # Conditional build:
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
9
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}
15 Version:        2.3.1
16 Release:        4
17 License:        MIT
18 Group:          Libraries/Python
19 Source0:        https://files.pythonhosted.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
20 # Source0-md5:  99e2001affe861ae3a5aa2e9f233e2d7
21 Patch0:         tesseract4.patch
22 URL:            https://github.com/sirfz/tesserocr
23 BuildRequires:  rpm-pythonprov
24 BuildRequires:  rpmbuild(macros) >= 1.714
25 BuildRequires:  tesseract-devel >= 3.04
26 %if %{with python2}
27 BuildRequires:  python-Cython
28 BuildRequires:  python-devel
29 BuildRequires:  python-pillow
30 BuildRequires:  python-setuptools
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-Cython
34 BuildRequires:  python3-devel
35 BuildRequires:  python3-pillow
36 BuildRequires:  python3-setuptools
37 %endif
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 tesserocr integrates directly with Tesseract's C++ API using Cython
42 which allows for a simple Pythonic and easy-to-read source code. It
43 enables real concurrent execution when used with Python's threading
44 module by releasing the GIL while processing an image in tesseract.
45
46 tesserocr is designed to be Pillow-friendly but can also be used with
47 image files instead.
48
49 %package -n python3-%{pypi_name}
50 Summary:        A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
51 Group:          Libraries/Python
52
53 %description -n python3-%{pypi_name}
54 tesserocr integrates directly with Tesseract's C++ API using Cython
55 which allows for a simple Pythonic and easy-to-read source code. It
56 enables real concurrent execution when used with Python's threading
57 module by releasing the GIL while processing an image in tesseract.
58
59 tesserocr is designed to be Pillow-friendly but can also be used with
60 image files instead.
61
62 %prep
63 %setup -q -n %{pypi_name}-%{version}
64 %patch0 -p1
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
79 rm -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
90 rm -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.066176 seconds and 2 git commands to generate.