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.
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
*** This bug has been marked as a duplicate of 5364 ***