Blame SPECS/python3.11-wheel.spec

32d410
%global __python3 /usr/bin/python3.11
32d410
%global python3_pkgversion 3.11
32d410
32d410
# The function of bootstrap is that it disables the wheel subpackage
32d410
%bcond_with bootstrap
32d410
32d410
# Default: when bootstrapping -> disable tests
32d410
%if %{with bootstrap}
32d410
%bcond_with tests
32d410
%else
32d410
%bcond_without tests
32d410
%endif
32d410
32d410
# Similar to what we have in pythonX.Y.spec files.
32d410
# If enabled, provides unversioned executables and other stuff.
32d410
# Disable it if you build this package in an alternative stack.
32d410
%bcond_with main_python
32d410
32d410
%global pypi_name wheel
32d410
%global python_wheel_name %{pypi_name}-%{version}-py3-none-any.whl
32d410
32d410
Name:           python%{python3_pkgversion}-%{pypi_name}
32d410
Version:        0.38.4
32d410
Release:        3%{?dist}
32d410
Summary:        Built-package format for Python
32d410
32d410
# packaging is ASL 2.0 or BSD
32d410
License:        MIT and (ASL 2.0 or BSD)
32d410
URL:            https://github.com/pypa/wheel
32d410
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
32d410
BuildArch:      noarch
32d410
32d410
BuildRequires:  python%{python3_pkgversion}-devel
32d410
BuildRequires:  python%{python3_pkgversion}-rpm-macros
32d410
BuildRequires:  python%{python3_pkgversion}-setuptools
32d410
32d410
# python3 bootstrap: this is rebuilt before the final build of python3, which
32d410
# adds the dependency on python3-rpm-generators, so we require it manually
32d410
BuildRequires:  python3-rpm-generators
32d410
32d410
%if %{with tests}
32d410
BuildRequires:  python%{python3_pkgversion}-pytest
32d410
# several tests compile extensions
32d410
# those tests are skipped if gcc is not found
32d410
BuildRequires:  gcc
32d410
%endif
32d410
32d410
# Virtual provides for the packages bundled by wheel.
32d410
# Actual version can be found in git history:
32d410
# https://github.com/pypa/wheel/commits/master/src/wheel/vendored/packaging/tags.py
32d410
%global bundled %{expand:
32d410
Provides:       bundled(python%{python3_version}dist(packaging)) = 21.3
32d410
}
32d410
32d410
%{bundled}
32d410
32d410
%global _description %{expand:
32d410
Wheel is the reference implementation of the Python wheel packaging standard,
32d410
as defined in PEP 427.
32d410
32d410
It has two different roles:
32d410
32d410
 1. A setuptools extension for building wheels that provides the bdist_wheel
32d410
    setuptools command.
32d410
 2. A command line tool for working with wheel files.}
32d410
32d410
%description %{_description}
32d410
32d410
%if %{without bootstrap}
32d410
%package -n     %{python_wheel_pkg_prefix}-%{pypi_name}-wheel
32d410
Summary:        The Python wheel module packaged as a wheel
32d410
%{bundled}
32d410
32d410
%description -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel
32d410
A Python wheel of wheel to use with virtualenv.
32d410
%endif
32d410
32d410
32d410
%prep
32d410
%autosetup -n %{pypi_name}-%{version} -p1
32d410
32d410
32d410
%build
32d410
%py3_build
32d410
32d410
32d410
%install
32d410
%py3_install
32d410
mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python3_version}}
32d410
%if %{with main_python}
32d410
ln -s %{pypi_name}-%{python3_version} %{buildroot}%{_bindir}/%{pypi_name}-3
32d410
ln -s %{pypi_name}-3 %{buildroot}%{_bindir}/%{pypi_name}
32d410
%endif
32d410
32d410
%if %{without bootstrap}
32d410
# We can only use bdist_wheel when wheel is installed, hence we don't build the wheel in %%build
32d410
export PYTHONPATH=%{buildroot}%{python3_sitelib}
32d410
%py3_build_wheel
32d410
mkdir -p %{buildroot}%{python_wheel_dir}
32d410
install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
32d410
%endif
32d410
32d410
32d410
%if %{with tests}
32d410
%check
32d410
rm setup.cfg  # to drop pytest coverage options configured there
32d410
%pytest -v --ignore build
32d410
%endif
32d410
32d410
%files -n python%{python3_pkgversion}-%{pypi_name}
32d410
%license LICENSE.txt
32d410
%doc README.rst
32d410
%{_bindir}/%{pypi_name}-%{python3_version}
32d410
%if %{with main_python}
32d410
%{_bindir}/%{pypi_name}
32d410
%{_bindir}/%{pypi_name}-3
32d410
%endif
32d410
%{python3_sitelib}/%{pypi_name}*/
32d410
32d410
%if %{without bootstrap}
32d410
%files -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel
32d410
%license LICENSE.txt
32d410
# we own the dir for simplicity
32d410
%dir %{python_wheel_dir}/
32d410
%{python_wheel_dir}/%{python_wheel_name}
32d410
%endif
32d410
32d410
%changelog
32d410
* Wed Feb 01 2023 Charalampos Stratakis <cstratak@redhat.com> - 0.38.4-3
32d410
- Explicitly require the python3.11-rpm-macros
32d410
32d410
* Wed Feb 01 2023 Charalampos Stratakis <cstratak@redhat.com> - 0.38.4-2
32d410
- Disable bootstrap
32d410
32d410
* Tue Dec 13 2022 Charalampos Stratakis <cstratak@redhat.com> - 0.38.4-1
32d410
- Initial package
32d410
- Fedora contributions by:
32d410
      Charalampos Stratakis <cstratak@redhat.com>
32d410
      Dennis Gilmore <dennis@ausil.us>
32d410
      Haikel Guemar <hguemar@fedoraproject.org>
32d410
      Igor Gnatenko <ignatenkobrain@fedoraproject.org>
32d410
      Karolina Surma <ksurma@redhat.com>
32d410
      Lumir Balhar <lbalhar@redhat.com>
32d410
      Matej Stuchlik <mstuchli@redhat.com>
32d410
      Miro HronĨok <miro@hroncok.cz>
32d410
      Robert Kuska <rkuska@redhat.com>
32d410
      Slavek Kabrda <bkabrda@redhat.com>
32d410
      Tomas Hrnciar <thrnciar@redhat.com>
32d410
      Tomas Orsava <torsava@redhat.com>