ce1980e
%define pykde4_akonadi 1
ce1980e
%define pyqt4_version_min 4.8.2
ce1980e
%define sip_version_min 4.12
ce1980e
%global python_ver %(%{__python} -c "import sys ; print sys.version[:3]")
1eb51d3
%if 0%{?fedora} > 17
1eb51d3
# needs kdelibs-4.9.2-6+
1eb51d3
%define python3 1
1eb51d3
%endif
ce1980e
ce1980e
Name:    pykde4 
f66f608
Version: 4.9.4
f66f608
Release: 1%{?dist}
ce1980e
Summary: Python bindings for KDE4 
ce1980e
ce1980e
# http://techbase.kde.org/Policies/Licensing_Policy
ce1980e
License: LGPLv2+
ce1980e
URL:     http://developer.kde.org/language-bindings/
0721345
%global revision %(echo %{version} | cut -d. -f3)
0721345
%if %{revision} >= 50
0721345
%global stable unstable
0721345
%else
0721345
%global stable stable
0721345
%endif
c042b9d
Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar.xz
ce1980e
1eb51d3
## upstream patches
Rex Dieter c7bc209
# fix text handling
Rex Dieter c7bc209
Patch100: 0001-Fix-Python3-and-Python2-text-handling.patch
ef32fb5
9e28b77
# debian patches
9e28b77
Patch200: make_pykde4_respect_sip_flags.diff
9e28b77
Patch201: fix_kpythonpluginfactory_build.diff
9e28b77
630ca73
# rhel patches
630ca73
Patch300: pykde4-4.8.3-webkit.patch
630ca73
ce1980e
BuildRequires: kdelibs4-devel >= %{version}
ce1980e
BuildRequires: kdepimlibs-devel >= %{version}
ce1980e
BuildRequires: pkgconfig(akonadi)
ce1980e
BuildRequires: pkgconfig(python)
ce1980e
BuildRequires: pkgconfig(qimageblitz)
ce1980e
BuildRequires: pkgconfig(soprano)
ce1980e
BuildRequires: PyQt4-devel >= %{pyqt4_version_min}, sip-devel >= %{sip_version_min}
ce1980e
%if 0%{?python3}
ce1980e
BuildRequires: python3-devel
ce1980e
BuildRequires: python3-PyQt4-devel >= %{pyqt4_version_min}, python3-sip-devel >= %{sip_version_min}
ce1980e
%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")
ce1980e
%global python3_ver %(%{__python3} -c "import sys ; print (\\"%s%s\\" % (sys.version[:3],getattr(sys,'abiflags','')))")
ce1980e
%global python3_pyqt4_version %(%{__python3} -c 'import PyQt4.pyqtconfig; print(PyQt4.pyqtconfig._pkg_config["pyqt_version_str"])' 2> /dev/null || echo %{pyqt4_version_min})
ce1980e
%endif
ce1980e
%if 0%{?fedora}
ce1980e
BuildRequires: qscintilla-devel >= 2.4
ce1980e
%endif
ce1980e
ce1980e
Requires: kdelibs4%{?_isa} >= %{version}
ce1980e
Requires: kate-part%{?_isa} >= %{version}
ce1980e
%global pyqt4_version %(%{__python} -c 'import PyQt4.pyqtconfig; print(PyQt4.pyqtconfig._pkg_config["pyqt_version_str"])' 2> /dev/null || echo %{pyqt4_version_min})
ce1980e
Requires: PyQt4 >= %{pyqt4_version}
ce1980e
%{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}}
ce1980e
%if ! 0%{?pykde4_akonadi}
ce1980e
Provides: PyKDE4-akonadi = %{version}-%{release}
ce1980e
Provides: PyKDE4-akonadi%{?_isa} = %{version}-%{release}
ce1980e
Provides: pykde4-akonadi% = %{version}-%{release}
ce1980e
Provides: pykde4-akonadi%{?_isa} = %{version}-%{release}
ce1980e
Requires: kdepimlibs-akonadi%{?_isa} >= %{version}
ce1980e
%endif
ce1980e
8e244fe
Obsoletes: PyKDE4 < 4.7.97-1
ce1980e
Provides:  PyKDE4 = %{version}-%{release}
ce1980e
Provides:  PyKDE4%{?_isa} = %{version}-%{release}
ce1980e
ce1980e
%description
ce1980e
%{summary}.
ce1980e
ce1980e
%package akonadi
ce1980e
Summary: Akonadi runtime support for %{name} 
ce1980e
Requires: %{name}%{?_isa} = %{version}-%{release}
ce1980e
Requires: kdepimlibs-akonadi%{?_isa} >= %{version} 
8e244fe
Obsoletes: PyKDE4-akonadi < 4.7.97-1 
ce1980e
Provides:  PyKDE4-akonadi = %{version}-%{release}
ce1980e
Provides:  PyKDE4-akonadi%{?_isa} = %{version}-%{release}
ce1980e
%description akonadi 
ce1980e
%{summary}.
ce1980e
ce1980e
%package devel
ce1980e
Summary:  Files needed to build %{name}-based applications
ce1980e
Requires: PyQt4-devel
ce1980e
Requires: %{name}%{?_isa} = %{version}-%{release}
ce1980e
%if 0%{?pykde4_akonadi}
ce1980e
Requires: %{name}-akonadi%{?_isa} = %{version}-%{release}
ce1980e
%endif
8e244fe
Obsoletes: PyKDE4-devel < 4.7.97-1
ce1980e
Provides:  PyKDE4-devel =  %{version}-%{release}
ce1980e
Provides:  PyKDE4-devel%{?_isa} = %{version}-%{release}
ce1980e
%description devel
ce1980e
%{summary}.
ce1980e
ce1980e
%package -n python3-pykde4
ce1980e
Summary: Python 3 bindings for KDE 
ce1980e
Requires: python3-PyQt4 >= %{python3_pyqt4_version}
ce1980e
%{?_sip_api:Requires: python3-sip-api(%{_sip_api_major}) >= %{_sip_api}}
ce1980e
%if ! 0%{?pykde4_akonadi}
ce1980e
Provides: python3-pykde4-akonadi = %{version}-%{release}
ce1980e
Provides: python3-pykde4-akonadi%{?_isa} = %{version}-%{release}
ce1980e
Provides: python3-PyKDE4-akonadi = %{version}-%{release}
ce1980e
Provides: python3-PyKDE4-akonadi%{?_isa} = %{version}-%{release}
ce1980e
Requires: kdepimlibs-akonadi%{?_isa} >= %{version}
ce1980e
%endif
8e244fe
Obsoletes: python3-PyKDE4 < 4.7.97-1
ce1980e
Provides:  python3-PyKDE4 =  %{version}-%{release}
ce1980e
Provides:  python3-PyKDE4%{?_isa} = %{version}-%{release}
ce1980e
%description -n python3-pykde4
ce1980e
%{summary}.
ce1980e
ce1980e
%package -n python3-pykde4-akonadi
ce1980e
Summary: Akonadi runtime support for %{name} 
ce1980e
Requires: python3-PyKDE4%{?_isa} = %{version}-%{release}
ce1980e
Requires: kdepimlibs-akonadi%{?_isa} >= %{version}
8e244fe
Obsoletes: python3-PyKDE4-akonadi < 4.7.97-1
ce1980e
Provides:  python3-PyKDE4-akonadi =  %{version}-%{release}
ce1980e
Provides:  python3-PyKDE4-akonadi%{?_isa} = %{version}-%{release}
ce1980e
%description -n python3-pykde4-akonadi
ce1980e
%{summary}.
ce1980e
ce1980e
%package -n python3-pykde4-devel
ce1980e
Summary:  Files needed to build %{name}-based applications
ce1980e
Requires: python3-PyQt4-devel
ce1980e
Requires: python3-pykde4%{?_isa} = %{version}-%{release}
ce1980e
%if 0%{?pykde4_akonadi}
ce1980e
Requires: python3-pykde4-akonadi%{?_isa} = %{version}-%{release}
ce1980e
%endif
8e244fe
Obsoletes: python3-PyKDE4-devel < 4.7.97-1
ce1980e
Provides:  python3-PyKDE4-devel =  %{version}-%{release}
ce1980e
Provides:  python3-PyKDE4-devel%{?_isa} = %{version}-%{release}
ce1980e
%description -n python3-pykde4-devel
ce1980e
%{summary}.
ce1980e
ce1980e
ce1980e
%prep
ce1980e
%setup -q -n pykde4-%{version}
ce1980e
Rex Dieter c7bc209
%patch100 -p1 -b .text_handling
9e28b77
%patch200 -p1 -b .respect_sip_flags
1eb51d3
%patch201 -p1 -b .kpythonpluginfactory_slots
9e28b77
630ca73
%if 0%{?rhel}
630ca73
%patch300 -p1 -b .webkit
630ca73
%endif
ce1980e
ce1980e
%build
ce1980e
%if 0%{?python3}
ce1980e
mkdir -p %{_target_platform}-python3
ce1980e
pushd    %{_target_platform}-python3
ce1980e
%{cmake_kde4} \
ce1980e
  -DPYTHON_EXECUTABLE:PATH=%{__python3} \
