Remove long since obsoleted tags and such, at least mention all
spec sections by name. Obviously mountains of information is missing,
and what is there is totally chaotic and inconsistent, but at least
there's a place to add more now.
Macros might want to pass along options meant for others while perhaps
modifying some of them, without exposing it all to users.
Have "-" as the parametric macro opts string disable all options processing
in rpm, allowing the macro to handle the raw argument list as they place.
Fixes: #547
Since Lua can easily return multiple values, combine test for definition
and parametric into one rpm.isdefined() API, always returning two booleans.
This also kinda ensures correct API usage as both are needed to positively
identify a defined, non-parametric macro.
We already have the macro arguments in an ARGV that's suitable for
passing to Lua, just store it in the macro buffer for passing around.
As macros can nest arbitrarily, we need to store and restore the mb
args which is a bit hacky, but much less trouble than changing all the
related functions to pass argound an argv which only one function
ever uses. Ditto with the macro entry itself, which is needed to pass
around the options (and name, and maybe something else too later).
Besides all the normal rpm defined macros for arguments and options,
parametric Lua macros now get pre-processed options and arguments
in native local tables "opt" and "arg" for much more pleasant access.
"opt" and "arg" tables are always there even if no options or arguments
were passed, this avoids having to deal with multiple cases and test
for nil's all over the place.
Fixes: #1092
The idea here is to start building a comprehensive RPM reference manual
where all features are eventually covered. Tutorials belong elsewhere.
The doc/manual contents are woefully inadequate and horribly out of date,
but even the longest journey starts with the first step.
For rough reproduction steps (yeah I know, this isn't my cup of tea):
perl -pi -e 's:\\verbatim:```:g' *
perl -pi -e 's:\\endverbatim:```:g' *
perl -pi -e 's:\\section .*? :## :g' *
perl -pi -e 's:\\page .*? :# :g' *
# plus clean up doxygen /* .. */ markings manually.
Some of the content is painfully out of sync with stuff on rpm.org but
now we can at least meaningfully diff.
The argument --verity-algo can be used to specify the algorithm for
the fsverity signatures. If nothing is specified, this will default to
sha256. The available algorithms depend on libfsverity, currently
sha256 and sha512 are supported.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This documents the new arguments --signverity and --certpath required
to sign a package with fsverity signatures.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
With the recent addition of the dynamic build requirements and the
accompanying -br option, it isn't entirely obvious that it's just an
additional build stage which may be executed with other build options as
well. Let's make it clear by rewording the section and incorporating
the %generate_buildrequires stage.
Fixes: #1304
Doesn't make much sense to install manuals for features that are not
enabled in a build. Conditionalize our man page installation where
necessary, taking care to include the manuals in tarballs regardless
of configured status.
Inspired by PR (#1247) from Thierry Vignaud
Adds rpm version as a new expression value type, denoted by v"" (similar
to Python u"", b"" etc), which are compared using rpm version comparison
algorithm rather than regular string comparison.
For example in specs:
%if v"%{python_version}" < v"3.9"
%endif
...but also command lines, arbitrary macros etc:
rpm --eval '%[v"1:1.2" < v"2.0"]'
Fixes: #1217
It's more than a little hysterical that rpm hasn't had a meaningful
public API for parsing and comparing version strings. The API may seem
kinda overkill for some things but then this does give us a place to
check for invalid version strings, which is a thing we never had before
(although the current code doesn't do much in the way of checking)
Fixes: #561
On packages where a separate payload digest exists (ie those built with
rpm >= 4.14), rpm v3 header+payload signatures are nothing but expensive
legacy baggage, as the payload digest will be signed by a header-only
signature already, without having to recalculate the entire file.
Automatically detect the payload digest presence and only add V3
signatures on packages that need it, but also add an override switch
to force their addition if needed for compatibility or so. A particular
use-case would be ability to signature-level verify the entire package
on rpm older than 4.14.
Fixes: #863
The politically correct version would be changing these all to .in files
with autoconf substituting the correct value during the build process
but that is such a PITA for what is at best a neglible benefit in this case,
it's just not worth it.
Fixes#779
- in a majority of examples in the manual the text after the
--queryformat argument is in double quotes - thus it does not
look good to wrote that "A query format is passed to RPM after
the --queryformat argument, and normally should be enclosed
in single quotes".
- in the case of:
rpm -qa -i --queryformat "%{NAME} %{SIZE}\n"
-i is not ignored, so this is omitted in the text.
- language correction
- added a link to a formatting tags documentation
- added an explicit example of a query expression
- removed example of "viewing the verify flags', that does
not have any purpose here
Supports the same expressions as spec %if conditions because, well,
it's the same expression parser. Only this returns the result as
a string instead of a boolean.
There has been no way to add comments to multiline macros, and while
spec files technically support #-commenting at beginning of lines, it
does not apply to all sections and causes generation after generation
of packagers to stumble on the same items over and over: macros
are expanded within spec comment lines, which makes commenting multiline
macros such as %configure annoying, comments inteded for scriptlets
end up being in the previous scriptlets body, and numerous other quirks.
This implements the M4-inspired %dnl macro primitive which literally
discards everything until the next newline (or end of string), without
expanding the contents. This allows comments to be used inside multiline
macros and everywhere in spec.
Caveat: in some places such as %description the newline doesn't actually
get discarded but this is a a spec parser issue, not on the macro side.
Closes: #158
Supports new %generate_buildrequires section in the spec file which is executed
after %prep. Stdout is captured and turned into BuildRequires. These are then
checked. If they cannot be fulfilled a source package is created with all
BuildRequires and the build is terminated after that.
rpmbuild has now the following new build modes -br, -tr, -rr and exits with 11
if build requirements are not met.
That means for users:
* No %generate_buildrequires
* rpmbuild -br is equivalent to rpmbuild -bs
* rpmbuild -br --nodeps is equivalent to rpmbuild -bs
* %generate_buildrequires
* rpmbuild -br will check dynamic BuildRequires
* Satisfied → src.rpm
* Unsatisfied → buildreqs.nosrc.rpm
* rpmbuild -br --nodeps will always generate buildreqs.nosrc.rpm
Source packages contain
Requires: rpmlib(DynamicBuildRequires) <= 4.15.0-1
if the spec contains a %generate_buildrequires section and
Provide: rpmlib(DynamicBuildRequires) = 4.15.0-1
if the results been added to the source package.
Co-authored-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>