python-rpm-generators/python-rpm-generators.spec
Miro Hrončok 43b2eea5d4 Generate purl(pkg:pypi/...) Provides
- Fixes: rhbz#2514458
- https://fedoraproject.org/wiki/Changes/Adopt_PURL_Metadata

Alongside the existing python*dist() Provides, generate Package URL
(purl) Provides like purl(pkg:pypi/setuptools@41.6.0) for identifying
Python packages in a ecosystem-independent way.

The purl name is normalized per the purl spec for PyPI (lowercase,
underscores replaced with dashes, dots preserved, unlike PEP 503).
The version is canonicalized per PEP 440 with trailing zeros preserved.

Enabled by default via the %__purl_provides_pypi macro.
Packagers can %undefine it for packages not actually on PyPI.
Extras subpackages do not get purl Provides.

Assisted-By: Claude Opus 4.6
2026-08-26 12:36:44 +00:00

66 lines
2.5 KiB
RPMSpec

Name: python-rpm-generators
Summary: Dependency generators for Python RPMs
Version: 15
Release: %autorelease
Url: https://src.fedoraproject.org/rpms/python-rpm-generators
# Originally the following files were part of RPM, so the license is inherited: GPL-2.0-or-later
# The COPYING file is grabbed from the last commit that changed the files
Source0: https://raw.githubusercontent.com/rpm-software-management/rpm/102eab50b3d0d6546dfe082eac0ade21e6b3dbf1/COPYING
Source1: python.attr
Source2: pythondist.attr
# This was crafted in-place as a fork of python.attr, hence also GPL-2.0-or-later
Source3: pythonname.attr
# This one is also originally from RPM, but it has its own license declaration: LGPL-2.1-or-later
Source4: pythondistdeps.py
# This was crafted in-place with the following license declaration:
# LicenseRef-Fedora-Public-Domain OR CC0-1.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later
# Note that CC0-1.0 is not allowed for code in Fedora, so we skip it in the package License tag
Source5: pythonbundles.py
# Macros to enable/disable opt-in/opt-out generator features.
# Older features have their macros in python-srpm-macros,
# but shipping them here is simpler to maintain.
# This is essentially data, so no explicit license.
Source6: macros.python-rpm-generators
# See individual licenses above Source declarations
# Originally, this was simplified to GPL-2.0-or-later, but "effective license" analysis is no longer allowed
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND (LicenseRef-Fedora-Public-Domain OR LGPL-2.1-or-later OR GPL-2.0-or-later)
BuildArch: noarch
%description
%{summary}.
%package -n python3-rpm-generators
Summary: %{summary}
Requires: python3-packaging
# We have parametric macro generators, we need RPM 4.16 (4.15.90+ is 4.16 alpha)
Requires: rpm > 4.15.90-0
# This contains the Lua functions we use:
Requires: python-srpm-macros >= 3.10-15
%description -n python3-rpm-generators
%{summary}.
%prep
%autosetup -c -T
cp -a %{sources} .
%install
install -Dpm0644 -t %{buildroot}%{_fileattrsdir} *.attr
install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} *.py
install -Dpm0644 -t %{buildroot}%{_rpmmacrodir} macros.*
%files -n python3-rpm-generators
%license COPYING
%{_fileattrsdir}/python.attr
%{_fileattrsdir}/pythondist.attr
%{_fileattrsdir}/pythonname.attr
%{_rpmconfigdir}/pythondistdeps.py
%{_rpmconfigdir}/pythonbundles.py
%{_rpmmacrodir}/macros.python-rpm-generators
%changelog
%autochangelog