File leptonica.spec of Package leptonica

#
# spec file for package leptonica
#
# Copyright (c) 2012 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 major   3

Name:           leptonica
Version:        1.69
Release:        0
Summary:        Leptonica Library
License:        BSD-2-Clause
Group:          System/Libraries
Url:            http://code.google.com/p/leptonica/
Source0:        http://leptonica.googlecode.com/files/leptonica-%{version}.tar.bz2
Source1:        baselibs.conf
# PATCH-FIX-UPSTREAM liblept-1.69-no_return.patch lazy.kent@opensuse.org -- fix no-return-in-nonvoid-function error
# Reported upstream: http://code.google.com/p/leptonica/issues/detail?id=69
Patch0:         liblept-1.69-no_return.patch
BuildRequires:  giflib-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  libtool
%if 0%{?suse_version} >= 1210
BuildRequires:  pkgconfig(libwebp)
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Library for efficient image processing and image analysis operations.

%package -n liblept%{major}
Summary:        Leptonica Library
Group:          System/Libraries

%description -n liblept%{major}
Library for efficient image processing and image analysis operations.

%package -n liblept-devel
Summary:        Leptonica Development Files
Group:          Development/Libraries/C and C++
Requires:       liblept%{major} = %{version}

%description -n liblept-devel
Development files for Leptonica library.

%package tools
Summary:        Leptonica tools
Group:          Productivity/Graphics/Other

%description tools
Programs for manipulating images.

%prep
%setup -q
%patch -P 0 -p0

%build
%configure \
    --disable-static \
    --program-prefix=leptonica-
make %{?_smp_mflags}

%install
make install DESTDIR="%buildroot"
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_bindir}/{*gen,*reg,*test*}

%post -n liblept%{major} -p /sbin/ldconfig

%postun -n liblept%{major} -p /sbin/ldconfig

%files -n liblept%{major}
%defattr(-,root,root)
%{_libdir}/liblept.so.3*

%files -n liblept-devel
%defattr(-,root,root)
%doc leptonica-license.txt README.html version-notes.html moller52.jpg
%{_includedir}/leptonica
%{_libdir}/liblept.so

%files -n leptonica-tools
%defattr(-,root,root)
%doc leptonica-license.txt
%{_bindir}/leptonica-*

%changelog
openSUSE Build Service is sponsored by