Blob Blame History Raw
%global srcname pyocr

Name:           python-%{srcname}
Version:        0.8.2
Release:        %autorelease
Summary:        Python wrapper for OCR engines (Tesseract, Cuneiform, etc)

License:        GPLv3+
Source0:        %pypi_source

BuildArch:      noarch

BuildRequires:  tesseract
BuildRequires:  tesseract-osd
BuildRequires:  tesseract-langpack-fra
BuildRequires:  tesseract-langpack-jpn

%global _description \
A Python wrapper for Tesseract and Cuneiform

%description %{_description}

%package -n     python3-%{srcname}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(sphinx)

Recommends:     tesseract

%description -n python3-%{srcname} %{_description}

%autosetup -n %{srcname}-%{version} -p1

%pyproject_buildrequires -r


# generate html docs
PYTHONPATH=${PWD}/build/lib sphinx-build-3 doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%pyproject_save_files %{srcname}

export LANG=C.UTF-8
%{pytest} tests

%files -n python3-%{srcname} -f %{pyproject_files}
%doc AUTHORS ChangeLog html
%license COPYING