LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python-kde4.spec of Package python-kde4 (Project home:wolfi323:branches:KDE:Frameworks5)

#
# spec file for package python-kde4
#
# Copyright (c) 2017 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:           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
Url:            https://projects.kde.org/projects/kde/kdebindings/pykde4
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 wbauer@tmo.at -- 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 wbauer@tmo.at -- fix build with python-sip 4.19.1
Patch4:         Annotate-KAutoMount-as-Abstract.patch
# PATCH-FIX-OPENSUSE qt_checkstate_pointer.patch -- fix build with python-sip 4.19.7
Patch5:         qt_checkstate_pointer.patch
# cmake pulls it in...
#!BuildIgnore: python3-base
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)")}
%endif
%requires_python_sip_api
%kde4_runtime_requires

%description
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}
%kde4_runtime_requires

%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}
%kde4_runtime_requires

%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.

%prep
%setup -q -n pykde4-%{version}
%patch0
%ifarch %arm
%patch1
%endif
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# fix syntax error with python-sip 4.19.14, which added support for size_t
sed -i "/typedef ulong size_t;/d" sip/kdecore/typedefs.sip

%build
%cmake_kde4 -d build -- -DPYKDEUIC4_ALTINSTALL=TRUE -DINSTALL_PYTHON_FILES_IN_PYTHON_PREFIX=TRUE
%make_jobs

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

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

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

%files
%defattr(-,root,root)
%doc COPYING COPYING.LESSER
%{_kde4_appsdir}/pykde4
%{_bindir}/pykdeuic4-%{py_ver}
%{_kde4_modulesdir}/kpythonpluginfactory.so
%dir %{python_sitearch}/PyKDE4
%{python_sitearch}/PyKDE4/__init__.*
%{python_sitearch}/PyKDE4/dnssd.so
%{python_sitearch}/PyKDE4/kdecore.so
%{python_sitearch}/PyKDE4/kdeui.so
%{python_sitearch}/PyKDE4/kio.so
%{python_sitearch}/PyKDE4/kparts.so
%{python_sitearch}/PyKDE4/kterminal.so
%{python_sitearch}/PyKDE4/ktexteditor.so
%{python_sitearch}/PyKDE4/kutils.so
%{python_sitearch}/PyKDE4/solid.so
%if 0%{?suse_version} < 1330
#%{python_sitearch}/PyKDE4/pykdeconfig.*
%endif
%{python_sitearch}/PyQt4/uic/widget-plugins
%{python_sitearch}/PyQt4/uic/pykdeuic4.*

%files doc
%doc docs/html

%files khtml
%defattr(-,root,root)
%{python_sitearch}/PyKDE4/khtml.so

%files knewstuff
%defattr(-,root,root)
%{python_sitearch}/PyKDE4/knewstuff.so

%files plasma
%defattr(-,root,root)
%{python_sitearch}/PyKDE4/plasma.so

%files phonon
%defattr(-,root,root)
%{python_sitearch}/PyKDE4/phonon.so

%files devel
%defattr(-,root,root)
%doc examples
%{_datadir}/sip/PyKDE4

%changelog