[Bug 1058378] Re: Got a %endif with no %if

Mike Miller mike.t.miller at gmail.com
Sun Sep 30 21:15:54 UTC 2012

Ok, I'm able to reproduce this now. Attached is a smaller spec file that
shows the same problem like so:

$ rpmbuild -bb --target=x86_64-linux lp-1058378.spec 
builds fine
$ rpmbuild -bb --target=i386-linux lp-1058378.spec 
error: /home/mike/lp-1058378.spec:19: Got a %endif with no %if

I think the problem is that macros are now not expanded in the false
condition of an if-else, so the second %if_target_cpu is not expanded
and the parser sees an extra %endif. This is an issue with rpm upstream,
also fails for me in Fedora 18 alpha. I can ask about this upstream to
see if this behavior is intentional or a bug.

** Attachment added: "lp-1058378.spec"

** Changed in: rpm (Ubuntu)
       Status: New => Confirmed

You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rpm in Ubuntu.

  Got a %endif with no %if

Status in “rpm” package in Ubuntu:

Bug description:
  Ubuntu 12.10 beta2
  rpm 4.10

  When compiling this spec

  Summary: GNU Compiler Collection
  Name:% {_stm_pkg_prefix}-cross-gcc
  % if_target_cpu sh
  Version: 4.5.2
  % else
  % if_target_cpu arm
  Version: 4.5.0
  % else
  Version: 4.2.4
  % endif
  % endif
  Release: 78
  License: GPL / LGPL
  Group: Development / Languages

  Compilation stops with an error

  Got a% endif with no% if

  With version 4.9.9 compiles ok.

To manage notifications about this bug go to:

More information about the foundations-bugs mailing list