Question

I'm creating my own rpm files. Now I'm writing a bash script that will put these rpm's automatically in the repository structure:

distribution/arch/rpm

eg:

openSUSE13.1/i586/product-0.1.0-0.i586.rpm

I have found that in the /etc/os-release file I can find the name of the distribution I have etc; but not my architecture. So how do I get the architecture of my computer? I know I could eventually parse it from the rpm name (which looks like this: product-0.1.0-0.i586.rpm), but probably there is some file describing my computer architecture that would give me i586 easily?

EDIT the rpm's I produce have the i586 architecture in their name. However:

  • uname -m gives me i686
  • uname -i gives me i386
Was it helpful?

Solution

thanks to Jord I found this line in the file /usr/lib/rpm/rpmrc:

buildarchtranslate: i686: i586

so apparently it is rpmbuild that does a translation from my "uname -m" architecture i686 to i586. So theoretically it would be possible to use uname -m and look in the rpmrc file for a translation, but that would be very laborious.

in short parsing the name of the rpm that was produced is the most effective way to get the architecture. No macro or variable seems to be defined that matches the one produced by rpmbuild (since a translation step is included)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top