Blame SPECS/python3.11-wheel.spec

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