User Tools

Site Tools


rebuild

Rebuilding from source RPMs

While LinuxLabs does it's best to choose reasonable build options for user applications, sometimes, there is a need to rebuild a package. This document is a brief summary of that process. Detailed information on creating, modifying, and managing RPMs is found in Maximum RPM included here for your convieniance.

  • RPM re-build steps Obtain the src RPM. Many will be available on the Nimbus source disk.
  • Install the source: rpm -i my.src.rpm

The componatns of the RPM will be installed under /usr/src/redhat into the following sub-directories:

  • SOURCE contains the original source code and any patches added by the package maintainer
  • SPECS contains the .spec file which controls the packaging process.
  • SRPM will contain the rebuilt source RPM containing any changes you make to the package
  • RPMS will contain the binary RPM(s) produced by the build. These are the RPMs that are ultimatly installed on the master.
  • BUILD will contain the working source directory that the actual compilation takes place in. The source here will have the patches applied.
  • cd /usr/src/redhat/SPECS
  • Modify the .spec file to suit your needs

The spec file contains the commands used to compile the application. These commands will appear under the %build heading. Most commonly, they will be in a line (or lines) starting with ./configure ….

The options available will be completely dependant on the original software. Often, a project homepage will include build instructions outlining the options available to you. In other cases, the BUILD directory will contain a README or an INSTALL text file with those instructions.

You may want to change the release version of the package to a distinct local version to avoid confusion as to which version of the software is installed. The release version is kept near the top of the spec file as a header item like 'Release: <nimbus..>'

  • rpm -ba my.spec
    translation: 'rpm, build all from my.spec'

This step will cause the application to be compiled, and the source and binary package(s) to be produced. This step may take some time to complete. Should build errors be reported (lack of source and binary .rpm(s) is a good sign of a build error), review the .spec file, and documentation and re-try this step.

  • cd ../RPMS/i386
  • rpm -U –force my-version.rpm

This will install your version of the package over the default installation. If necessary, this can be reversed by re-installing the original rpm over your local version.

rebuild.txt · Last modified: 2010/04/15 21:18 (external edit)