RPM rebuild made easier?

Ralf Corsepius corsepiu at faw.uni-ulm.de
Thu Feb 27 03:13:16 UTC 2003


Am Mit, 2003-02-26 um 21.09 schrieb Thomas Doerfler:
> Hi,
> 
> we had a discussion about version dependent tool installation 
> prefixes some weeks ago, and I accepted the reasons why the 
> RPMs on OARs web server all use the standard prefix 
> "/opt/rtems". My conclusion was (and is) that rebuilding the 
> tools (under linux) is not so painful.
Yes, it is trivial.

> Now I have actually (once again) rebuilt the current toolset, 
> and in the RPM specs found constucts to change the rebuild 
> process with "--define" statements fromt the RPM command line.
> 
> So here is my request: Would it be possible to replace the 
> "_prefix" definition in the specs from 
> 
> %define _prefix   /opt/rtems
> 
> to something like:
> 
> %define _prefix   %{?prefix:%prefix}%{!?prefix:/opt/rtems}
> 
> (Ralf, is this correct?
Not quite. 

Syntactically it is correct (I am using similar constructs in many of my
rpms), but 
* %prefix has a special meaning inside of rpm-specs:
- %prefix is the relocation prefix, also used by rpm/rpmbuild --prefix;
- %prefix defaults to %_prefix, so your %define above is circular
=> I am not sure about the potential side-effects  

* changing %_prefix or %_prefix doesn't help much wrt. parallel
installation. You'd also have to change the package %name.

>  Any improvements possible?
Of cause ;)

For the moment, there is an easier way to apply a different installation prefix:

In RTEMS source tree,
cd scripts
../bootstrap
./configure --prefix=/opt/rtems-4.6
make

The rpm-specs generated then will apply /opt/rtems-4.6 instead of
/opt/rtems.

> The anybody who wants to rebuild the toolset simply has to 
> call RPM as follows:
> 
> 
> $ rpm -ba --define 'prefix /opt/rtems/binutils-2.13.2.1-gcc-
> 3.2.1-newlib-1.11.0' --define 'gnat 0' --define 'gcj 0' 
> powerpc-rtems-gcc-3.2.1-newlib-1.11.0.spec
> 
> No more hacking around inside the specs...
You've just discovered, why it is implemented the way it is.

Except of the prefix you are using, it's exactly what I am using for
speeding up testing the rpms.

> Is it possible to integrate this into the toolse specs?

Ralf





More information about the users mailing list