Subject: A basic spec file question

From: Devrim Gündüz <[email-masked]>
Date: Fri, 02 Oct 2020 10:08:32 +0100

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

---

From: Craig Ringer <[email-masked]>
Date: Fri, 2 Oct 2020 17:37:56 +0800

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

---

From: Heath Lord <[email-masked]>
Date: Fri, 2 Oct 2020 07:04:16 -0400

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
<[email-masked]> 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
>