Re: A basic spec file question

From: Heath Lord <heath(dot)lord(at)crunchydata(dot)com>
To: Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
Cc: Devrim Gündüz <devrim(at)gunduz(dot)org>, PostgreSQL YUM ML <pgsql-pkg-yum(at)lists(dot)postgresql(dot)org>
Subject: Re: A basic spec file question
Date: 2020-10-02 11:04:16
Message-ID: CA+BEBhukkX5ez12RWa6b9vUHTAd7dGsz2pwt+5TWcPP-3LTGpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

Devrim,

The issue is with the "<=" in this line:

%if 0%{?fedora} <= 31 || 0%{?rhel} <= 8 || 0%{?suse_version} >= 1315

With the "0%{variable}" format you will get "0" whenever a variable
is not defined, so whenever you do a comparison with a "<=" it will
resolve to TRUE when that variable is undefined. Since fedora and
rhel are never both defined at the same time the above logic will
always resolve to being TRUE.
Anytime you use this comparison logic to determine whether the
variable is "<=" you will also have to verify that the variable is
defined as well.

Thanks,
Heath

On Fri, Oct 2, 2020 at 5:38 AM Craig Ringer
<craig(dot)ringer(at)enterprisedb(dot)com> wrote:
>
> Add a %dump at the end of the spec file body and/or relevant parts throughout to see how it evaluated. %echo macros are useful too
>
> On Fri, 2 Oct 2020, 17:08 Devrim Gündüz, <devrim(at)gunduz(dot)org> wrote:
>>
>>
>>
>> Hi,
>>
>> I am probably missing a very basic thing, but... What is wrong in this
>> line? I am expecting Fedora 32 and 33 not do depend on CGAL package,
>> but then the Fedora 33 RPM depends on CGAL >= 4.7 .
>>
>> https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/master/common/sfcgal/master/sfcgal.spec;h=2678073373595d042341fe9724db6ccf1f2daacf;hb=b57f568a1eb1780a397d4c25c46c678399048e9b#l26
>>
>> What am I missing?
>>
>> Regards,
>> --
>> Devrim Gündüz
>> Open Source Solution Architect, Red Hat Certified Engineer
>> Twitter: @DevrimGunduz , @DevrimGunduzTR

In response to

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Bruno Lavoie 2020-10-15 14:38:46 Adding YUM packages to repository
Previous Message Craig Ringer 2020-10-02 09:37:56 Re: A basic spec file question