Some ports, particularly the p5-
ports,
need to change their pkg-plist
depending on
what options they are configured with (or version of
perl
, in the case of p5-
ports). To make this easy, any instances in the
pkg-plist
of %%OSREL%%
,
%%PERL_VER%%
, and
%%PERL_VERSION%%
will be substituted for
appropriately. The value of %%OSREL%%
is the
numeric revision of the operating system (e.g.,
4.9
). %%PERL_VERSION%%
is
the full version number of perl
(e.g.,
5.00502
) and %%PERL_VER%%
is the perl
version number minus
the patchlevel (e.g., 5.005
). Several other
%%
related to
port's documentation files are described in the relevant section.VARS
%%
If you need to make other substitutions, you can set the
PLIST_SUB
variable with a list of
pairs and instances of
VAR
=VALUE
%%
will be
substituted with VAR
%%VALUE
in the
pkg-plist
.
For instance, if you have a port that installs many files in a version-specific subdirectory, you can put something like
in the Makefile
and use
%%OCTAVE_VERSION%%
wherever the version shows up
in pkg-plist
. That way, when you upgrade the port,
you will not have to change dozens (or in some cases, hundreds) of
lines in the pkg-plist
.
This substitution (as well as addition of any manual pages) will be done between
the pre-install
and
do-install
targets, by reading from
and writing to
PLIST
(default:
TMPPLIST
). So if
your port builds WRKDIR
/.PLIST.mktmp
on the fly, do so in or
before PLIST
pre-install
. Also, if your port
needs to edit the resulting file, do so in
post-install
to a file named
.TMPPLIST
Another possibility to modify port's packing list is based
on setting the variables PLIST_FILES
and
PLIST_DIRS
. The value of each variable
is regarded as a list of pathnames to
write to
along with TMPPLIST
contents. Names listed in PLIST
PLIST_FILES
and PLIST_DIRS
are subject to
%%
substitution, as described above.
Except for that, names from VAR
%%PLIST_FILES
will appear in the final packing list unchanged,
while @dirrm
will be
prepended to names from PLIST_DIRS
.
To take effect, PLIST_FILES
and
PLIST_DIRS
must be set before
is written,
i.e. in TMPPLIST
pre-install
or earlier.
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。