This way, when we add new options to the actual macro in pyproject-rpm-macros,
spec files that use them are parsable with the old pyproject-srpm-macros package.
Last time, when we added the -g option in 1.16.0,
it took at least a week for Fedora CI to be able to parse a spec file with it,
as pyproject-srpm-macros 1.16.0+ needed to actually be installed on the CI systems.
Next time this happens, the new option will be parsable with older versions of pyproject-rpm-macros
Note that the (-) syntax is not supported yet on RPM 4.16 in RHEL 9.
I'd use an expression to keep the literal set of flags for older RPM versions:
%pyproject_buildrequires(%[v"0%{?rpmversion}" >= v"4.19" ? "-" : "rRxtNwpe:g:C:"])
But macro options are not processed as macros:
https://github.com/rpm-software-management/rpm/issues/3440
As a result, this is not compatible with RHEL 9 and cannot be backported to it.
Unless the (-) syntax is backported:
https://issues.redhat.com/browse/RHEL-67161
https://gitlab.com/redhat/centos-stream/rpms/rpm/-/merge_requests/60
18 lines
882 B
Plaintext
18 lines
882 B
Plaintext
# This file is called macros.aaa-pyproject-srpm
|
|
# to sort alphabetically before macros.pyproject.
|
|
# When this file is installed but macros.pyproject is not
|
|
# this macro will cause the package with the real macro to be installed.
|
|
# When macros.pyproject is installed, it overrides this macro.
|
|
# Note: This takes arbitrary options, to ease addition of new options to the real macro.
|
|
%pyproject_buildrequires(-) echo 'pyproject-rpm-macros' && exit 0
|
|
|
|
|
|
# Declarative buildsystem, requires RPM 4.20+ to work
|
|
# https://rpm-software-management.github.io/rpm/manual/buildsystem.html
|
|
# This is the minimal implementation to be in the srpm package,
|
|
# as required even before the BuildRequires are installed
|
|
%buildsystem_pyproject_conf() %nil
|
|
%buildsystem_pyproject_generate_buildrequires() %pyproject_buildrequires %*
|
|
%buildsystem_pyproject_build() %nil
|
|
%buildsystem_pyproject_install() %nil
|