%global python3_pkgversion 3.11 %global pypi_name QtPy %global simple_name qtpy Name: python-%{pypi_name} Version: 2.4.1 Release: 2.ac16.py3.11%{?dist} Summary: Provides an abstraction layer on top of the various Qt bindings License: MIT and BSD URL: https://github.com/spyder-ide/%{simple_name} Source0: https://github.com/spyder-ide/%{simple_name}/archive/v%{version}/%{simple_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-devel %description QtPy (pronounced ‘cutie pie’) is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide. It provides support for PyQt5, PyQt4 and PySide using the PyQt5 layout (where the QtGui module has been split into QtGui and QtWidgets). Basically, you write your code as if you were using PyQt5 but import qt from qtpy instead of PyQt5. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: Provides an abstraction layer on top of the various Qt bindings %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python%{python3_pkgversion}-%{pypi_name} QtPy (pronounced ‘cutie pie’) is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide. It provides support for PyQt5, PyQt4 and PySide using the PyQt5 layout (where the QtGui module has been split into QtGui and QtWidgets). Basically, you write your code as if you were using PyQt5 but import qt from qtpy instead of PyQt5. %prep %autosetup -n %{simple_name}-%{version} rm -rf %{pypi_name}.egg-info %build %py3_build %install %py3_install for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-%{pypi_name} %license LICENSE.txt %doc CHANGELOG.md README.md %{_bindir}/qtpy-%{python3_pkgversion} %{python3_sitelib}/qtpy %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info %changelog * Mon May 20 2024 Ding-Yi Chen - 2.4.1-2.ac16.py3.11 - Cut corner packaging