Bug 14463

Summary: Nested %if handling in spec files is broken
Product: [Retired] Red Hat Linux Reporter: Charles R. Anderson <cra>
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: djuran, pmatilai, redhat, wuth
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-29 21:41:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch from H.J. Lu
none
clean diff against rpm-4.0.4-7x.18.src.rpm none

Description Charles R. Anderson 2000-07-22 16:28:53 UTC
I'm getting this error with rpm-3.0.5-6x (from ftp.redhat.de) on Red Hat
6.2:

>rpm -ba -v -v -v --target=i386,i586,i686 kernel-2.2.16-ipsec.spec
Building target platforms: i386,i586,i686
Building for target i386
parse error in expression
/home/cra/src/redhat/SPECS/kernel-2.2.16-ipsec.spec:22:
parseExpressionBoolean returns -1

The relevent bits of the spec file are below.   I added an ipsec define as
a third optional component to the kernel-2.2.16-3 spec file to build with
freeswan.   I used the same ugly method as lfs and ext3, and doubled the
number of %if statements, because I see no way around it.  This spec file
builds fine with rpm-3.0.4-0.48 on an i586 box.

Line 22 below is the first %if %{ext3}.

# define lfs as either 0 (for off) or 1 (for on) when making the kernel
%define subrelease 3.1
%define ipsec 1
%define lfs 0
%define ext3 0
Version: %{kversion}
%if %{ipsec}

%if %{lfs}
%if %{ext3}
Release: %{subrelease}.ipsec.lfs.ext3
%else
Release: %{subrelease}.ipsec.lfs
%endif
%else
%if %{ext3}
Release: %{subrelease}.ipsec.ext3
%else
Release: %{subrelease}.ipsec
%endif
%endif

%else

%if %{lfs}
%if %{ext3}
Release: %{subrelease}.lfs.ext3
%else
Release: %{subrelease}.lfs
%endif
%else
%if %{ext3}
Release: %{subrelease}.ext3
%else
Release: %{subrelease}
%endif
%endif

%endif

Comment 1 Jeff Johnson 2000-08-16 20:18:02 UTC
This is due to the patch at bugzilla #11485. You have the following choices for
now (I
will not be able to change rpm for a couple of weeks due to impending Red Hat
7.0 release):

1) fix the kernel spec file. I believe that the latest Raw Hide kernel has these
changes.

2) revert the #11485 patch and rebuild rpm.

3) I have a patch from H. J. Lu that fixes the problem, but I dunno at the
moment if that
will be the final fix. Send mail to <jbj> if you wish the patch.

Comment 2 Jeff Johnson 2000-08-16 20:18:45 UTC
*** Bug 16392 has been marked as a duplicate of this bug. ***

Comment 3 Jeff Johnson 2000-08-24 15:11:28 UTC
*** Bug 16843 has been marked as a duplicate of this bug. ***

Comment 4 Jeff Johnson 2000-08-29 19:23:34 UTC
Created attachment 3083 [details]
Patch from H.J. Lu

Comment 5 Jeff Johnson 2000-10-19 20:22:20 UTC
*** Bug 19399 has been marked as a duplicate of this bug. ***

Comment 6 panu.matilainen 2000-11-13 15:16:22 UTC
BTW this still happens with rpm-4.0-4 and 4.0.1-0.6 from rawhide. H.J's patch
fixes it though.

Comment 7 Jeff Johnson 2001-02-22 21:39:48 UTC
Changing component.

Comment 8 David Juran 2002-02-16 11:10:28 UTC
And the bug still seems to be there for 4.0.2-6x

Comment 9 Edward Rudd 2002-08-09 03:06:36 UTC
This still happens with rpm 4.0.4-7x on a RH 7.2 system..
Is this going to be fixed sometime??

Comment 10 David Juran 2002-08-10 13:21:28 UTC
And the error is still there in rpm 4.0.4-7x.18 in RH 7.3 as well...

Comment 11 David Juran 2002-12-15 11:30:02 UTC
The bug still seems to exists in rpm-4.1-1.06 in RedHat 8.0

Comment 12 Virgil 2003-05-02 00:12:29 UTC
Still not working in RedHat 9.  rpm-4.2-0.69

Comment 13 Virgil 2003-05-02 01:41:13 UTC
Created attachment 91468 [details]
clean diff against rpm-4.0.4-7x.18.src.rpm

This is HJ's patch, cleaned up to apply against rpm-4.0.4-7x.18.src.rpm from
RedHat 7.3.

Comment 14 Bill Nottingham 2005-09-29 21:41:55 UTC
Closing bugs on older, no longer supported, releases. Apologies for any lack of
response.

For RPM issues, please try a current release such as Fedora Core 4; if bugs
persist, please open a new issue.