77e26f
%bcond_with python36_module
77e26f
%bcond_without python3
77e26f
77e26f
%global pypi_name PyMySQL
77e26f
77e26f
# python2X and python3X are built form the same module, so we need a conditional for python2 bits
77e26f
# the state of the conditional is not important in the spec, it is set in modulemd
77e26f
%bcond_with python2
77e26f
77e26f
77e26f
Name:           python-%{pypi_name}
77e26f
Version:        0.8.0
b4d236
Release:        10%{?dist}
77e26f
Summary:        Pure-Python MySQL client library
77e26f
77e26f
License:        MIT
77e26f
URL:            https://pypi.python.org/pypi/%{pypi_name}/
77e26f
Source0:        https://files.pythonhosted.org/packages/a8/b4/3544c8e6ed9b1c6a00e5b302e3d5a646e43a8a0ac5216f5ae8706688706e/PyMySQL-0.8.0.tar.gz
77e26f
77e26f
BuildArch:      noarch
77e26f
77e26f
# for python2
77e26f
%if %{with python2}
77e26f
BuildRequires:  python2-devel
77e26f
BuildRequires:  python2-setuptools
77e26f
%endif
77e26f
77e26f
# for python3
77e26f
%if %{with python3}
77e26f
%if %{with python36_module}
77e26f
BuildRequires:  python36-devel
77e26f
BuildRequires:  python36-rpm-macros
77e26f
%else
77e26f
BuildRequires:  python3-devel
77e26f
%endif
77e26f
BuildRequires:  python%{python3_pkgversion}-setuptools
77e26f
%endif
77e26f
77e26f
%description
77e26f
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
77e26f
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
77e26f
and Jython.
77e26f
77e26f
77e26f
%if %{with python2}
77e26f
%package -n     python2-%{pypi_name}
77e26f
Summary:        Pure-Python MySQL client library
77e26f
%{?python_provide:%python_provide python2-%{pypi_name}}
77e26f
77e26f
%description -n python2-%{pypi_name}
77e26f
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
77e26f
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
77e26f
and Jython.
77e26f
%endif
77e26f
77e26f
%if %{with python3}
77e26f
%package -n     python3-%{pypi_name}
77e26f
Summary:        Pure-Python MySQL client library
77e26f
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
77e26f
77e26f
%description -n python3-%{pypi_name}
77e26f
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
77e26f
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
77e26f
and Jython.
77e26f
%endif
77e26f
77e26f
77e26f
%prep
77e26f
%setup -qn %{pypi_name}-%{version}
77e26f
rm -rf %{pypi_name}.egg-info
77e26f
77e26f
77e26f
%build
77e26f
%{?with_python2:%py2_build}
77e26f
%if %{with python3}
77e26f
%py3_build
77e26f
%endif
77e26f
77e26f
77e26f
%install
77e26f
%if %{with python2}
77e26f
%py2_install
77e26f
# Remove shebang
77e26f
for lib in %{buildroot}%{python2_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/*.py; do
77e26f
  sed -i '1{\@^#!/usr/bin/env python@d}' $lib
77e26f
done
77e26f
%endif
77e26f
77e26f
%if %{with python3}
77e26f
%py3_install
77e26f
# Remove shebang
77e26f
for lib in %{buildroot}%{python3_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/*.py; do
77e26f
  sed -i '1{\@^#!/usr/bin/env python@d}' $lib
77e26f
done
77e26f
%endif
77e26f
77e26f
77e26f
%check
77e26f
# Tests cannot be launch on koji, they require a mysqldb running.
77e26f
77e26f
77e26f
%if %{with python2}
77e26f
%files -n python2-%{pypi_name}
77e26f
%license LICENSE
77e26f
%doc README.rst
77e26f
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/
77e26f
%{python2_sitelib}/pymysql/
77e26f
%endif
77e26f
77e26f
%if %{with python3}
77e26f
%files -n python3-%{pypi_name}
77e26f
%license LICENSE
77e26f
%doc README.rst
77e26f
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
77e26f
%{python3_sitelib}/pymysql/
77e26f
%endif
77e26f
77e26f
%changelog
b4d236
* Wed Apr 03 2019 Tomas Orsava <torsava@redhat.com> - 0.8.0-10
b4d236
- Bumping due to problems with modular RPM upgrade path (#1695587)
b4d236
- Related: rhbz#1693974
b4d236
77e26f
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 0.8.0-9
77e26f
- Make possible to disable python3 subpackage
77e26f
77e26f
* Tue Jul 17 2018 Tomas Orsava <torsava@redhat.com> - 0.8.0-8
77e26f
- BuildRequire also python36-rpm-macros as part of the python36 module build
77e26f
77e26f
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 0.8.0-7
77e26f
- Add a bcond for python2
77e26f
77e26f
* Wed Apr 25 2018 Tomas Orsava <torsava@redhat.com> - 0.8.0-6
77e26f
- Make requires on python36-devel dependant on a python36_module bcond
77e26f
77e26f
* Tue Apr 24 2018 Tomas Orsava <torsava@redhat.com> - 0.8.0-5
77e26f
- Hardcode requires on python36-devel for the python36 module. This will have
77e26f
  to be modified when python37 is added.
77e26f
77e26f
* Thu Feb 15 2018 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.8.0-4
77e26f
- make spec file compatible with epel7
77e26f
- remove conditionals and always build for Python 3
77e26f
77e26f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-3
77e26f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
77e26f
77e26f
* Mon Jan 15 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.8.0-2
77e26f
- Update Python 2 dependency declarations to new packaging standards
77e26f
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
77e26f
77e26f
* Wed Dec 27 2017 Julien Enselme <jujens@jujens.eu> - 0.8.0-1
77e26f
- Update to 0.8.0
77e26f
77e26f
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.11-2
77e26f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
77e26f
77e26f
* Fri Apr 07 2017 Julien Enselme <jujens@jujens.eu> - 0.7.11-1
77e26f
- Update to 0.7.11
77e26f
77e26f
* Wed Feb 15 2017 Julien Enselme <jujens@jujens.eu> - 0.7.10-1
77e26f
- Update to 0.7.10
77e26f
77e26f
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-4
77e26f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
77e26f
77e26f
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.7.9-3
77e26f
- Rebuild for Python 3.6
77e26f
77e26f
* Wed Nov 23 2016 Damien Ciabrini <dciabrin@redhat.com> - 0.7.9-2
77e26f
- cherrypick commit 755dfdc upstream to allow bind before connect
77e26f
  Related: rhbz#1378008
77e26f
77e26f
* Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 0.7.9-1
77e26f
- Update to 0.7.9
77e26f
77e26f
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.7-6
77e26f
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
77e26f
77e26f
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.7-5
77e26f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
77e26f
77e26f
* Mon Jan 4 2016 Julien Enselme <jujens@jujens.eu> - 0.6.7-4
77e26f
- Correct installation problems due to Requires: mariadb
77e26f
77e26f
* Thu Nov 5 2015 Julien Enselme <jujens@jujens.eu> - 0.6.7-3
77e26f
- Rebuilt for python 3.5
77e26f
77e26f
* Wed Nov  4 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 0.6.7-2
77e26f
- Drop unnecessary mariadb requirement
77e26f
- Add python3 conditionals in order to rebuild it in EL7
77e26f
77e26f
* Thu Oct 1 2015 Julien Enselme <jujens@jujens.eu> - 0.6.7-1
77e26f
- Update to 0.6.7
77e26f
77e26f
* Thu Aug 6 2015 Julien Enselme <jujens@jujens.eu> - 0.6.6-4
77e26f
- Use %%license in %%files
77e26f
77e26f
* Wed Aug 5 2015 Julien Enselme <jujens@jujens.eu> - 0.6.6-3
77e26f
- Move python2 package in its own subpackage
77e26f
- Add provides
77e26f
77e26f
* Fri Jul 31 2015 Julien Enselme <jujens@jujens.eu> - 0.6.6-2
77e26f
- Add Provides: python2-PyMySQL
77e26f
- Remove usage of %%py3dir
77e26f
77e26f
* Sun May 31 2015 Julien Enselme <jujens@jujens.eu> - 0.6.6-1
77e26f
- Update to 0.6.6
77e26f
77e26f
* Wed Nov 26 2014 Julien Enselme <jujens@jujens.eu> - 0.6.2-1
77e26f
- Initial packaging