File tesseract-gui.spec of Package tesseract-gui

# spec file for package tesseract-gui
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           tesseract-gui
Version:        2.9
Release:        0
License:        GPL-3.0+
Summary:        GTK+ Based GUI for Tesseract
Group:          Productivity/Graphics/Other
BuildRequires:  hicolor-icon-theme
BuildRequires:  python-base
BuildRequires:  rsvg-view
BuildRequires:  update-desktop-files
Requires:       ImageMagick
Requires:       python-gtk
Requires:       tesseract-ocr >= 3.00
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

Tesseract-GUI is not a front-end for tesseract-ocr.
It is just a graphical way to use it with simple image manipulation
thru ImageMagick.

Some features are:
* Auto-index: Process lots of images and index and rename all output
  text files automatically.
* Rotate: To correct the angle of images after scan and before covert
* Crop: Convert just an area of the image. You can use it to create
* Contrast: Lighten or darken the edge of the characters of the image.
* Generalize: Apply the changes to every image.
* Concatenate: Now you can create an only final text file with this

%setup -q
sed -i 's/env python/python/' bin/%{name}.py


# Create a desktop file because the original one is incorrect.
cat > %{name}.desktop << EOF
[Desktop Entry]
Name=Tesseract GUI
GenericName=GTK+ Based GUI for Tesseract
GenericName[ru]=Графическая оболочка для Tesseract
Comment=Manipulate and OCR scanned images
Comment[ru]=Оптическое распознавание отсканированных изображений

install -Dm 0755 bin/%{name}.py \
install -dm 0755 %{buildroot}%{_bindir}/
ln -s ../share/%{name}/%{name}.py %{buildroot}%{_bindir}/%{name}
install -m 0644 share/tesseract-gui/* \

# Python byte compile.
pushd %{buildroot}%{_datadir}/%{name}/
%py_compile .

# Install icons of various sizes.
install -Dm 0644 share/icons/%{name}-icon.svg \
for s in 256 128 96 64 48 32 22 16 ; do
install -dm 0755 \
rsvg-convert -w ${s} -h ${s} share/icons/%{name}-icon.svg -o \

%suse_update_desktop_file -i %{name}