File ocrfeeder.spec of Package ocrfeeder
#
# spec file for package ocrfeeder
#
# 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 http://bugs.opensuse.org/
#
Summary: OCRFeeder - Optical Character Recognition program
Name: ocrfeeder
Version: 0.8.1
Release: 0
Group: Productivity/Graphics/Other
License: GPL-3.0
Url: http://live.gnome.org/OCRFeeder
Source: http://ftp.gnome.org/pub/GNOME/sources/ocrfeeder/%{version}/release_%{version}.tar.xz
Patch0: ocrfeeder.desktop.patch
#Add ancient greek support (grc)
Patch1: grc.patch
Patch2: iso_639_2T.patch
BuildRequires: intltool
BuildRequires: python-enchant
%if 0%{?suse_version} <= 131
BuildRequires: python-imaging-sane
%else
BuildRequires: python-sane
%endif
BuildRequires: python-reportlab
BuildRequires: python-setuptools
#This is required to launch Xvfb because of python-gtk
BuildRequires: xorg-x11-server
%if 0%{?suse_version}
## the following is an attempt to get around this horrible message.
## configure.ac:31: warning: macro `AM_GLIB_GNU_GETTEXT' not found in library
# BuildRequires: pkg-config
# BuildRequires: libtool
BuildRequires: gtk3-devel
## note the disconnect between the error message and the fix.
##
BuildRequires: gnome-doc-utils-devel >= 0.3.2
BuildRequires: python-gtkspell
BuildRequires: sane-backends-devel
BuildRequires: python-gtk
BuildRequires: python-goocanvas
BuildRequires: python-gobject
BuildRequires: python-gobject-cairo
BuildRequires: python-gobject2
BuildRequires: python-gnome
BuildRequires: gobject-introspection
BuildRequires: gobject-introspection-devel
BuildRequires: goocanvas
BuildRequires: goocanvas-devel
## the next two should be part of the build environment, but are
## constanlty missing ever since. takes me 10 minutes each time
## when the build process fails very late, what a waste of time.
BuildRequires: update-desktop-files
BuildRequires: fdupes
## The above are the fix for /var/tmp/rpm-tmp.mkeCpx: line 54: fg: no job control
## note the disconnect between the error message and the fix.
Requires: python-gtkspell
Requires: python-gtk
Requires: python-goocanvas
Requires: sane-backends
BuildRequires: automake
BuildRequires: intltool
BuildRequires: gnome-common
## 11.4 needs to mention xz explicily:
BuildRequires: xz
%{py_requires}
%else # FEDORA
BuildRequires: gnome-doc-utils >= 0.3.2
BuildRequires: gnome-python2-gtkspell
BuildRequires: sane-backends-libs
BuildRequires: pygtk2-devel
BuildRequires: pygoocanvas-devel
Requires: gnome-python2-gtkspell
Requires: pygoocanvas
Requires: pygtk2
%endif
Requires: ghostscript
Requires: tesseract
Recommends: cuneiform >= 1.1.0
Requires: python >= 2.6, python <= 3.0
Requires: python-enchant
%if 0%{suse_version} <= 131
Requires: python-imaging
Requires: python-imaging-sane
%else
Requires: python-Pillow
Requires: python-sane
%endif
Requires: python-reportlab
Requires: python-lxml
# It doesn't run in 12.3, for it includes a pre-release that lacks typelib for gtkspell
Requires: unpaper >= 0.3
Obsoletes: %name < %version
BuildArch: noarch
%description
A document layout analysis and optical character recognition system.
Given the images it will automatically outline its contents,
distinguish between what's graphics and text and perform OCR over the latter.
It generates multiple formats, its main one being ODT.
%prep
%setup -q -n release_%{version}
%patch0 -p0
%patch1 -p1
%patch2 -p1
%build
#autoreconf -fi
#Start Xvfb
export DISPLAY=:98
Xvfb :98 &
trap "kill $! || true" EXIT
sleep 10
./autogen.sh --libdir=%{_datadir}
#%configure --libdir=%{_datadir}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
install -d -m 755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
(
cd %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
ln -s ../../../../ocrfeeder/icons/ocrfeeder.svg .
)
%if 0%{?suse_version}
%fdupes %{buildroot}%{python_sitelib}
## I've studied
## http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
## But the Categories Graphics Scanning OCR cannot be found there.
## I've taken them from home:gberh ocrfeeder.
##
## The original fedora categories Application;Office; are apparently forbidden
## with SUSE.
## ERROR: No sufficient Category definition: /home/abuild/rpmbuild/BUILDROOT/ocrfeeder-0.7.7-2.i386//usr/share/applications/ocrfeeder.desktop
## Errors in installed desktop file detected. Please refer to http://en.opensuse.org/SUSE_Package_Conventions/RPM_Macros
%suse_update_desktop_file -u -r -G 'OCR Suite' %{name} Office Graphics Scanning OCR
%endif
%find_lang %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS NEWS README COPYING
%{_bindir}/%{name}
%{_bindir}/%{name}-cli
%{_datadir}/%{name}
%{_datadir}/gnome/help/%{name}/*/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/ocrfeeder.svg
%{_mandir}/man1/*.1.gz
%{python_sitelib}/*
%changelog