📄 index.html
字号:
<P>8.3.3. So What Can I Do with It? 108
</P>
<P>8.3.4. Stick with Us! 110
</P>
</blockquote>
</blockquote>
<P><b>Part II RPM and Developers: How to Distribute Your Software <BR>
More Easily with RPM</b>
</P>
<P>
<b> 9 The Philosophy Behind RPM 113</b>
</P>
<blockquote>
<p>
9.1. Pristine Sources 114
</P>
<P>
9.2. Easy Builds 115
</p>
<blockquote>
<P>
9.2.1. Reproducible Builds 115
</P>
<P>9.2.2. Unattended Builds 116
</P>
</blockquote>
<p>
9.3. Multiarchitecture/Operating System Support
116
</P>
<P>
9.4. Easier for Your Users 116
</p>
<blockquote>
<P>
9.4.1. Easy Upgrades 116
</P>
<P>9.4.2. Intelligent Configuration File Handling
116
</P>
<P>9.4.3. Powerful Query Capabilities 117
</P>
<P>9.4.4. Easy Package Verification 117
</P>
</blockquote>
<p>
9.5. To Summarize 117
</p>
</blockquote>
<P>
<b> 10 The Basics of Developing with RPM 119</b>
</P>
<blockquote>
<p>
10.1. The Inputs 120
</p>
<blockquote>
<P>
10.1.1. The Sources 120
</P>
<P>10.1.2. The Patches 120
</P>
<P>10.1.3. The Spec File 121
</P>
</blockquote>
<p>
10.2. The Engine: RPM 123
</P>
<P>
10.3. The Outputs 123
</p>
<blockquote>
<P>
10.3.1. The Source Package File 123
</P>
<P>10.3.2. The Binary RPM 123
</P>
</blockquote>
<p>
10.4. And Now… 124
</P>
</blockquote>
<A NAME="PAGENUM-9"><P>Page 9</P></A>
<P>
<b> 11 Building Packages: A Simple Example
125</b>
</P>
<blockquote>
<p>
11.1. Creating the Build Directory Structure
126
</P>
<P>
11.2. Getting the Sources 127
</P>
<P>
11.3. Creating the Spec File 127
</p>
<blockquote>
<P>
11.3.1. The Preamble 127
</P>
<P>11.3.2. The %prep Section 129
</P>
<P>11.3.3. The %build Section 130
</P>
<P>11.3.4. The %install Section 130
</P>
<P>11.3.5. The %files Section 131
</P>
<P>11.3.6. The Missing Spec File Sections 132
</P>
</blockquote>
<p>
11.4. Starting the Build 132
</P>
<P>
11.5. When Things Go Wrong 136
</p>
<blockquote>
<P>
11.5.1. Problems During the Build 136
</P>
<P>11.5.2. Testing Newly Built Packages 137
</P>
</blockquote>
<p>
11.6. Summary 137
</p>
</blockquote>
<P>
<b> 12 rpm -b Command Reference 139</b>
</P>
<blockquote>
<p>
12.1. rpm -b: What Does It Do? 140
</p>
<blockquote>
<P>
12.1.1. rpm -bp: Execute %prep 141
</P>
<P>12.1.2. rpm -bc: Execute %prep, %build 142
</P>
<P>12.1.3. rpm -bi: Execute %prep, %build,
%install 143
</P>
<P>12.1.4. rpm -bb: Execute %prep, %build,
%install, Package (bin) 144
</P>
<P>12.1.5. rpm -ba: Execute %prep, %build,
%install, Package (bin, src) 145
</P>
<P>12.1.6. rpm -bl: Check %files List 146
</P>
<P>12.1.7. --short-circuit: Force Build to Start at a Particular Stage
149
</P>
<P>12.1.8. --buildarch <arch>: Perform a Build for the
<arch> Architecture 151
</P>
<P>12.1.9. --buildos <os>: Perform Build for the
<os> Operating System 152
</P>
<P>12.1.10. --sign: Add a Digital Signature to the Package
152
</P>
<P>12.1.11. --test: Create, Save Build Scripts for Review
153
</P>
<P>12.1.12. --clean: Clean Up After Build 154
</P>
<P>12.1.13. --buildroot <path>: Execute
%install Using <path>
As the Root 155
</P>
<P>12.1.14. --timecheck <secs>: Print a Warning if Files to Be <BR>
Packaged Are More Than <secs> Old 158
</P>
<P>12.1.15. -vv: Display Debugging Information
159
</P>
<P>12.1.16. --quiet: Produce As Little Output As Possible
159
</P>
<P>12.1.17. --rcfile <rcfile>: Set Alternate
rpmrc File to <rcfile> 160
</P>
</blockquote>
<p>
12.2. Other Build-Related Commands 160
</p>
<blockquote>
<P>
12.2.1. rpm --recompile: What Does It Do? 160
</P>
<P>12.2.2. rpm --rebuild: What Does It Do? 161
</P>
</blockquote>
<p>
12.3. Summary 162
</P>
</blockquote>
<A NAME="PAGENUM-10"><P>Page 10</P></A>
<P>
<b> 13 Inside the Spec File 163</b>
</P>
<blockquote>
<p>
13.1. Comments: Notes Ignored by RPM 164
</P>
<P>
13.2. Tags: Data Definitions 164
</p>
<blockquote>
<P>
13.2.1. Package Naming Tags 165
</P>
<P>13.2.2. Descriptive Tags 166
</P>
<P>13.2.3. Dependency Tags 169
</P>
<P>13.2.4. Architecture- and Operating System_Specific Tags
172
</P>
<P>13.2.5. Directory-Related Tags 174
</P>
<P>13.2.6. Source and Patch Tags 175
</P>
</blockquote>
<p>
13.3. Scripts: RPM's Workhorse 178
</p>
<blockquote>
<P>
13.3.1. Build-Time Scripts 178
</P>
<P>13.3.2. Install/Erase-Time Scripts 181
</P>
<P>13.3.3. Verification-Time Script—The
%verifyscript Script 183
</P>
</blockquote>
<p>
13.4. Macros: Helpful Shorthand for Package Builders
183
</p>
<blockquote>
<P>
13.4.1. The %setup Macro 184
</P>
<P>13.4.2. The %patch Macro 191
</P>
</blockquote>
<p>
13.5. The %files List 194
</P>
<P>
13.6. Directives for the %files List 194
</p>
<blockquote>
<P>
13.6.1. File-Related Directives 195
</P>
<P>13.6.2. Directory-Related Directives 197
</P>
</blockquote>
<p>
13.7. The Lone Directive: %package 200
</p>
<blockquote>
<P>
13.7.1. -n <string>: Use <string> As the Entire
Subpackage Name 201
</P>
</blockquote>
<p>
13.8. Conditionals 201
</p>
<blockquote>
<P>
13.8.1. The %ifarch Conditional 202
</P>
<P>13.8.2. The %ifnarch Conditional 202
</P>
<P>13.8.3. The %ifos Conditional 203
</P>
<P>13.8.4. The %ifnos Conditional 203
</P>
<P>13.8.5. The %else Conditional 203
</P>
<P>13.8.6. The %endif Conditional 203
</P>
</blockquote>
<p>
13.9. Summary 204
</p>
</blockquote>
<P>
<b> 14 Adding Dependency Information to a Package
205</b>
</P>
<blockquote>
<p>
14.1. An Overview of Dependencies 206
</P>
<P>
14.2. Automatic Dependencies 206
</p>
<blockquote>
<P>
14.2.1. The Automatic Dependency Scripts 207
</P>
<P>14.2.2. Automatic Dependencies: An Example 208
</P>
<P>14.2.3. The autoreqprov Tag: Disable Automatic <BR>
Dependency Processing 209
</P>
</blockquote>
<p>
14.3. Manual Dependencies 209
</p>
<blockquote>
<P>
14.3.1. The requires Tag 209
</P>
<P>14.3.2. The conflicts Tag 211
</P>
<P>14.3.3. The provides Tag 212
</P>
</blockquote>
<p>
14.4. To Summarize 213
</P>
</blockquote>
<A NAME="PAGENUM-11"><P>Page 11</P></A>
<P>
<b> 15 Making a Relocatable Package 215</b>
</P>
<blockquote>
<p>
15.1. Why Relocatable Packages? 216
</P>
<P>
15.2. The prefix tag: Relocation Central 216
</P>
<P>
15.3. Relocatable Wrinkles: Things to Consider
217
</p>
<blockquote>
<P>
15.3.1. %files List Restrictions 218
</P>
<P>15.3.2. Relocatable Packages Must Contain Relocatable Software
218
</P>
<P>15.3.3. The Relocatable Software Is Referenced by <BR>
Other Software 219
</P>
</blockquote>
<p>
15.4. Building a Relocatable Package 219
</p>
<blockquote>
<P>
15.4.1. Tying Up the Loose Ends 221
</P>
<P>15.4.2. Test-Driving a Relocatable Package 222
</P>
</blockquote>
</blockquote>
<P><b> 16 Making a Package That Can Build Anywhere
225</b>
</P>
<blockquote>
<p>
16.1. Using Build Roots in a Package 226
</p>
<blockquote>
<P>
16.1.1. Some Things to Consider 229
</P>
</blockquote>
<p>
16.2. Having RPM Use a Different Build Area
230
</p>
<blockquote>
<P>
16.2.1. Setting Up a Build Area 230
</P>
<P>16.2.2. Directing RPM to Use the New Build Area
231
</P>
<P>16.2.3. Performing a Build in a New Build Area
231
</P>
</blockquote>
<p>
16.3. Specifying File Attributes 233
</p>
<blockquote>
<P>
16.3.1. %attr: How Does It Work? 233
</P>
<P>16.3.2. Betcha Thought We Forgot 235
</P></blockquote>
</blockquote>
<P><b> 17 Adding PGP Signatures to a Package
237</b>
</P>
<blockquote>
<p>
17.1. Why Sign a Package? 238
</P>
<P>
17.2. Getting Ready to Sign 238
</p>
<blockquote>
<P>
17.2.1. Preparing PGP: Creating a Key Pair 238
</P>
<P>17.2.2. Preparing RPM 240
</P>
</blockquote>
<p>
17.3. Signing Packages 241
</p>
<blockquote>
<P>
17.3.1. --sign: Sign a Package at Build Time 241
</P>
<P>17.3.2. --resign: Replace a Package's Signature(s)
243
</P>
<P>17.3.3. --addsign: Add a Signature to a Package
244
</P>
</blockquote>
</blockquote>
<P><b> 18 Creating Subpackages 247</b>
</P>
<blockquote>
<p>
18.1. What Are Subpackages? 248
</P>
<P>
18.2. Why Are Subpackages Needed? 248
</P>
<P>
18.3. Our Sample Spec File: Subpackages Galore!
248
</P>
<P>
18.4. Spec File Changes for Subpackages 249
</p>
<blockquote>
<P>
18.4.1. The Subpackage's Preamble 249
</P>
<P>18.4.2. The %files List 253
</P>
<P>18.4.3. Install and Erase Time Scripts 255
</P>
</blockquote>
<p>
18.5. Build-Time Scripts: Unchanged for Subpackages
257
</p>
<blockquote>
<P>
18.5.1. Our Spec File: One Last Look 257
</P>
</blockquote>
<p>
18.6. Building Subpackages 259
</p>
<blockquote>
<P>
18.6.1. Giving Subpackages the Once-Over 260
</P>
</blockquote>
</blockquote>
<A NAME="PAGENUM-12"><P>Page 12</P></A>
<P><b> 19 Building Packages for Multiple Architectures and <BR>
Operating Systems 263</b>
</P>
<br>
<p>
19.1. Architectures and Operating Systems: A Primer
264
</p>
<blockquote>
<P>
19.1.1. Let's Just Call Them Platforms 265
</P>
</blockquote>
<p>
19.2. What Does RPM Do to Make Multiplatform
Packaging Easier? 265
</p>
<blockquote>
<P>
19.2.1. Automatic Detection of the Build Platform
265
</P>
<P>19.2.2. Automatic Detection of the Install Platform
265
</P>
<P>19.2.3. Platform-Dependent Tags 265
</P>
<P>19.2.4. Platform-Dependent Conditionals 266
</P>
</blockquote>
<p>
19.3. Build and Install Platform Detection
266
</p>
<blockquote>
<P>
19.3.1. Platform-Specific rpmrc Entries 266
</P>
<P>19.3.2. Overriding Platform Information at Build Time
268
</P>
<P>19.3.3. Overriding Platform Information at Install Time
268
</P>
</blockquote>
<p>
19.4. optflags: The Other rpmrc File Entry
269
</P>
<P>
19.5. Platform-Dependent Tags 269
</p>
<blockquote>
<P>
19.5.1. The excludexxx Tags 270
</P>
<P>19.5.2. The exclusivexxx Tags 270
</P>
</blockquote>
<p>
19.6. Platform-Dependent Conditionals 270
</p>
<blockquote>
<P>
19.6.1. Common Features of All Conditionals 271
</P>
<P>19.6.2. %ifxxx 272
</P>
<P>19.6.3. %ifnxxx 272
</P>
</blockquote>
<p>
19.7. Hints and Kinks 273
</p>
<P>
<b> 20 Real-World Package Building 275</b>
</P>
<blockquote>
<p>
20.1. An Overview of Amanda 276
</P>
<P>
20.2. Initial Building Without RPM 276
</p>
<blockquote>
<P>
20.2.1. Setting Up a Test Build Area 277
</P>
<P>20.2.2. Getting Software to Build 278
</P>
<P>20.2.3. Installing and Testing 279
</P>
</blockquote>
<p>
20.3. Initial Building with RPM 281
</p>
<blockquote>
<P>
20.3.1. Generating Patches 281
</P>
<P>20.3.2. Making a First-Cut Spec File 283
</P>
<P>20.3.3. Getting the Original Sources Unpacked
285
</P>
<P>20.3.4. Getting Patches Properly Applied 286
</P>
<P>20.3.5. Letting RPM Do the Building 287
</P>
<P>20.3.6. Letting RPM Do the Installing 288
</P>
<P>20.3.7. Testing RPM's Handiwork 289
</P>
</blockquote>
<p>
20.4. Package Building 289
</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -