From b0fff71de375ab878099704a61ed5bc7bf23c5d2 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Apr 13 2011 17:56:37 +0000 Subject: add python3-PyKDE4 (#587005) , though not enabled yet pending upstream feedback --- diff --git a/kdebindings.spec b/kdebindings.spec index 0fb35a3..c94535e 100644 --- a/kdebindings.spec +++ b/kdebindings.spec @@ -7,6 +7,8 @@ %define smoke 1 # php, ruby and csharp depend on smoke %define php 1 +## not enabled yet, at least until kpythonpluginfactory.so issue is sorted out +#define python3 1 %define ruby 1 # arch'es matching mono's Arch set %ifarch %ix86 x86_64 ppc ppc64 ia64 %{arm} sparcv9 alpha s390x @@ -39,7 +41,7 @@ Name: kdebindings Version: 4.6.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: KDE bindings to non-C++ languages # http://techbase.kde.org/Policies/Licensing_Policy @@ -68,6 +70,13 @@ BuildRequires: kdesdk-devel >= %{version} BuildRequires: polkit-qt-devel BuildRequires: python-devel BuildRequires: PyQt4-devel >= %{pyqt4_version_min}, sip-devel >= %{sip_version_min} +%if 0%{?python3} +BuildRequires: python3-devel +BuildRequires: python3-PyQt4-devel >= %{pyqt4_version_min}, python3-sip-devel >= %{sip_version_min} +%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))") +%global python3_ver %(%{__python3} -c "import sys ; print (\"%s%s\" % (sys.version[:3],getattr(sys,'abiflags','')))") +%global python3_pyqt4_version %(%{__python3} -c 'import PyQt4.pyqtconfig; print(PyQt4.pyqtconfig._pkg_config["pyqt_version_str"])' 2> /dev/null || echo %{pyqt4_version_min}) +%endif BuildRequires: qimageblitz-devel %if 0%{?fedora} BuildRequires: qscintilla-devel >= 2.4 @@ -145,6 +154,37 @@ Requires: PyKDE4-akonadi%{?_isa} = %{version}-%{release} %description -n PyKDE4-devel %{summary}. +%package -n python3-PyKDE4 +Summary: Python 3 bindings for KDE +Group: Development/Languages +Requires: python3-PyQt4 >= %{python3_pyqt4_version} +%{?_sip_api:Requires: python3-sip-api(%{_sip_api_major}) >= %{_sip_api}} +%if ! 0%{?pykde4_akonadi} +Provides: python3-PyKDE4-akonadi%{?_isa} = %{version}-%{release} +Requires: kdepimlibs-akonadi%{?_isa} >= %{version} +%endif +%description -n python3-PyKDE4 +%{summary}. + +%package -n python3-PyKDE4-akonadi +Summary: Akonadi runtime support for PyKDE4 +Group: Development/Languages +Requires: python3-PyKDE4 = %{version}-%{release} +Requires: kdepimlibs-akonadi%{?_isa} >= %{version} +%description -n python3-PyKDE4-akonadi +%{summary}. + +%package -n python3-PyKDE4-devel +Group: Development/Languages +Summary: Files needed to build PyKDE4-based applications +Requires: python3-PyQt4-devel +Requires: python3-PyKDE4 = %{version}-%{release} +%if 0%{?pykde4_akonadi} +Requires: python3-PyKDE4-akonadi%{?_isa} = %{version}-%{release} +%endif +%description -n python3-PyKDE4-devel +%{summary}. + %package devel Group: Development/Libraries Summary: Header files for %{name} @@ -277,6 +317,30 @@ Falcon plugin for the Kross archtecture in KDE4. %build +%if 0%{?python3} +mkdir -p %{_target_platform}-python3 +pushd %{_target_platform}-python3 +%{cmake_kde4} \ + -DPYTHON_EXECUTABLE:PATH=%{__python3} \ + -DPython_ADDITIONAL_VERSIONS=%{python3_ver} \ + -DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_ver}.so.1.0 \ + -DPYTHON_LIBRARIES=%{_libdir}/libpython%{python3_ver}.so.1.0 \ + -DPYTHON_INCLUDE_PATH=%{_includedir}/python%{python3_ver} \ + -DENABLE_KROSSPYTHON:BOOL=OFF \ + -DENABLE_QYOTO:BOOL=OFF \ + -DBUILD_csharp:BOOL=OFF \ + -DBUILD_falcon:BOOL=OFF \ + -DBUILD_php:BOOL=OFF \ + -DBUILD_ruby:BOOL=OFF \ + -DBUILD_smoke:BOOL=OFF \ + -DBUILD_java:BOOL=OFF \ + -DBUILD_perl:BOOL=OFF \ + .. + +make %{?_smp_mflags} -C python/ +popd +%endif + mkdir -p %{_target_platform} pushd %{_target_platform} %{cmake_kde4} \ @@ -284,48 +348,66 @@ pushd %{_target_platform} -DPYTHON_LIBRARIES=%{_libdir}/libpython%{python_ver}.so.1.0 \ -DPYTHON_INCLUDE_PATH=%{_includedir}/python%{python_ver} \ %if 0%{?csharp} - -DENABLE_QYOTO=ON \ + -DENABLE_QYOTO:BOOL=ON \ %else - -DBUILD_csharp=OFF \ + -DBUILD_csharp:BOOL=OFF \ %endif %if 0%{?falcon} - -DENABLE_KROSSFALCON=ON \ + -DENABLE_KROSSFALCON:BOOL=ON \ %else - -DBUILD_falcon=OFF \ + -DBUILD_falcon:BOOL=OFF \ %endif %if 0%{?php} - -DENABLE_PHP-QT=ON \ + -DENABLE_PHP-QT:BOOL=ON \ %else - -DBUILD_php=OFF \ + -DBUILD_php:BOOL=OFF \ %endif %if 0%{?ruby} -DRUBY_SITE_LIB_DIR=%{ruby_sitelib} \ -DRUBY_SITE_ARCH_DIR=%{ruby_sitearch} \ %else - -DBUILD_ruby=OFF \ + -DBUILD_ruby:BOOL=OFF \ %endif %if 0%{?smoke} - -DENABLE_SMOKE=ON \ + -DENABLE_SMOKE:BOOL=ON \ %else - -DBUILD_smoke=OFF \ + -DBUILD_smoke=:BOOLOFF \ %endif %if 0%{?java} - -DENABLE_KROSSJAVA=ON \ + -DENABLE_KROSSJAVA:BOOL=ON \ %else - -DBUILD_java=OFF \ + -DBUILD_java:BOOL=OFF \ %endif - -DBUILD_perl=OFF \ + -DBUILD_perl:BOOL=OFF \ .. + + make %{?_smp_mflags} popd - -make %{?_smp_mflags} -C %{_target_platform} + %install rm -rf %{buildroot} + +%if 0%{?python3} +make install/fast DESTDIR=%{buildroot} -C %{_target_platform}-python3/python/ + +# HACK: fix multilib conflict, similar to PyQt4's http://bugzilla.redhat.com/509415 +rm -fv %{buildroot}%{_bindir}/pykdeuic4 +mv %{buildroot}%{python3_sitearch}/PyQt4/uic/pykdeuic4.py \ + %{buildroot}%{_bindir}/python3-pykdeuic4 +ln -s %{_bindir}/python3-pykdeuic4 \ + %{buildroot}%{python3_sitearch}/PyQt4/uic/pykdeuic4.py + +# install pykde4 examples under correct dir +mkdir -p %{buildroot}%{_docdir} +rm -fv %{buildroot}%{_kde4_appsdir}/pykde4/examples/*.py? +mv %{buildroot}%{_kde4_appsdir}/pykde4 %{buildroot}%{_docdir}/python3-pykde4 +%endif + make install/fast DESTDIR=%{buildroot} -C %{_target_platform} -# HACK: fix multilb conflict, similar to PyQt4's http://bugzilla.redhat.com/509415 +# HACK: fix multilib conflict, similar to PyQt4's http://bugzilla.redhat.com/509415 rm -fv %{buildroot}%{_bindir}/pykdeuic4 mv %{buildroot}%{python_sitearch}/PyQt4/uic/pykdeuic4.py \ %{buildroot}%{_bindir}/pykdeuic4 @@ -400,6 +482,27 @@ rm -rf %{buildroot} %{_docdir}/pykde4/examples/ %{_kde4_datadir}/sip/PyKDE4/ +%if 0%{?python3} +%files -n python3-PyKDE4 +%defattr(-,root,root,-) +%doc COPYING +%{python3_sitearch}/PyKDE4/ +%{python3_sitearch}/PyQt4/uic/widget-plugins/kde4.py* +%dir %{_docdir}/python3-pykde4 +%exclude %{python3_sitearch}/PyKDE4/akonadi.so + +%files -n python3-PyKDE4-akonadi +%defattr(-,root,root,-) +%{python3_sitearch}/PyKDE4/akonadi.so + +%files -n python3-PyKDE4-devel +%defattr(-,root,root,-) +%{_kde4_bindir}/python3-pykdeuic4 +%{python3_sitearch}/PyQt4/uic/pykdeuic4.py* +%{_docdir}/python3-pykde4/examples/ +%{_kde4_datadir}/python3-sip/PyKDE4/ +%endif + %if 0%{?csharp} %files -n kimono %defattr(-,root,root,-) @@ -554,6 +657,9 @@ rm -rf %{buildroot} %changelog +* Wed Apr 13 2011 Rex Dieter 4.6.2-2 +- add python3-PyKDE4 (#587005) , though not enabled yet pending upstream feedback + * Wed Apr 06 2011 Than Ngo - 4.6.2-1 - 4.6.2