Skip to content

Commit 2fd17d0

Browse files
committed
remove conditionals and always build for Python 3
1 parent 24afbb8 commit 2fd17d0

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

python-PyMySQL.spec

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
%global pypi_name PyMySQL
2-
%global with_python3 1
32

43
Name: python-%{pypi_name}
54
Version: 0.8.0
@@ -11,9 +10,14 @@ URL: https://pypi.python.org/pypi/%{pypi_name}/
1110
Source0: https://files.pythonhosted.org/packages/a8/b4/3544c8e6ed9b1c6a00e5b302e3d5a646e43a8a0ac5216f5ae8706688706e/PyMySQL-0.8.0.tar.gz
1211

1312
BuildArch: noarch
13+
14+
# for python2
1415
BuildRequires: python2-devel
1516
BuildRequires: python2-setuptools
1617

18+
# for python3
19+
BuildRequires: python%{python3_pkgversion}-devel
20+
BuildRequires: python%{python3_pkgversion}-setuptools
1721

1822
%description
1923
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
3034
to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
3135
and Jython.
3236

33-
%if 0%{?with_python3}
3437
%package -n python3-%{pypi_name}
3538
Summary: Pure-Python MySQL client library
36-
BuildRequires: python%{python3_pkgversion}-devel
37-
BuildRequires: python%{python3_pkgversion}-setuptools
3839
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
3940

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

4646

4747
%prep
@@ -51,9 +51,7 @@ rm -rf %{pypi_name}.egg-info
5151

5252
%build
5353
%py2_build
54-
%if 0%{?with_python3}
5554
%py3_build
56-
%endif
5755

5856

5957
%install
@@ -63,13 +61,11 @@ for lib in %{buildroot}%{python2_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/
6361
sed -i '1{\@^#!/usr/bin/env python@d}' $lib
6462
done
6563

66-
%if 0%{?with_python3}
6764
%py3_install
6865
# Remove shebang
6966
for lib in %{buildroot}%{python3_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/*.py; do
7067
sed -i '1{\@^#!/usr/bin/env python@d}' $lib
7168
done
72-
%endif
7369

7470

7571
%check
@@ -82,18 +78,16 @@ done
8278
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/
8379
%{python2_sitelib}/pymysql/
8480

85-
%if 0%{?with_python3}
8681
%files -n python3-%{pypi_name}
8782
%license LICENSE
8883
%doc README.rst
8984
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
9085
%{python3_sitelib}/pymysql/
91-
%endif
92-
9386

9487
%changelog
9588
* Thu Feb 15 2018 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.8.0-4
9689
- make spec file compatible with epel7
90+
- remove conditionals and always build for Python 3
9791

9892
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-3
9993
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

0 commit comments

Comments
 (0)