Linux command
rpmspec 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
rpmspec --query [path/to/rpm.spec]
Example
rpmspec --querytags
Example
rpmspec --query --queryformat "%{name}: %{summary}\n" [path/to/rpm.spec]
Example
rpmspec --query --srpm [path/to/rpm.spec]
Parse
rpmspec --parse [path/to/rpm.spec]
Example
rpmspec --query --buildrequires [path/to/rpm.spec]
Example
rpmspec --define "[dist .el9]" --query [path/to/rpm.spec]
说明
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.
参数
- --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.
FAQ
What is the rpmspec command used for?
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.
How do I run a basic rpmspec example?
Run `rpmspec --query [path/to/rpm.spec]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --query, -q do in rpmspec?
Query the spec file for package information.