Bug 7584 - %defines enclosed by %ifarch executed unconditionally
%defines enclosed by %ifarch executed unconditionally
Status: CLOSED DUPLICATE of bug 5364
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
6.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-12-04 14:30 EST by Dale Elisabeth Atems
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-12-16 15:24:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dale Elisabeth Atems 1999-12-04 14:30:31 EST
In rpm-3.0.3-2, %defines inside successive %ifarch blocks are executed
regardless of whether the conditional is satisfied. The following excerpt
results in HOSTTYPE=alpha-pc-linux and SOUND=none on an i386:

%build

%ifarch i386
%define HOSTTYPE i386-pc-linux
%define SOUND native
%endif

%ifarch sparc
%define HOSTTYPE sparc-unknown-linux
%define SOUND none
%endif

%ifarch alpha
%define HOSTTYPE alpha-pc-linux
%define SOUND none
%endif

# Delete the originals for the patched files
find . -name "*.orig" -exec rm {} \;

./configure %{HOSTTYPE} --with-dialogs=athena  --with-sound=%{SOUND} \
            --cflags="$RPM_OPT_FLAGS" --error-checking=none          \
            --debug=no --prefix=/usr --lockdir=/var/lock/xemacs      \
            --with-session=yes


If executed on an i386, configuration proceeds for an alpha-pc-linux.
Echo statements placed inside the %ifarch sparc and %ifarch alpha blocks do
not execute, however.
Comment 1 Jeff Johnson 1999-12-16 15:23:59 EST
I'm resisting adding support for %define within %ifarch because I believe
that %ifarch is the wrong way to package. Meanwhile, here's a nearly
equivalent snippet of code that will probably work for you:

%build

%ifarch i386
SOUND=native
%else
SOUND=none
%endif

# Delete the originals for the patched files
find . -name "*.orig" -exec rm {} \;

./configure %{_target_platform} --with-dialogs=athena  --with-sound=${SOUND} \
             --cflags="$RPM_OPT_FLAGS" --error-checking=none          \
             --debug=no --prefix=/usr --lockdir=/var/lock/xemacs      \
             --with-session=yes
Comment 2 Jeff Johnson 1999-12-16 15:24:59 EST
*** This bug has been marked as a duplicate of 5364 ***

Note You need to log in before you can comment on or make changes to this bug.