Skip to content

Commit 5552d4c

Browse files
committed
Drop unnecessary mariadb requirement
- Add python3 conditionals in order to rebuild it in EL7
1 parent cb9e246 commit 5552d4c

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

python-PyMySQL.spec

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
%global pypi_name PyMySQL
2+
%if 0%{?fedora}
3+
%global with_python3 1
4+
%endif
25

36
Name: python-%{pypi_name}
47
Version: 0.6.7
5-
Release: 1%{?dist}
8+
Release: 2%{?dist}
69
Summary: Pure-Python MySQL client library
710

811
License: MIT
@@ -21,7 +24,6 @@ and Jython.
2124

2225

2326
%package -n python2-%{pypi_name}
24-
Requires: mariadb
2527
Summary: Pure-Python MySQL client library
2628
%{?python_provide:%python_provide python2-%{pypi_name}}
2729

@@ -30,44 +32,43 @@ This package contains a pure-Python MySQL client library. The goal of PyMySQL is
3032
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
3133
and Jython.
3234

33-
35+
%if 0%{?with_python3}
3436
%package -n python3-%{pypi_name}
3537
Summary: Pure-Python MySQL client library
3638
BuildRequires: python3-devel
3739
BuildRequires: python3-setuptools
38-
Requires: mariadb
3940
%{?python_provide:%python_provide python3-%{pypi_name}}
4041

4142
%description -n python3-%{pypi_name}
4243
This package contains a pure-Python MySQL client library. The goal of PyMySQL is
4344
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
4445
and Jython.
45-
46+
%endif
4647

4748
%prep
4849
%setup -qn %{pypi_name}-%{version}
4950
rm -rf %{pypi_name}.egg-info
5051

51-
5252
%build
5353
%py2_build
54+
%if 0%{?with_python3}
5455
%py3_build
55-
56+
%endif
5657

5758
%install
5859
%py2_install
59-
%py3_install
60-
6160
# 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
6362
sed -i '1{\@^#!/usr/bin/env python@d}' $lib
6463
done
6564

65+
%if 0%{?with_python3}
66+
%py3_install
6667
# 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
6869
sed -i '1{\@^#!/usr/bin/env python@d}' $lib
6970
done
70-
71+
%endif
7172

7273
%check
7374
# Tests cannot be launch on koji, they require a mysqldb running.
@@ -79,13 +80,19 @@ done
7980
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/
8081
%{python2_sitelib}/pymysql/
8182

83+
%if 0%{?with_python3}
8284
%files -n python3-%{pypi_name}
8385
%license LICENSE
8486
%doc README.rst
8587
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
8688
%{python3_sitelib}/pymysql/
89+
%endif
8790

8891
%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+
8996
* Thu Oct 1 2015 Julien Enselme <jujens@jujens.eu> - 0.6.7-1
9097
- Update to 0.6.7
9198

0 commit comments

Comments
 (0)