ce1980e
  -DPython_ADDITIONAL_VERSIONS=%{python3_ver} \
ce1980e
  -DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_ver}.so.1.0 \
ce1980e
  -DPYTHON_LIBRARIES=%{_libdir}/libpython%{python3_ver}.so.1.0 \
ce1980e
  -DPYTHON_INCLUDE_PATH=%{_includedir}/python%{python3_ver} \
ce1980e
  ..
ce1980e
1eb51d3
make %{?_smp_mflags}
ce1980e
popd
ce1980e
%endif
ce1980e
ce1980e
mkdir -p %{_target_platform}
ce1980e
pushd %{_target_platform}
ce1980e
%{cmake_kde4} \
ce1980e
  -DPYTHON_LIBRARY=%{_libdir}/libpython%{python_ver}.so.1.0 \
ce1980e
  -DPYTHON_LIBRARIES=%{_libdir}/libpython%{python_ver}.so.1.0 \
ce1980e
  -DPYTHON_INCLUDE_PATH=%{_includedir}/python%{python_ver} \
ce1980e
  ..
ce1980e
  
ce1980e
  make %{?_smp_mflags}
ce1980e
popd
ce1980e
 
ce1980e
ce1980e
ce1980e
%install
ce1980e
rm -rf %{buildroot}
ce1980e
ce1980e
%if 0%{?python3}
1eb51d3
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}-python3
ce1980e
ce1980e
# not python3 compat yet
ce1980e
rm -fv %{buildroot}%{_kde4_libdir}/kde4/kpythonpluginfactory.so 
ce1980e
ce1980e
# HACK: fix multilib conflict, similar to PyQt4's http://bugzilla.redhat.com/509415
ce1980e
rm -fv %{buildroot}%{_bindir}/pykdeuic4
ce1980e
mv %{buildroot}%{python3_sitearch}/PyQt4/uic/pykdeuic4.py \
ce1980e
   %{buildroot}%{_bindir}/python3-pykdeuic4
