Re: RHEL and CentOS specific Requires in spec file
On 11/05/2022 00:17, Nico Kadel-Garcia wrote: %if 0%{?rhel} == 8 "0%{?rhel} == X" or "0%{?rhel} > 8" are okay, but "0%{?rhel} < X" will break some things on non-RHEL/EPEL distributions, including Fedora. Sometimes maintainers forget this behavior after changing the release version in a condition. That's why double checks are always preferable. -- Sincerely, Vitaly Zaitsev (vit...@easycoding.org) ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Re: RHEL and CentOS specific Requires in spec file
On Tue, May 10, 2022 at 12:28 PM Vitaly Zaitsev via devel wrote: > > On 10/05/2022 18:00, Ben Beasley wrote: > > Could you please elaborate on why this form is better? > > For building on RHEL without EPEL being enabled. > > > At minimum, “%if 0%{?rhel} && 0%{?rhel} == 8” is exactly equivalent to > > “%if 0%{?rhel} == 8”. > > Double checks are preferable, because "%if 0%{?rhel} < X" can easily > break things. > > For example, on Fedora the %{?rhel} macro is not defined, so the > condition 0%{?rhel} < 9 will be true because 0 is less than 9. So what? If you're checking: %if 0%{?rhel} == 8 There's no need for the double check. If you were looking for RHEL < 8, yeah, it could make sense %if 0%{?rhel} && 0%{?rhel} < 8 ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Re: RHEL and CentOS specific Requires in spec file
On 10/05/2022 18:00, Ben Beasley wrote: Could you please elaborate on why this form is better? For building on RHEL without EPEL being enabled. At minimum, “%if 0%{?rhel} && 0%{?rhel} == 8” is exactly equivalent to “%if 0%{?rhel} == 8”. Double checks are preferable, because "%if 0%{?rhel} < X" can easily break things. For example, on Fedora the %{?rhel} macro is not defined, so the condition 0%{?rhel} < 9 will be true because 0 is less than 9. -- Sincerely, Vitaly Zaitsev (vit...@easycoding.org) ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Re: RHEL and CentOS specific Requires in spec file
On Tue, May 10, 2022 at 11:42 AM Ron Olson wrote: > > No, it’s not available in RHEL nor in CentOS 8 and Stream 8; if I used the > rhel tag would that include those? > Either is fine. %rhel and %el8 are both defined for all EL8 platforms. Using %rhel is mostly useful if you want to handle multiple versions of RHEL. -- 真実はいつも一つ!/ Always, there's only one truth! ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Re: RHEL and CentOS specific Requires in spec file
Could you please elaborate on why this form is better? I would have thought they were more or less equivalent, but it’s very possible that there is some non-obvious difference I don’t know about. At minimum, “%if 0%{?rhel} && 0%{?rhel} == 8” is exactly equivalent to “%if 0%{?rhel} == 8”. – Ben On 5/10/22 11:53, Vitaly Zaitsev via devel wrote: On 10/05/2022 17:01, Ron Olson wrote: |%if 0%{?el8}| Better fix: %if 0%{?rhel} && 0%{?rhel} == 8 ... %else ... %endif ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Re: RHEL and CentOS specific Requires in spec file
On 10/05/2022 17:01, Ron Olson wrote: |%if 0%{?el8}| Better fix: %if 0%{?rhel} && 0%{?rhel} == 8 ... %else ... %endif -- Sincerely, Vitaly Zaitsev (vit...@easycoding.org) ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Re: RHEL and CentOS specific Requires in spec file
No, it’s not available in RHEL nor in CentOS 8 and Stream 8; if I used the rhel tag would that include those? On 10 May 2022, at 10:24, Neal Gompa wrote: > On Tue, May 10, 2022 at 11:01 AM Ron Olson wrote: >> >> Hey all- >> >> I got a bug report about installing Swift on RHEL 8 where nothing provides >> binutils-gold. I think this will fix it: >> >> %if 0%{?el8} >> Requires: binutils >> %else >> Requires: binutils-gold >> %endif >> >> But was hoping for some confirmation about this being the right way to >> handle this situation. >> > > It works, but is binutils-gold available in RHEL at all? If not, you > probably want to swap to 0%{?rhel} instead. > > > > -- > 真実はいつも一つ!/ Always, there's only one truth! > ___ > devel mailing list -- devel@lists.fedoraproject.org > To unsubscribe send an email to devel-le...@lists.fedoraproject.org > 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@lists.fedoraproject.org > Do not reply to spam on the list, report it: > https://pagure.io/fedora-infrastructure ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Re: RHEL and CentOS specific Requires in spec file
On Tue, May 10, 2022 at 11:01 AM Ron Olson wrote: > > Hey all- > > I got a bug report about installing Swift on RHEL 8 where nothing provides > binutils-gold. I think this will fix it: > > %if 0%{?el8} > Requires: binutils > %else > Requires: binutils-gold > %endif > > But was hoping for some confirmation about this being the right way to handle > this situation. > It works, but is binutils-gold available in RHEL at all? If not, you probably want to swap to 0%{?rhel} instead. -- 真実はいつも一つ!/ Always, there's only one truth! ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
RHEL and CentOS specific Requires in spec file
Hey all- I got a bug report about installing Swift on RHEL 8 where nothing provides binutils-gold. I _think_ this will fix it: ``` %if 0%{?el8} Requires: binutils %else Requires: binutils-gold %endif ``` But was hoping for some confirmation about this being the right way to handle this situation. Thanks! Ron___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure