When using vendored dependencies, the licenses in the sources will
typically match the licenses in the binaries. In this scenario the
SourceLicense tag can be omitteed since it should match the License tag.
For example, this allows adding BuildRequires that are required in
the "%prep" scriptlet. Adding them as dynamically generated
BuildRequires via "%generate_buildrequires" previously made these
dependencies unavailable in "%prep".
These settings are only valid for non-crate or workspace projects.
For crates published on crates.io, both URL and Source0 have values
that can be derived from the crate name.
Currently, this prevents generating spec files with the "SourceLicense"
tag, which was only implemented in RPM 4.18. This is not supported when
targeting RHEL / EPEL 9, which is on RPM 4.16.
This commit introduces many settings - additional source files,
additional packaged files, specifying additional commands that are
injected into %prep, %build, %install, or %check - both before and
after the respective %cargo_* macros.
rust-packaging >= 26 now has "official" support for overriding the
installation of library sources / binary targets by setting RPM macros.
This commit adds settings to correspond to the %cargo_install_lib and
%cargo_install_bin macros and plugs them through to the spec generator.
References to the the private %__cargo_is_bin and %__cargo_is_lib macros,
which could previously be used to hack this behaviour, were removed.
If the heuristics fail because the project uses a weird naming or
versioning scheme or if the directory name does not match the
"{project}-{version}" pattern. This is mostly the case for "workspace"
proejcts.
In the case the heuristics fail, the version can be overriden on the
command line.