@pmatilai commented on this pull request.
> +in and parsed after *%install* (but before *%check*). This mechanism enables
> the
+creation of sub-packages based on the build results.
+
+Spec parts cannot include preamble tags or directives that are needed for, or
+influence, the build process. This includes all build scriptlets, sources and
+patches, *BuildRequires*, *BuildArch* (except for *noarch* sub-packages),
+*BuildSystem*, *ExcludeArch*, *ExclusiveArch*, *ExcludeOS* and *ExclusiveOS*.
+These will terminate the build with an error if encountered in a spec part.
+Declaring macros meant to be used in build scriptlets is not an error, however
+they will not influence the build for obvious reasons.
+
+Generally, _.specpart_ files should be generated by separate executables
invoked
+from build scriptlets rather than by the scriptlets directly. This is to ensure
+that the spec syntax meant for those files is not interpreted prematurely, when
+the spec is read. Spec directives starting at the beginning of the line, such
as
+in here documents, should be avoided entirely as they would be interpreted
right
It's not a matter of "should be avoided", they cannot be used. "They" being all
the multiline %section like things in spec. This actually goes to all heredocs
in a spec, not just dynamic spec parts, but it'd be rare for a spec to want to
generate a heredoc with spec directives for some other purpose I guess.
Conditionals, macros and %include are okay to be used to create a heredoc, just
that they are interpreted right away on initial spec parse, not at the point of
dynamic parsing.
How exactly to phrase that for the manual... our definition of a directive in
this man page is rather vague, coming back to it after a break. Argh 😅
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4299#pullrequestreview-4851827577
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/4299/review/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint