Maximum RPM

Taking the RPM Package Manager to the Limit

Edward C. Bailey

Red Hat, Inc.

Paul Nasrat

Matthias Saou

Ville Skyttä


Table of Contents
Linux and RPM — A Brief History
Parts of the book, and who they're for
I. RPM and Computer Users — How to Use RPM to Effectively Manage Your Computer
1. An Introduction to Package Management
What are Packages, and Why Manage Them?
Package Management: How to Do It?
RPM Design Goals
What's in a package?
Let's Get Started
2. Using RPM to Install Packages
rpm -i — What does it do?
Performing an Install
Two handy options
Additional options to rpm -i
3. Using RPM to Erase Packages
rpm -e — What Does it Do?
Erasing a Package
Additional Options
rpm -e and Config files
Watch Out!
4. Using RPM to Upgrade Packages
rpm -U — What Does it Do?
Upgrading a Package
They're Nearly Identical…
5. Getting Information About Packages
rpm -q — What does it do?
The Parts of an RPM Query
A Few Handy Queries
6. Using RPM to Verify Installed Packages
rpm -V — What Does it Do?
When Verification Fails — rpm -V Output
Selecting What to Verify, and How
We've Lied to You…
7. Using RPM to Verify Package Files
rpm -K — What Does it Do?
Configuring PGP for rpm -K
Using rpm -K
8. Miscellanea
Other RPM Options
Using rpm2cpio
Source Package Files and How To Use Them
II. RPM and Developers — How to Distribute Your Software More Easily With RPM
9. The Philosophy Behind RPM
Pristine Sources
Easy Builds
Multi-architecture/operating system Support
Easier For Your Users
To Summarize…
10. The Basics of Developing With RPM
The Inputs
The Engine: RPM
The Outputs
And Now…
11. Building Packages: A Simple Example
Creating the Build Directory Structure
Getting the Sources
Creating the Spec File
Starting the Build
When Things Go Wrong
12. rpmbuild Command Reference
rpmbuild — What Does it Do?
Other Build-related Commands
13. Inside the Spec File
Comments: Notes Ignored by RPM
Tags: Data Definitions
Scripts: RPM's Workhorse
Macros: Helpful Shorthand for Package Builders
The %files List
Directives For the %files list
The Lone Directive: %package
14. Adding Dependency Information to a Package
An Overview of Dependencies
Automatic Dependencies
Manual Dependencies
To Summarize…
15. Making a Relocatable Package
Why relocatable packages?
The prefix tag: Relocation Central
Relocatable Wrinkles: Things to Consider
Building a Relocatable Package
16. Making a Package That Can Build Anywhere
Using Build Roots in a Package
Having RPM Use a Different Build Area
Specifying File Attributes
17. Adding PGP Signatures to a Package
Why Sign a Package?
Getting Ready to Sign
Signing Packages
18. Creating Subpackages
What Are Subpackages?
Why Are They Needed?
Our Example Spec File: Subpackages Galore!
Spec File Changes For Subpackages
Build-Time Scripts: Unchanged For Subpackages
Building Subpackages
19. Building Packages for Multiple Architectures and Operating Systems
Architectures and Operating Systems: A Primer
What Does RPM Do To Make Multi-Platform Packaging Easier?
Build and Install Platform Detection
optflags — The Other rpmrc File Entry
Platform-Dependent Tags
Platform-Dependent Conditionals
Hints and Kinks
20. Real-World Package Building
An Overview of Amanda
Initial Building Without RPM
Initial Building With RPM
Package Building
21. A Guide to the RPM Library API
An Overview of rpmlib
rpmlib Functions
Example Code
III. Appendixes
A. Format of the RPM File
RPM File Naming Convention
RPM File Format
Tools For Studying RPM Files
Identifying RPM files with the file(1) command
B. The rpmrc File
Using the --showrc Option
Different Places an rpmrc File Resides
rpmrc File Syntax
rpmrc File Entries
C. Concise RPM Command Reference
Global Options
Informational Options
Query Mode
Verify Mode
Install Mode
Upgrade Mode
Erase Mode
Build Mode
Rebuild Mode
Recompile Mode
Resign Mode
Add Signature Mode
Check Signature Mode
Initialize Database Mode
Rebuild Database Mode
D. Available Tags For --queryformat
List of --queryformat Tags
E. Concise Spec File Reference
The Preamble
The %files List
Directives For the %files list
%package Directive
F. RPM-related Resources
Where to Get RPM
Where to Talk About RPM
RPM On the World Wide Web
RPM's License
G. An Introduction to PGP
PGP — Privacy for Regular People
Installing PGP for RPM's Use
IV. RPM Man Pages
rpm -- RPM Package Manager
rpmbuild -- Build RPM Package(s)
rpmgraph -- Display RPM Package Dependency Graph