On Sun, Mar 31, 2002 at 12:50:49AM -0000, Derek Stewart wrote:
> Hi Richard,
> 
> Thanks for the information and the attached file. I will have a look at it
> when I get time from the Q60 building.
> 
> I was really talking about re-compiling Linux Applications to Q60 Linux,
> well, maybe I could say any Linux system. As I have had problems
> re-compiling programs on Intel Linux systems, probably not understanding how
> the operating system working.

ok, that is something different. You want to make sure that you have
installed the latest libs and their '-devel' versions from 
linux-q40.sourceforge.net. Then look for a '*.src.rpm' version of
the package you want to compile. In the ideal case, you take this
package, do
   rpm -ihv package.src.rpm
   rpm -ba /usr/src/redhat/SPECS/package.spec
and install/upgrade the binary packages with 'rpm -Uhv' after that.
When the package built cleanly use
   rpm --clean --rmsource SPECS/package.spec to remove clutter.
The name of the specfile (called package.spec above) may need
a little guessing occasionally.

There are many pitfalls in this process but most of them have really
simple workarounds and I do not mind to help.

Alternatively you might compile the packages without the "help"
of rpm, this solves many problems but introduces others so I would
only recommend it if there is no 'src.rpm' file for that package
anywhere.

One issue with rpm is that it is very stubborn in that if anything 
goes wrong in the process of building you would normally have to repeat 
all stages of the build to get it fixed.. this is currently simply 
inacceptable for a slow system like the Q60.
The workaround is to conditionalise the '%setup', '%patch'
and '%configure' directives. Eg 99% of specfiles have something
like 
...
%prep
%setup -q
%patch
...
%build
./configure
make
....

where
%setup will remove old build tree and unpack the package and
%patch ... will apply patches when specified

When the package doesn't compile/build out of the box change the
specfile to something like

%prep
case "${RPM_COMMAND:-all}" in
all)
%setup -q
%patch
...
;;
esac

%build
case "${RPM_COMMAND:-all}" in
all)
./configure
;;
esac
make
....

Next time you invoke 'rpm -ba SPECS/package.spec' you will get either
a full 'clean' build if RPM_COMMAND is unset or =all, or only the
'make' and install stages will be retried if you did 'export RPM_COMMAND=build'
previously

Bye
Richard

Reply via email to