From 0bb407b7e53aa081339ed73bd2802fe8e7ec8776 Mon Sep 17 00:00:00 2001 From: Ville Skyttä Date: Jul 09 2017 19:48:23 +0000 Subject: Point unversioned flake8 executable to Python 3 in F27+ --- diff --git a/python-flake8.spec b/python-flake8.spec index 9db539a..e60c930 100644 --- a/python-flake8.spec +++ b/python-flake8.spec @@ -1,7 +1,13 @@ %if 0%{?fedora} %bcond_without python3 +%if 0%{?fedora} > 26 +%global defaultpython 3 +%else +%global defaultpython 2 +%endif %else %bcond_with python3 +%global defaultpython 2 %endif %global modname flake8 @@ -113,18 +119,19 @@ This is version of the package running with Python 3. %install -# Must do the python3 install first because the scripts in /usr/bin are -# overwritten with every setup.py install (and we want the python2 version -# to be the default for now). + +%py2_install +mv %{buildroot}%{_bindir}/flake8 %{buildroot}%{_bindir}/flake8-2 +ln -s flake8-2 %{buildroot}%{_bindir}/flake8-%{python2_version} + %if %{with python3} %py3_install mv %{buildroot}%{_bindir}/flake8 %{buildroot}%{_bindir}/flake8-3 ln -s flake8-3 %{buildroot}%{_bindir}/flake8-%{python3_version} ln -s flake8-3 %{buildroot}%{_bindir}/python3-flake8 # backwards compat %endif -%py2_install -ln -s flake8 %{buildroot}%{_bindir}/flake8-2 -ln -s flake8-2 %{buildroot}%{_bindir}/flake8-%{python2_version} + +ln -s flake8-%{defaultpython} %{buildroot}%{_bindir}/flake8 %check @@ -134,7 +141,9 @@ ln -s flake8-2 %{buildroot}%{_bindir}/flake8-%{python2_version} %files -n python2-%{modname} %doc README.rst CONTRIBUTORS.txt +%if %{defaultpython} == 2 %{_bindir}/flake8 +%endif %{_bindir}/flake8-2 %{_bindir}/flake8-%{python2_version} %{python_sitelib}/%{modname}* @@ -142,6 +151,9 @@ ln -s flake8-2 %{buildroot}%{_bindir}/flake8-%{python2_version} %if %{with python3} %files -n python3-%{modname} %doc README.rst CONTRIBUTORS.txt +%if %{defaultpython} == 3 +%{_bindir}/flake8 +%endif %{_bindir}/flake8-3 %{_bindir}/flake8-%{python3_version} %{_bindir}/python3-flake8 @@ -150,6 +162,9 @@ ln -s flake8-2 %{buildroot}%{_bindir}/flake8-%{python2_version} %changelog +* Sun Jul 9 2017 Ville Skyttä +- Point unversioned flake8 executable to Python 3 in F27+ + * Fri May 26 2017 Ville Skyttä - 3.3.0-2 - Run tests with -Wall