python3.14-packaging/SPECS/python3.14-packaging.spec
2026-04-16 04:57:44 -04:00

126 lines
3.5 KiB
RPMSpec

## START: Set by rpmautospec
## (rpmautospec version 0.6.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 5;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
%global python3_pkgversion 3.14
%global pypi_name packaging
# Specify --with bootstrap to build in bootstrap mode
# This mode is needed, because python3-rpm-generators need packaging
%bcond_with bootstrap
# When bootstrapping, the tests and docs are disabled because the dependencies are not yet available.
# We don't want python-pretend in future RHEL, so we disable tests on RHEL as well.
# No reason to ship the documentation in RHEL either, so it is also disabled by default.
%if %{without bootstrap} && %{undefined rhel}
# Specify --without tests to prevent the dependency loop on python-pytest
%bcond_without tests
%else
%bcond_with tests
%endif
Name: python%{python3_pkgversion}-%{pypi_name}
Version: 25.0
Release: %autorelease
Summary: Core utilities for Python packages
License: BSD-2-Clause OR Apache-2.0
URL: https://github.com/pypa/packaging
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: pyproject-rpm-macros
BuildRequires: unzip
%if %{with bootstrap}
BuildRequires: python%{python3_pkgversion}-flit-core
%endif
# Upstream uses nox for testing, we specify the test deps manually as well.
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pretend
%endif
%global _description %{expand:
python-packaging provides core utilities for Python packages like utilities for
dealing with versions, specifiers, markers etc.}
%description %_description
%if %{with bootstrap}
Provides: python%{python3_pkgversion}dist(packaging) = %{version}
Provides: python%{python3_version}dist(packaging) = %{version}
Requires: python(abi) = %{python3_version}
%endif
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
%if %{without bootstrap}
%generate_buildrequires
%pyproject_buildrequires -r
%endif
%build
%if %{with bootstrap}
%{python3} -m flit_core.wheel
%else
%pyproject_wheel
%endif
%install
%if %{with bootstrap}
mkdir -p %{buildroot}%{python3_sitelib}
unzip dist/packaging-%{version}-py3-none-any.whl -d %{buildroot}%{python3_sitelib} -x packaging-%{version}.dist-info/RECORD
echo '%{python3_sitelib}/packaging*' > %{pyproject_files}
%else
%pyproject_install
%pyproject_save_files %{pypi_name}
%endif
%check
%{!?with_bootstrap:%pyproject_check_import}
%if %{with tests}
%pytest
%endif
%files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files}
%license LICENSE LICENSE.APACHE LICENSE.BSD
%doc README.rst CHANGELOG.rst CONTRIBUTING.rst
%changelog
## START: Generated by rpmautospec
* Thu Nov 27 2025 Lumir Balhar <lbalhar@redhat.com> - 25.0-5
- Revert "Enable bootstrap"
* Wed Nov 26 2025 Lumir Balhar <lbalhar@redhat.com> - 25.0-4
- Enable bootstrap
* Tue Nov 25 2025 Lukáš Zachar <lzachar@redhat.com> - 25.0-3
- Add gating
* Tue Nov 25 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 25.0-2
- Convert from Fedora for the Python 3.14 stack in RHEL
* Tue Nov 25 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 25.0-1
- RHEL: Rename SPEC to python3.14-packaging.spec
## END: Generated by rpmautospec