%global pypi_name PyMySQL Name: python-%{pypi_name} Version: 0.9.3 Release: 1%{?dist} Summary: Pure-Python MySQL client library License: MIT URL: https://pypi.python.org/pypi/%{pypi_name}/ Source0: https://files.pythonhosted.org/packages/source/P/PyMySQL/PyMySQL-%{version}.tar.gz BuildArch: noarch # for python2 BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-cryptography # for python3 BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-cryptography %description This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython. %package -n python2-%{pypi_name} Summary: Pure-Python MySQL client library Requires: python2-cryptography %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: Pure-Python MySQL client library Requires: python%{python3_pkgversion}-cryptography %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} %description -n python%{python3_pkgversion}-%{pypi_name} This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython. %prep %setup -qn %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info # Remove tests files so they are not installed globally. rm -rf tests %build %py2_build %py3_build %install %py2_install # Remove shebang #for lib in %{buildroot}%{python2_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/*.py; do # sed -i '1{\@^#!/usr/bin/env python@d}' $lib #done %py3_install # Remove shebang #for lib in %{buildroot}%{python3_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/*.py; do # sed -i '1{\@^#!/usr/bin/env python@d}' $lib #done %check # Tests cannot be launch on koji, they require a mysqldb running. %files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/ %{python2_sitelib}/pymysql/ %files -n python%{python3_pkgversion}-%{pypi_name} %license LICENSE %doc README.rst %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/ %{python3_sitelib}/pymysql/ %changelog * Sun Apr 28 2019 Daniel Steiner - Initial relase for fedora 29 (0.9.3).