Re: Macronize %package -n python3-foo?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 16, 2021 at 5:32 AM Miro Hrončok <mhroncok@xxxxxxxxxx> wrote:
>
> Hello Pythonistas.
>
>
> I find myself cop-pasting this boring snippet each time I create a Python
> package (using the old macros or the new):
>
>
>    %package -n python3-foo
>    Summary:        %{summary}
>
>    %description -n python3-foo %_description
>
> And using one of those in %files:
>
>    %files -n python3-foo
>    %files -n python3-foo -f %{pyproject_files}
>
> I wonder whether it makes sense to macronize this.
>
> For example:
>
>    Name: python-foo
>    ...
>
>    %global _description %{expand:
>    This is the description for both SRPM and the python3-foo package.}
>
>    %description %_description
>
>    %py3_package %_description
>
>    ...
>
>    %py3_files
>    ...
>
>
> Or maybe even (if possible):
>
>    Name: python-foo
>    ...
>
>    %py3_package_with_description
>    This is the description for both SRPM and the python3-foo package.
>
>    ...
>
>    %py3_files
>    ...
>
>
> Both macros would figure the package name by replacing the python- prefix from
> %{name} with python3-.
>
>
> Pros: No more copy-paste-edit \o/
>
> Cons: The more is hidden from the reader behind automagic macros, the less
> obvious is the spec file to somebody who tries to read or modify it :(
>
>
> What is your opinion?

I would actually like this, and make it easy for us to build for
multiple Pythons (even if we don't do it by default in Fedora). This
is how openSUSE works with their "singlespec" model[1], and I have
come to appreciate it, even though I don't like some of the details of
the openSUSE implementation (such as weird parsing and rewriting of
stanzas for dependencies instead of the use of a generator and the
usage of alternatives, as shown in this example[2]).

[1]: https://en.opensuse.org/openSUSE:Packaging_Python#What_is_single-spec.3F
[2]: https://build.opensuse.org/package/view_file/devel:languages:python:flask/python-flask-oidc/python-flask-oidc.spec?expand=1



--
真実はいつも一つ!/ Always, there's only one truth!
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux