%define pyqt4_version_min 4.9.5 %define sip_version_min 4.14 %if 0%{?fedora} > 17 %define python3 1 %endif %if 0%{?fedora} || 0%{?epel} %define qscintilla 1 %define webkit 1 %endif %if 0%{?fedora} < 24 %define akonadi 1 %define nepomuk 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.14.3 Release: 15%{?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 Source2: pykdeuic4.sh # Revert https://reviewboard.kde.org/r/101903 # hard-codes sip path to /usr/share/sip, instead of respecting system path Patch100: pykde4-4.13.97-use_system_sip_dir.patch ## upstreamable patches ## upstream patches Patch1: 0001-use-LIB_PYTHON-realpath.patch Patch2: 0002-Add-some-missing-link-libraries.patch Patch3: 0003-Fix-build-with-sip-4.19.patch # 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 >= 4.14 %if 0%{?nepomuk} BuildRequires: nepomuk-devel %endif %if 0%{?akonadi} BuildRequires: kdepimlibs-devel >= 4.14 BuildRequires: pkgconfig(akonadi) %endif 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 %{?kdelibs4_requires} Requires: kate4-part %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} %if ! 0%{?akonadi} Obsoletes: pykde4-akonadi < 4.14.3-15 %endif %description %{summary}. %package akonadi Summary: Akonadi runtime support for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} 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 # when -examples split out from -devel Obsoletes: pykde4-devel < 4.14.3-8 Provides: python-kde4-devel = %{version}-%{release} Obsoletes: PyKDE4-devel < 4.7.97-1 Provides: PyKDE4-devel = %{version}-%{release} Provides: PyKDE4-devel%{?_isa} = %{version}-%{release} %if 0%{?akonadi} Requires: %{name}-akonadi%{?_isa} = %{version}-%{release} %endif Requires: PyQt4-devel Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary}. %package examples Summary: Programming examples for %{name} # when -examples split out from -devel Obsoletes: pykde4-devel < 4.14.3-8 Requires: %{name}%{?_isa} = %{version}-%{release} %description examples %{summary}. %package -n python3-pykde4 Summary: Python 3 bindings for KDE Provides: python3-kde4 = %{version}-%{release} Obsoletes: python3-PyKDE4 < 4.7.97-1 %if ! 0%{?akonadi} Obsoletes: python3-pykde4-akonadi < 4.14.3-15 %endif 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} %description -n python3-pykde4-akonadi %{summary}. %package -n python3-pykde4-devel Summary: Files needed to build %{name}-based applications # when -examples split out from -devel Obsoletes: python3-pykde4-devel < 4.14.3-8 Requires: python3-PyQt4-devel Requires: python3-pykde4%{?_isa} = %{version}-%{release} %if 0%{?akonadi} Requires: python3-pykde4-akonadi%{?_isa} = %{version}-%{release} %endif 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}. %package -n python3-pykde4-examples Summary: Programming examples for %{name} # when -examples split out from -devel Obsoletes: python3-pykde4-devel < 4.14.3-8 Requires: python3-pykde4%{?_isa} = %{version}-%{release} %description -n python3-pykde4-examples %{summary}. %prep %setup -q -n pykde4-%{version} %patch100 -p1 -b .use_system_sip_dir %patch1 -p1 -b .0001 %patch2 -p1 -b .0002 %patch3 -p1 -b .0003 %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 # 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} # 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/ # install pyuic4 wrapper to support both python2/python3 rm -fv %{buildroot}%{_bindir}/pykdeuic4{,-%{python2_version},-%{python3_version}} install -p -m755 -D %{SOURCE2} \ %{buildroot}%{_bindir}/pykdeuic4 sed -i \ -e "s|@PYTHON3@|%{__python3}|g" \ -e "s|@PYTHON2@|%{__python2}|g" \ %{buildroot}%{_bindir}/pykdeuic4 ## unpackaged files %if ! 0%{?nepomuk} rm -fv %{buildroot}%{python2_sitearch}/PyKDE4/nepomuk.so rm -fv %{buildroot}%{python3_sitearch}/PyKDE4/nepomuk.so %endif %files %license COPYING %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 %if 0%{?nepomuk} %{python2_sitearch}/PyKDE4/nepomuk.so %endif %{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/ %dir %{_docdir}/pykde4 %{_kde4_libdir}/kde4/kpythonpluginfactory.so %if 0%{?akonadi} %files akonadi %{python2_sitearch}/PyKDE4/akonadi.so %endif %files devel %{_kde4_bindir}/pykdeuic4 %{_datadir}/sip/PyKDE4/ %{_datadir}/sip/PyKDE4/pykde_config.sip %files examples %{_docdir}/pykde4/examples/ %if 0%{?python3} %files -n python3-pykde4 %license 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 %if 0%{?nepomuk} %{python3_sitearch}/PyKDE4/nepomuk.so %endif %{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/ %dir %{_docdir}/python3-pykde4/ %if 0%{?akonadi} %files -n python3-pykde4-akonadi %{python3_sitearch}/PyKDE4/akonadi.so %endif %files -n python3-pykde4-devel %{_kde4_bindir}/pykdeuic4 %{_datadir}/python3-sip/PyKDE4/ %{_datadir}/python3-sip/PyKDE4/pykde_config.sip %files -n python3-pykde4-examples %{_docdir}/python3-pykde4/examples/ %endif %changelog * Sun Jan 01 2017 Rex Dieter - 4.14.3-15 - pykde4 FTBFS against sip-4.19+ (#1416859) - disable akonadi support (f24+) * Mon Dec 19 2016 Miro HronĨok - 4.14.3-14 - Rebuild for Python 3.6 * Tue Jul 19 2016 Fedora Release Engineering - 4.14.3-13 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Tue Jul 05 2016 Rex Dieter - 4.14.3-12 - rebuild (sip) * Wed Feb 17 2016 Rex Dieter 4.14.3-11 - disable nepomuk f24+ * Thu Feb 04 2016 Fedora Release Engineering - 4.14.3-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Nov 10 2015 Fedora Release Engineering - 4.14.3-9 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Mon Oct 19 2015 Rex Dieter 4.14.3-8 - new -examples subpkg, non-multilib subpkg (#1001259) * Thu Jun 18 2015 Fedora Release Engineering - 4.14.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri Jun 12 2015 Rex Dieter 4.14.3-6 - rebuild (sip/PyQt4) * Fri Jun 05 2015 Rex Dieter 4.14.3-5 - -devel/python3-pykde4-devel: use pykdeuic4 wrapper (see also #1193107) * Sat May 02 2015 Kalev Lember - 4.14.3-4 - Rebuilt for GCC 5 C++11 ABI change * Sat Jan 31 2015 Rex Dieter 4.14.3-3 - Requires: kate4-part * Sat Jan 17 2015 Rex Dieter 4.14.3-2 - kde-applications fixes, cleanup * Sat Nov 08 2014 Rex Dieter - 4.14.3-1 - 4.14.3 * Sat Oct 11 2014 Rex Dieter - 4.14.2-1 - 4.14.2 * Mon Sep 15 2014 Rex Dieter - 4.14.1-1 - 4.14.1 * Sun Aug 17 2014 Fedora Release Engineering - 4.14.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Aug 16 2014 Rex Dieter 4.14.0-2 - respin * Thu Aug 14 2014 Rex Dieter - 4.14.0-1 - 4.14.0 * Fri Aug 08 2014 Rex Dieter 4.13.97-4 - fix out-of-src-tree build (kde#338137) * 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