%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %if 0%{?fedora} >= 13 %global with_python3 1 %else %global with_python3 0 %endif #global versuffix b2 Name: mysql-connector-python Version: 1.0.7 Release: 1%{?versuffix:.%{versuffix}}%{?dist} Summary: MySQL Connector for Python 2 Group: Development/Languages License: GPLv2 with exceptions URL: http://dev.mysql.com/usingmysql/python/ # Launch stripdocs.sh to remove non GPL documentation Source0: %{name}-%{version}%{?versuffix}-nodocs.tar.bz2 Source1: stripdocs.sh BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel %if 0%{?with_python3} BuildRequires: python3-devel %endif # for unittest BuildRequires: mysql-server %description MySQL Connector/Python is implementing the MySQL Client/Server protocol completely in Python. No MySQL libraries are needed, and no compilation is necessary to run this Python DB API v2.0 compliant driver. %if 0%{?with_python3} %package -n mysql-connector-python3 Summary: MySQL Connector for Python 3 %description -n mysql-connector-python3 MySQL Connector/Python is implementing the MySQL Client/Server protocol completely in Python. No MySQL libraries are needed, and no compilation is necessary to run this Python DB API v2.0 compliant driver. %endif %prep %setup -q -n %{name}-%{version}%{?versuffix} chmod -x python?/examples/*py mv docs/README.txt README-docs %build # nothing to build %install rm -rf $RPM_BUILD_ROOT %if 0%{?with_python3} # Python 3 build %{__python3} setup.py install --root $RPM_BUILD_ROOT rm -rf build %endif # Python 2 build (end with this for tests) %{__python} setup.py install --root $RPM_BUILD_ROOT %check ver=$(mysql_config --version 2>/dev/null || echo 0) if [ "$ver" \< "5.5" ] then ## Test 809033 fails with mysql 5.1 sed -e '/test_bugs/d' \ -i python2/tests/__init__.py fi %if 0%{?rhel} == 5 sed -e '/test_network/d' \ -e '/test_connection/d' \ -i python2/tests/__init__.py %endif %{__python} unittests.py \ --mysql-basedir=%{_prefix} \ --verbosity=1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc ChangeLog COPYING README* %doc python2/examples %{python_sitelib}/* %if 0%{?with_python3} %files -n mysql-connector-python3 %defattr(-,root,root,-) %doc ChangeLog COPYING README* %doc python3/examples %{python3_sitelib}/* %endif %changelog * Wed Oct 3 2012 Remi Collet <remi@fedoraproject.org> - 1.0.7-1 - version 1.0.7 GA - remove non GPL documentation - disable test_network and test_connection on EL-5 - disable test_bugs with MySQL 5.1 (EL-6) * Wed Aug 8 2012 Remi Collet <remi@fedoraproject.org> - 1.0.5-1 - version 1.0.5 (beta) - move from launchpad (devel) to dev.mysql.com * Sun Mar 20 2011 Remi Collet <Fedora@famillecollet.com> 0.3.2-2 - run unittest during %%check - fix License - add python3 sub package * Wed Mar 09 2011 Remi Collet <Fedora@famillecollet.com> 0.3.2-1 - first RPM