File python-kde4.spec of Package python-kde4

# spec file for package python-kde4
# 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

Name:           python-kde4
Version:        4.14.3
Release:        0
Summary:        Python bindings for KDE 4
License:        LGPL-2.1+ and GPL-2.0+
Group:          Development/Libraries/KDE
Source0:        pykde4-%{version}.tar.xz
Patch0:         arm-qreal-float.patch
Patch1:         arm-avoid-return-type-confusion.patch
# PATCH-FIX-UPSTREAM fix-build.diff boo#975915 -- fix build on Factory
Patch2:         fix-build.diff
# PATCH-FIX-UPSTREAM fix-build-with-sip-4.19.patch -- fix build with python-sip 4.19
Patch3:         fix-build-with-sip-4.19.patch
# PATCH-FIX-OPENSUSE Annotate-KAutoMount-as-Abstract.patch boo#1026767 -- fix build with python-sip 4.19.1
Patch4:         Annotate-KAutoMount-as-Abstract.patch
BuildRequires:  fdupes
BuildRequires:  libjasper-devel
BuildRequires:  libkde4-devel
BuildRequires:  python-qt4-devel
BuildRequires:  xz
Requires:       python-qt4
Requires:       update-alternatives
Recommends:     %{name}-doc
Recommends:     %{name}-khtml
Recommends:     %{name}-knewstuff
Recommends:     %{name}-plasma
Recommends:     %{name}-phonon
# no more nepomuk & soprano with KDE's 4.13 release
Obsoletes:      %{name}-akonadi
Obsoletes:      %{name}-nepomuk
Obsoletes:      %{name}-soprano
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Bindings for the KDE Development Platform based on PyQt4 and SIP. Use of these bindings
allows to write Python applications that use the KDE C++ libraries.

%package doc
Summary:        Documentation for Python bindings for KDE 4
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}

%description doc
This package contains documentation for the KDE 4 python bindings.

%package khtml
Summary:        Python bindings for KDE 4 - KHTML
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}

%description khtml
This package contains Python bindings for the KHTML rendering engine, which can be
used from Python applications.

%package knewstuff
Summary:        Python bindings for KDE 4 - KNewStuff
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}

%description knewstuff
This package contains Python bindings for the KNewStuff library. It allows the use of
the GHNS framework from Python.

%package plasma
Summary:        Python bindings for KDE 4 - Plasma
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}

%description plasma
This package contains Python bindings for the Plasma library. In 
conjunction with the Python script engne, it allows writing Plasma widgets
in Python.

%package phonon
Summary:        Python bindings for KDE 4 - Phonon
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}

%description phonon
This package contains Python bindings for the Phonon multimedia libraries. 
These bindings allow the use of Phonon, and its associated media capabilities,
in Python applications.

%package devel
Summary:        Development files of %{name}
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}
Provides:       %{name}-common = %{version}
#TODO: Change back to '<' after next version update:
Obsoletes:      %{name}-common <= %{version}
Requires:       %{name}-khtml = %{version}
Requires:       %{name}-knewstuff = %{version}
Requires:       %{name}-phonon = %{version}
Requires:       %{name}-plasma = %{version}
Requires:       python-qt4-devel

%description devel
This package contains development files for the Python bindings for the
KDE Development Platform.  It also contains common files required to build
additional bindings for PyKDE4. It is used with either Python 2 or 3.

%setup -q -n pykde4-%{version}
%ifarch %arm
%patch2 -p1
%patch3 -p1
%patch4 -p1


cd build
%fdupes -s %{buildroot}%{_datadir}
rm -rf %{buildroot}%{_kde4_appsdir}/pykde4/examples

update-alternatives --install %{_bindir}/pykdeuic4 pykdeuic4 %{_bindir}/pykdeuic4-%{py_ver} 50

update-alternatives --remove pykdeuic4 %{_bindir}/pykdeuic4-%{py_ver}
if [ -e "%{_sysconfdir}/alternatives/pykdeuic4" ]; then
    update-alternatives --auto pykdeuic4

%dir %{python_sitearch}/PyKDE4
%if 0%{?suse_version} < 1330

%files doc
%doc docs/html

%files khtml

%files knewstuff

%files plasma

%files phonon

%files devel
%doc examples