rpmspec
Query and parse RPM spec files
TLDR
SYNOPSIS
rpmspec {--query | --parse} [options] specfile
DESCRIPTION
rpmspec queries RPM spec files to extract package information without building packages. It can list packages that would be generated, show package metadata, expand macros, and parse spec file content.This is useful for validating spec files, extracting build requirements, and debugging macro expansion during package development.
PARAMETERS
--query, -q
Query the spec file for package information.--querytags
List available query format tags.--queryformat format
Custom output format using rpm header tags (e.g., %{name}, %{version}).--srpm
Query source package information instead of binary packages.--buildrequires
List build requirements from the spec file.--parse
Parse and expand spec file macros, outputting the processed spec to stdout.--define "macro value"
Define a macro for spec file processing.--target platform
Set target platform for the query.-v, --verbose
Verbose output.
CAVEATS
Some spec file features may require additional macros or definitions to parse correctly. Conditional blocks (%if/%endif) are evaluated during parsing and may produce different results depending on defined macros. The --define flag is needed to simulate target distribution settings.
HISTORY
Part of the RPM package manager toolchain. Provides spec file introspection capabilities separate from the full build process.
