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