Maximum RPM

Taking the Red Hat Package Manager to the Limit

Edward C. Bailey


Dedication

To Deb — My lover, editor, indexer, and friend…

To Matt, who heard "Daddy can't play right now" far too often…

Table of Contents
Preface
1. Linux and RPM — A Brief History
2. Parts of the book, and Who They're For
3. Acknowledgements
I. RPM and Computer Users — How to Use RPM to Effectively Manage Your Computer
1. An Introduction to Package Management
1.1. What are Packages, and Why Manage Them?
1.2. Package Management: How to Do It?
1.3. RPM Design Goals
1.4. What's in a package?
1.5. Let's Get Started
2. Using RPM to Install Packages
2.1. rpm -i — What does it do?
2.2. Performing an Install
2.3. Two handy options
2.4. Additional options to rpm -i
3. Using RPM to Erase Packages
3.1. rpm -e — What Does it Do?
3.2. Erasing a Package
3.3. Additional Options
3.4. rpm -e and Config files
3.5. Watch Out!
4. Using RPM to Upgrade Packages
4.1. rpm -U — What Does it Do?
4.2. Upgrading a Package
4.3. They're Nearly Identical…
5. Getting Information About Packages
5.1. rpm -q — What does it do?
5.2. The Parts of an RPM Query
5.3. A Few Handy Queries
6. Using RPM to Verify Installed Packages
6.1. rpm -V — What Does it Do?
6.2. When Verification Fails — rpm -V Output
6.3. Selecting What to Verify, and How
6.4. We've Lied to You…
7. Using RPM to Verify Package Files
7.1. rpm -K — What Does it Do?
7.2. Configuring PGP for rpm -K
7.3. Using rpm -K
8. Miscellania
8.1. Other RPM Options
8.2. Using rpm2cpio
8.3. 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
9.1. Pristine Sources
9.2. Easy Builds
9.3. Multi-architecture/operating system Support
9.4. Easier For Your Users
9.5. To Summarize…
10. The Basics of Developing With RPM
10.1. The Inputs
10.2. The Engine: RPM
10.3. The Outputs
10.4. And Now…
11. Building Packages: A Simple Example
11.1. Creating the Build Directory Structure
11.2. Getting the Sources
11.3. Creating the Spec File
11.4. Starting the Build
11.5. When Things Go Wrong
12. rpm -b Command Reference
12.1. rpm -b — What Does it Do?
12.2. Other Build-related Commands
13. Inside the Spec File
13.1. Comments: Notes Ignored by RPM
13.2. Tags: Data Definitions
13.3. Scripts: RPM's Workhorse
13.4. Macros: Helpful Shorthand for Package Builders
13.5. The %files List
13.6. Directives For the %files list
13.7. The Lone Directive: %package
13.8. Conditionals
14. Adding Dependency Information to a Package
14.1. An Overview of Dependencies
14.2. Automatic Dependencies
14.3. Manual Dependencies
14.4. To Summarize…
15. Making a Relocatable Package
15.1. Why relocatable packages?
15.2. The prefix tag: Relocation Central
15.3. Relocatable Wrinkles: Things to Consider
15.4. Building a Relocatable Package
16. Making a Package That Can Build Anywhere
16.1. Using Build Roots in a Package
16.2. Having RPM Use a Different Build Area
16.3. Specifying File Attributes
17. Adding PGP Signatures to a Package
17.1. Why Sign a Package?
17.2. Getting Ready to Sign
17.3. Signing Packages
18. Creating Subpackages
18.1. What Are Subpackages?
18.2. Why Are They Needed?
18.3. Our Example Spec File: Subpackages Galore!
18.4. Spec File Changes For Subpackages
18.5. Build-Time Scripts: Unchanged For Subpackages
18.6. Building Subpackages
19. Building Packages for Multiple Architectures and Operating Systems
19.1. Architectures and Operating Systems: A Primer
19.2. What Does RPM Do To Make Multi-Platform Packaging Easier?
19.3. Build and Install Platform Detection
19.4. optflags — The Other rpmrc File Entry
19.5. Platform-Dependent Tags
19.6. Platform-Dependent Conditionals
19.7. Hints and Kinks
20. Real-World Package Building
20.1. An Overview of Amanda
20.2. Initial Building Without RPM
20.3. Initial Building With RPM
20.4. Package Building
21. A Guide to the RPM Library API
21.1. An Overview of rpmlib
21.2. rpmlib Functions
21.3. Example Code
III. Appendixes
A. Format of the RPM File
A.1. RPM File Naming Convention
A.2. RPM File Format
A.3. Tools For Studying RPM Files
A.4. Identifying RPM files with the file(1) command
B. The rpmrc File
B.1. Using the --showrc Option
B.2. Different Places an rpmrc File Resides
B.3. rpmrc File Syntax
B.4. rpmrc File Entries
C. Concise RPM Command Reference
C.1. Global Options
C.2. Informational Options
C.3. Query Mode
C.4. Verify Mode
C.5. Install Mode
C.6. Upgrade Mode
C.7. Erase Mode
C.8. Build Mode
C.9. Rebuild Mode
C.10. Recompile Mode
C.11. Resign Mode
C.12. Add Signature Mode
C.13. Check Signature Mode
C.14. Initalize Database Mode
C.15. Rebuild Database Mode
D. Available Tags For --queryformat
D.1. List of --queryformat Tags
I. Red Hat Linux
rpm -- RPM Package Manager
E. Concise Spec File Reference
E.1. Comments
E.2. The Preamble
E.3. Scriptlets
E.4. Macros
E.5. The %files List
E.6. Directives For the %files list
E.7. %package Directive
E.8. Conditionals
F. RPM-related Resources
F.1. Where to Get RPM
F.2. Where to Talk About RPM
F.3. RPM On the World Wide Web
F.4. RPM's License
F.5. GNU GENERAL PUBLIC LICENSE
G. An Introduction to PGP
G.1. PGP — Privacy for Regular People
G.2. Installing PGP for RPM's Use
Index
List of Tables
2-1. rpm -i Command Syntax
3-1. rpm -e Command Syntax
4-1. rpm -U Command Syntax
5-1. rpm -q Command Syntax
6-1. rpm -V Command Syntax
6-2. Verification Versus File Types
7-1. rpm -K Command Syntax
12-1. rpm -b Command Syntax