Re: Distro feature macros: a replacement for many %if rhel/fedora/amzn

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

 



Dne 02. 07. 23 v 23:15 Smith, Stewart via devel napsal(a):
3. Per distro package features (in some include file somewhere? Probably not the SPEC file itself… maybe an include to it?)

In the Avahi example above, the WITH_PYTHON is distro dependent for some reason, but is local to the package, it isn’t something that’s distro-wide.

Perhaps a package-local distro file?
i.e. adding in something like the following in the package spec file

Source1234: %{_vendor}-macros.inc
%include %{_vendor}-macros.inc

and then having the include have the %if{amzn/rhel/fedora} <>= VERSION logic there


Thoughts?


My real world example:

%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires:  (python%{python3_pkgversion}-tomli if python%{python3_pkgversion} < 3.11)
%else
BuildRequires:  python%{python3_pkgversion}-tomli
%endif
# grammar
%if 0%{?fedora} || 0%{?rhel} > 8
BuildRequires:  python3dist(lark-parser)
%endif

This will require macro %distro_has_python-lark-parser (can I use dashes in macro?). In this case it is forwad only, but if there would be;

%if 0%{?rhel} && 0%{?rhel} < 8

then I will have to negate this formul (and not make mistake) or I will need to add it to RHEL7 retroactively. Which takes time and in the mean time the builds will be broken. Or you had to define the macro yourself on the top of the spec file. And once you add it there, it will likely stay there forever.

And wene if you implement it your way, then you will have to keep for transition period of 10 years the oldfashioned %if-rhel.

It seems to me that it would be cat'n'mouse game with no winner. It seems better to me to use the rich dependencies like:

BuildRequires:  (python%{python3_pkgversion}-tomli if python%{python3_pkgversion} < 3.11)

I reckognize though that this cannot be applied in all situations.

--

Miroslav Suchy, RHCA
Red Hat, Manager, Packit and CPT, #brno, #fedora-buildsys
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-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/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux