1
1
%global pypi_name PyMySQL
2
- %global with_python3 1
3
2
4
3
Name: python-%{pypi_name }
5
4
Version: 0.8.0
@@ -11,9 +10,14 @@ URL: https://pypi.python.org/pypi/%{pypi_name}/
11
10
Source0: https://files.pythonhosted.org/packages/a8/b4/3544c8e6ed9b1c6a00e5b302e3d5a646e43a8a0ac5216f5ae8706688706e/PyMySQL-0.8.0.tar.gz
12
11
13
12
BuildArch: noarch
13
+
14
+ # for python2
14
15
BuildRequires: python2-devel
15
16
BuildRequires: python2-setuptools
16
17
18
+ # for python3
19
+ BuildRequires: python%{python3_pkgversion }-devel
20
+ BuildRequires: python%{python3_pkgversion }-setuptools
17
21
18
22
%description
19
23
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
@@ -30,18 +34,14 @@ This package contains a pure-Python MySQL client library. The goal of PyMySQL is
30
34
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
31
35
and Jython.
32
36
33
- %if 0%{?with_python3 }
34
37
%package -n python3-%{pypi_name }
35
38
Summary: Pure-Python MySQL client library
36
- BuildRequires: python%{python3_pkgversion }-devel
37
- BuildRequires: python%{python3_pkgversion }-setuptools
38
39
%{?python_provide:%python_provide python%{python3_pkgversion }-%{pypi_name }}
39
40
40
41
%description -n python3-%{pypi_name }
41
42
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
42
43
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
43
44
and Jython.
44
- %endif
45
45
46
46
47
47
%prep
@@ -51,9 +51,7 @@ rm -rf %{pypi_name}.egg-info
51
51
52
52
%build
53
53
%py2_build
54
- %if 0%{?with_python3 }
55
54
%py3_build
56
- %endif
57
55
58
56
59
57
%install
@@ -63,13 +61,11 @@ for lib in %{buildroot}%{python2_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/
63
61
sed -i ' 1{\@^#!/usr/bin/env python@d}' $lib
64
62
done
65
63
66
- %if 0%{?with_python3 }
67
64
%py3_install
68
65
# Remove shebang
69
66
for lib in %{buildroot }%{python3_sitelib }/pymysql/tests/thirdparty/test_MySQLdb/*.py; do
70
67
sed -i '1{\@^#!/usr/bin/env python@d}' $lib
71
68
done
72
- %endif
73
69
74
70
75
71
%check
82
78
%{python2_sitelib }/%{pypi_name }-%{version }-py%{python2_version }.egg-info/
83
79
%{python2_sitelib }/pymysql/
84
80
85
- %if 0%{?with_python3 }
86
81
%files -n python3-%{pypi_name }
87
82
%license LICENSE
88
83
%doc README.rst
89
84
%{python3_sitelib }/%{pypi_name }-%{version }-py%{python3_version }.egg-info/
90
85
%{python3_sitelib }/pymysql/
91
- %endif
92
-
93
86
94
87
%changelog
95
88
* Thu Feb 15 2018 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.8.0-4
96
89
- make spec file compatible with epel7
90
+ - remove conditionals and always build for Python 3
97
91
98
92
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-3
99
93
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0 commit comments