1 /*! \page relocatable Relocatable packages
3 Relocatable packages are a way to give the user a little control
4 over the installation location of a package. For example, a vendor
5 may distribute their software to install in "/opt" but you'd like
6 it to install in "/usr/opt". If the vendor were distributing a
7 relocatable RPM package, it would be easy.
9 \subsection relocatable_building Building a Relocatable Package
11 Not all software can be "relocatable". Before continuing you should
12 think about how the program works, what files it accesses, what other
13 programs access *it* (and expect it to be in a certain place), etc.
14 If you determine that the location of the package doesn't matter,
15 then it can probably be built as "relocatable".
17 All you need to do to build a relocatable package is put one or more:
23 in your spec file. The "<dir>" will usually be something like "/usr",
24 "/usr/local", or "/opt". Every file in your %files list must start
25 with that prefix. For example, if you have "Prefix: /usr" and your
26 %files list contains "/etc/foo.conf", the build will fail. The fix for
34 into the spec file so that the /usr and /etc directories may be
35 relocated separately when this package is installed.
38 \subsection relocatable_installing Installing Relocatable Packages
40 By default, RPM will install a relocatable package in the prefix
41 directory listed in the spec file. You can override this on the
42 RPM install command line with "--prefix <dir>". For example, if
43 the package in question were going to be installed in "/opt" but
44 you don't have enough disk space there (and it is a relocatable
45 package), you could install it "--prefix /usr/opt".
47 If there is more then one Prefix you may relocate each prefix
48 separately by using syntax like:
51 rpm ... --relocate /opt=/usr/opt --relocate /etc=/usr/etc ...
54 If any of the Prefixes is not being relocated they can be skipped on