specfile uses RPM for macro expansion and condition evaluation, however, that's not always necessary, hence the force_parse argument to the Specfile constructor that allows to use the created instance even if RPM parsing fails. But since specfile is already capable of parsing macro definitions as well as macro substitutions, we could go one step further and implement a simple, self-contained macro expansion, without using RPM.
specfile uses RPM for macro expansion and condition evaluation, however, that's not always necessary, hence the
force_parseargument to theSpecfileconstructor that allows to use the created instance even if RPM parsing fails. But since specfile is already capable of parsing macro definitions as well as macro substitutions, we could go one step further and implement a simple, self-contained macro expansion, without using RPM.