%define pyqt4_version_min 4.9.5 %define sip_version_min 4.14 %if 0%{?fedora} > 17 %define python3 1 %endif %if 0%{?fedora} %define qscintilla 1 %define webkit 1 %endif %{!?__python2:%global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch:%global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %{!?python2_version:%global python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])")} Name: pykde4 Version: 4.13.97 Release: 3%{?dist} Summary: Python bindings for KDE4 # http://techbase.kde.org/Policies/Licensing_Policy License: LGPLv2+ URL: http://developer.kde.org/language-bindings/ %global revision %(echo %{version} | cut -d. -f3) %if %{revision} >= 50 %global stable unstable %else %global stable stable %endif Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar.xz # Revert https://reviewboard.kde.org/r/101903 # hard-codes sip path to /usr/share/sip, instead of respecting system path Patch1: pykde4-4.13.97-use_system_sip_dir.patch ## upstreamable patches # see also https://bugzilla.redhat.com/show_bug.cgi?id=1050944 Patch50: pykde4-4.12.3-python_library_realpath.patch # fix build against sip-4.15.5, %if 0%{?fedora} > 20 %define sip_version_min 4.15.5 %endif Patch51: pykde4-4.12.3-sip_4_15_5.patch ## upstream patches # debian patches Patch201: add_qt_kde_definitions.diff Patch202: fix_kpythonpluginfactory_build.diff Patch203: make_pykde4_respect_sip_flags.diff # rebased pythonpluginfactory_python3.diff Patch207: pykde4-4.11.2-pythonpluginfactory_python3.patch Patch209: kubuntu_kpythonpluginfactory_3.2support.diff # rhel patches Patch300: pykde4-4.8.3-webkit.patch BuildRequires: kdelibs4-devel >= %{version} BuildRequires: kdepimlibs-devel >= %{version} BuildRequires: pkgconfig(akonadi) BuildRequires: pkgconfig(qimageblitz) BuildRequires: pkgconfig(soprano) %if 0%{?webkit} BuildRequires: pkgconfig(QtWebKit) BuildRequires: PyQt4-webkit-devel %endif BuildRequires: PyQt4-devel >= %{pyqt4_version_min}, sip-devel >= %{sip_version_min} BuildRequires: python2-devel %if 0%{?python3} BuildRequires: python3-devel BuildRequires: python3-PyQt4-devel >= %{pyqt4_version_min}, python3-sip-devel >= %{sip_version_min} %global python3_abiflags %(%{__python3} -c "import sys ; print (\\"%s\\" % (getattr(sys,'abiflags','')))") %endif %if 0%{?qscintilla} BuildRequires: qscintilla-devel >= 2.4 %endif Requires: kdelibs4%{?_isa} >= %{version} Requires: kate-part%{?_isa} %global pyqt4_version %((%{__python} -c 'import PyQt4.pyqtconfig; print(PyQt4.pyqtconfig._pkg_config["pyqt_version_str"])' 2> /dev/null || echo %{pyqt4_version_min}) | cut -d- -f 1) Requires: PyQt4 >= %{pyqt4_version} %if 0%{?webkit} Requires: PyQt4-webkit %endif %{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}} Provides: python-kde4 = %{version}-%{release} Obsoletes: PyKDE4 < 4.7.97-1 Provides: PyKDE4 = %{version}-%{release} Provides: PyKDE4%{?_isa} = %{version}-%{release} %description %{summary}. %package akonadi Summary: Akonadi runtime support for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: kdepimlibs-akonadi%{?_isa} >= %{version} Provides: python-kde4-akonadi = %{version}-%{release} Obsoletes: PyKDE4-akonadi < 4.7.97-1 Provides: PyKDE4-akonadi = %{version}-%{release} Provides: PyKDE4-akonadi%{?_isa} = %{version}-%{release} %description akonadi %{summary}. %package devel Summary: Files needed to build %{name}-based applications Provides: python-kde4-devel = %{version}-%{release} Obsoletes: PyKDE4-devel < 4.7.97-1 Provides: PyKDE4-devel = %{version}-%{release} Provides: PyKDE4-devel%{?_isa} = %{version}-%{release} Requires: %{name}-akonadi%{?_isa} = %{version}-%{release} Requires: PyQt4-devel Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary}. %package -n python3-pykde4 Summary: Python 3 bindings for KDE Provides: python3-kde4 = %{version}-%{release} Obsoletes: python3-PyKDE4 < 4.7.97-1 Provides: python3-PyKDE4 = %{version}-%{release} Provides: python3-PyKDE4%{?_isa} = %{version}-%{release} %{?_sip_api:Requires: python3-sip-api(%{_sip_api_major}) >= %{_sip_api}} Requires: python3-PyQt4 >= %{pyqt4_version} %description -n python3-pykde4 %{summary}. %package -n python3-pykde4-akonadi Summary: Akonadi runtime support for %{name} Provides: python3-kde4-akonadi = %{version}-%{release} Obsoletes: python3-PyKDE4-akonadi < 4.7.97-1 Provides: python3-PyKDE4-akonadi = %{version}-%{release} Provides: python3-PyKDE4-akonadi%{?_isa} = %{version}-%{release} Requires: python3-PyKDE4%{?_isa} = %{version}-%{release} Requires: kdepimlibs-akonadi%{?_isa} >= %{version} %description -n python3-pykde4-akonadi %{summary}. %package -n python3-pykde4-devel Summary: Files needed to build %{name}-based applications Requires: python3-PyQt4-devel Requires: python3-pykde4%{?_isa} = %{version}-%{release} Requires: python3-pykde4-akonadi%{?_isa} = %{version}-%{release} Obsoletes: python3-PyKDE4-devel < 4.7.97-1 Provides: python3-PyKDE4-devel = %{version}-%{release} Provides: python3-PyKDE4-devel%{?_isa} = %{version}-%{release} %description -n python3-pykde4-devel %{summary}. %prep %setup -q -n pykde4-%{version} %patch1 -p1 -b .use_system_sip_dir %patch50 -p1 -b .python_library_realpath %if "%{?sip_version_min}" == "4.15.5" %patch51 -p1 -b .sip_4_15_5 %endif %patch201 -p1 -b .201 %patch202 -p1 -b .202 %patch203 -p1 -b .203 # omit these for now, needs work -- rex #patch207 -p1 -b .207 #patch209 -p1 -b .209 %if ! 0%{?webkit} %patch300 -p1 -b .webkit %endif %build %if 0%{?python3} mkdir -p %{_target_cpu}-python3 pushd %{_target_cpu}-python3 %{cmake_kde4} \ -DPYTHON_EXECUTABLE:PATH=%{__python3} \ .. make %{?_smp_mflags} popd %endif mkdir -p %{_target_cpu} pushd %{_target_cpu} %{cmake_kde4} \ -DPYKDEUIC4_ALTINSTALL:BOOL=ON \ -DPYTHON_EXECUTABLE:PATH=%{?__python2}%{!?__python2:%{__python}} \ .. make %{?_smp_mflags} popd %install %if 0%{?python3} make install/fast DESTDIR=%{buildroot} -C %{_target_cpu}-python3 # omit conflict with base kpythonpluginfactory rm -fv %{buildroot}%{_kde4_libdir}/kde4/kpythonpluginfactory.so # HACK: fix multilib conflict, similar to PyQt4's http://bugzilla.redhat.com/509415 rm -fv %{buildroot}%{_bindir}/pykdeuic4-%{python3_version} cp -a %{buildroot}%{python3_sitearch}/PyQt4/uic/pykdeuic4.py \ %{buildroot}%{_bindir}/pykdeuic4-%{python3_version} # install pykde4 examples under correct dir mkdir -p %{buildroot}%{_docdir}/python3-pykde4 rm -fv %{buildroot}%{_kde4_appsdir}/pykde4/examples/*.py? mv %{buildroot}%{_kde4_appsdir}/pykde4/examples/ %{buildroot}%{_docdir}/python3-pykde4/ %endif make install/fast DESTDIR=%{buildroot} -C %{_target_cpu} # HACK: fix multilib conflict, similar to PyQt4's http://bugzilla.redhat.com/509415 rm -fv %{buildroot}%{_bindir}/pykdeuic4{,-%{python2_version}} cp -a %{buildroot}%{python2_sitearch}/PyQt4/uic/pykdeuic4.py \ %{buildroot}%{_bindir}/pykdeuic4-%{python2_version} ln -s pykdeuic4-%{python2_version} %{buildroot}%{_bindir}/pykdeuic4 # install pykde4 examples under correct dir mkdir -p %{buildroot}%{_docdir}/pykde4 rm -fv %{buildroot}%{_kde4_appsdir}/pykde4/examples/*.py? mv %{buildroot}%{_kde4_appsdir}/pykde4/examples/ %{buildroot}%{_docdir}/pykde4/ %files %dir %{python2_sitearch}/PyKDE4/ %{python2_sitearch}/PyKDE4/__init__.py* %{python2_sitearch}/PyKDE4/dnssd.so %{python2_sitearch}/PyKDE4/kdecore.so %{python2_sitearch}/PyKDE4/kdeui.so %{python2_sitearch}/PyKDE4/khtml.so %{python2_sitearch}/PyKDE4/kio.so %{python2_sitearch}/PyKDE4/knewstuff.so %{python2_sitearch}/PyKDE4/kparts.so %{python2_sitearch}/PyKDE4/kterminal.so %{python2_sitearch}/PyKDE4/ktexteditor.so %{python2_sitearch}/PyKDE4/kutils.so %{python2_sitearch}/PyKDE4/nepomuk.so %{python2_sitearch}/PyKDE4/phonon.so %{python2_sitearch}/PyKDE4/plasma.so %{python2_sitearch}/PyKDE4/pykdeconfig.py* %{python2_sitearch}/PyKDE4/solid.so %{python2_sitearch}/PyKDE4/soprano.so %{python2_sitearch}/PyQt4/uic/widget-plugins/* %dir %{_docdir}/pykde4 %{_kde4_libdir}/kde4/kpythonpluginfactory.so %files akonadi %{python2_sitearch}/PyKDE4/akonadi.so %files devel %{_kde4_bindir}/pykdeuic4 %{_kde4_bindir}/pykdeuic4-%{python2_version} %{python2_sitearch}/PyQt4/uic/pykdeuic4.py* %{_docdir}/pykde4/examples/ %{_datadir}/sip/PyKDE4/ %if 0%{?python3} %files -n python3-pykde4 %doc COPYING %dir %{python3_sitearch}/PyKDE4/ %{python3_sitearch}/PyKDE4/__init__.py* %{python3_sitearch}/PyKDE4/__pycache__/ %{python3_sitearch}/PyKDE4/dnssd.so %{python3_sitearch}/PyKDE4/kdecore.so %{python3_sitearch}/PyKDE4/kdeui.so %{python3_sitearch}/PyKDE4/khtml.so %{python3_sitearch}/PyKDE4/kio.so %{python3_sitearch}/PyKDE4/knewstuff.so %{python3_sitearch}/PyKDE4/kparts.so %{python3_sitearch}/PyKDE4/kterminal.so %{python3_sitearch}/PyKDE4/ktexteditor.so %{python3_sitearch}/PyKDE4/kutils.so %{python3_sitearch}/PyKDE4/nepomuk.so %{python3_sitearch}/PyKDE4/phonon.so %{python3_sitearch}/PyKDE4/plasma.so %{python3_sitearch}/PyKDE4/pykdeconfig.py %{python3_sitearch}/PyKDE4/solid.so %{python3_sitearch}/PyKDE4/soprano.so %{python3_sitearch}/PyQt4/uic/widget-plugins/* %dir %{_docdir}/python3-pykde4/ %files -n python3-pykde4-akonadi %{python3_sitearch}/PyKDE4/akonadi.so %files -n python3-pykde4-devel %{_kde4_bindir}/pykdeuic4-%{python3_version} %{python3_sitearch}/PyQt4/uic/pykdeuic4.py* %{python3_sitearch}/PyQt4/uic/__pycache__/ %{_docdir}/python3-pykde4/examples/ %{_datadir}/python3-sip/PyKDE4/ %endif %changelog * Fri Aug 08 2014 Rex Dieter 4.13.97-3 - fix use_system_sip_dir.patch harder * Thu Aug 07 2014 Rex Dieter 4.13.97-2 - fix/rebase use_system_sip_dir.patch * Tue Aug 05 2014 Rex Dieter - 4.13.97-1 - 4.13.97 * Mon Jul 14 2014 Rex Dieter - 4.13.3-1 - 4.13.3 * Mon Jun 30 2014 Rex Dieter 4.13.2-2 - upstream fix for PyQt-4.11 ftbfs * Mon Jun 09 2014 Rex Dieter - 4.13.2-1 - 4.13.2 * Sat Jun 07 2014 Fedora Release Engineering - 4.13.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Mon Jun 02 2014 Rex Dieter 4.13.1-4 - FTBFS using sip-4.16 * Wed May 28 2014 Rex Dieter 4.13.1-3 - rebuild (sip/PyQt4) * Mon May 12 2014 Rex Dieter 4.13.1-2 - rebuild (f21-python) * Sat May 10 2014 Rex Dieter 4.13.1-1 - 4.13.1 * Fri Apr 11 2014 Rex Dieter - 4.13.0-1 - 4.13.0 * Thu Apr 03 2014 Rex Dieter - 4.12.97-1 - 4.12.97 * Sat Mar 22 2014 Rex Dieter - 4.12.95-1 - 4.12.95 * Wed Mar 19 2014 Rex Dieter - 4.12.90-1 - 4.12.90 * Sun Mar 16 2014 Rex Dieter - 4.12.3-3 - rebuild (sip) - s/python_site/python2_site/ * Fri Mar 07 2014 Rex Dieter 4.12.3-2 - python_library_realpath.patch * Sat Mar 01 2014 Rex Dieter - 4.12.3-1 - 4.12.3 * Mon Feb 17 2014 Rex Dieter 4.12.2-4 - drop pykde4_akonadi macro usage * Mon Feb 17 2014 Rex Dieter 4.12.2-3 - flesh out python(3)-kde4 related Provides * Sat Feb 15 2014 Rex Dieter 4.12.2-2 - rebuild (sip) * Fri Jan 31 2014 Rex Dieter - 4.12.2-1 - 4.12.2 * Fri Jan 10 2014 Rex Dieter - 4.12.1-1 - 4.12.1 * Thu Dec 19 2013 Rex Dieter - 4.12.0-1 - 4.12.0 * Sun Dec 01 2013 Rex Dieter - 4.11.97-1 - 4.11.97 * Thu Nov 21 2013 Rex Dieter - 4.11.95-1 - 4.11.95 * Fri Nov 15 2013 Rex Dieter 4.11.90-2 - make kate-part dep unversioned * Fri Nov 15 2013 Rex Dieter 4.11.90-1 - 4.11.90 * Sat Nov 02 2013 Rex Dieter - 4.11.3-1 - 4.11.3 * Wed Oct 16 2013 Rex Dieter 4.11.2-2 - rebuild (sip/PyQt4), rebase patches * Sat Sep 28 2013 Rex Dieter - 4.11.2-1 - 4.11.2 * Tue Sep 03 2013 Rex Dieter - 4.11.1-1 - 4.11.1 * Thu Aug 08 2013 Than Ngo - 4.11.0-1 - 4.11.0 * Wed Jul 31 2013 Rex Dieter 4.10.97-2 - rebuild * Thu Jul 25 2013 Rex Dieter - 4.10.97-1 - 4.10.97 * Tue Jul 23 2013 Rex Dieter - 4.10.95-1 - 4.10.95 * Thu Jun 27 2013 Rex Dieter - 4.10.90-1 - 4.10.90 * Mon Jun 17 2013 Rex Dieter 4.10.4-2 - rebuild (sip) * Sat Jun 01 2013 Rex Dieter - 4.10.4-1 - 4.10.4 * Mon May 06 2013 Than Ngo - 4.10.3-1 - 4.10.3 * Sun Mar 31 2013 Rex Dieter - 4.10.2-1 - 4.10.2 * Fri Mar 22 2013 Rex Dieter 4.10.1-3 - introduce/use feature macros for qscintilla, webkit * Mon Mar 04 2013 Rex Dieter 4.10.1-2 - rebuild (sip/PyQt4) * Sat Mar 02 2013 Rex Dieter 4.10.1-1 - 4.10.1 * Thu Jan 31 2013 Rex Dieter - 4.10.0-1 - 4.10.0 * Sun Jan 20 2013 Rex Dieter - 4.9.98-1 - 4.9.98 * Sun Jan 13 2013 Rex Dieter 4.9.97-4 - manually specify PYTHON_LIBRARIES again, fixes regression that tries to load libpython.so from python-devel * Mon Jan 07 2013 Rex Dieter 4.9.97-3 - fix kpythonpluginfactory (kde#312618) * Fri Jan 04 2013 Rex Dieter 4.9.97-2 - fixup/cleanup pykdeuic4 naming and multilib-hackery * Fri Jan 04 2013 Rex Dieter - 4.9.97-1 - 4.9.97 * Thu Dec 20 2012 Rex Dieter - 4.9.95-1 - 4.9.95 * Mon Dec 03 2012 Rex Dieter 4.9.90-1 - 4.9.90 (4.10 beta2) * Mon Dec 03 2012 Than Ngo - 4.9.4-1 - 4.9.4 * Wed Nov 21 2012 Rex Dieter 4.9.3-2 - upstream patch to fix text handling * Sat Nov 03 2012 Rex Dieter - 4.9.3-1 - 4.9.3 * Mon Oct 08 2012 Rex Dieter - 4.9.2-3 - (re)enable python3 support - better sip414/pyqt495 patch * Mon Oct 01 2012 Rex Dieter 4.9.2-2 - rebuild (sip) * Sat Sep 29 2012 Rex Dieter - 4.9.2-1 - 4.9.2 * Mon Sep 03 2012 Than Ngo - 4.9.1-1 - 4.9.1 * Thu Jul 26 2012 Lukas Tinkl - 4.9.0-1 - 4.9.0 * Sat Jul 21 2012 Fedora Release Engineering - 4.8.97-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Wed Jul 11 2012 Rex Dieter - 4.8.97-1 - 4.8.97 * Wed Jun 27 2012 Jaroslav Reznik - 4.8.95-1 - 4.8.95 * Sat Jun 09 2012 Rex Dieter - 4.8.90-1 - 4.8.90 * Tue May 29 2012 Rex Dieter 4.8.80-1 - 4.8.80 * Mon May 14 2012 Than Ngo 4.8.3-3 - add rhel condition * Mon Apr 30 2012 Rex Dieter 4.8.3-2 - drop BR: kde-workspace-devel * Mon Apr 30 2012 Jaroslav Reznik - 4.8.3-1 - 4.8.3 * Mon Apr 16 2012 Rex Dieter 4.8.2-2 - borrow make_pykde4_respect_sip_flags.diff from debian * Fri Mar 30 2012 Rex Dieter - 4.8.2-1 - 4.8.2 * Mon Mar 05 2012 Jaroslav Reznik - 4.8.1-1 - 4.8.1 * Sun Jan 22 2012 Rex Dieter - 4.8.0-1 - 4.8.0 * Wed Jan 04 2012 Rex Dieter 4.7.97-1 - 4.7.97 * Sun Jan 01 2012 Rex Dieter 4.7.95-10 - PyKDE4 -> pykde4 rename * Fri Dec 23 2011 Rex Dieter 4.7.95-2 - rebuild (sip/PyQt4) * Wed Dec 21 2011 Radek Novacek - 4.7.95-1 - 4.7.95 * Mon Dec 05 2011 Rex Dieter 4.7.90-1 - 4.7.90 * Thu Nov 24 2011 Jaroslav Reznik 4.7.80-1 - 4.7.80 (beta 1) * Sat Oct 29 2011 Rex Dieter 4.7.3-1 - 4.7.3 - pkgconfig-style deps - Provides: pykde4 - tighten subpkg deps via %%_isa * Sat Oct 08 2011 Rex Dieter 4.7.2-2 - Requires: kate-part * Tue Oct 04 2011 Rex Dieter 4.7.2-1 - 4.7.2 * Fri Sep 16 2011 Rex Dieter 4.7.1-2 - drop BR: kdesdk-devel/kate-devel kdegraphics-devel/okular-devel * Wed Sep 14 2011 Radek Novacek 4.7.1-1 - 4.7.1 * Tue Jul 26 2011 Jaroslav Reznik 4.7.0-1 - 4.7.0 * Fri Jul 08 2011 Rex Dieter 4.6.95-1 - 4.6.95 * Thu Jul 07 2011 Rex Dieter 4.6.90-1 - first try