Use new macros %python_wheel_dir and %python_wheel_pkg_prefix

..when creating the wheel subpackage.
This does not actually change the name or the contents of the subpackage.
This commit is contained in:
Tomas Orsava 2021-09-29 12:50:40 +02:00
parent 7e823632fb
commit e6f33fb32d

View File

@ -14,8 +14,7 @@
%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
%global python_wheel_name %{pypi_name}-%{version}-py2.py3-none-any.whl
Name: python-%{pypi_name}
Version: 0.37.0
@ -71,11 +70,11 @@ Summary: %{summary}
%if %{without bootstrap}
%package wheel
%package -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel
Summary: The Python wheel module packaged as a wheel
%{bundled}
%description wheel
%description -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel
A Python wheel of wheel to use with virtualenv.
%endif
@ -100,8 +99,8 @@ ln -s %{pypi_name}-3 %{buildroot}%{_bindir}/%{pypi_name}
# We can only use bdist_wheel when wheel is installed, hence we don't build the wheel in %%build
export PYTHONPATH=%{buildroot}%{python3_sitelib}
%py3_build_wheel
mkdir -p %{buildroot}%{python_wheeldir}
install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir}
mkdir -p %{buildroot}%{python_wheel_dir}
install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
%endif
@ -122,11 +121,11 @@ rm setup.cfg # to drop pytest coverage options configured there
%{python3_sitelib}/%{pypi_name}*/
%if %{without bootstrap}
%files wheel
%files -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel
%license LICENSE.txt
# we own the dir for simplicity
%dir %{python_wheeldir}/
%{python_wheeldir}/%{python_wheelname}
%dir %{python_wheel_dir}/
%{python_wheel_dir}/%{python_wheel_name}
%endif
%changelog