LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-29-2012, 05:27 AM   #1
Random Element
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
Building an RPM for 32 and 64 linux


Hi,

I hope someone can help...

I'm trying to build a RPM that can be run on both 32 and 64 bit linux (Centos 6.3 patched up do date).

I've looked at rpm.orgs Max RPM documentation and that's helped a lot. I'm using the %ifarch command to specific different actions for each OS type, but if I run rpmbuild -ba on a 64 bit machine the rpm won't install on a 32 bit machine with the error "Package xxx is intended for a x86_64 architecture". If, when building I run the command "rpmbuild -ba --target i386 xxx.spec" then it will be installed on both 32 and 64 bit servers but always install 32bit components

Is there a way to get just 1 rpm to work with both 32 and 64 bit or do I need to use the 1 spec file to create 2 rpms?

Any help would be gratefully received

Thanks
 
Old 10-30-2012, 12:48 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by Random Element View Post
Hi,

I hope someone can help...

I'm trying to build a RPM that can be run on both 32 and 64 bit linux (Centos 6.3 patched up do date).

I've looked at rpm.orgs Max RPM documentation and that's helped a lot. I'm using the %ifarch command to specific different actions for each OS type, but if I run rpmbuild -ba on a 64 bit machine the rpm won't install on a 32 bit machine with the error "Package xxx is intended for a x86_64 architecture". If, when building I run the command "rpmbuild -ba --target i386 xxx.spec" then it will be installed on both 32 and 64 bit servers but always install 32bit components

Is there a way to get just 1 rpm to work with both 32 and 64 bit or do I need to use the 1 spec file to create 2 rpms?

Any help would be gratefully received

Thanks
I think the most simple way is create 2 rpms from one specfile.
While it's possible to pack in one rpm both 32-bit and 64-bit libraries/executables
such decision has a number of drawbacks:
- much more complicated build process
- you have to pretend that this package is noarch or i386, when indeed it is not.
- because you have both i386 and x86_64 files then either you have turn off dependencies generation,
or dependencies check will fail most of the times - on all i386 systems an on pure x86-64 systems.

Valery
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error in building rpm of open ldap from source using rpm package manager Infotechie Linux - Software 2 05-02-2012 01:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration