On any standard x86-64 box, you only have /usr/lib/{x86_64,noarch}-linux directories, and only have macro files for those directories. Hence, if you try and build i386 packages, you will get packages with %{_lib} = lib64, %{_libdir} = /usr/lib64, etc.
If you rm -f /etc/rpm/platform and use setarch i386 rpmbuild does it work?
Appears to, at least from a quick check of /lib vs /lib64.
And what was in /etc/rpm/platform pray tell? "ia32e" is my guess ...
[notting@xenomorph ~]$ cat /etc/rpm/platform x86_64-redhat-linux
Ok, my bad (although there's another closely reklated problem with multiple aliases like amd64 and i132e for x86_64). Arch (as currently set within rpm using uname(2) or /etc/rpm/platfrom) is not the right variable to determine multilib build configuration.
This problem is likely fixed (by setting arch from --target) in rpm-4.4.7-0.15. UPSTREAM
Jeff, Any chance you could isolate the patch from 4.4.7 and attach that here. Please don't take this wrong: 1) I do not wish to get involved in the whole fork rpm or stick with upstream discussion. 2) I would love to see Fedora jump to 4.4.7 since some of the new features I could really use (I maintain 80+ packages in FE). But: 3) I don't see the jump to 4.4.7 happening soon and would still like to see this fixed. Thanks!
The patch to use --target is non-trivial and mired in legacy expectations of how rpmbuild should be configured. E.g. setarch is not the right approach, consider non-linux functionality (which I have to accomodate even if you don't). I don't wish to be involved with Fedora fork-or-jbj discussions either; I feel your pain. I don't see the "jump" to 4.4.7 happening at all. Various people will talk, wring their hands about how big an asshole I am, and do nothing.
FWIW, the patches necessary to implement setting rpm's conception of arch from --target were posted to <rpm-devel.duke.edu> in August 2006 with a request for comments. Some of the comments remain to be satisfied.
User pnasrat's account has been closed
Reassigning to owner after bugzilla made a mess, sorry about the noise...
rpm 4.4.2.2-13 in rawhide now includes the x86 arch macros on x86_64. That doesn't fix much by itself, the issue is, um, tangled...