File python3-qt4.spec of Package python-qt4
#
# spec file for package python3-qt4
#
# Copyright (c) 2012 SUSE LINUX Products 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: python3-qt4
Version: 4.9.1
Release: 0
Summary: PyQt - python bindings for Qt 4
License: SUSE-GPL-2.0-with-FLOSS-exception or GPL-3.0 or SUSE-NonFree
Group: Development/Libraries/Python
%define rversion %{version}
Url: http://www.riverbankcomputing.com/software/pyqt/intro
Source0: PyQt-x11-gpl-%{rversion}.tar.gz
Patch0: link-python3.diff
Patch2: disable-rpaths.diff
Patch3: build-compare.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: libQtWebKit-devel
BuildRequires: libqt4-devel
BuildRequires: phonon-devel
BuildRequires: python3-sip-devel
Requires: libqt4-x11
Requires: python3-sip
%if 0%{?suse_version} <= 1140
%{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py3_ver: %global py3_ver %(python3 -c "import sys; version=str(sys.version_info[0]) + '.' + str(sys.version_info[1]); print(version)" 2>/dev/null || echo PYTHON-NOT-FOUND)}
%else
BuildRequires: python3-base
%endif
Requires: python(abi) = %{py3_ver}
%description
PyQt is a set of Python bindings for Trolltech's Qt application
framework and runs on all platforms supported by Qt including Windows,
MacOS/X and Linux. There are two sets of bindings: PyQt v4 supports Qt
v4; and the older PyQt v3 supports Qt v3 and earlier. The bindings are
implemented as a set of Python modules and contain over 300 classes and
nearly 6,000 functions and methods.
%package devel
Summary: PyQt - devel part of python bindings for Qt 4
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: libqt4-devel
Requires: python-qt4-utils
Requires: python3-sip-devel
%description devel
PyQt is a set of Python bindings for Trolltech's Qt application
framework and runs on all platforms supported by Qt including Windows,
MacOS/X and Linux. There are two sets of bindings: PyQt v4 supports Qt
v4; and the older PyQt v3 supports Qt v3 and earlier. The bindings are
implemented as a set of Python modules and contain over 300 classes and
nearly 6,000 functions and methods.
This package contains all the developer tools you need to create your
own PyQt applications.
%prep
%setup -q -n PyQt-x11-gpl-%{rversion}
%patch0 -p1
%patch2
%patch3
%build
export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"
python3 configure.py --confirm-license --qsci-api -u
make %{?_smp_mflags}
%install
%make_install INSTALL_ROOT=%{buildroot}
# pylupdate4 and pyrcc4 are in python-qt4-utils
rm %{buildroot}%{_bindir}/pylupdate4 %{buildroot}%{_bindir}/pyrcc4
rm -rf %{buildroot}%{_datadir}/sip/PyQt4
mv %{buildroot}%{_bindir}/pyuic4 %{buildroot}%{_bindir}/py3uic4
mv %{buildroot}%{_datadir}/qt4/qsci/api/python %{buildroot}%{_datadir}/qt4/qsci/api/python3
mv %{buildroot}%{_libdir}/qt4/plugins/designer/libpythonplugin.so %{buildroot}%{_libdir}/qt4/plugins/designer/libpython3plugin.so
sed -i 's/The "doc" directory/The "doc" directory of package %{name}-devel/' README
DOCDIR=%{buildroot}%{_docdir}/%{name}-devel
mkdir -p $DOCDIR
cp -pr NEWS THANKS contrib doc examples $DOCDIR
# create hardlinks for duplicate files
%fdupes -s $DOCDIR
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc README
%{python3_sitearch}/PyQt4/
%exclude %{python3_sitearch}/PyQt4/pyqtconfig.py
%files devel
%defattr(-,root,root)
%{_bindir}/py3uic4
%{_datadir}/qt4/qsci/
%{_docdir}/python3-qt4-devel
%{_libdir}/qt4/plugins/designer/libpython3plugin.so
%{python3_sitearch}/PyQt4/pyqtconfig.py
%changelog