rpm file name generated from spec

Todd Rinaldo toddr at cpanel.net
Wed Jan 6 16:55:08 UTC 2010


On Jan 5, 2010, at 8:07 PM, Jeff Johnson wrote:

> 
> On Jan 5, 2010, at 7:15 PM, Todd Rinaldo wrote:
> 
>> I'm building rpms from an srpm across multiple distributions. I ran into a problem on FC11 32bit which shows I don't fully understand how rpm filenames are generated. When the rpm file is generating, it's generating it as .i586.rpm but when I do rpm -E '%_arch' on that system, it comes back as i386.
>> 
> 
> Well there's actually several questions there ...
> 
> 1) Q: How are *.rpm filenames generated?
>   A: Output filenames are generated using this macro
> 	$ rpm -E '%{_rpmfilename}'
>      which usually has some value (when as a macro) like
> 	%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}
>      The doubled %% chars stop macro expansion, the remaining
>      string with single % chars is filled in from header tags
>      same as
> 	$ rpm -q --qf '%{NAME{-%{VERSION}-%{RELEASE}.%{ARCH}' bash
> 
> 2) Q: How is RPMTAG_ARCH chosen for package headers?
>   A: There's multiple ways. E.g.
> 	BuildArchitecture: noarch
>      is what sets architecture for *.noarch.rpm.
>      For your specific i386 != i586 architectire question, there's
>      a "preferred" output of "i586" and there's a "canonical" architecture of "i386".
>      The values are being set in build configuration which you can inspect with
> 	rpm --showrc
>      There's also a means yo specify architecture using --target when building.
> 
> 3) Q: What determines the platform architecture?
>   A: Usually the CPU-VENDOR-OS-GNU string in /etc/rpm/platform, but (if missing)
>      uname(2) values (with a minor translation like s/powerpc/ppc/) is used.
> 



Jeff, thanks for your detailed responses

Q1: When running rpm --showrc |grep 86 on FC11/32, the only variable that seems to match the how my RPMs are being generated here is %_target_cpu. Would this be a better predictor of the arch of the RPM that was generated? At the moment, of the 50 Red Hat derivative systems I'm testing, only FC11/32 %_arch does not match the RPM file name %%ARCH.

Q2: Does the arch in the file name serve a purpose? if I rename a i586 RPM to i386, does the install of the RPM file behave differently? Most RPMs are compiled for a specific distribution and major version of that distribution. Was arch name something put into RPM file names long ago that in this day and age lacks a use other than knowing 32/64 bit-ness?

Q3: You mentioned:
	A. /etc/rpm/platform (not there)
        B. uname(2) -- perl -mPOSIX -e 'print join("\n", POSIX::uname()) . "\n"' implies i686, not i586
if A and B != i586, what is happening here? 

I see from other responses that this was an intentional change by the fedora folks, but at the moment, I'm at a loss to figure out what was changed to make rpm file generation behave this way.

Thanks,
Todd


More information about the Rpm-list mailing list