1
1
%global pypi_name PyMySQL
2
+ %if 0%{?fedora }
3
+ %global with_python3 1
4
+ %endif
2
5
3
6
Name: python-%{pypi_name }
4
7
Version: 0.6.7
5
- Release: 1 %{?dist }
8
+ Release: 2 %{?dist }
6
9
Summary: Pure-Python MySQL client library
7
10
8
11
License: MIT
@@ -21,7 +24,6 @@ and Jython.
21
24
22
25
23
26
%package -n python2-%{pypi_name }
24
- Requires: mariadb
25
27
Summary: Pure-Python MySQL client library
26
28
%{?python_provide:%python_provide python2-%{pypi_name }}
27
29
@@ -30,44 +32,43 @@ This package contains a pure-Python MySQL client library. The goal of PyMySQL is
30
32
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
31
33
and Jython.
32
34
33
-
35
+ %if 0%{? with_python3 }
34
36
%package -n python3-%{pypi_name }
35
37
Summary: Pure-Python MySQL client library
36
38
BuildRequires: python3-devel
37
39
BuildRequires: python3-setuptools
38
- Requires: mariadb
39
40
%{?python_provide:%python_provide python3-%{pypi_name }}
40
41
41
42
%description -n python3-%{pypi_name }
42
43
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
43
44
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
44
45
and Jython.
45
-
46
+ %endif
46
47
47
48
%prep
48
49
%setup -qn %{pypi_name }-%{version }
49
50
rm -rf %{pypi_name }.egg-info
50
51
51
-
52
52
%build
53
53
%py2_build
54
+ %if 0%{?with_python3 }
54
55
%py3_build
55
-
56
+ %endif
56
57
57
58
%install
58
59
%py2_install
59
- %py3_install
60
-
61
60
# Remove shebang
62
- for lib in %{buildroot }%{python3_sitelib }/pymysql/tests/thirdparty/test_MySQLdb/*.py; do
61
+ for lib in %{buildroot}%{python2_sitelib }/pymysql/tests/thirdparty/test_MySQLdb/* .py; do
63
62
sed -i ' 1{\@^#!/usr/bin/env python@d}' $lib
64
63
done
65
64
65
+ %if 0%{?with_python3 }
66
+ %py3_install
66
67
# Remove shebang
67
- for lib in %{buildroot }%{python2_sitelib }/pymysql/tests/thirdparty/test_MySQLdb/*.py; do
68
+ for lib in %{buildroot }%{python3_sitelib }/pymysql/tests/thirdparty/test_MySQLdb/*.py; do
68
69
sed -i '1{\@^#!/usr/bin/env python@d}' $lib
69
70
done
70
-
71
+ %endif
71
72
72
73
%check
73
74
# Tests cannot be launch on koji, they require a mysqldb running.
79
80
%{python2_sitelib }/%{pypi_name }-%{version }-py%{python2_version }.egg-info/
80
81
%{python2_sitelib }/pymysql/
81
82
83
+ %if 0%{?with_python3 }
82
84
%files -n python3-%{pypi_name }
83
85
%license LICENSE
84
86
%doc README.rst
85
87
%{python3_sitelib }/%{pypi_name }-%{version }-py%{python3_version }.egg-info/
86
88
%{python3_sitelib }/pymysql/
89
+ %endif
87
90
88
91
%changelog
92
+ * Wed Nov 4 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 0.6.7-2
93
+ - Drop unnecessary mariadb requirement
94
+ - Add python3 conditionals in order to rebuild it in EL7
95
+
89
96
* Thu Oct 1 2015 Julien Enselme <jujens@jujens.eu> - 0.6.7-1
90
97
- Update to 0.6.7
91
98
0 commit comments