openSUSE Forums > openSUSE Build Service (OBS) » Building RPM packages for multiple platforms

Go Back   openSUSE Forums > openSUSE Build Service (OBS)
Forums FAQ Members List Search Today's Posts Mark Forums Read


openSUSE Build Service (OBS) Questions about creating packages for openSUSE and using the Build Service

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 28-Jul-2009, 07:07
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 1
ydiamant hasn't been rated much yet
Default Building RPM packages for multiple platforms

I would like to create one single RPM package that depending on the architecture of the system that is installed (i.e. i386 or x86_64), it installs platform-specific files.

For example, I have some configuration files only (no compiling required) that I want to package. If the RPM would be installed on x86, the files would go under /usr/lib ; if the RPM would be installed on x86_64, the files would go under /usr/lib64.

Currently, I have in the ../SOURCES directory the following structure:

foo_rpm/
foo_rpm/usr
foo_rpm/usr/lib
foo_rpm/usr/lib64
foo_rpm/usr/lib/foo_config
foo_rpm/usr/lib64/foog_config


Is it possible to have just one RPM, that can handle this ? Meaning for example, could my RPM have all these files packaged, but when it's installed on x86, it would only install:

/usr
/usr/lib
/usr/lib/foo_config


In the .spec file I have defined:

%files
%ifarch i386 i486 i586 i686
/usr/lib
%endif

%ifarch x86_64
/usr/lib64
%endif


However, I realized that this applies only at the build time.
When I run

rpmbuild -ba --target=i586 ./foo_rpm.spec

it creates a foo_rpm.i586.rpm package.

Then I have to run once more

rpmbuild -ba --target=x86_64 ./foo_rpm.spec

to create a foo_rpm.x86_64.rpm package.

Would be nice if a single foo_rpm RPM package would contain all files for both architectures, but installs only the files applicable for the system it is being installed on.
Reply With Quote
  #2 (permalink)  
Old 28-Jul-2009, 07:34
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,703
malcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputation
Default Re: Building RPM packages for multiple platforms

Quote:
Originally Posted by ydiamant
I would like to create _one_single_ RPM package that depending on the
architecture of the system that is installed (i.e. i386 or x86_64), it
installs platform-specific files.

For example, I have some configuration files only (no compiling
required) that I want to package. If the RPM would be installed on x86,
the files would go under /usr/lib ; if the RPM would be installed on
x86_64, the files would go under /usr/lib64.

Currently, I have in the ../SOURCES directory the following structure:

foo_rpm/
foo_rpm/usr
foo_rpm/usr/lib
foo_rpm/usr/lib64
foo_rpm/usr/lib/foo_config
foo_rpm/usr/lib64/foog_config

Is it possible to have just one RPM, that can handle this ? Meaning for
example, could my RPM have all these files packaged, but when it's
installed on x86, it would only install:

/usr
/usr/lib
/usr/lib/foo_config

In the .spec file I have defined:

%files
%ifarch i386 i486 i586 i686
/usr/lib
%endif

%ifarch x86_64
/usr/lib64
%endif

However, I realized that this applies only at the build time.
When I run

rpmbuild -ba --target=i586 ./foo_rpm.spec

it creates a foo_rpm.i586.rpm package.

Then I have to run once more

rpmbuild -ba --target=x86_64 ./foo_rpm.spec

to create a foo_rpm.x86_64.rpm package.

Would be nice if a single foo_rpm RPM package would contain all files
for both architectures, but installs only the files applicable for the
system it is being installed on.
Hi
Just use the %{_libdir} variable in your spec file. Config files don't
go in the library hierarchy though? Your manually building these, if
you used the build service it has separate build for the arch's.

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 16:05, 2 users, load average: 0.08, 0.07, 0.07
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Reply With Quote
Reply

Bookmarks

Tags
multiple platforms, rpm, rpmbuild


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2