RPM-HOWTO(1).pdf

(43 KB) Pobierz
RPM HOWTO
RPM HOWTO
RPM at Idle
Donnie Barnes
Red Hat, Inc.
djb@redhat.com
Copyright © 1999 by Red Hat, Inc.
Revision History
Revision V3.0
3 November 1999
This document and its contents are copyright protected. Redistribution of this document is permitted as long
as the content remains completely intact and unchanged. In other words, you may reformat and reprint or
redistribute only.
RPM HOWTO
Table of Contents
1. Introduction. ....................................................................................................................................................1
2. Overview. .........................................................................................................................................................2
3. General Information. ......................................................................................................................................3
3.1. Acquiring RPM. ................................................................................................................................3
3.2. RPM Requirements. ..........................................................................................................................3
4. Using RPM. ......................................................................................................................................................4
5. Now what can I really do with RPM?. ..........................................................................................................5
6. Building RPMs. ...............................................................................................................................................7
6.1. The Spec File. ...................................................................................................................................7
6.2. The Header. .......................................................................................................................................8
6.3. Prep. ..................................................................................................................................................9
6.4. Build. ...............................................................................................................................................10
6.5. Install. .............................................................................................................................................10
6.6. Cleaning your system. .....................................................................................................................11
6.7. Optional pre and post Install/Uninstall Scripts. ..............................................................................11
6.8. Files. ................................................................................................................................................11
6.9. Changelog. ......................................................................................................................................12
7. Building It. .....................................................................................................................................................13
7.1. The Source Directory Tree.. ............................................................................................................13
7.2. Test Building.. .................................................................................................................................13
7.3. Generating the File List. .................................................................................................................13
7.4. Building the Package with RPM. ....................................................................................................13
7.5. Testing It. ........................................................................................................................................14
7.6. What to do with your new RPMs. ...................................................................................................14
7.7. What Now?. ....................................................................................................................................14
8. Multi−architectural RPM Building. ............................................................................................................15
8.1. Sample spec File. ............................................................................................................................15
8.2. Optflags. ..........................................................................................................................................16
8.3. Macros. ............................................................................................................................................16
8.4. Excluding Architectures from Packages. ........................................................................................16
8.5. Finishing Up ...................................................................................................................................16
i
193233707.001.png
1. Introduction
RPM is the R PM P ackage M anager. It is an open packaging system available for anyone to use. It allows
users to take source code for new software and package it into source and binary form such that binaries can
be easily installed and tracked and source can be rebuilt easily. It also maintains a database of all packages
and their files that can be used for verifying packages and querying for information about files and/or
packages.
Red Hat, Inc. encourages other distribution vendors to take the time to look at RPM and use it for their own
distributions. RPM is quite flexible and easy to use, though it provides the base for a very extensive system. It
is also completely open and available, though we would appreciate bug reports and fixes. Permission is
granted to use and distribute RPM royalty free under the GPL.
More complete documentation is available on RPM in the book by Ed Bailey, Maximum RPM . That book is
available for download or purchase at www.redhat.com .
1. Introduction
1
193233707.002.png
2. Overview
First, let me state some of the philosophy behind RPM. One design goal was to allow the use of "pristine"
sources. With RPP (our former packaging system of which none of RPM is derived), our source packages
were the "hacked" sources that we built from.
Theoretically, one could install a source RPP and then make it with no problems. But the sources were not the
original ones, and there was no reference as to what changes we had to make to get it to build. One had to
download the pristine sources separately. With RPM, you have the pristine sources along with patches that we
used to compile from. We see this as a big advantage. Why? Several reasons. For one, if a new version of a
program comes out, you don't necessarily have to start from scratch to get it to compile under RHL. You can
look at the patch to see what you might need to do. All the compile−in defaults are easily visible this way.
RPM is also designed to have powerful querying options. You can do searches through your entire database
for packages or just certain files. You can also easily find out what package a file belongs to and where it
came from. The RPM files themselves are compressed archives, but you can query individual packages easily
and quickly because of a custom binary header added to the package with everything you could possibly need
to know contained in uncompressed form. This allows for fast querying.
Another powerful feature is the ability to verify packages. If you are worried that you deleted an important file
for some package, just verify it. You will be notified of any anomalies. At that point, you can reinstall the
package if necessary. Any config files that you had are preserved as well.
We would like to thank the folks from the BOGUS distribution for many of their ideas and concepts that are
included in RPM. While RPM was completely written by Red Hat, Inc., its operation is based on code written
by BOGUS (PM and PMS).
2. Overview
2
3. General Information
3.1. Acquiring RPM
The best way to get RPM is to install Red Hat Linux. If you don't want to do that, you can still get and use
RPM. It can be acquired from ftp.redhat.com .
3.2. RPM Requirements
RPM itself should build on basically any Unix−like system. It has been built and used on Tru64 Unix, AIX,
Solaris, SunOS, and basically all flavors of Linux.
To build RPMs from source, you also need everything normally required to build a package, like gcc , make ,
etc.
3. General Information
3
193233707.003.png
Zgłoś jeśli naruszono regulamin