Replace grep, sed usage with rpmspec

This makes sure all macros are correctly expanded, and
all .spec formats that are supported by RPM can be parsed.

https://wiki.merproject.org/wiki/Packaging_guidelines/ParsingSpecFiles