Библиотека сайта rus-linux.net
Different Places an rpmrc
File Resides
RPM looks for rpmrc
files in four places:
In
/usr/lib/
, for a file calledrpmrc
.In
/etc/
, for a file calledrpmrc
.In a file called
.rpmrc
in the user's login directory.In a file specified by the --rcfile option, if the option is present on the command line.
The first three files are read in the order listed, such that if a given
rmprc
entry is present in each file, the value of the
entry read last is the one used by RPM. This means,
for example, that an entry in .rpmrc
in the user's
login directory will always override the same entry in
/etc/rpmrc
. Likewise, an entry in
/etc/rpmrc
will always override the same entry in
/usr/lib/rpmrc
.
If the --rcfile option is used, then only
/usr/lib/rpmrc
and the file following the
--rcfile option are read, in that order. The
/usr/lib/rpmrc
file is always
read first. This cannot be changed.
Let's look at each of these files, starting with
/usr/lib/rpmrc
.
/usr/lib/rpmrc
The file /usr/lib/rpmrc
is
always read. It contains information that RPM uses
to set some default values. This file should never be
modified! Doing so may cause RPM to operate incorrectly.
|
Quite a bunch of stuff, isn't it? With the exception of the first five
lines, which indicate where several important directories and programs
are located, the remainder of this file contains
rpmrc
entries that are related to RPM's
architecture and operating system processing. As you might imagine, any
tinkering here will probably not be very productive, so leave any
modifications here to the RPM developers.
Next, we have /etc/rpmrc
.
/etc/rpmrc
The file /etc/rpmrc
, unlike
/usr/lib/rpmrc
, is fair game for modifications and
additions. In fact, /etc/rpmrc
isn't created by
default, so its contents are entirely up to you. It's the perfect place
to keep rpmrc
entries of a system-wide or global
nature.
The vendor entry is a great example of a good
candidate for inclusion in /etc/rpmrc
. In most
cases, a particular system is dedicated to building packages for one
vendor. In these instances, setting the vendor entry
in /etc/rpmrc
is best.
Next in the hierarchy is a file named .rpmrc
,
residing in the user's login directory.
.rpmrc
in the user's login directory
As you might imagine, a file called .rpmrc
in a
user's login directory is only going to be read by that user when he or
she runs RPM. Like /etc/rpmrc
, this file is not
created by default, but it can contain the same
rpmrc
entries as the other files. The
packager entry, which should contain the name and
contact information for the person who built the package, is an
appropriate candidate for ~/.rpmrc
.
File indicated by the --rcfile option
The --rcfile option is best used only when a totally
different RPM configuration is desired for one or two packages. Since
the only other rpmrc
file read is
/usr/lib/rpmrc
with its low-level default settings,
the file specified with the --rcfile option will have
to be more comprehensive than either /etc/rpmrc
or
~/.rmprc
.