rpmspectool

Utility for parsing, querying, and manipulating RPM spec files

brewmacoslinux
Try with needOr install directly
Source

About

Utility for handling RPM spec files

Commands

rpmspectool

Examples

Extract the Version field from a spec file$ rpmspectool --query-tag Version mypackage.spec
List all tags and their values in a spec file$ rpmspectool --dump mypackage.spec
Set or modify a tag value in a spec file$ rpmspectool --set-tag Release 2 mypackage.spec