12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

136CHAPTER 5Working with RPM SoftwareThink beyond traditional software programs. RPM packages can be used to install userfiles required for a corporate workstation, custom VPN software or configuration files,corporate templates for internal and external communications, and so on.Advantages of distributing custom scripts, corporate templates, configuration files, andthe like in RPM format instead of just copying them to each system include. Version control. The RPM version number can help you keep track of the versionnumber for debugging or determining which systems need to be updated.. Easier distribution. Installing an RPM can be done remotely from an SSH session orvia <strong>Red</strong> <strong>Hat</strong> Network Satellite.. Consistency. By defining where the files are installed when building the RPMpackage, administrators can find them in the same location on any system. This canbe especially useful if multiple administrators are responsible for installing andusing the software.. Verification. Using the verify option previously discussed, administrators canquickly determine if the files have been altered (assuming the RPM database was notmodified to hide the file modifications).The program necessary for building RPM packages is not installed by default. Before buildingyour RPM packages or following the example in this section, install the rpm-buildpackage and its dependencies. If your system is registered with RHN, install the packagewith the yum install rpm-build command or refer to Chapter 3 for instructions on howto schedule its installation with the RHN website.NOTEThe example files used in this section can be downloaded from the book’s website.This section discusses the following steps for building an RPM:1. Setting up the build environment.2. Creating a spec file that defines the package name, version, release number, description,and more.3. Creating a Makefile that contains target actions such as building the source andbinary RPM files.4. Creating a tarball of all the source files.5. Running the appropriate Makefile target to build the source RPM, binary RPM, or both.Setting Up the Build EnvironmentBefore building the package, set up your build environment. By default, the/usr/src/redhat/ directory is used and contains the following subdirectories: BUILD, RPMS,SOURCES, SPECS, and SRPMS. However, these directories are owned by the root user and areonly writable by the root user. When building RPMs, it is best to build as a non-root user

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!