II. RPM and Developers — How to Distribute Your Software More Easily With RPM

Table of Contents
9. The Philosophy Behind RPM
9.1. Pristine Sources
9.2. Easy Builds
9.2.1. Reproducible Builds
9.2.2. Unattended Builds
9.3. Multi-architecture/operating system Support
9.4. Easier For Your Users
9.4.1. Easy Upgrades
9.4.2. Intelligent Configuration File Handling
9.4.3. Powerful Query Capabilities
9.4.4. Easy Package Verification
9.5. To Summarize…
10. The Basics of Developing With RPM
10.1. The Inputs
10.1.1. The Sources
10.1.2. The Patches
10.1.3. The Spec File
10.2. The Engine: RPM
10.3. The Outputs
10.3.1. The Source Package File
10.3.2. The Binary RPM
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.3.1. The Preamble
11.3.2. The %prep Section
11.3.3. The %build Section
11.3.4. The %install Section
11.3.5. The %files Section
11.3.6. The Missing Spec File Sections
11.4. Starting the Build
11.5. When Things Go Wrong
11.5.1. Problems During the Build
11.5.2. Testing Newly Built Packages
12. rpm -b Command Reference
12.1. rpm -b — What Does it Do?
12.1.1. rpm -bp — Execute %prep
12.1.2. rpm -bc — Execute %prep, %build
12.1.3. rpm -bi — Execute %prep, %build, %install
12.1.4. rpm -bb — Execute %prep, %build, %install, package (bin)
12.1.5. rpm -ba — Execute %prep, %build, %install, package (bin, src)
12.1.6. rpm -bl — Check %files list
12.1.7. --short-circuit — Force build to start at particular stage
12.1.8. --buildarch <arch> — Perform Build For the <arch> Architecture
12.1.9. --buildos <os> — Perform Build For the <os> Operating System
12.1.10. --sign — Add a Digital Signature to the Package
12.1.11. --test — Create, Save Build Scripts For Review
12.1.12. --clean — Clean up after build
12.1.13. --buildroot <path> — Execute %install using <path> as the root
12.1.14. --timecheck <secs> — Print a warning if files to be packaged are over <secs> old
12.1.15. -vv — Display debugging information
12.1.16. --quiet — Produce as Little Output as Possible
12.1.17. --rcfile <rcfile> — Set alternate rpmrc file to <rcfile>
12.2. Other Build-related Commands
12.2.1. rpm --recompile — What Does it Do?
12.2.2. rpm --rebuild — What Does it Do?
13. Inside the Spec File
13.1. Comments: Notes Ignored by RPM
13.2. Tags: Data Definitions
13.2.1. Package Naming Tags
13.2.2. Descriptive Tags
13.2.3. Dependency Tags
13.2.4. Architecture- and Operating System-Specific Tags
13.2.5. Directory-related Tags
13.2.6. Source and Patch Tags
13.3. Scripts: RPM's Workhorse
13.3.1. Build-time Scripts
13.3.2. Install/Erase-time Scripts
13.3.3. Verification-Time Script — The %verifyscript Script
13.4. Macros: Helpful Shorthand for Package Builders
13.4.1. The %setup Macro
13.4.2. The %patch Macro
13.5. The %files List
13.6. Directives For the %files list
13.6.1. File-related Directives
13.6.2. Directory-related Directives
13.7. The Lone Directive: %package
13.7.1. -n <string> — Use <string> As the Entire Subpackage Name
13.8. Conditionals
13.8.1. The %ifarch Conditional
13.8.2. The %ifnarch Conditional
13.8.3. The %ifos Conditional
13.8.4. The %ifnos Conditional
13.8.5. The %else Conditional
13.8.6. The %endif Conditional
14. Adding Dependency Information to a Package
14.1. An Overview of Dependencies
14.2. Automatic Dependencies
14.2.1. The Automatic Dependency Scripts
14.2.2. Automatic Dependencies: An Example
14.2.3. The autoreqprov Tag — Disable Automatic Dependency Processing
14.3. Manual Dependencies
14.3.1. The requires Tag
14.3.2. The conflicts Tag
14.3.3. The provides Tag
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.3.1. %files List Restrictions
15.3.2. Relocatable Packages Must Contain Relocatable Software
15.3.3. The Relocatable Software Is Referenced By Other Software
15.4. Building a Relocatable Package
15.4.1. Tying Up the Loose Ends
15.4.2. Test-Driving a Relocatable Package
16. Making a Package That Can Build Anywhere
16.1. Using Build Roots in a Package
16.1.1. Some Things to Consider
16.2. Having RPM Use a Different Build Area
16.2.1. Setting up a Build Area
16.2.2. Directing RPM to Use the New Build Area
16.2.3. Performing a Build in a New Build Area
16.3. Specifying File Attributes
16.3.1. %attr — How Does It Work?
16.3.2. Betcha Thought We Forgot…
17. Adding PGP Signatures to a Package
17.1. Why Sign a Package?
17.2. Getting Ready to Sign
17.2.1. Preparing PGP: Creating a Key Pair
17.2.2. Preparing RPM
17.3. Signing Packages
17.3.1. --sign — Sign a Package At Build-Time
17.3.2. --resign — Replace a Package's Signature(s)
17.3.3. --addsign — Add a Signature To a Package
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.4.1. The Subpackage's "Preamble"
18.4.2. The %files List
18.4.3. Install- and Erase-time Scripts
18.5. Build-Time Scripts: Unchanged For Subpackages
18.5.1. Our Spec File: One Last Look…
18.6. Building Subpackages
18.6.1. Giving Subpackages the Once-Over
19. Building Packages for Multiple Architectures and Operating Systems
19.1. Architectures and Operating Systems: A Primer
19.1.1. Let's Just Call Them Platforms
19.2. What Does RPM Do To Make Multi-Platform Packaging Easier?
19.2.1. Automatic Detection of Build Platform
19.2.2. Automatic Detection of Install Platform
19.2.3. Platform-Dependent Tags
19.2.4. Platform-Dependent Conditionals
19.3. Build and Install Platform Detection
19.3.1. Platform-Specific rpmrc Entries
19.3.2. Overriding Platform Information At Build-Time
19.3.3. Overriding Platform Information At Install-Time
19.4. optflags — The Other rpmrc File Entry
19.5. Platform-Dependent Tags
19.5.1. The excludexxx Tag
19.5.2. The exclusivexxx Tag
19.6. Platform-Dependent Conditionals
19.6.1. Common Features of All Conditionals
19.6.2. %ifxxx
19.6.3. %ifnxxx
19.7. Hints and Kinks
20. Real-World Package Building
20.1. An Overview of Amanda
20.2. Initial Building Without RPM
20.2.1. Setting Up A Test Build Area
20.2.2. Getting Software to build
20.2.3. Installing and testing
20.3. Initial Building With RPM
20.3.1. Generating patches
20.3.2. Making a first-cut spec file
20.3.3. Getting the original sources unpacked
20.3.4. Getting patches properly applied
20.3.5. Letting RPM do the Building
20.3.6. Letting RPM do the Installing
20.3.7. Testing RPM's Handiwork
20.4. Package Building
20.4.1. Creating the %files list
20.4.2. Testing those first packages
20.4.3. Finishing Touches
21. A Guide to the RPM Library API
21.1. An Overview of rpmlib
21.2. rpmlib Functions
21.2.1. Error Handling
21.2.2. Getting Package Information
21.2.3. Variable Manipulation
21.2.4. rpmrc-Related Information
21.2.5. RPM Database Manipulation
21.2.6. RPM Database Traversal
21.2.7. RPM Database Search
21.2.8. Package Manipulation
21.2.9. Package And File Verification
21.2.10. Dependency-Related Operations
21.2.11. Diagnostic Output Control
21.2.12. Signature Verification
21.2.13. Header Manipulation
21.2.14. Header Entry Manipulation
21.2.15. Header Iterator Support
21.3. Example Code
21.3.1. Example #1
21.3.2. Example #2
21.3.3. Example #3