%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?__python2: %define __python2 %{__python}} %define name ocrfeeder %define nameuc OCRFeeder Name: %{name} Version: 0.8.1 Release: 0%{?dist}.2sunshine Summary: Document layout analysis and optical character recognition system Group: Applications/File License: GPLv3+ and LGPLv2+ URL: https://wiki.gnome.org/%{nameuc} Source0: https://download.gnome.org/sources/%{name}/0.8/%{name}-%{version}.tar.xz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildArch: noarch BuildRequires: intltool >= 0.35.0 BuildRequires: python-devel >= 2.5 BuildRequires: pygtk2-devel >= 2.13 BuildRequires: perl(XML::Parser) BuildRequires: gnome-python2-gtkspell BuildRequires: gnome-doc-utils >= 0.3.2 # from README # these should ideally be Requires only, see those below # pygoocanvas: README says >= 0.12 BuildRequires: pygoocanvas >= 0.10 BuildRequires: python-enchant >= 1.3 BuildRequires: python-reportlab # python-imaging-sane: README says >= 1.1.7 %if (0%{?fedora} && 0%{?fedora} < 19) BuildRequires: python-imaging >= 1.1 BuildRequires: python-imaging-sane >= 1.1 %else BuildRequires: python-pillow BuildRequires: python-sane %endif BuildRequires: goocanvas2 BuildRequires: python-gobject BuildRequires: gobject-introspection # Trying to support both Fedora and RHEL, F21 obsoletes python-setuptools-devel # https://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel %if (0%{?fedora} && 0%{?fedora} < 21) BuildRequires: python-setuptools-devel %else BuildRequires: python-setuptools %endif Requires: pygtk2 >= 2.13 Requires: python-enchant >= 1.3 Requires: python-reportlab %if (0%{?fedora} && 0%{?fedora} < 19) Requires: python-imaging >= 1.1 # python-imaging-sane: README says >= 1.1.7 Requires: python-imaging-sane >= 1.1 %else Requires: python-pillow Requires: python-sane %endif Requires: goocanvas2 Requires: gnome-python2-gtkspell # pygoocanvas: README says >= 0.12 Requires: pygoocanvas >= 0.10 Requires: ghostscript >= 8.63 Requires: unpaper >= 0.3 Requires(post): desktop-file-utils Requires(postun): desktop-file-utils %description OCRFeeder is a document layout analysis and optical character recognition application. It is able to automatically outline a document image's contents, distinguish between graphics and text and perform OCR over the latter. It can export to several formats, its main one being ODT. OCRFeeder has a GTK+ graphical user interface that allows the user to control the application and, for example, edit and correct the automatic recognition. It can also be used from the command line for automation. %prep %setup -q %build export PYTHON=%{__python2} %configure %{__make} %{?_smp_mflags} %install %{__rm} -rf %{buildroot} %{__make} install DESTDIR=%{buildroot} # this is missed by the new install process %{__install} -Dp resources/icons/%{name}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %find_lang %{name} %post update-desktop-database &> /dev/null || : %postun update-desktop-database &> /dev/null || : %clean %{__rm} -rf %{buildroot} %files -f %{name}.lang %defattr(-,root,root,-) %doc README COPYING NEWS AUTHORS %{_bindir}/%{name} %{_bindir}/%{name}-cli %{python_sitelib}/* %{_datadir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_datadir}/gnome/help/%{name} %{_mandir}/man1/* %changelog * Sat Jun 3 2017 Moritz Barsnick 0.8.1-0.2sunshine - add BR and Requires python-sane (python-pillow no longer contains sane) - add BR python-gobject and gobject-introspection * Sun May 22 2016 Moritz Barsnick 0.8.1-0.1sunshine - update to 0.8.1 - drop patch * Mon Sep 01 2014 Moritz Barsnick 0.7.11-0.9sunshine - python-setuptools-devel is obsolete in F21, https://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel * Mon Sep 01 2014 Moritz Barsnick 0.7.11-0.8sunshine - un-BR python, use %%__python2 instead * Mon Sep 01 2014 Moritz Barsnick 0.7.11-0.7sunshine - BR python (starting on F21, apparently) * Sun Aug 10 2014 Moritz Barsnick 0.7.11-0.6sunshine - add patch from upstream for proper import of python-imaging modules * Thu Apr 10 2014 Moritz Barsnick 0.7.11-0.5sunshine - add BR intltool * Thu Apr 10 2014 Moritz Barsnick 0.7.11-0.4sunshine - add Requires and BR gnome-python2-gtkspell - add Requires and BR python-reportlab * Wed Apr 09 2014 Moritz Barsnick 0.7.11-0.3sunshine - fix license (bz #961223) * Wed Apr 09 2014 Moritz Barsnick 0.7.11-0.2sunshine - update desktop database - fix %%changelog * Wed Apr 09 2014 Moritz Barsnick 0.7.11-0.1sunshine - update to 0.7.11 - new URL * Mon Nov 05 2012 Moritz Barsnick 0.7.10-0.1sunshine - update to 0.7.10 * Fri May 04 2012 Moritz Barsnick 0.7.9-0.1sunshine - update to 0.7.9 * Tue Mar 20 2012 Moritz Barsnick 0.7.8-0.1sunshine - update to 0.7.8 - drop my modules patch, it's upstream (hurray!) * Sun Dec 18 2011 Moritz Barsnick 0.7.7-0.1sunshine - update to 0.7.7 - use xz compressed source - update dependencies according to README * Fri May 20 2011 Moritz Barsnick 0.7.5-0.1sunshine - update to 0.7.5 * Mon Mar 21 2011 Moritz Barsnick 0.7.4-0.1sunshine - update to 0.7.4 - drop the PyGtk version patch, the detection mechanism has changed (and no longer enforces a too high version) - add a patch for the new python module detection mechanism, you can't "import gtk" in a non-X11 environment; actually, we should probably refrain from detecting the modules at build time and just Require the correct ones - add proper versioned Requires according to README (adapted for F10), and add identical BuildRequires while the build process actually checks these * Tue Jan 04 2011 Moritz Barsnick 0.7.3-0.1sunshine - update to 0.7.3 - the package should be noarch - add a patch to lower required PyGtk version (at build!) from 2.16 to 2.13 for F10 - add Requires: python-enchant (found by trial and error) - make Requires: pygtk versioned - add several BRs: - versioned BR pygtk2-devel - versioned BR perl and perl(XML::Parser) - versioned BR gnome-doc-utils >= 0.3.2 - use %%configure and %%{__make} install, package has switched to autoconf - manually install ocrfeeder.svg, new autoconf based installed misses it - package new GNOME help files - drop missing TRANSLATORS from %%doc * Wed Nov 10 2010 Moritz Barsnick 0.7.1a-0.1sunshine - update to 0.7.1a * Tue Aug 03 2010 Moritz Barsnick 0.7-0.1sunshine - update to 0.7 * Fri Apr 09 2010 Moritz Barsnick 0.6.6-0.1sunshine - update to 0.6.6 - package new AUTHORS file in %%doc - use new normed mktemp BuildRoot - remove the locale dir patch, something similiar is upstream * Fri Mar 26 2010 Moritz Barsnick 0.6.5-0.1sunshine - update to 0.6.5 - package man pages * Sun Jan 24 2010 Moritz Barsnick 0.6-0.1sunshine - update to 0.6 - package name is now lower case, d'uh, thanks for all the extra work - name Source URL (GNOME) - rebase the locale patch - remove the engines hack, engines seem no longer available * Mon Nov 09 2009 Moritz Barsnick 0.4-0.1sunshine - initial RPM, SPEC adapted from squeal.spec, with l18n, and tricks for lower case vs. upper case naming (l18n directory name must equal package name) - add a patch for putting the l18n files into the proper directory structure - explicitly copy engines directory, an install rule is missing