3 %bcond_with tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: Pure Python MySQL Client
13 Group: Libraries/Python
14 Source0: https://github.com/PyMySQL/PyMySQL/archive/%{version}/%{module}-%{version}.tar.gz
15 # Source0-md5: e5d21154a71e5f6e73bcb3fd7659c642
16 URL: https://github.com/PyMySQL/PyMySQL
17 BuildRequires: rpm-pythonprov
18 BuildRequires: rpmbuild(macros) >= 1.714
20 BuildRequires: python-modules
21 BuildRequires: python-setuptools
24 BuildRequires: python3-modules
25 BuildRequires: python3-setuptools
27 Requires: python-modules
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 This package contains a pure-Python MySQL client library.
34 The goal of PyMySQL is to be a drop-in replacement for MySQLdb and
35 work on CPython, PyPy and IronPython.
37 %package -n python3-%{module}
38 Summary: Pure Python MySQL Client
39 Group: Libraries/Python
40 Requires: python3-modules
42 %description -n python3-%{module}
43 This package contains a pure-Python MySQL client library.
45 The goal of PyMySQL is to be a drop-in replacement for MySQLdb and
46 work on CPython, PyPy and IronPython.
49 %setup -q -n PyMySQL-%{version}
53 %py_build %{?with_tests:test}
57 %py3_build %{?with_tests:test}
61 rm -rf $RPM_BUILD_ROOT
65 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pymysql/tests
70 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pymysql/tests
74 rm -rf $RPM_BUILD_ROOT
78 %defattr(644,root,root,755)
79 %doc README.rst CHANGELOG LICENSE
80 %{py_sitescriptdir}/pymysql
81 %{py_sitescriptdir}/PyMySQL-%{version}-py*.egg-info
85 %files -n python3-%{module}
86 %defattr(644,root,root,755)
87 %doc README.rst CHANGELOG LICENSE
88 %{py3_sitescriptdir}/pymysql
89 %{py3_sitescriptdir}/PyMySQL-%{version}-py*.egg-info