Macronize %package -n python3-foo?

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

 



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?
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
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