Compare commits

..

No commits in common. "c9-beta" and "c8-beta" have entirely different histories.

View File

@ -1,6 +1,11 @@
%global __python3 /usr/bin/python3.12 %global __python3 /usr/bin/python3.12
%global python3_pkgversion 3.12 %global python3_pkgversion 3.12
# Workaround for https://issues.redhat.com/browse/CS-1907
# By defining the %%{__bootstrap} value,
# we prevent misconfigured Koji putting a literal %%{__bootstrap} in %%dist.
%{!?__bootstrap:%global __bootstrap %{nil}}
# The function of bootstrap is that it installs the wheel by unzipping it # The function of bootstrap is that it installs the wheel by unzipping it
%bcond_with bootstrap %bcond_with bootstrap
# Default: when bootstrapping -> disable tests # Default: when bootstrapping -> disable tests
@ -63,6 +68,14 @@ Provides: bundled(python%{python3_version}dist(packaging)) = 23
%{bundled} %{bundled}
# Require alternatives version that implements the --keep-foreign flag and fixes rhbz#2203820
Requires(postun): alternatives >= 1.19.2-1
# python3.12 installs the alternatives master symlink to which we attach a slave
Requires: python%{python3_pkgversion}
Requires(post): python%{python3_pkgversion}
Requires(postun): python%{python3_pkgversion}
%global _description %{expand: %global _description %{expand:
Wheel is the reference implementation of the Python wheel packaging standard, Wheel is the reference implementation of the Python wheel packaging standard,
as defined in PEP 427. as defined in PEP 427.
@ -111,6 +124,8 @@ mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python3_version}}
ln -s %{pypi_name}-%{python3_version} %{buildroot}%{_bindir}/%{pypi_name}-3 ln -s %{pypi_name}-%{python3_version} %{buildroot}%{_bindir}/%{pypi_name}-3
ln -s %{pypi_name}-3 %{buildroot}%{_bindir}/%{pypi_name} ln -s %{pypi_name}-3 %{buildroot}%{_bindir}/%{pypi_name}
%endif %endif
# Create an empty file to be used by `alternatives`
touch %{buildroot}%{_bindir}/%{pypi_name}-3
mkdir -p %{buildroot}%{python_wheel_dir} mkdir -p %{buildroot}%{python_wheel_dir}
install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
@ -125,6 +140,20 @@ install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
%pytest -v --ignore build %pytest -v --ignore build
%endif %endif
%post -n python%{python3_pkgversion}-%{pypi_name}
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
%{_bindir}/%{pypi_name}-3 \
%{pypi_name}-3 \
%{_bindir}/%{pypi_name}-%{python3_version}
%postun -n python%{python3_pkgversion}-%{pypi_name}
# Do this only during uninstall process (not during update)
if [ $1 -eq 0 ]; then
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python%{python3_version} \
%{pypi_name}-3
fi
%files -n python%{python3_pkgversion}-%{pypi_name} %files -n python%{python3_pkgversion}-%{pypi_name}
%license LICENSE.txt %license LICENSE.txt
%doc README.rst %doc README.rst
@ -133,6 +162,7 @@ install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
%{_bindir}/%{pypi_name} %{_bindir}/%{pypi_name}
%{_bindir}/%{pypi_name}-3 %{_bindir}/%{pypi_name}-3
%endif %endif
%ghost %{_bindir}/%{pypi_name}-3
%{python3_sitelib}/%{pypi_name}*/ %{python3_sitelib}/%{pypi_name}*/
%files -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel %files -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel