.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "RPMSPEC" "8" "29 October 2010" "" ""
.SH NAME
rpmspec \- RPM Spec Tool
.SH SYNOPSIS
.SS QUERYING SPEC FILES
\f[B]rpmspec\f[R] {\f[B]\-q|\-\-query\f[R]} [\f[B]select\-options\f[R]]
[\f[B]query\-options\f[R]] \f[I]SPEC_FILE ...\f[R]
.SS PARSING SPEC FILES TO STDOUT
\f[B]rpmspec\f[R] {\f[B]\-P|\-\-parse\f[R]} \f[I]SPEC_FILE ...\f[R]
.SS INVOKING MACRO SHELL
\f[B]rpmspec\f[R] {\f[B]\[en]shell\f[R]} [\f[I]SPEC_FILE ...\f[R]]
.SH DESCRIPTION
\f[B]rpmspec\f[R] is a tool for querying a spec file.
More specifically for querying hypothetical packages which would be
created from the given spec file.
So querying a spec file with \f[B]rpmspec\f[R] is similar to querying a
package built from that spec file.
But is is not identical.
With \f[B]rpmspec\f[R] you can\[aq]t query all fields which you can
query from a built package.
E. g.
you can\[aq]t query BUILDTIME with \f[B]rpmspec\f[R] for obvious
reasons.
You also cannot query other fields automatically generated during a
build of a package like auto generated dependencies.
.SS select\-options
[\f[B]\-\-rpms\f[R]] [\f[B]\-\-srpm\f[R]]
.SS query\-options
[\f[B]\-\-qf,\-\-queryformat\f[R] \f[I]QUERYFMT\f[R]]
[\f[B]\-\-target\f[R] \f[I]TARGET_PLATFORM\f[R]]
.SS QUERY OPTIONS
The general form of an rpm spec query command is
.PP
\f[B]rpm\f[R] {\f[B]\-q|\-\-query\f[R]} [\f[B]select\-options\f[R]]
[\f[B]query\-options\f[R]]
.PP
You may specify the format that the information should be printed in.
To do this, you use the
.PP
\f[B]\-\-qf|\-\-queryformat\f[R] \f[I]QUERYFMT\f[R]
.PP
option, followed by the \f[I]QUERYFMT\f[R] format string.
See \f[B]rpm\f[R](8) for details.
.SS SELECT OPTIONS
.TP
\f[B]\-\-rpms\f[R]
Operate on the all binary package headers generated from spec.
.TP
\f[B]\-\-builtrpms\f[R]
Operate only on the binary package headers of packages which would be
built from spec.
That means ignoring package headers of packages that won\[aq]t be built
from spec i.
e.
ignoring package headers of packages without file section.
.TP
\f[B]\-\-srpm\f[R]
Operate on the source package header(s) generated from spec.
.SH EXAMPLES
Get list of binary packages which would be generated from the rpm spec
file:
.RS
.IP
.EX
$ rpmspec \-q rpm.spec
rpm\-4.11.3\-3.fc20.x86_64
rpm\-libs\-4.11.3\-3.fc20.x86_64
rpm\-build\-libs\-4.11.3\-3.fc20.x86_64
...
.EE
.RE
.PP
Get summary infos for single binary packages generated from the rpm spec
file:
.RS
.IP
.EX
$ rpmspec \-q \-\-qf \[dq]%{name}: %{summary}\[rs]n\[dq] rpm.spec
rpm: The RPM package management system
rpm\-libs: Libraries for manipulating RPM packages
rpm\-build\-libs: Libraries for building and signing RPM packages
...
.EE
.RE
.PP
Get the source package which would be generated from the rpm spec file:
.RS
.IP
.EX
$ rpmspec \-q \-\-srpm rpm.spec
rpm\-4.11.3\-3.fc20.x86_64
.EE
.RE
.PP
Parse the rpm spec file to stdout:
.RS
.IP
.EX
$ rpmspec \-P rpm.spec
Summary: The RPM package management system
Name: rpm
Version: 4.14.0
...
.EE
.RE
.PP
Run interactive macro shell for debugging macros:
.RS
.IP
.EX
$ rpmspec \-\-shell
> %define foo bar
> %foo
bar
> %(date)
Tue Apr 13 03:55:37 PM EEST 2021
> %getncpus
8
.EE
.RE
.PP
Run interactive macros shell in spec context:
.RS
.IP
.EX
$ rpmspec \-\-shell popt.spec
%name
popt
%version
1.18
.EE
.RE
.SH SEE ALSO
\f[B]popt\f[R](3), \f[B]rpm\f[R](8), \f[B]rpmdb\f[R](8),
\f[B]rpmkeys\f[R](8), \f[B]rpmsign\f[R](8), \f[B]rpm2cpio\f[R](8),
\f[B]rpmbuild\f[R](8)
.PP
\f[B]rpmspec \-\-help\f[R] \- as rpm supports customizing the options
via popt aliases it\[aq]s impossible to guarantee that what\[aq]s
described in the manual matches what\[aq]s available.
.PP
\f[B]http://www.rpm.org/ \f[R]
.SH AUTHORS
.IP
.EX
Marc Ewing
Jeff Johnson
Erik Troan
Panu Matilainen
.EE