File pypoppler.spec of Package pypoppler

#
# spec file for package pypoppler
#
# Copyright (c) 2016 SUSE LINUX 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/
#


Name:           pypoppler
Version:        0.12.1
Release:        0
Summary:        Python bindings for the Poppler PDF rendering library
License:        GPL-2.0+
Group:          Productivity/Other
Url:            https://launchpad.net/poppler-python/
Source:         pypoppler-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM pypoppler-0.12.1-poppler-0.16.0.patch lp#696025 coolo@novell.com -- Fix build with poppler 0.16.0, based on patch from launchpad
Patch0:         pypoppler-0.12.1-poppler-0.16.0.patch
# PATCH-FIX-UPSTREAM pypoppler-0.12.1-poppler-0.18.0.patch lp#776234 vuntz@opensuse.org -- Fix build with poppler 0.18
Patch1:         pypoppler-0.12.1-poppler-0.18.0.patch
# PATCH-FIX-UPSTREAM pypoppler-0.12.1-poppler-0.39.0.patch lp#1528489 zaitor@opensuse.org -- Fix build with poppler-0.39.0
Patch2:         pypoppler-0.12.1-poppler-0.39.0.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pkgconfig(atk)
BuildRequires:  pkgconfig(poppler-glib)
BuildRequires:  pkgconfig(pycairo)
BuildRequires:  pkgconfig(pygtk-2.0)
%py_requires
%if 0%{?suse_version} <= 1110
%define python_sitelib %{py_sitedir}
%define python_sitearch %{py_sitearch}
%endif

%description
PyPoppler is a wrapper which exposes the poppler API to the
python world. It is fairly complete, most of the API are covered.

%package -n python-poppler
Summary:        Python bindings for the Poppler PDF rendering library
Group:          Productivity/Other
Provides:       %{name} = %{version}

%description -n python-poppler
PyPoppler is a wrapper which exposes the poppler API to the
python world. It is fairly complete, most of the API are covered.

%prep
%setup -q
%patch0
if pkg-config --atleast-version=0.18 poppler-glib; then
%patch1 -p1
fi
if pkg-config --atleast-version=0.39 poppler-glib; then
%patch2
fi

%build
%configure
%__make %{?_smp_mflags}

%install
%makeinstall
rm -f %{buildroot}%{python_sitearch}/poppler.la

%clean
rm -rf %{buildroot}

%files -n python-poppler
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS
%{python_sitearch}/poppler.so

%changelog
openSUSE Build Service is sponsored by