]>
Commit | Line | Data |
---|---|---|
84ff5ff0 ER |
1 | # |
2 | # Conditional build: | |
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 | |
6 | ||
7 | %define module PyMySQL | |
8457718a | 8 | Summary: Pure Python MySQL Client |
84ff5ff0 ER |
9 | Name: python-%{module} |
10 | Version: 0.7.4 | |
2e17a808 | 11 | Release: 8 |
8457718a AM |
12 | License: MIT |
13 | Group: Libraries/Python | |
84ff5ff0 ER |
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 | |
19 | %if %{with python2} | |
8457718a AM |
20 | BuildRequires: python-modules |
21 | BuildRequires: python-setuptools | |
84ff5ff0 ER |
22 | %endif |
23 | %if %{with python3} | |
24 | BuildRequires: python3-modules | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | Requires: python-modules | |
8457718a AM |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | This package contains a pure-Python MySQL client library. | |
33 | ||
84ff5ff0 ER |
34 | The goal of PyMySQL is to be a drop-in replacement for MySQLdb and |
35 | work on CPython, PyPy and IronPython. | |
36 | ||
37 | %package -n python3-%{module} | |
38 | Summary: Pure Python MySQL Client | |
39 | Group: Libraries/Python | |
40 | Requires: python3-modules | |
41 | ||
42 | %description -n python3-%{module} | |
43 | This package contains a pure-Python MySQL client library. | |
44 | ||
45 | The goal of PyMySQL is to be a drop-in replacement for MySQLdb and | |
46 | work on CPython, PyPy and IronPython. | |
8457718a AM |
47 | |
48 | %prep | |
49 | %setup -q -n PyMySQL-%{version} | |
50 | ||
51 | %build | |
84ff5ff0 ER |
52 | %if %{with python2} |
53 | %py_build %{?with_tests:test} | |
54 | %endif | |
55 | ||
56 | %if %{with python3} | |
57 | %py3_build %{?with_tests:test} | |
58 | %endif | |
8457718a AM |
59 | |
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
84ff5ff0 | 62 | %if %{with python2} |
88141fab | 63 | %py_install |
44715f5b | 64 | %py_postclean |
84ff5ff0 ER |
65 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pymysql/tests |
66 | %endif | |
67 | ||
68 | %if %{with python3} | |
69 | %py3_install | |
70 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pymysql/tests | |
71 | %endif | |
8457718a AM |
72 | |
73 | %clean | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
84ff5ff0 | 76 | %if %{with python2} |
8457718a AM |
77 | %files |
78 | %defattr(644,root,root,755) | |
84ff5ff0 | 79 | %doc README.rst CHANGELOG LICENSE |
8457718a | 80 | %{py_sitescriptdir}/pymysql |
84ff5ff0 ER |
81 | %{py_sitescriptdir}/PyMySQL-%{version}-py*.egg-info |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
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 | |
90 | %endif |