[CentOS] rpmbuild for different architecture [OT?]

Fri Feb 8 20:08:15 UTC 2013
Steve <zephod at cfl.rr.com>

As far as I can tell, the rpm-list went defunct circa 2008 so I'm asking here. 
No doubt someone will let me know if this is not OK.

I'm trying to build an RPM on a CentOS VM targeted to run on an ARM architecture machine.

I have a test program, prime, that I cross compiled on my VM and when I copy it onto 
my target machine it runs correctly. Now I want to package it in an RPM.

On my target machine, I run
$ uname -m
armv71

so on the VM I wrote my spec file and ran
$ rpmbuild -ba --target armv71 prime.spec
...
processing files: prime-1.0-1.armv71
unknown, 0: Warning using regular magic file '/etc/magic'
Requires(rpmlib): rpmlib(payloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
...
Wrote /home/steve/rpmbuild/RPMS/armv71/prime-1.0-1.armv71.rpm
...

So it seems that some parts of rpm realize that I've cross compiled and some parts don't. 
Any ideas on how to get rid of these warning messages? I tried putting 'Autoreq: 0' in the spec file but that didn't help.

A second problem is that when I go to install the rpm on the target machine, I get an error saying that the architecture doesn't match.
I had to use --ignorarch to get it to install. What does rpm use to determine what the architecture is if not uname?

With the --ignorearch option, the RPM installs and the program runs as expected.

Thanks,
Steve