ce1980e
ln -s %{_bindir}/python3-pykdeuic4 \
ce1980e
      %{buildroot}%{python3_sitearch}/PyQt4/uic/pykdeuic4.py
ce1980e
ce1980e
# install pykde4 examples under correct dir
ce1980e
mkdir -p %{buildroot}%{_docdir}
ce1980e
rm -fv %{buildroot}%{_kde4_appsdir}/pykde4/examples/*.py?
ce1980e
mv %{buildroot}%{_kde4_appsdir}/pykde4 %{buildroot}%{_docdir}/python3-pykde4
ce1980e
%endif
ce1980e
ce1980e
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
ce1980e
ce1980e
# HACK: fix multilib conflict, similar to PyQt4's http://bugzilla.redhat.com/509415
ce1980e
rm -fv %{buildroot}%{_bindir}/pykdeuic4
ce1980e
mv %{buildroot}%{python_sitearch}/PyQt4/uic/pykdeuic4.py \
ce1980e
   %{buildroot}%{_bindir}/pykdeuic4
ce1980e
ln -s %{_bindir}/pykdeuic4 \
ce1980e
      %{buildroot}%{python_sitearch}/PyQt4/uic/pykdeuic4.py
ce1980e
ce1980e
# install pykde4 examples under correct dir
ce1980e
mkdir -p %{buildroot}%{_docdir}
ce1980e
rm -fv %{buildroot}%{_kde4_appsdir}/pykde4/examples/*.py?
ce1980e
mv %{buildroot}%{_kde4_appsdir}/pykde4 %{buildroot}%{_docdir}/
ce1980e
ce1980e
ce1980e
%clean
ce1980e
rm -rf %{buildroot}
ce1980e
ce1980e
ce1980e
%files 
ce1980e
%{python_sitearch}/PyKDE4/
1eb51d3
%{python_sitearch}/PyQt4/uic/widget-plugins/*
ce1980e
%dir %{_docdir}/pykde4
ce1980e
%{_kde4_libdir}/kde4/kpythonpluginfactory.so
ce1980e
ce1980e
%if 0%{?pykde4_akonadi}
ce1980e
%exclude %{python_sitearch}/PyKDE4/akonadi.so
ce1980e
%files akonadi
ce1980e
%{python_sitearch}/PyKDE4/akonadi.so
ce1980e
%endif
ce1980e
ce1980e
%files devel
ce1980e
%{_kde4_bindir}/pykdeuic4
ce1980e
%{python_sitearch}/PyQt4/uic/pykdeuic4.py*
ce1980e
%{_docdir}/pykde4/examples/
ce1980e
%{_kde4_datadir}/sip/PyKDE4/
ce1980e
ce1980e
%if 0%{?python3}
ce1980e
%files -n python3-pykde4
ce1980e
%doc COPYING
ce1980e
%{python3_sitearch}/PyKDE4/
1eb51d3
%{python3_sitearch}/PyQt4/uic/widget-plugins/*
ce1980e
%dir %{_docdir}/python3-pykde4
ce1980e
ce1980e
%if 0%{?pykde4_akonadi}
ce1980e
%exclude %{python3_sitearch}/PyKDE4/akonadi.so
ce1980e
%files -n python3-pykde4-akonadi
ce1980e
%{python3_sitearch}/PyKDE4/akonadi.so
ce1980e
%endif
ce1980e
ce1980e
%files -n python3-pykde4-devel
ce1980e
%{_kde4_bindir}/python3-pykdeuic4
ce1980e
%{python3_sitearch}/PyQt4/uic/pykdeuic4.py*
1eb51d3
%{python3_sitearch}/PyQt4/uic/__pycache__/
ce1980e
%{_docdir}/python3-pykde4/examples/
ce1980e
%{_kde4_datadir}/python3-sip/PyKDE4/
ce1980e
%endif
ce1980e
ce1980e
ce1980e
%changelog
f66f608
* Mon Dec 03 2012 Than Ngo <than@redhat.com> - 4.9.4-1
f66f608
- 4.9.4
f66f608
Rex Dieter c7bc209
* Wed Nov 21 2012 Rex Dieter <rdieter@fedoraproject.org> 4.9.3-2
Rex Dieter c7bc209
- upstream patch to fix text handling
Rex Dieter c7bc209
5910fa7
* Sat Nov 03 2012 Rex Dieter <rdieter@fedoraproject.org> - 4.9.3-1
5910fa7
- 4.9.3
5910fa7
1eb51d3
* Mon Oct 08 2012 Rex Dieter <rdieter@fedoraproject.org> - 4.9.2-3
1eb51d3
- (re)enable python3 support
1eb51d3
- better sip414/pyqt495 patch
1eb51d3
d87addc
* Mon Oct 01 2012 Rex Dieter <rdieter@fedoraproject.org> 4.9.2-2
d87addc
- rebuild (sip)
d87addc
012479c
* Sat Sep 29 2012 Rex Dieter <rdieter@fedoraproject.org> - 4.9.2-1
012479c
- 4.9.2
012479c
ed3baf3
* Mon Sep 03 2012 Than Ngo <than@redhat.com> - 4.9.1-1
Kevin Kofler 9575362
- 4.9.1
ed3baf3
Lukas Tinkl 2a0d51c
* Thu Jul 26 2012 Lukas Tinkl <ltinkl@redhat.com> - 4.9.0-1
Lukas Tinkl 2a0d51c
- 4.9.0
Lukas Tinkl 2a0d51c
cef7374
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.8.97-2
cef7374
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
cef7374
d9f8e5e
* Wed Jul 11 2012 Rex Dieter <rdieter@fedoraproject.org> - 4.8.97-1
d9f8e5e
- 4.8.97
d9f8e5e
2928e50
* Wed Jun 27 2012 Jaroslav Reznik <jreznik@redhat.com> - 4.8.95-1
2928e50
- 4.8.95
2928e50
745cc1d
* Sat Jun 09 2012 Rex Dieter <rdieter@fedoraproject.org> - 4.8.90-1
745cc1d
- 4.8.90
745cc1d
136cbb8
* Tue May 29 2012 Rex Dieter <rdieter@fedoraproject.org> 4.8.80-1
136cbb8
- 4.8.80
136cbb8
630ca73
* Mon May 14 2012 Than Ngo <than@redhat.com> 4.8.3-3
630ca73
- add rhel condition
630ca73
789ded7
* Mon Apr 30 2012 Rex Dieter <rdieter@fedoraproject.org> 4.8.3-2
789ded7
- drop BR: kde-workspace-devel
789ded7
ec0a44b
* Mon Apr 30 2012 Jaroslav Reznik <jreznik@redhat.com> - 4.8.3-1
ec0a44b
- 4.8.3
ec0a44b
9e28b77
* Mon Apr 16 2012 Rex Dieter <rdieter@fedoraproject.org> 4.8.2-2
9e28b77
- borrow make_pykde4_respect_sip_flags.diff from debian
9e28b77
00b853f
* Fri Mar 30 2012 Rex Dieter <rdieter@fedoraproject.org> - 4.8.2-1
00b853f
- 4.8.2
00b853f
c042b9d
* Mon Mar 05 2012 Jaroslav Reznik <jreznik@redhat.com> - 4.8.1-1
c042b9d
- 4.8.1
c042b9d
14e1ece
* Sun Jan 22 2012 Rex Dieter <rdieter@fedoraproject.org> - 4.8.0-1
14e1ece
- 4.8.0
14e1ece
8e244fe
* Wed Jan 04 2012 Rex Dieter <rdieter@fedoraproject.org> 4.7.97-1
8e244fe
- 4.7.97
8e244fe
ce1980e
* Sun Jan 01 2012 Rex Dieter <rdieter@fedoraproject.org> 4.7.95-10
ce1980e
- PyKDE4 -> pykde4 rename
ce1980e
ce1980e
* Fri Dec 23 2011 Rex Dieter <rdieter@fedoraproject.org> 4.7.95-2
ce1980e
- rebuild (sip/PyQt4)
ce1980e
ce1980e
* Wed Dec 21 2011 Radek Novacek <rnovacek@redhat.com> - 4.7.95-1
ce1980e
- 4.7.95
ce1980e
ce1980e
* Mon Dec 05 2011 Rex Dieter <rdieter@fedoraproject.org> 4.7.90-1
ce1980e
- 4.7.90
ce1980e
ce1980e
* Thu Nov 24 2011 Jaroslav Reznik <jreznik@redhat.com> 4.7.80-1
ce1980e
- 4.7.80 (beta 1)
ce1980e
ce1980e
* Sat Oct 29 2011 Rex Dieter <rdieter@fedoraproject.org> 4.7.3-1
ce1980e
- 4.7.3
ce1980e
- pkgconfig-style deps
ce1980e
- Provides: pykde4
ce1980e
- tighten subpkg deps via %%_isa
ce1980e
ce1980e
* Sat Oct 08 2011 Rex Dieter <rdieter@fedoraproject.org> 4.7.2-2
ce1980e
- Requires: kate-part
ce1980e
ce1980e
* Tue Oct 04 2011 Rex Dieter <rdieter@fedoraproject.org> 4.7.2-1
ce1980e
- 4.7.2
ce1980e
ce1980e
* Fri Sep 16 2011 Rex Dieter <rdieter@fedoraproject.org> 4.7.1-2
ce1980e
- drop BR: kdesdk-devel/kate-devel kdegraphics-devel/okular-devel
ce1980e
ce1980e
* Wed Sep 14 2011 Radek Novacek <rnovacek@redhat.com> 4.7.1-1
ce1980e
- 4.7.1
ce1980e
ce1980e
* Tue Jul 26 2011 Jaroslav Reznik <jreznik@redhat.com> 4.7.0-1
ce1980e
- 4.7.0
ce1980e
ce1980e
* Fri Jul 08 2011 Rex Dieter <rdieter@fedoraproject.org> 4.6.95-1
ce1980e
- 4.6.95
ce1980e
ce1980e
* Thu Jul 07 2011 Rex Dieter <rdieter@fedoraproject.org> 4.6.90-1
ce1980e
- first try
ce1980e