]> git.pld-linux.org Git - packages/python-tesserocr.git/blob - python-tesserocr.spec
93ad5b555b10672236f5bd3d3b573f767446883e
[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.2.2
16 Release:        2
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:  e6c9c8f6f6720e16cd612146e20e7feb
21 URL:            https://github.com/sirfz/tesserocr
22 BuildRequires:  rpm-pythonprov
23 BuildRequires:  rpmbuild(macros) >= 1.714
24 BuildRequires:  tesseract-devel >= 3.04
25 %if %{with python2}
26 BuildRequires:  python-Cython
27 BuildRequires:  python-devel
28 BuildRequires:  python-pillow
29 BuildRequires:  python-setuptools
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3-Cython
33 BuildRequires:  python3-devel
34 BuildRequires:  python3-pillow
35 BuildRequires:  python3-setuptools
36 %endif
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
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.
44
45 tesserocr is designed to be Pillow-friendly but can also be used with
46 image files instead.
47
48 %package -n python3-%{pypi_name}
49 Summary:        A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython
50 Group:          Libraries/Python
51
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.
57
58 tesserocr is designed to be Pillow-friendly but can also be used with
59 image files instead.
60
61 %prep
62 %setup -q -n %{pypi_name}-%{version}
63
64 # Remove bundled egg-info
65 %{__rm} -r %{egg_name}.egg-info
66
67 %build
68 %if %{with python2}
69 %py_build %{?with_tests:test}
70 %endif
71
72 %if %{with python3}
73 %py3_build %{?with_tests:test}
74 %endif
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78 %if %{with python2}
79 %py_install
80 %py_postclean
81 %endif
82
83 %if %{with python3}
84 %py3_install
85 %endif
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %if %{with python2}
91 %files
92 %defattr(644,root,root,755)
93 %doc README.rst
94 %attr(755,root,root) %{py_sitedir}/%{module}.so
95 %{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
96 %endif
97
98 %if %{with python3}
99 %files -n python3-%{pypi_name}
100 %defattr(644,root,root,755)
101 %doc README.rst
102 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
103 %{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info
104 %endif
This page took 0.047626 seconds and 2 git commands to generate.