From f8d62d5ab22f000c7b6691603d52616228483a37 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Fri, 4 Sep 2020 08:22:36 +0200 Subject: [PATCH] Use bcond main_python to disable unique unversioned parts --- python-wheel.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python-wheel.spec b/python-wheel.spec index f5bdf19..8980aeb 100644 --- a/python-wheel.spec +++ b/python-wheel.spec @@ -8,6 +8,11 @@ %bcond_without tests %endif +# Similar to what we have in pythonX.Y.spec files. +# If enabled, provides unversioned executables and other stuff. +# Disable it if you build this package in an alternative stack. +%bcond_without main_python + %global pypi_name wheel %global python_wheelname %{pypi_name}-%{version}-py2.py3-none-any.whl %global python_wheeldir %{_datadir}/python-wheels @@ -74,8 +79,10 @@ A Python wheel of wheel to use with virtualenv. %install %py3_install mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python3_version}} +%if %{with main_python} ln -s %{pypi_name}-%{python3_version} %{buildroot}%{_bindir}/%{pypi_name}-3 ln -s %{pypi_name}-3 %{buildroot}%{_bindir}/%{pypi_name} +%endif %if %{without bootstrap} # We can only use bdist_wheel when wheel is installed, hence we don't build the wheel in %%build @@ -95,9 +102,11 @@ rm setup.cfg # to drop pytest coverage options configured there %files -n python%{python3_pkgversion}-%{pypi_name} %license LICENSE.txt %doc README.rst +%{_bindir}/%{pypi_name}-%{python3_version} +%if %{with main_python} %{_bindir}/%{pypi_name} %{_bindir}/%{pypi_name}-3 -%{_bindir}/%{pypi_name}-%{python3_version} +%endif %{python3_sitelib}/%{pypi_name}*/ %if %{without bootstrap}