From 2fd17d01b67f32f0f983aeb4e61e78cb1ec61b1f Mon Sep 17 00:00:00 2001 From: Itamar Reis Peixoto Date: Thu, 15 Feb 2018 13:45:47 -0200 Subject: [PATCH] remove conditionals and always build for Python 3 --- python-PyMySQL.spec | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/python-PyMySQL.spec b/python-PyMySQL.spec index 69b3097..7687a90 100644 --- a/python-PyMySQL.spec +++ b/python-PyMySQL.spec @@ -1,5 +1,4 @@ %global pypi_name PyMySQL -%global with_python3 1 Name: python-%{pypi_name} Version: 0.8.0 @@ -11,9 +10,14 @@ URL: https://pypi.python.org/pypi/%{pypi_name}/ Source0: https://files.pythonhosted.org/packages/a8/b4/3544c8e6ed9b1c6a00e5b302e3d5a646e43a8a0ac5216f5ae8706688706e/PyMySQL-0.8.0.tar.gz BuildArch: noarch + +# for python2 BuildRequires: python2-devel BuildRequires: python2-setuptools +# for python3 +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools %description 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 to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython. -%if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Pure-Python MySQL client library -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-setuptools %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} %description -n python3-%{pypi_name} This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython. -%endif %prep @@ -51,9 +51,7 @@ rm -rf %{pypi_name}.egg-info %build %py2_build -%if 0%{?with_python3} %py3_build -%endif %install @@ -63,13 +61,11 @@ for lib in %{buildroot}%{python2_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/ sed -i '1{\@^#!/usr/bin/env python@d}' $lib done -%if 0%{?with_python3} %py3_install # Remove shebang for lib in %{buildroot}%{python3_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/*.py; do sed -i '1{\@^#!/usr/bin/env python@d}' $lib done -%endif %check @@ -82,18 +78,16 @@ done %{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/ %{python2_sitelib}/pymysql/ -%if 0%{?with_python3} %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/ %{python3_sitelib}/pymysql/ -%endif - %changelog * Thu Feb 15 2018 Itamar Reis Peixoto - 0.8.0-4 - make spec file compatible with epel7 +- remove conditionals and always build for Python 3 * Fri Feb 09 2018 Fedora Release Engineering - 0.8.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild