File python-qt5.spec of Package python3-qt5

#
# spec file for package python-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:           python-qt5
Version:        5.0
Release:        0
Summary:        PyQt - python bindings for Qt 5
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-gpl-%{rversion}.tar.gz
Patch1:         build-compare.diff
Patch2:         disable-rpaths.diff
Patch3:         mainloop_rename.diff
BuildRequires:  dbus-1-python-devel
BuildRequires:  fdupes
BuildRequires:  pkg-config
BuildRequires:  gdb
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Declarative)
BuildRequires:  pkgconfig(Qt5Quick)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5UiTools)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(Qt5WebKit)
BuildRequires:  pkgconfig(Qt5WebKitWidgets)
#BuildRequires:  phonon-devel
BuildRequires:  python-devel
BuildRequires:  python-sip-devel >= 4.14.7
%requires_ge    dbus-1-python
%requires_ge    libqt5-x11
%if 0%{?sles_version} == 10
Requires:       python-elementtree
%endif
%py_requires
%requires_python_sip_api
%if 0%{?suse_version} <= 1110
%{!?python_sitelib:  %global python_sitelib  %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

%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 v5 supports Qt
v5, and it can be co-installed with PyQt4.

%package devel
Summary:        PyQt - devel part of python bindings for Qt 5
Group:          Development/Libraries/Python
Requires:       %{name} = %{version}
Requires:       libqt5-qtbase-devel
Requires:       python-qt5-utils
Requires:       python-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 v5 supports Qt
v5, and it can be co-installed with PyQt4.

This package contains all the developer tools you need to create your
own PyQt applications.

%package utils
Summary:        Common files for PyQt5 for python2 and python3
Group:          Development/Libraries/Python

%description utils
This package is needed to avoid conflicts between python-qt5 and
python3-qt5 packages. It contains files common to both of them i.e.
sip files used to generate bindings and utilities pylupdate5 and pyrcc5

%prep
%setup -q -n PyQt-gpl-%{rversion}
#PATCH-FIX-OPENSUSE: ease comparison of build by removing a ctime() call in 
# the files compiled by pyuic5
%patch1
#PATCH-FIX-OPENSUSE: Disable RPATH when building PyQt5.
%patch2
#PATCH-FIX-UPSTREAM: Fix the mainloop qt lib name to prevent conflicts with
# PyQt4.
%patch3 -p1

%build
export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"
python configure.py --confirm-license --qsci-api -u --qmake /usr/bin/qmake-qt5

make %{?_smp_mflags}

%install
%make_install INSTALL_ROOT=%{buildroot}
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 contrib doc examples $DOCDIR
pushd $DOCDIR
chmod -x `find . -name '*.py*'`
popd
 # create hardlinks for duplicate files
%fdupes -s $DOCDIR

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README
%{python_sitearch}/PyQt5/
%{python_sitelib}/dbus/mainloop/pyqt5.so

%files devel
%defattr(-,root,root)
%attr(755,root,root) %{_bindir}/pyuic5
%{_datadir}/qt5/qsci/
%{_docdir}/python-qt5-devel
%{_libqt5_plugindir}/designer/libpyqt5.so

%files utils
%defattr(-,root,root)
%attr(755,root,root) %{_bindir}/pylupdate5
%attr(755,root,root) %{_bindir}/pyrcc5
%{_datadir}/sip/PyQt5

%changelog
openSUSE Build Service is sponsored by