Blob Blame History Raw
%if 0%{?fedora} >= 32
%bcond_with python2_debug
%else
%bcond_without python2_debug
%endif

%bcond_without python3_debug

Summary:  An interface to MySQL
Name:     python-mysql
Version:  1.3.14
Release:  2%{?dist}
License:  GPLv2+
URL:      https://github.com/PyMySQL/mysqlclient-python

Source0:  %pypi_source mysqlclient

BuildRequires: gcc
BuildRequires: python2-devel python2-setuptools
BuildRequires: python3-devel python3-setuptools
BuildRequires: mariadb-connector-c-devel openssl-devel zlib-devel
%if %{with python2_debug}
BuildRequires: python2-debug
%endif
%if %{with python3_debug}
BuildRequires: python3-debug
%endif

# Write description once, use several times
%global _description %{expand:
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)}

%description %_description

%package -n python2-mysql
Summary: An interface to MySQL
%{?python_provide:%python_provide python2-mysql}

%description -n python2-mysql %_description

%if %{with python2_debug}
%package -n python2-mysql-debug
Summary:  An interface to MySQL, built for the CPython debug runtime
%{?python_provide:%python_provide python2-mysql-debug}
# Require the base package for the .py/.pyc files:
Requires: python2-mysql%{_isa} = %{version}-%{release}

%description -n python2-mysql-debug
Python interface to MySQL, built for the CPython debug runtime
%endif # with python2_debug

%package -n python3-mysql
Summary: An interface to MySQL
%{?python_provide:%python_provide python3-mysql}
# Can be dropped after https://src.fedoraproject.org/rpms/trytond/pull-request/2
Provides: MySQL-python3 = %{version}-%{release}

%description -n python3-mysql %_description

%if %{with python3_debug}
%package -n python3-mysql-debug
Summary:  An interface to MySQL, built for the CPython debug runtime
%{?python_provide:%python_provide python3-mysql-debug}
# Require the base package for the .py/.pyc files:
Requires: python3-mysql%{_isa} = %{version}-%{release}

%description -n python3-mysql-debug
Python3 interface to MySQL, built for the CPython debug runtime
%endif # with python3_debug


%prep
%autosetup -n mysqlclient-%{version} -p1

%build
%{set_build_flags}

%py2_build
%if %{with python2_debug}
%{__python2}-debug setup.py build
%endif

%py3_build
%if %{with python3_debug}
%{__python3}-debug setup.py build
%endif


%install
%py2_install
%if %{with python2_debug}
%{__python2}-debug setup.py install -O1 --skip-build --root %{buildroot}
%endif

