Re: generating 32-bit RPM's

Dave Atkinson <[email protected]>
Newsgroups gmane.linux.redhat.amd64
Message-ID <[email protected]>
Can I stick my 2p's worth in?  Sorry for v. late reply, I've only just
discovered this list...

I too have been considering this problem recently.  I wanted to install
32-bit mplayer so's I could use the [ahem] other codecs... couldn't get
yum to install 32-bit mplayer (if anyone can explain to me a simple way
of installing an arbitary 32-bit pkg on x86_64..? thx ;).

Couldn't find one, so I thought I'd compile the pkgs myself, using

$ rpmbuild --target i386 ....

as I'd had no problems building SMP i686 and non-SMP i386 and i686 pkgs
on my old dual PIII...

I have tried to understand what rpmbuild does from looking at the srcs
and the rc/macro files that get sourced (rpmbuild --showrc, or more
accurately, strace -e open rpmbuild --showrc | awk 'prog to dig out
filenames'*).

The --target option sets the %_target_cpu, %_target_os and %
target_platform macros.  This I _believe_ affects the setting of the %
_optflags, so any RPM that uses %configure should get the right compiler
flags.  What gets screwed on x86_64 is that the %_lib and %_libdir
macros remains set to lib64 regardless of the setting of --target.

So I'm wondering if the fix is a patch to rpm, either to 
a) post-process (hack) the above macros based on the host and target
arch at runtime, (bad idea) or 
b) add a new conditional %if(|n)targetarch and ship a rpmrc file which
sets the macros correctly at runtime (better idea) or
c) have rpm set %_lib, %_libdir and anything else that may be required
internally based on target arch (previous idea is better?)
d) something I haven't thought of ;)

What have I missed? ;)
Dave A.

* awk '/^open\("\/(etc|usr\/lib)\/rpm\/.*(rc|macro).*/ && $0 !
~ /ENOENT/{tmp=substr($1,7);gsub(/".*/,"",tmp);print tmp}'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.