Chapter 12. Building Products from Source RPMs

To build a product from a source RPM Package Manager (SRPM), do the following:

  1. Install the SRPM:

    1. Insert the CD-ROM on the head node.

    2. Enter the following:

      # rpm -ihv /mnt/cdrom/SRPMS/package_version.src.rpm package 

      For example, to install lconsole:

      # rpm -ihv /mnt/cdrom/SRPMS/lconsole-1.1-1.src.rpm lconsole 

      The contents of the SRPM will be installed on the system in the /usr/src/redhat/SOURCES directory. The contents of the SRPM may be compressed tar files (tarballs) and/or patch files.

  2. Create a build directory and change directories to it:

    # mkdir /tmp/build
    # cd /tmp/build

  3. Move the tarball and/or patch files to the build directory. For example:

    # mv /usr/src/redhat/SOURCES/lconsole-1.1.tar.gz /tmp/build

  4. Uncompress the tarball and extract the files:

    # tar zxvf tarball

    For example:

    # tar zxvf lconsole-1.1.tar.gz 

  5. Change to the package's directory. For example:

    # cd lconsole-1.1

  6. If there are patches that you want to apply, enter the following:

    # patch -p0 <patchfile

    For more information, see the patch(1) man page.

  7. Build the package:

    # make