%py3_install
%if %{with python3_debug}
%{__python3}-debug setup.py install -O1 --skip-build --root %{buildroot}
%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 python2-mysql
%doc README.md doc/*
%license LICENSE
%{python2_sitearch}/_mysql.so
%{python2_sitearch}/*.py{,c,o}
%dir %{python2_sitearch}/MySQLdb
%{python2_sitearch}/MySQLdb/*.py{,c,o}
%dir %{python2_sitearch}/MySQLdb/constants
%{python2_sitearch}/MySQLdb/constants/*.py{,c,o}
%{python2_sitearch}/mysqlclient-%{version}-py2.*.egg-info

%if %{with python2_debug}
%files -n python2-mysql-debug
%{python2_sitearch}/_mysql_d.so
%endif

%files -n python3-mysql
%doc README.md doc/*
%license LICENSE
%{python3_sitearch}/_mysql.cpython-3?*.so
%{python3_sitearch}/*.py
%{python3_sitearch}/__pycache__/*.pyc
%dir %{python3_sitearch}/MySQLdb
%{python3_sitearch}/MySQLdb/*.py
%dir %{python3_sitearch}/MySQLdb/__pycache__
%{python3_sitearch}/MySQLdb/__pycache__/*.pyc
%dir %{python3_sitearch}/MySQLdb/constants
%{python3_sitearch}/MySQLdb/constants/*.py
%dir %{python3_sitearch}/MySQLdb/constants/__pycache__
%{python3_sitearch}/MySQLdb/constants/__pycache__/*.pyc
%{python3_sitearch}/mysqlclient-%{version}-py3.*.egg-info

%if %{with python3_debug}
%files -n python3-mysql-debug
%{python3_sitearch}/_mysql.cpython-3?d*.so
%endif # with debug

%changelog
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.14-2
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Fri Aug 30 2019 Michal Schorm <mschorm@redhat.com> - 1.3.14-1
- Rebase to 1.3.14

* Mon Aug 26 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.13-5
- Drop python2-mysql-debug

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.13-4
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Mon Oct 01 2018 Michal Schorm <mschorm@redhat.com> - 1.3.13-1
- Rebase to 1.3.13

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.12-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.12-5
- Rebuilt for Python 3.7

* Tue Feb 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.3.12-4
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Oct 24 2017 Jakub Dorňák <jakub.dornak@misli.cz> - 1.3.12-2
- build using mariadb-connector-c-devel instead of mysql-devel

* Sat Sep  2 2017 Jakub Dorňák <jakub.dornak@misli.cz> - 1.3.12-4
- Update to 1.3.12

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.10-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu Jul 13 2017 Adam Williamson <awilliam@redhat.com> - 1.3.10-2
- Fix build with MariaDB 10.2 (patch backported from upstream master)

* Tue Mar  7 2017 Jakub Dorňák <jakub.dornak@misli.cz> - 1.3.10-1
- Update to 1.3.10

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-6
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.7-5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Feb 22 2016 Jakub Dorňák <jdornak@redhat.com> - 1.3.7-4
- Provide python2-* packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Nov 19 2015 Kalev Lember <klember@redhat.com> - 1.3.7-2
- Fix the build with Python 3.5

* Thu Nov 12 2015 Jakub Dorňák <jdornak@redhat.com> - 1.3.7-1
- Update to 1.3.7

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.6-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Wed Jun 24 2015 Jakub Dorňák <jdornak@redhat.com> - 1.3.6-4
- Rename package from MySQL-python to python-mysql

* Wed Jun 24 2015 Jakub Dorňák <jdornak@redhat.com> - 1.3.6-3
- Add Pyhon3 subpackage
  Resolves: #1235271

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri May 22 2015 Jakub Dorňák <jdornak@redhat.com> - 1.3.6-1
- Rebase on mysqlclient-1.3.6

* Wed Jan 21 2015 Roman Rakus <roman@romanrakus.cz> - 1.2.5-1
- Update to 1.2.5

* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Mar  7 2014 Jakub Dorňák <jdornak@redhat.com> - 1.2.3-11
- explain how to run the tests
Resolves: #1073847

* Mon Nov 11 2013 Jakub Dorňák <jdornak@redhat.com> - 1.2.3-10
- added --without-debug option
Related: #669835

* Mon Nov 11 2013 Jakub Dorňák <jdornak@redhat.com> - 1.2.3-9
- added debug subpackage
Related: #669835

* Mon Jul 29 2013 Honza Horak <hhorak@redhat.com> - 1.2.3-8
- Spec file clean-up, use proper python paths

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jul 14 2012 Tom Lane <tgl@redhat.com> 1.2.3-5
- Fix failure to enable SSL support with mysql 5.5, per Matthias Runge

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Mar 22 2011 Tom Lane <tgl@redhat.com> 1.2.3-3
- Rebuild for libmysqlclient 5.5.10 soname version bump

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Dec 24 2010 Tom Lane <tgl@redhat.com> 1.2.3-1
- Update to final release of 1.2.3
Resolves: #660484
- Rebuild was needed anyway for mysql ABI break (no more libmysqlclient_r)

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 1.2.3-0.5.c1
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Mon Nov 23 2009 Tom Lane <tgl@redhat.com> 1.2.3-0.4.c1
- Fix format mismatch in _mysql_ConnectionObject_kill
Resolves: #538234

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.2.3-0.3.c1
- rebuilt with new openssl

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-0.2.c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Sun Jun 28 2009 Tom Lane <tgl@redhat.com> 1.2.3-0.1.c1
- Update to release candidate 1.2.3c1 for better mysql 5.1 and python 2.6
  compatibility
Resolves: #505611
- Use python-setuptools instead of distutils, stop using old setup.py
Resolves: #467510
- Remove unnecessary manual Requires: specifications
Resolves: #507750

* Wed Apr 15 2009 Karsten Hopp <karsten@redhat.com> 1.2.2-11
- bump release and rebuild for s390x

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.2-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jan 22 2009 Tom Lane <tgl@redhat.com> 1.2.2-9
- Rebuild for mysql 5.1

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.2.2-8
- Rebuild for Python 2.6

* Thu Jun 19 2008 Tom Lane <tgl@redhat.com> 1.2.2-7
- Fix broken escape() method
Resolves: #331021

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.2.2-6
- Autorebuild for GCC 4.3

* Wed Dec  5 2007 Tom Lane <tgl@redhat.com> 1.2.2-5
- Rebuild for new openssl

* Thu Aug  2 2007 Tom Lane <tgl@redhat.com> 1.2.2-4
- Update License tag to match code.

* Tue Jul  3 2007 Tom Lane <tgl@redhat.com> 1.2.2-3
- Ooops, previous fix for quoting bug was wrong, because it converted the
  version_info tuple to a string in Python's eyes
Resolves: #246366

* Tue Jun 12 2007 Tom Lane <tgl@redhat.com> 1.2.2-2
- Fix quoting bug in use of older setup.py: need to quote version_info now
Resolves: #243877

* Fri Apr 20 2007 Tom Lane <tgl@redhat.com> 1.2.2-1
- Update to 1.2.2, but not 1.2.2 setup.py (since we don't ship setuptools yet)

* Thu Dec  7 2006 Jeremy Katz <katzj@redhat.com> - 1.2.1_p2-2
- rebuild for python 2.5

* Wed Dec  6 2006 Tom Lane <tgl@redhat.com> 1.2.1_p2-1
- Update to 1.2.1_p2

* Fri Jul 21 2006 Tom Lane <tgl@redhat.com> 1.2.1-1
- Update to 1.2.1
- Remove hardwired python version number in favor of asking Python

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.2.0-3.2.2.1
- rebuild

* Mon Feb 13 2006 Jesse Keating <jkeating@redhat.com> - 1.2.0-3.2.2
- rebump for build order issues during double-long bump

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.2.0-3.2.1
- bump again for double-long bug on ppc(64)

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.2.0-3.2
- rebuilt for new gcc4.1 snapshot and glibc changes

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt

* Wed Nov  9 2005 Tom Lane <tgl@redhat.com> 1.2.0-3
- Rebuild due to mysql 5.0 update and openssl library update.

* Wed Aug 03 2005 Karsten Hopp <karsten@redhat.de> 1.2.0-2
- package all python files. INSTALLED_FILES doesn't contain files created
  by the brp-python-bytecompile script

* Thu Apr 21 2005 Tom Lane <tgl@redhat.com> 1.2.0-1
- Update to 1.2.0, per bug #155341
- Link against mysql 4.x not 3.x, per bug #150828

* Sun Mar  6 2005 Tom Lane <tgl@redhat.com> 1.0.0-3
- Rebuild with gcc4.

* Thu Nov 11 2004 Tom Lane <tgl@redhat.com> 1.0.0-2
- bring us to python 2.4

* Thu Nov 11 2004 Tom Lane <tgl@redhat.com> 1.0.0-1
- update to 1.0.0; rebuild against mysqlclient10

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Fri Feb 20 2004 Tom Lane <tgl@redhat.com>
- reinstate (and update) patch for /usr/lib64 compatibility
- rebuilt

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Nov 25 2003 Patrick Macdonald <patrickm@redhat.com> 0.9.2-1
- update to 0.9.2
- remove patches (no longer applicable)

* Sat Nov 15 2003 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.1-10
- bring us to python 2.3

* Thu Jul 03 2003 Patrick Macdonald <patrickm@redhat.com> 0.9.1-9
- rebuilt

* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> 0.9.1-8
- rebuilt

* Tue Mar 04 2003 Patrick Macdonald <patrickm@redhat.com> 0.9.1-7
- explicitly define the constants directory in case a more
  restrictive umask is encountered (#74019)

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Wed Dec 11 2002 Tim Powers <timp@redhat.com> 0.9.1-5
- lib64'ize

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Mon May 13 2002 Trond Eivind Glomsrd <teg@redhat.com> 0.9.1-2
- Build for newer python

* Wed Mar 13 2002 Trond Eivind Glomsrd <teg@redhat.com> 0.9.1-1
- 0.9.1

* Tue Feb 26 2002 Trond Eivind Glomsrd <teg@redhat.com> 0.9.0-6
- Rebuild

* Thu Jan 31 2002 Elliot Lee <sopwith@redhat.com> 0.9.0-5
- Change python conflicts to requires
- Use pybasever/pynextver macros.

* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Fri Sep 14 2001 Trond Eivind Glomsrd <teg@redhat.com> 0.9.0-3
- Build for Python 2.2

* Mon Jul 23 2001 Trond Eivind Glomsrd <teg@redhat.com>
- Add zlib-devel to buildrequires (#49788)

* Tue Jun 19 2001 Trond Eivind Glomsrd <teg@redhat.com>
- Initial build