[Rpm-maint] [rpm-software-management/rpm] Spec file versioning macros (Issue #2443)
Cristian Le
notifications at github.com
Wed Mar 22 09:54:00 UTC 2023
This is a reference from fedora packaging committee [issue](https://pagure.io/packaging-committee/issue/1264):
> I would like to propose a few helper macros for dealing with version control:
> - Format git tag -> rpm version: e.g. 1.2.3-rc1/1.2.3rc -> 1.2.3~rc1. This could be detected from [python's packaging.version](https://packaging.pypa.io/en/stable/version.html)
> - Format rpm version -> git tag/free format: e.g. 1.2.3~rc1 -> 1.2.3-rc1. An interface for this could be: %{version_format -base 1.2.3 -prerel rc1 -format v{base}-{prerel}} or if possible more automated %{version_format -version %{version} -format v{base}-{prerel}}
> - Detect version from git tag/.git_archival.txt similar to setuptools_scm. This would be incredibly useful for in-source packaging, but not in dist-gits
>
> These issues arose when trying to make packit be able to parse the version from git tags like v1.2.3-rc1. We can make a custom handling there, but it would be better to have a more standardized way to do this. The best case is to implement these upstream so that these can be used by OpenSuse as well.
>
> For reference here are a few workarounds that have to be maintained and are inconsistent with each other: [bluefish](https://src.fedoraproject.org/rpms/bluefish/blob/rawhide/f/bluefish.spec#_2), [cmake](https://src.fedoraproject.org/rpms/cmake/blob/rawhide/f/cmake.spec#_68)
Ideally it should be implemented here, but should it first be developed on redhat rpm macros?
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2443
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/2443 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230322/2e38bc9d/attachment.html>
More information about the Rpm-maint
mailing list