this pull request enables spec preprocessing functionality that originated in rpkg-util. I tested this PR successfully with fedpkg tool. I haven't yet tested other tools like rfpkg but I assume they could work if they work in similar fashion to fedpkg. This complements work that was done in mock previously: https://github.com/rpm-software-management/mock/commit/bda814a743ef74e6dfbee261a4db6e2f219382d1
If this is accepted, I plan to continue the integration by extending the tag subcommand to be able to populate tag messages automatically from git commits from the latest reachable annotated tag and also add some more options (like --name, --version, or --release and possibly others to make the integration smooth).
Basically, what this commit does is that it enables usage of rpkg-macros in spec files (if preprocess_spec configuration option is set to True). This is a possible solution for automatic release and changelog generation problem but it offers more than that.
I am open to any required code changes and improvements in this PR or in future.
NOTES from the commit:
enabled by setting preprocess_spec to True in the config file
uses preproc and rpkg-macros to do the job
when preprocessing is enabled, the generated files will
be put into an auto-generated directory under /tmp/
(e.g. /tmp/fedpkg for the fedpkg tool)
this enables preprocessing for all rpm-based commands:
srpm, local, prep, install, compile, lint, verify-files, clog
mockbuild, koji scratch build, copr build
also a new subcommand spec is introduced just to render
the spec file without further building srpm etc.
some introduced functions are currently unused (e.g.
utils.changelog_entry or utils.edit). The functions are
intended to be used in a future commit that extends the tag subcommand to automatically pregenerate tag messages.
preproc and rpkg-macros packages are newly required,
also python-munch
Hello,
this pull request enables spec preprocessing functionality that originated in rpkg-util. I tested this PR successfully with fedpkg tool. I haven't yet tested other tools like
rfpkgbut I assume they could work if they work in similar fashion to fedpkg. This complements work that was done in mock previously: https://github.com/rpm-software-management/mock/commit/bda814a743ef74e6dfbee261a4db6e2f219382d1If this is accepted, I plan to continue the integration by extending the
tagsubcommand to be able to populate tag messages automatically from git commits from the latest reachable annotated tag and also add some more options (like--name,--version, or--releaseand possibly others to make the integration smooth).Basically, what this commit does is that it enables usage of rpkg-macros in spec files (if
preprocess_specconfiguration option is set to True). This is a possible solution for automatic release and changelog generation problem but it offers more than that.I am open to any required code changes and improvements in this PR or in future.
NOTES from the commit:
be put into an auto-generated directory under /tmp/
(e.g. /tmp/fedpkg for the fedpkg tool)
srpm, local, prep, install, compile, lint, verify-files, clog
mockbuild, koji scratch build, copr build
specis introduced just to renderthe spec file without further building srpm etc.
utils.changelog_entry or utils.edit). The functions are
intended to be used in a future commit that extends the
tagsubcommand to automatically pregenerate tag messages.also python-munch
Signed-off-by: clime clime@fedoraproject.org