.\" Generated by scdoc 1.11.4 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "RPMSPEC" "1" "2026-01-08" "RPM 6.0.1" .PP .SH NAME rpmspec - RPM Spec Tool .PP .SH SYNOPSIS \fBrpmspec\fR {\fB-q\fR|\fB--query\fR} [options] [query-options] \fISPEC_FILE\fR .\&.\&.\& .PP \fBrpmspec\fR {\fB-P\fR|\fB--parse\fR} [options] \fISPEC_FILE\fR .\&.\&.\& .PP \fBrpmspec\fR \fB--shell\fR [options] [\fISPEC_FILE\fR .\&.\&.\&] .PP .SH DESCRIPTION \fBrpmspec\fR 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 \fBrpmspec\fR is similar to querying a package built from that spec file.\& But it is not identical.\& With \fBrpmspec\fR you can'\&t query all fields which you can query from a built package.\& E.\& g.\& you can'\&t query BUILDTIME with \fBrpmspec\fR for obvious reasons.\& You also cannot query other fields automatically generated during a build of a package like auto generated dependencies.\& .PP .SH OPERATIONS \fB-q\fR, \fB--query\fR .RS 4 Query parsed spec header, similarly to querying packages.\& .PP .RE \fB-P\fR, \fB--parse\fR .RS 4 Output parsed spec file to the standard output.\& That is, conditionals are handled, macros parsed and so on.\& .PP .RE \fB--shell\fR .RS 4 Invoke an interactive shell for inspecting macros, optionally after parsing a spec.\& Mainly useful for troubleshooting.\& .PP .RE .SH ARGUMENTS \fISPECFILE\fR .RS 4 RPM spec file used for building packages with rpmbuild.\& .PP .RE .SH OPTIONS See \fBrpm-common\fR(8) for the options common to all operations.\& .PP .SH QUERY OPTIONS \fB--qf\fR \fIQUERYFMT\fR, \fB--queryformat\fR \fIQUERYFMT\fR .RS 4 Specify output format for spec queries.\& See \fBrpm-queryformat\fR(7) for details.\& .PP .RE \fB--rpms\fR .RS 4 Operate on the all binary package headers generated from spec.\& .PP .RE \fB--builtrpms\fR .RS 4 Operate only on the binary package headers of packages which would be built from spec.\& That means ignoring package headers of packages that won'\&t be built from spec i.\& e.\& ignoring package headers of packages without file section.\& .PP .RE \fB--srpm\fR .RS 4 Operate on the source package header(s) generated from spec.\& .PP .RE .SH ENVIRONMENT See \fBrpm-common\fR(8).\& .PP .SH EXIT STATUS On success, 0 is returned, a nonzero failure code otherwise.\& .PP .SH EXAMPLES \fBrpmspec -q rpm.\&spec\fR .RS 4 Get list of binary packages which would be generated from the rpm spec file, eg: .nf .RS 4 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 \&.\&.\&. .fi .RE .PP .RE \fBrpmspec -q --qf "%{name}: %{summary}n" rpm.\&spec\fR .RS 4 Get summary infos for single binary packages generated from the rpm spec file, eg: .nf .RS 4 rpm: The RPM package management system rpm-libs: Libraries for manipulating RPM packages rpm-build-libs: Libraries for building and signing RPM packages \&.\&.\&. .fi .RE .PP .RE \fBrpmspec -q --srpm rpm.\&spec\fR .RS 4 Get the source package which would be generated from the rpm spec file, eg: .nf .RS 4 rpm-4\&.11\&.3-3\&.fc20\&.x86_64 .fi .RE .PP .RE \fBrpmspec -P rpm.\&spec\fR .RS 4 Parse the rpm spec file to standard output, eg: .nf .RS 4 Summary: The RPM package management system Name: rpm Version: 4\&.14\&.0 \&.\&.\&. .fi .RE .PP .RE \fBrpmspec --shell\fR .RS 4 Run interactive macro shell for debugging macros, eg: .nf .RS 4 > %define foo bar > %foo bar > %(date) Tue Apr 13 03:55:37 PM EEST 2021 > %getncpus 8 .fi .RE .PP .RE \fBrpmspec --shell popt.\&spec\fR .RS 4 Run interactive macros shell in spec context, eg: .nf .RS 4 %name popt %version 1\&.18 .fi .RE .PP .RE .SH SEE ALSO \fBpopt\fR(3), \fBrpm\fR(8), \fBrpmbuild\fR(1), \fBrpm-queryformat\fR(7), \fBrpm-macros\fR(7) .PP \fBrpmspec --help\fR - as rpm supports customizing the options via popt aliases it'\&s impossible to guarantee that what'\&s described in the manual matches what'\&s available.\& .PP \fBhttp://www.\&rpm.\&org/\fR