[Rpm-maint] [rpm-software-management/rpm] spec file preprocessing on rpm level (#1472)

Michal Novotný notifications at github.com
Thu Dec 31 03:29:46 UTC 2020


Hello,

since this change https://pagure.io/fesco/issue/2532 will not likely be accepted, I would like to ask if you were willing to accept a pull request to enable spec file preprocessing directly on rpm level. It would add a third type of macro (except `%{}` and `%()`), which would work similarly to `%()` except that the values (after expansion) would be put verbatim into the spec file that goes into an srpm generated by rpmbuild.

Basically, spec files would be always passed through `preproc` utility first before they would be handed over for further rpm processing. Enabling/disabling of this feature would be only system-wide, not spec-wide as you need to preprocess a template first before parsing it.

This is a way to bring innovation to rpm ecosystem mainly by:
- enabling automatic version, release, changelog, VCS generation e.g. from git metadata
- enabling dynamic source generation e.g. from a git submodule with mirrored upstream sources
- providing a way for automatic generation of requires and build requires by analyzing upstream sources

The only added dependency would the `preproc` utility, which I would just rewrite from python to C, it is less than 100 lines of code currently so it won't be a problem.

People basically didn't like that `rpmbuild -bs` would no longer always work on a spec file within Fedora DistGit after accepting the aforementioned change. Having the preprocessor directly in rpm would solve that problem.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1472
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201230/47612762/attachment.html>


More information about the Rpm-maint mailing list