LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File tesseract.spec of Package tesseract (Project Documentation:Tools)

#
# spec file for package tesseract
#
# 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 http://bugs.opensuse.org/
#


%define tarname tesseract-ocr
%define so_ver 3

Name:           tesseract
Version:        3.02.02
Release:        0
Summary:        Open Source OCR Engine
License:        Apache-2.0 and GPL-2.0+
Group:          Productivity/Graphics/Other
Url:            http://code.google.com/p/tesseract-ocr/
Source0:        http://tesseract-ocr.googlecode.com/files/%{tarname}-%{version}.tar.gz
Source1:        http://tesseract-ocr.googlecode.com/files/%{tarname}-%{version}-doc-html.tar.gz
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  liblept-devel
BuildRequires:  pkg-config
Recommends:     tesseract-traineddata-american
Provides:       %{tarname} = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A commercial quality OCR engine originally developed at HP between 1985 and
1995. In 1995, this engine was among the top 3 evaluated by UNLV. It was
open-sourced by HP and UNLV in 2005. From 2007 it is developed by Google.

%package devel
Summary:        Tesseract Open Source OCR Engine Development files
Group:          Development/Libraries/Other
Requires:       liblept-devel
Requires:       libtesseract%{so_ver} = %{version}

%description devel
This package contains development files for the Tesseract Open Source OCR
Engine.

%package -n libtesseract%{so_ver}
Summary:        Open Source OCR Engine
Group:          System/Libraries

%description -n libtesseract%{so_ver}
A commercial quality OCR engine originally developed at HP between 1985 and
1995. In 1995, this engine was among the top 3 evaluated by UNLV. It was
open-sourced by HP and UNLV in 2005. From 2007 it is developed by Google.

%prep
%setup -q -b1 -n %{tarname}

%build
export CXXFLAGS="%{optflags} -fno-strict-aliasing -fPIC"
%configure --disable-static
make %{?_smp_mflags}

%install
%make_install

# Remove libtool config files
rm -f %{buildroot}%{_libdir}/libtesseract.la

# Manually install the devel docs in order to fix rpmlint warnings "files-duplicate" and "doc-file-dependency"
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-devel
cp -a doc/html/ %{buildroot}%{_defaultdocdir}/%{name}-devel/
# Fix rpmlint warning "doc-file-dependency"
rm -f %{buildroot}%{_defaultdocdir}/%{name}-devel/html/installdox

# Fix rpmlint warning "files-duplicate"
%fdupes -s %{buildroot}

%post -n libtesseract%{so_ver} -p /sbin/ldconfig

%postun -n libtesseract%{so_ver} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog README ReleaseNotes
%{_bindir}/*
%dir %{_datadir}/tessdata
%{_datadir}/tessdata/configs/
%{_datadir}/tessdata/tessconfigs/
%{_mandir}/man1/*.1%{ext_man}
%{_mandir}/man5/*.5%{ext_man}

%files devel
%defattr(-,root,root,-)
%doc %{_defaultdocdir}/%{name}-devel/
%{_includedir}/%{name}/
%{_libdir}/lib%{name}*.so
%{_libdir}/pkgconfig/*.pc

%files -n libtesseract%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libtesseract.so.%{so_ver}*

%changelog