| Maximum RPM: Taking the Red Hat Package Manager to the Limit | ||
|---|---|---|
| Prev | Chapter 15. Making a Relocatable Package | Next |
The best way to explain how the prefix tag is used is to step through an example. Here's a sample prefix tag:
Prefix: /opt
|
In this example, the prefix path is defined as /opt. This means that, by default, the package will install its files under /opt. Let's assume the spec file contains the following line in its %files list:
/opt/bin/baz
|
If the package is installed without any relocation, this file will be installed in /opt/bin. This is identical to how a non-relocatable package is installed.
However, if the package is to be relocated on installation, the path of every file in the %files list is modified according to the following steps:
The part of the file's path that corresponds to the path specified on the prefix tag line is removed.
The user-specified relocation prefix is prepended to the file's path.
Using our /opt/bin/baz/opt), with a new prefix, say, /usr/local/opt. Following the steps above, we first remove the original prefix from the file's path:
/opt/bin/baz
|
becomes:
/bin/baz
|
/usr/local/opt + /bin/baz = /usr/local/opt/bin/baz
|
the package builder needs to consider before getting on the relocatable package bandwagon.
| Главная |