# Override default upstream location [/usr/share/doc/libhocr] %define hocrdocdir %{_docdir}/%{name}-%{version} # sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: libhocr Version: 0.10.17 Release: 6%{?dist} Summary: A Hebrew optical character recognition library Group: System Environment/Libraries License: GPLv3+ URL: http://hocr.berlios.de Source0: http://download.berlios.de/hocr/%{name}-%{version}.tar.bz2 # Sent upstream (private mail, the project has no mailing list) Patch0: libhocr-missing-incl.patch # Fix fedora bugs #574259, #577657, #574631 # Sent upstream (private mail, the project has no mailing list) Patch1: libhocr-no-scanner.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: fftw-devel, hspell-devel, libtiff-devel BuildRequires: desktop-file-utils BuildRequires: swig, python-devel, gtk2-devel, gettext %description LibHocr is a GNU Hebrew optical character recognition library. It scans document images, improve the image, analyzes the page layout, recognizes the characters and outputs the text. The output texts are now editable text, ready for your blog, word processor or any other use. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: gtk2-devel # We ship *.pc files (requires the -devel of contained libs) Requires: pkgconfig Requires: hspell-devel, libtiff-devel %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package gtk Summary: GTK+ application for %{name} Group: Applications/Productivity Requires: %{name} = %{version}-%{release} Requires: python-imaging-sane, pygtk2-libglade Requires: python(hocr) = %{version}-%{release} # We use gtktextbuffer which uses gtkspell which have a runtime # check of the spellcheck backends... so here it is: Requires: hspell %description gtk The %{name}-gtk package contains a GUI application that uses %{name}. %package python Summary: Python bindings for %{name} Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} Requires: python > 2.5 Provides: python(hocr) = %{version}-%{release} %description python The %{name}-python package contains python binding for %{name}. %prep %setup -q %patch0 %patch1 %build export CFLAGS="%optflags -Werror-implicit-function-declaration" %configure #--disable-static make # %{?_smp_mflags} find . -name '*.desktop' | while read file; do /usr/bin/desktop-file-validate "$file" done %install rm -rf %{buildroot} # We must preserve timestamps so we don't cause # problems for multilib architectures. Use install -p # Ref: https://fedoraproject.org/wiki/PackagingDrafts/MultilibTricks#Timestamps make install \ DESTDIR=%{buildroot} \ INSTALL="%{__install} -p" \ hocrdocdir=%{hocrdocdir} \ examples_binding_dir=%{hocrdocdir}/examples/bindings find %{buildroot} -name '*.la' -exec rm -f {} ';' # Remove static libs per Fedora packaging policy find %{buildroot} -name '*.a' -exec rm -f {} ';' rm -f %{buildroot}/%{hocrdocdir}/NEWS # Empty, not usefull. rm -f %{buildroot}/%{hocrdocdir}/INSTALL # Not needed anymore ;-) desktop-file-install --vendor="fedora" \ --add-category="Graphics" \ --delete-original \ --dir=%{buildroot}%{_datadir}/applications \ %{buildroot}/%{_datadir}/applications/hocr-gtk.desktop \ %{buildroot}/%{_datadir}/applications/sane-pygtk.desktop %find_lang hocr-gtk %find_lang sane-pygtk cat hocr-gtk.lang sane-pygtk.lang > %{name}.lang %clean rm -rf %{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc %dir %{hocrdocdir} %doc %{hocrdocdir}/AUTHORS %doc %{hocrdocdir}/COPYING %doc %{hocrdocdir}/ChangeLog %doc %{hocrdocdir}/HACKING %doc %{hocrdocdir}/README %{_libdir}/*.so.* %{_bindir}/hocr %{_mandir}/man1/*.1* %files devel %defattr(-,root,root,-) %doc %{_mandir}/man3/*.3* %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %doc %{hocrdocdir}/examples %files gtk -f %{name}.lang %defattr(-,root,root,-) %{_bindir}/hocr-gtk %{_bindir}/sane-pygtk %{_datadir}/applications/*.desktop %{_datadir}/hocr-gtk %{_datadir}/pixmaps/hocr1-128.png %{_datadir}/pixmaps/hocr1-48.png %{_datadir}/sane-pygtk %files python %defattr(-,root,root,-) # For noarch packages: sitelib %{python_sitelib}/*.py* # For arch-specific packages: sitearch %{python_sitearch}/_hocr.so %changelog * Mon Jun 7 2010 Oron Peled <oron@actcom.co.il> - 0.10.17-6 - Fix fedora bugs #574259, #577657, #574631 - Applied a local patch, since upstream did not issued any release since Mar-2010, despite several bug reports (some with fixes). I'll send this fix upstream for inclusion (one can always hope ;-) * Thu Feb 18 2010 Oron Peled <oron@actcom.co.il> - 0.10.17-5 - Fix fedora bug 565233 -- Added python(hocr) as provides to libhocr-python and as requires to libhocr-gtk * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.17-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.17-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.10.17-2 - Rebuild for Python 2.6 * Sat Aug 16 2008 Oron Peled <oron@actcom.co.il> 0.10.17-1 - New upstream version (See installed ChangeLog) - Our patches merged upstream. Only a single patch needed to build. * Thu Aug 14 2008 Oron Peled <oron@actcom.co.il> 0.10.13-3 - More packaging fixes - Patches for upstream: some compile warning cleanup and .desktop files fixes. * Sun Aug 3 2008 Oron Peled <oron@actcom.co.il> 0.10.13-2 - Packaging fixes - Two new patches against upstream * Tue Jul 22 2008 Oron Peled <oron@actcom.co.il> 0.10.13-1 - New upstream version (see ChangeLog) - All patches merged upstream. * Mon Jul 21 2008 Oron Peled <oron@actcom.co.il> 0.10.11-2 - Fix python install directories (on x86_64). * Mon Jul 14 2008 Oron Peled <oron@actcom.co.il> 0.10.11-1 - initial release