%-> Hi,
%->
%-> I want to compile an optimal RH installation
%-> for my system by compiling the source rpms
%-> for RH 6.2 on my 6.1 system and upgrading
%-> the system using these newly compiled
%-> rpms.
%-> Can anyone tell me what the command is
%-> to compile a SRPM so that i end up with
%-> a rpm-file ready for installation?
%->
%-> Thanks,
%-> J.

Are you after a Pentium III or similar optimised installation? It's tempting
to reply to this in OpenBSD style with 'man rpm', but I'll do some
copy-and-paste from that man page as well ;-)


BUILD OPTIONS
       The general form of an rpm build command is

           rpm -[b|t]O [build-options] <package_spec>+

       The  argument  used  is -b if a spec file is being used to
       build the package and -t if RPM should look  inside  of  a
       gzipped (or compressed) tar file for the spec file to use.
       After the first argument, the next argument (O)  specifies
       the stages of building and packaging to be done and is one
       of:

       -bp    Executes the "%prep"  stage  from  the  spec  file.
              Normally  this  involves  unpacking the sources and
              applying any patches.

       -bl    Do a "list check".  The "%files" section  from  the
              spec file is macro expanded, and checks are made to
              verify that each file exists.

       -bc    Do the "%build" stage from  the  spec  file  (after
              doing the prep stage).  This generally involves the
              equivalent of a "make".

       -bi    Do the "%install" stage from the spec  file  (after
              doing  the  prep and build stages).  This generally
              involves the equivalent of a "make install".

       -bb    Build a  binary  package  (after  doing  the  prep,
              build, and install stages).

       -bs
              equivalent of a "make".

       -bi    Do the "%install" stage from the spec  file  (after
              doing  the  prep and build stages).  This generally
              involves the equivalent of a "make install".

       -bb    Build a  binary  package  (after  doing  the  prep,
              build, and install stages).

       -bs    Build  just  the  source  package  (after doing the
              prep, build, and install stages).

       --timecheck
              Set the "timecheck" age (0 to disable).  This value
              can  also  be  configured  by  defining  the  macro
              "_timecheck".  The  timecheck  value  expresses, in
              seconds, the maximum age of a file being  packaged.
              Warnings  will  be printed for all files beyond the
              timecheck age.

       --clean
              Remove the build tree after the packages are  made.

       --rmsource
              Remove  the  sources  and spec file after the build
              (may also be used standalone, eg.  "rpm  --rmsource
              foo.spec").

       --test Do  not execute any build stages.  Useful for test-
              ing out spec files.

       --sign Embed a PGP signature in the package.  This  signa-
              ture  can  be  used to verify the integrity and the
              origin of the package.  See the section on PGP SIG-
              NATURES for configuration details.

       --buildroot <dir>
              When  building  the package, override the BuildRoot
              tag with directory <dir>.

       --target <platform>
              When building the package, interpret <platform>  as
              arch-vendor-os  and  set  the macros _target, _tar-
              get_arch and _target_os accordingly.

       --buildarch <arch>
              When building the package, set the architecture  to
              <arch>.  This option has been obsoleted by --target
              in RPM 3.0.

       --buildos <os>
              When building the package, set the architecture  to
              <os>. This option has been obsoleted by --target in
              RPM 3.0.

REBUILD AND RECOMPILE OPTIONS
       There are two other ways to invoke building with rpm:

       rpm --recompile <source_package_file>+

       rpm --rebuild <source_package_file>+

       When invoked this way, rpm installs the named source pack-
       age,  and  does a prep, compile and install.  In addition,
       --rebuild builds a new binary package. When the build  has
       completed,  the build directory is removed (as in --clean)
       and the the sources and spec  file  for  the  package  are
       removed.



Having perused the above, you need to do to do two things:

1.      Install GCC 2.95.2 (search rpmfind.net for it, or get the tarball from
http://gcc.gnu.org/ . GCC 2.95.2 is able to produce Pentium III-optimised
binaries, unlike the older version of GCC that ships with RH6.1 (AFAIK).

2.      Edit /usr/lib/rpm/rpmrc and add e.g:

optflags:
i386 -O6 -mpentiumpro -march=i686 -ffastmath -fstrict-aliasing -fexpensive-o
ptimizations -fomit-frame-pointer -fno-strength-reduce

These work well for me.

Not everything will compile OK, so expect to spend many an hour trying to
figure out why... ;-)

I've succesfully recompiled the 2.2.14 kernel, glibc, xf86 4.0 and KDE with
the above tweaks. Faster? Well... perhaps a bit.


Cheers,

-- Juha



-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to