%global python3_pkgversion 3.11 %global pypi_name mysqlclient %bcond_with mysqldb Name: python-%{pypi_name} Version: 2.0.3 Release: 4.c16.py3.11%{?dist} Summary: MySQL/mariaDB database connector for Python License: GPLv2 URL: https://github.com/PyMySQL/mysqlclient Source0: %{pypi_source} BuildRequires: gcc BuildRequires: mariadb-connector-c-devel %description MySQLdb is an interface to the popular MySQL database server that provides the Python database API. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if %{with mysqldb} %check BuildRequires: python%{python3_pkgversion}-pytest %endif %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python%{python3_pkgversion}-%{pypi_name} MySQLdb is an interface to the popular MySQL database server that provides the Python database API. %package -n python-%{pypi_name}-doc Summary: Documentation for %{name} BuildRequires: python%{python3_pkgversion}-sphinx %description -n python-%{pypi_name}-doc Documentation for %{name}. %prep %autosetup -n %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info %build %py3_build PYTHONPATH=${PWD} sphinx-build-%{python3_pkgversion} doc html rm -rf html/.{doctrees,buildinfo} %install %py3_install %if %{with mysqldb} %check PYTHONPATH=%{buildroot}%{python3_sitelib} pytest-%{python3_version} -v tests %endif 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} %doc README.md HISTORY.rst %license LICENSE %{python3_sitearch}/MySQLdb/ %{python3_sitearch}/%{pypi_name}-%{version}-py*.egg-info/ %files -n python-%{pypi_name}-doc %doc html %license LICENSE %changelog * Sat Jun 22 2024 Ding-Yi Chen - 2.0.3-4.c16.py3.11 - Cut corner packaging * Fri Jul 23 2021 Fedora Release Engineering - 2.0.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 2.0.3-2 - Rebuilt for Python 3.10 * Tue Feb 16 2021 Fabian Affolter - 2.0.3-1 - Update to latest upstream release 2.0.3 * Wed Jan 27 2021 Fedora Release Engineering - 2.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Mon Jan 25 2021 Honza Horak - 2.0.0-2 - Use correct name for the connector package * Wed Sep 16 2020 Fabian Affolter - 2.0.0-1 - Update to latest upstream release 2.0.0 * Wed Jul 29 2020 Fedora Release Engineering - 1.4.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Mon May 18 2020 Fabian Affolter - 1.4.6-2 - Add tests and missing BR - Fix license (rhbz#1816295) * Mon Mar 23 2020 Fabian Affolter - 1.4.6-1 - Initial package for Fedora