Blob Blame History Raw
Name:          gimagereader
Version:       3.1.99
Release:       1%{?dist}
Summary:       A front-end to tesseract-ocr

License:       GPLv3+
URL:           https://github.com/manisandro/gimagereader
Source0:       https://github.com/manisandro/gimagereader/releases/download/v%{version}/%{name}-%{version}.tar.xz

BuildRequires: cmake
BuildRequires: gtkmm30-devel
BuildRequires: gtkspellmm30-devel
BuildRequires: gtksourceviewmm3-devel
BuildRequires: cairomm-devel
BuildRequires: poppler-glib-devel
BuildRequires: tesseract-devel
BuildRequires: sane-backends-devel
BuildRequires: intltool
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: qt5-qtbase-devel
BuildRequires: qtspell-qt5-devel
BuildRequires: poppler-qt5-devel
BuildRequires: json-glib-devel
BuildRequires: libxml++-devel
BuildRequires: podofo-devel

Requires:      hicolor-icon-theme

%description
gImageReader is a simple front-end to tesseract. Features include:
 - Import PDF documents and images from disk, scanning devices, clipboard and screenshots
 - Process multiple images and documents in one go
 - Manual or automatic recognition area definition
 - Recognize to plain text or to hOCR documents
 - Recognized text displayed directly next to the image
 - Post-process the recognized text, including spellchecking
 - Generate PDF documents from hOCR documents


%package gtk
Summary:       A Gtk+ front-end to tesseract-ocr
Requires:      %{name}-common = %{version}-%{release}
Obsoletes:     %{name} < 2.94-1

%description gtk
gImageReader is a simple front-end to tesseract. Features include:
 - Import PDF documents and images from disk, scanning devices, clipboard and screenshots
 - Process multiple images and documents in one go
 - Manual or automatic recognition area definition
 - Recognize to plain text or to hOCR documents
 - Recognized text displayed directly next to the image
 - Post-process the recognized text, including spellchecking
 - Generate PDF documents from hOCR documents
This package contains the Gtk+ front-end.


%package qt
Summary:       A Qt front-end to tesseract-ocr
Requires:      %{name}-common = %{version}-%{release}

%description qt
gImageReader is a simple front-end to tesseract. Features include:
 - Import PDF documents and images from disk, scanning devices, clipboard and screenshots
 - Process multiple images and documents in one go
 - Manual or automatic recognition area definition
 - Recognize to plain text or to hOCR documents
 - Recognized text displayed directly next to the image
 - Post-process the recognized text, including spellchecking
 - Generate PDF documents from hOCR documents
This package contains the Qt front-end.

%package common
Summary:       Common files for %{name}
BuildArch:     noarch

%description common
Common files for %{name}.


%prep
%setup -q


%build
mkdir build_gtk
(
cd build_gtk
%cmake -DINTERFACE_TYPE=gtk -DENABLE_VERSIONCHECK=0 -DMANUAL_DIR="%{_defaultdocdir}/%{name}-common" ..
%make_build
)
mkdir build_qt
(
cd build_qt
%cmake -DINTERFACE_TYPE=qt5 -DENABLE_VERSIONCHECK=0 -DMANUAL_DIR="%{_defaultdocdir}/%{name}-common" ..
%make_build
)


%install
%make_install -C build_gtk
%make_install -C build_qt
%{_bindir}/desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}-gtk.desktop
%{_bindir}/desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}-qt5.desktop
%{_bindir}/appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}-gtk.appdata.xml
%{_bindir}/appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}-qt5.appdata.xml

%find_lang %{name}


%post gtk
/usr/bin/update-desktop-database &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :


%postun gtk
/usr/bin/update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans gtk
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :


%post qt
/usr/bin/update-desktop-database &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :


%postun qt
/usr/bin/update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans qt
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files common -f %{name}.lang
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%doc %{_defaultdocdir}/%{name}-common/manual*.html

%files gtk
%{_bindir}/%{name}-gtk
%{_datadir}/appdata/%{name}-gtk.appdata.xml
%{_datadir}/applications/%{name}-gtk.desktop
%{_datadir}/glib-2.0/schemas/org.gnome.%{name}.gschema.xml

%files qt
%{_bindir}/%{name}-qt5
%{_datadir}/appdata/%{name}-qt5.appdata.xml
%{_datadir}/applications/%{name}-qt5.desktop

%changelog
* Fri Oct 14 2016 Sandro Mani <manisandro@gmail.com> - 3.1.99-1
- Update to 3.1.99

* Tue May 03 2016 Sandro Mani <manisandro@gmail.com> - 3.1.91-1
- Update to 3.1.91

* Thu Apr 28 2016 Sandro Mani <manisandro@gmail.com> - 3.1.90-1
- Update to 3.1.90

* Thu Feb 04 2016 Sandro Mani <manisandro@gmail.com> - 3.1.2-5
- Add patch to fix FTBFS

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Oct 16 2015 Sandro Mani <manisandro@gmail.com> - 3.1.2-3
- Rebuild (tesseract)

* Wed Oct 14 2015 Sandro Mani <manisandro@gmail.com> - 3.1.2-2
- Rebuild (tesseract)

* Tue Jun 30 2015 Sandro Mani <manisandro@gmail.com> - 3.1.2-1
- Update to 3.1.2

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Jun 11 2015 Sandro Mani <manisandro@gmail.com> - 3.1.1-1
- Update to 3.1.1

* Fri May 01 2015 Sandro Mani <manisandro@gmail.com> - 3.1-1
- Update to 3.1

* Sun Jan 04 2015 Sandro Mani <manisandro@gmail.com> - 3.0.1-1
- Update to 3.0.1.

* Mon Dec 15 2014 Sandro Mani <manisandro@gmail.com> - 3.0-1
- Update to 3.0.

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.93-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Wed Aug 13 2014 Sandro Mani <manisandro@gmail.com> - 2.93-4
- Rebuild (tesseract)

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.93-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun May 04 2014 Sandro Mani <manisandro@gmail.com> - 2.93-2
- Workaround rhbz #1065695

* Wed Apr 30 2014 Sandro Mani <manisandro@gmail.com> - 2.93-1
- Update to 2.93

* Wed Mar 19 2014 Sandro Mani <manisandro@gmail.com> - 2.92-1
- Update to 2.92

* Thu Feb 20 2014 Sandro Mani <manisandro@gmail.com> - 2.91-1
- Update to 2.91

* Sat Feb 15 2014 Sandro Mani <manisandro@gmail.com> - 2.91-0.2git20140216
- Update to newer 2.91 pre, work around crash at exit

* Thu Feb 13 2014 Sandro Mani <manisandro@gmail.com> - 2.91-0.1
- Update to 2.91 pre

* Thu Feb 13 2014 Sandro Mani <manisandro@gmail.com> - 2.90-3
- Require hicolor-icon-theme
- Add missing icon theme scriptlets

* Wed Feb 12 2014 Sandro Mani <manisandro@gmail.com> - 2.90-2
- Add appdata file

* Tue Feb 11 2014 Sandro Mani <manisandro@gmail.com> - 2.90-1
- Initial package.