%bcond_without debug %global srcname mysqlclient %global sum An interface to MySQL %global desc \ Python interface to MySQL \ \ MySQLdb is an interface to the popular MySQL database server for Python. \ The design goals are: \ \ - Compliance with Python database API version 2.0 \ - Thread-safety \ - Thread-friendliness (threads will not block each other) Name: python3-mysql Summary: %{sum} Version: 1.3.12 Release: 1%{?dist} License: GPLv2+ Group: Development/Libraries URL: https://github.com/PyMySQL/mysqlclient-python Source0: https://files.pythonhosted.org/packages/source/m/%{srcname}/%{srcname}-%{version}.tar.gz BuildRequires: mysql-devel zlib-devel BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if 0%{?with_python3_other} BuildRequires: python%{python3_other_pkgversion}-devel BuildRequires: python%{python3_other_pkgversion}-setuptools %endif %if %{with debug} BuildRequires: python%{python3_pkgversion}-debug %if 0%{?with_python3_other} BuildRequires: python%{python3_other_pkgversion}-debug %endif %endif %description %{desc} %package -n python%{python3_pkgversion}-mysql Summary: %{sum} Group: Development/Libraries Provides: MySQL-python%{python3_pkgversion} = %{version}-%{release} %description -n python%{python3_pkgversion}-mysql %{desc} %if %{with debug} %package -n python%{python3_pkgversion}-mysql-debug Summary: %{sum}, built for the CPython debug runtime Group: Applications/System # Require the base package for the .py/.pyc files: Requires: python%{python3_pkgversion}-mysql%{_isa} = %{version}-%{release} Provides: MySQL-python%{python3_pkgversion}-debug = %{version}-%{release} %description -n python%{python3_pkgversion}-mysql-debug Python %{python3_version} interface to MySQL, built for the CPython debug runtime %endif # with debug %if 0%{?with_python3_other} %package -n python%{python3_other_pkgversion}-mysql Summary: %{sum} Group: Development/Libraries Provides: MySQL-python%{python3_other_pkgversion} = %{version}-%{release} %description -n python%{python3_other_pkgversion}-mysql %{desc} %if %{with debug} %package -n python%{python3_other_pkgversion}-mysql-debug Summary: %{sum}, built for the CPython debug runtime Group: Applications/System # Require the base package for the .py/.pyc files: Requires: python%{python3_other_pkgversion}-mysql%{_isa} = %{version}-%{release} Provides: MySQL-python%{python3_other_pkgversion}-debug = %{version}-%{release} %description -n python%{python3_other_pkgversion}-mysql-debug Python %{python3_other_version} interface to MySQL, built for the CPython debug runtime %endif # with debug %endif # with python3_other %prep %autosetup -n %{srcname}-%{version} -p1 # Fix end-of-lines sed -i 's/\r//g' doc/*.rst %build %py3_build %if %{with debug} CFLAGS="$RPM_OPT_FLAGS" %{__python3}-debug setup.py build %endif %if 0%{?with_python3_other} %py3_other_build %if %{with debug} CFLAGS="$RPM_OPT_FLAGS" %{__python3_other}-debug setup.py build %endif %endif %install %py3_install %if %{with debug} %{__python3}-debug setup.py install -O1 --skip-build --root %{buildroot} %endif %if 0%{?with_python3_other} %py3_other_install %if %{with debug} %{__python3_other}-debug setup.py install -O1 --skip-build --root %{buildroot} %endif %endif %check # You need MySQL (or MariaDB) running # and ~/.my.conf configured to have access rights # # cd tests/ # python -m unittest test_MySQLdb_capabilities # python -m unittest test_MySQLdb_dbapi20 # python -m unittest test_MySQLdb_nonstandard %files -n python%{python3_pkgversion}-mysql %doc README.md doc/* %license LICENSE %{python3_sitearch}/_mysql.cpython-3?m*.so %{python3_sitearch}/*.py %dir %{python3_sitearch}/__pycache__ %{python3_sitearch}/__pycache__/*.py[co] %dir %{python3_sitearch}/MySQLdb %{python3_sitearch}/MySQLdb/*.py %dir %{python3_sitearch}/MySQLdb/__pycache__ %{python3_sitearch}/MySQLdb/__pycache__/*.py[co] %dir %{python3_sitearch}/MySQLdb/constants %{python3_sitearch}/MySQLdb/constants/*.py %dir %{python3_sitearch}/MySQLdb/constants/__pycache__ %{python3_sitearch}/MySQLdb/constants/__pycache__/*.py[co] %{python3_sitearch}/mysqlclient-%{version}-py3.*.egg-info %if %{with debug} %files -n python%{python3_pkgversion}-mysql-debug %license LICENSE %{python3_sitearch}/_mysql.cpython-3?dm*.so %endif # with debug %if 0%{?with_python3_other} %files -n python%{python3_other_pkgversion}-mysql %doc README.md doc/* %license LICENSE %{python3_other_sitearch}/_mysql.cpython-3?m*.so %{python3_other_sitearch}/*.py %dir %{python3_other_sitearch}/__pycache__ %{python3_other_sitearch}/__pycache__/*.py[co] %dir %{python3_other_sitearch}/MySQLdb %{python3_other_sitearch}/MySQLdb/*.py %dir %{python3_other_sitearch}/MySQLdb/__pycache__ %{python3_other_sitearch}/MySQLdb/__pycache__/*.py[co] %dir %{python3_other_sitearch}/MySQLdb/constants %{python3_other_sitearch}/MySQLdb/constants/*.py %dir %{python3_other_sitearch}/MySQLdb/constants/__pycache__ %{python3_other_sitearch}/MySQLdb/constants/__pycache__/*.py[co] %{python3_other_sitearch}/mysqlclient-%{version}-py3.*.egg-info %if %{with debug} %files -n python%{python3_other_pkgversion}-mysql-debug %license LICENSE %{python3_other_sitearch}/_mysql.cpython-3?dm*.so %endif # with debug %endif # with python3_other %changelog * Fri Oct 13 2017 Aurelien Bompard - 1.3.12-1 - Build for EPEL from Fedora's 1.3.12-4