Changeset View
Standalone View
en_US.ISO8859-1/books/porters-handbook/plist/chapter.xml
Show All 13 Lines | <chapter xmlns="http://docbook.org/ns/docbook" | ||||
<sect1 xml:id="plist-sub"> | <sect1 xml:id="plist-sub"> | ||||
<title>Changing <filename>pkg-plist</filename> Based on Make | <title>Changing <filename>pkg-plist</filename> Based on Make | ||||
Variables</title> | Variables</title> | ||||
<para>Some ports, particularly the <literal>p5-</literal> ports, | <para>Some ports, particularly the <literal>p5-</literal> ports, | ||||
need to change their <filename>pkg-plist</filename> depending on | need to change their <filename>pkg-plist</filename> depending on | ||||
what options they are configured with (or version of | what options they are configured with (or version of | ||||
<literal>perl</literal>, in the case of <literal>p5-</literal> | <literal>perl</literal>, in the case of <literal>p5-</literal> | ||||
ports). To make this easy, any instances in the | ports). To make this easy, any instances in | ||||
<filename>pkg-plist</filename> of <literal>%%OSREL%%</literal>, | <filename>pkg-plist</filename> of <literal>%%OSREL%%</literal>, | ||||
<literal>%%PERL_VER%%</literal>, and | <literal>%%PERL_VER%%</literal>, and | ||||
<literal>%%PERL_VERSION%%</literal> will be substituted for | <literal>%%PERL_VERSION%%</literal> will be substituted for | ||||
wblock: "for" can probably be removed without harm. | |||||
appropriately. The value of <literal>%%OSREL%%</literal> is the | appropriately. The value of <literal>%%OSREL%%</literal> is the | ||||
numeric revision of the operating system (e.g., | numeric revision of the operating system (for example, | ||||
<literal>4.9</literal>). <literal>%%PERL_VERSION%%</literal> | <literal>4.9</literal>). <literal>%%PERL_VERSION%%</literal> | ||||
and <literal>%%PERL_VER%%</literal> is the full version number | and <literal>%%PERL_VER%%</literal> is the full version number | ||||
of <command>perl</command> (e.g., <literal>5.8.9</literal>). | of <command>perl</command> (for example, <literal>5.8.9</literal>). | ||||
Several other | Several other | ||||
<literal>%%<replaceable>VARS</replaceable>%%</literal> related | <literal>%%<replaceable>VARS</replaceable>%%</literal> related | ||||
to port's documentation files are described in <link | to port's documentation files are described in <link | ||||
linkend="install-documentation">the relevant | linkend="install-documentation">the relevant | ||||
section</link>.</para> | section</link>.</para> | ||||
<para>If you need to make other substitutions, you can set the | <para>To make other substitutions, set | ||||
<varname>PLIST_SUB</varname> variable with a list of | <varname>PLIST_SUB</varname> with a list of | ||||
<literal><replaceable>VAR</replaceable>=<replaceable>VALUE</replaceable></literal> | <literal><replaceable>VAR</replaceable>=<replaceable>VALUE</replaceable></literal> | ||||
pairs and instances of | pairs and instances of | ||||
<literal>%%<replaceable>VAR</replaceable>%%</literal> will be | <literal>%%<replaceable>VAR</replaceable>%%</literal> will be | ||||
substituted with <replaceable>VALUE</replaceable> in the | substituted with <replaceable>VALUE</replaceable> in | ||||
<filename>pkg-plist</filename>.</para> | <filename>pkg-plist</filename>.</para> | ||||
<para>For instance, if you have a port that installs many files | <para>For instance, if a port that installs many files | ||||
wblockUnsubmitted Not Done Inline ActionsRemove "that". wblock: Remove "that". | |||||
in a version-specific subdirectory, you can put something | in a version-specific subdirectory, put something | ||||
wblockUnsubmitted Not Done Inline Actions"Something like" is vague. Like it how? wblock: "Something like" is vague. Like it how? | |||||
like</para> | like</para> | ||||
<programlisting>OCTAVE_VERSION= 2.0.13 | <programlisting>OCTAVE_VERSION= 2.0.13 | ||||
PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}</programlisting> | PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}</programlisting> | ||||
<para>in the <filename>Makefile</filename> and use | <para>in the <filename>Makefile</filename> and use | ||||
<literal>%%OCTAVE_VERSION%%</literal> wherever the version shows | <literal>%%OCTAVE_VERSION%%</literal> wherever the version shows | ||||
up in <filename>pkg-plist</filename>. That way, when you | up in <filename>pkg-plist</filename>. That way, when | ||||
wblockUnsubmitted Not Done Inline Actionsup in <filename>pkg-plist</filename>. When wblock: up in <filename>pkg-plist</filename>. When | |||||
upgrade the port, you will not have to change dozens (or in some | upgrading the port, change dozens (or in some | ||||
wblockUnsubmitted Not Done Inline Actionsthe port is upgraded, it will not be necessary to edit dozens (or in some wblock: the port is upgraded, it will not be necessary to edit dozens (or in some | |||||
cases, hundreds) of lines in the | cases, hundreds) of lines in | ||||
<filename>pkg-plist</filename>.</para> | <filename>pkg-plist</filename> will not be needed.</para> | ||||
wblockUnsubmitted Not Done Inline Actions<filename>pkg-plist</filename>.</para> wblock: <filename>pkg-plist</filename>.</para> | |||||
<para>If your port installs files conditionally on the options | <para>If the port installs files conditionally on the options | ||||
wblockUnsubmitted Not Done Inline Actions<para>If files are installed conditionally on the options wblock: <para>If files are installed conditionally on the options | |||||
set in the port, the usual way of handling it is prefixing the | set in the port, the usual way of handling it is prefixing | ||||
<filename>pkg-plist</filename> lines with a | <filename>pkg-plist</filename> lines with a | ||||
<literal>%%OPT%%</literal> for lines needed when the option is | <literal>%%OPT%%</literal> for lines needed when the option is | ||||
enabled, or <literal>%%NO_OPT%%</literal> when the option is | enabled, or <literal>%%NO_OPT%%</literal> when the option is | ||||
disabled, and adding <literal>OPTIONS_SUB=yes</literal> to the | disabled, and adding <literal>OPTIONS_SUB=yes</literal> to the | ||||
<filename>Makefile</filename>. See <xref | <filename>Makefile</filename>. See <xref | ||||
linkend="options_sub"/> for more information.</para> | linkend="options_sub"/> for more information.</para> | ||||
<para>For instance, if there are files that are only installed | <para>For instance, if there are files that are only installed | ||||
when the <literal>X11</literal> option is enabled, and the | when the <literal>X11</literal> option is enabled, and | ||||
<filename>Makefile</filename> has:</para> | <filename>Makefile</filename> has:</para> | ||||
<programlisting>OPTIONS_DEFINE= X11 | <programlisting>OPTIONS_DEFINE= X11 | ||||
OPTIONS_SUB= yes</programlisting> | OPTIONS_SUB= yes</programlisting> | ||||
<para>In the <filename>pkg-plist</filename> file, put | <para>In <filename>pkg-plist</filename>, put | ||||
<literal>%%X11%%</literal> in front of the lines only being | <literal>%%X11%%</literal> in front of the lines only being | ||||
installed when the option is enabled, like this :</para> | installed when the option is enabled, like this :</para> | ||||
<programlisting>%%X11%%bin/foo-gui</programlisting> | <programlisting>%%X11%%bin/foo-gui</programlisting> | ||||
<para>This substitution will be done between the | <para>This substitution will be done between the | ||||
<buildtarget>pre-install</buildtarget> and | <buildtarget>pre-install</buildtarget> and | ||||
<buildtarget>do-install</buildtarget> targets, by reading from | <buildtarget>do-install</buildtarget> targets, by reading from | ||||
<filename>PLIST</filename> and writing to | <filename>PLIST</filename> and writing to | ||||
<filename>TMPPLIST</filename> (default: | <filename>TMPPLIST</filename> (default: | ||||
<filename>WRKDIR/.PLIST.mktmp</filename>). So if your port | <filename>WRKDIR/.PLIST.mktmp</filename>). So if the port | ||||
builds <filename>PLIST</filename> on the fly, do so in or before | builds <filename>PLIST</filename> on the fly, do so in or before | ||||
<buildtarget>pre-install</buildtarget>. Also, if your port | <buildtarget>pre-install</buildtarget>. Also, if the port | ||||
needs to edit the resulting file, do so in | needs to edit the resulting file, do so in | ||||
<buildtarget>post-install</buildtarget> to a file named | <buildtarget>post-install</buildtarget> to a file named | ||||
<filename>TMPPLIST</filename>.</para> | <filename>TMPPLIST</filename>.</para> | ||||
<para>Another way of modifying a port's packing list is based on | <para>Another way of modifying a port's packing list is based on | ||||
setting the variables <varname>PLIST_FILES</varname>, | setting the variables <varname>PLIST_FILES</varname>, | ||||
<varname>PLIST_DIRS</varname>, and | <varname>PLIST_DIRS</varname>, and | ||||
<varname>PLIST_DIRSTRY</varname>. The value of each variable is | <varname>PLIST_DIRSTRY</varname>. The value of each variable is | ||||
regarded as a list of pathnames to write to | regarded as a list of pathnames to write to | ||||
<filename>TMPPLIST</filename> along with | <filename>TMPPLIST</filename> along with | ||||
<filename>PLIST</filename> contents. Names listed in | <filename>PLIST</filename> contents. Names listed in | ||||
<varname>PLIST_FILES</varname>, <varname>PLIST_DIRS</varname>, | <varname>PLIST_FILES</varname>, <varname>PLIST_DIRS</varname>, | ||||
and <varname>PLIST_DIRSTRY</varname> are subject to | and <varname>PLIST_DIRSTRY</varname> are subject to | ||||
<literal>%%<replaceable>VAR</replaceable>%%</literal> | <literal>%%<replaceable>VAR</replaceable>%%</literal> | ||||
substitution as described above. Except for that, names from | substitution as described above. Except for that, names from | ||||
<varname>PLIST_FILES</varname> will appear in the final packing | <varname>PLIST_FILES</varname> will appear in the final packing | ||||
list unchanged, while <literal>@dirrm</literal> and | list unchanged, while <literal>@dirrm</literal> and | ||||
<literal>@dirrmtry</literal> will be prepended to names from | <literal>@dirrmtry</literal> will be prepended to names from | ||||
<varname>PLIST_DIRS</varname> and | <varname>PLIST_DIRS</varname> and | ||||
<varname>PLIST_DIRSTRY</varname>, respectively. To take effect, | <varname>PLIST_DIRSTRY</varname>, respectively. To take effect, | ||||
<varname>PLIST_FILES</varname>, <varname>PLIST_DIRS</varname>, | <varname>PLIST_FILES</varname>, <varname>PLIST_DIRS</varname>, | ||||
and <varname>PLIST_DIRSTRY</varname> must be set before | and <varname>PLIST_DIRSTRY</varname> must be set before | ||||
<filename>TMPPLIST</filename> is written, i.e., in | <filename>TMPPLIST</filename> is written, that is, in | ||||
<buildtarget>pre-install</buildtarget> or earlier.</para> | <buildtarget>pre-install</buildtarget> or earlier.</para> | ||||
<para>From time to time, the <varname>OPTIONS_SUB</varname> | <para>From time to time, using <varname>OPTIONS_SUB</varname> | ||||
construct is not enough, in those cases, adding a specific | is not enough, in those cases, adding a specific | ||||
wblockUnsubmitted Not Done Inline ActionsBreak sentence after "enough". wblock: Break sentence after "enough". | |||||
<literal>TAG</literal> to the <varname>PLIST_SUB</varname> | <literal><replaceable>TAG</replaceable></literal> to <varname>PLIST_SUB</varname> | ||||
variable inside the <filename>Makefile</filename> with a special | inside the <filename>Makefile</filename> with a special | ||||
value of <literal>@comment</literal>, makes package tools to | value of <literal>@comment</literal>, makes package tools to | ||||
ignore the line. For instance, if some files are only installed | ignore the line. For instance, if some files are only installed | ||||
when the <literal>X11</literal> option is on and the | when the <literal>X11</literal> option is on and the | ||||
architecture is <literal>i386</literal>:</para> | architecture is <literal>i386</literal>:</para> | ||||
<programlisting>.include <bsd.port.pre.mk> | <programlisting>.include <bsd.port.pre.mk> | ||||
.if ${PORT_OPTIONS:MX11} && ${ARCH} == "i386" | .if ${PORT_OPTIONS:MX11} && ${ARCH} == "i386" | ||||
PLIST_SUB+= X11I386="" | PLIST_SUB+= X11I386="" | ||||
.else | .else | ||||
PLIST_SUB+= X11I386="@comment " | PLIST_SUB+= X11I386="@comment " | ||||
.endif</programlisting> | .endif</programlisting> | ||||
</sect1> | </sect1> | ||||
<sect1 xml:id="plist-cleaning"> | <sect1 xml:id="plist-cleaning"> | ||||
<title>Empty Directories</title> | <title>Empty Directories</title> | ||||
<sect2 xml:id="plist-dir-cleaning"> | <sect2 xml:id="plist-dir-cleaning"> | ||||
<title>Cleaning Up Empty Directories</title> | <title>Cleaning Up Empty Directories</title> | ||||
<para>When being de-installed, A port has to remove empty | <para>When being de-installed, A port has to remove empty | ||||
directories it created. This is usually accomplished by | directories it created. This is usually accomplished by | ||||
adding <literal>@dirrm</literal> lines for all directories | adding <literal>@dirrm</literal> lines for all directories | ||||
that are specifically created by the port. You need to delete | that are specifically created by the port. Subdirectories need to be deleted | ||||
wblockUnsubmitted Not Done Inline Actionss/need to/must/ wblock: s/need to/must/ | |||||
subdirectories before you can delete parent | before deleting parent | ||||
directories.</para> | directories.</para> | ||||
<programlisting> : | <programlisting> : | ||||
lib/X11/oneko/pixmaps/cat.xpm | lib/X11/oneko/pixmaps/cat.xpm | ||||
lib/X11/oneko/sounds/cat.au | lib/X11/oneko/sounds/cat.au | ||||
: | : | ||||
@dirrm lib/X11/oneko/pixmaps | @dirrm lib/X11/oneko/pixmaps | ||||
@dirrm lib/X11/oneko/sounds | @dirrm lib/X11/oneko/sounds | ||||
@dirrm lib/X11/oneko</programlisting> | @dirrm lib/X11/oneko</programlisting> | ||||
<para>However, sometimes <literal>@dirrm</literal> will give | <para>However, sometimes <literal>@dirrm</literal> will give | ||||
you errors because other ports share the same directory. You | errors because other ports share the same directory. | ||||
can use <literal>@dirrmtry</literal> to remove only empty | Use <literal>@dirrmtry</literal> to remove only empty | ||||
directories without warning.</para> | directories without warning.</para> | ||||
<programlisting>@dirrmtry share/doc/gimp</programlisting> | <programlisting>@dirrmtry share/doc/gimp</programlisting> | ||||
<para>This will neither print any error messages nor cause | <para>This will neither print any error messages nor cause | ||||
<command>pkg delete</command> (see &man.pkg-delete.8;) to | <command>pkg delete</command> (see &man.pkg-delete.8;) to | ||||
exit abnormally even if | exit abnormally even if | ||||
<filename>${PREFIX}/share/doc/gimp</filename> is not empty | <filename>${PREFIX}/share/doc/gimp</filename> is not empty | ||||
due to other ports installing some files in there.</para> | due to other ports installing some files in there.</para> | ||||
</sect2> | </sect2> | ||||
<sect2 xml:id="plist-dir-empty"> | <sect2 xml:id="plist-dir-empty"> | ||||
<title>Creating Empty Directories</title> | <title>Creating Empty Directories</title> | ||||
<para>Empty directories created during port installation need | <para>Empty directories created during port installation need | ||||
special attention. They will not get created when installing | special attention. They will not get created when installing | ||||
the package, because packages only store the files, and both | the package, because packages only store the files, and both | ||||
<command>pkg add</command> and <command>pkg install</command> | <command>pkg add</command> and <command>pkg install</command> | ||||
creates directories for them as needed. To make sure the | creates directories for them as needed. To make sure the | ||||
empty directory is created when installing the package, add | empty directory is created when installing the package, add | ||||
this line to <filename>pkg-plist</filename> above the | this line to <filename>pkg-plist</filename> above the | ||||
corresponding <literal>@dirrm</literal> line:</para> | corresponding <literal>@dirrm</literal> line:</para> | ||||
Not Done Inline Actionss/need to be/must/ wblock: s/need to be/must/ | |||||
Not Done Inline ActionsBreak sentence at "if": "...is created. If they are not created by the port code, create them in the Makefile:" wblock: Break sentence at "if":
"...is created. If they are not created by the port code, create them… | |||||
<programlisting>@exec mkdir -p %D/share/foo/templates</programlisting> | <programlisting>@exec mkdir -p %D/share/foo/templates</programlisting> | ||||
</sect2> | </sect2> | ||||
</sect1> | </sect1> | ||||
<sect1 xml:id="plist-config"> | <sect1 xml:id="plist-config"> | ||||
<title>Configuration Files</title> | <title>Configuration Files</title> | ||||
Not Done Inline Actions"Then" is not needed. wblock: "Then" is not needed. | |||||
<para>If your port installs configuration files to | <para>If the port installs configuration files to | ||||
<filename>PREFIX/etc</filename> (or elsewhere) do | <filename>PREFIX/etc</filename> (or elsewhere) do | ||||
<emphasis>not</emphasis> simply list them in the | <emphasis>not</emphasis> list them in | ||||
<filename>pkg-plist</filename>. That will cause | <filename>pkg-plist</filename>. That will cause | ||||
<command>pkg delete</command> to remove the files carefully | <command>pkg delete</command> to remove the files carefully | ||||
wblockUnsubmitted Not Done Inline Actionss/the files carefully/files that have been carefully/ wblock: s/the files carefully/files that have been carefully/ | |||||
edited by the user, and a re-installation will wipe them | edited by the user, and a re-installation will wipe them | ||||
out.</para> | out.</para> | ||||
<para>Instead, install sample file(s) as | <para>Instead, install sample file(s) as | ||||
<filename><replaceable>filename</replaceable>.sample</filename>, | <filename><replaceable>filename</replaceable>.sample</filename>, | ||||
and for each sample file, add this line to your | and for each sample file, add this line to | ||||
<filename>pkg-plist</filename>.</para> | <filename>pkg-plist</filename>.</para> | ||||
wblockUnsubmitted Not Done Inline ActionsThis is a little vague. @sample does all the work, all the porter has to do is use it. Maybe this is clearer with the sentence split into two: Instead, install sample files with a <filename><replaceable>filename</replaceable>.sample</filename> extension. The <literal>@sample</literal> macro automates this. For each sample file, add a line to <filename>pkg-plist</filename>:</para> Would be nice to explain that if the actual file is not present, the sample file will be wirtten to it. Also, on uninstall, config files that have been edited by the user will not be deleted, or overwritten by the sample file when reinstalled. wblock: This is a little vague. @sample does all the work, all the porter has to do is use it. Maybe… | |||||
<programlisting>@sample etc/orbit.conf.sample</programlisting> | <programlisting>@sample etc/orbit.conf.sample</programlisting> | ||||
<para>If there is a very good reason not to install a working | <para>If there is a very good reason not to install a working | ||||
configuration file by default, only list the sample filename in | configuration file by default, only list the sample filename in | ||||
<filename>pkg-plist</filename>, without the <literal>@sample | <filename>pkg-plist</filename>, without the <literal>@sample | ||||
</literal> part, and add a <link | </literal> part, and add a <link | ||||
linkend="porting-message">message</link> pointing out that the | linkend="porting-message">message</link> pointing out that the | ||||
user must copy and edit the file before the software will | user must copy and edit the file before the software will | ||||
work.</para> | work.</para> | ||||
<tip> | <tip> | ||||
<para>When a port installs its configuration in a subdirectory | <para>When a port installs its configuration in a subdirectory | ||||
of <filename>${PREFIX}/etc</filename>, it should be in | of <filename>${PREFIX}/etc</filename>, use | ||||
<varname>ETCDIR</varname>, which defaults to | <varname>ETCDIR</varname>, which defaults to | ||||
<literal>${PREFIX}/etc/${PORTNAME}</literal>, it can be | <literal>${PREFIX}/etc/${PORTNAME}</literal>, it can be | ||||
overridden in the ports <filename>Makefile</filename> if there | overridden in the ports <filename>Makefile</filename> if there | ||||
is a convention for the port to use some other directory. The | is a convention for the port to use some other directory. The | ||||
<literal>%%ETCDIR%%</literal> macro should be used in its | <literal>%%ETCDIR%%</literal> macro will be used in its | ||||
stead in the <filename>pkg-plist</filename> file.</para> | stead in <filename>pkg-plist</filename>.</para> | ||||
</tip> | </tip> | ||||
<note> | <note> | ||||
<para>The sample configuration files should always have the | <para>The sample configuration files should always have the | ||||
<filename>.sample</filename> suffix. If for some historical | <filename>.sample</filename> suffix. If for some historical | ||||
reason you cannot use the standard suffix, you can still use | reason using the standard suffix is not possible, use | ||||
this construct:</para> | this construct:</para> | ||||
<programlisting>@unexec if cmp -s %D/etc/orbit.conf-dist %D/etc/orbit.conf; then rm -f %D/etc/orbit.conf; fi | <programlisting>@unexec if cmp -s %D/etc/orbit.conf-dist %D/etc/orbit.conf; then rm -f %D/etc/orbit.conf; fi | ||||
etc/orbit.conf-dist | etc/orbit.conf-dist | ||||
@exec if [ ! -f %D/etc/orbit.conf ] ; then cp -p %D/%F %B/orbit.conf; fi</programlisting> | @exec if [ ! -f %D/etc/orbit.conf ] ; then cp -p %D/%F %B/orbit.conf; fi</programlisting> | ||||
<para>The order of these lines is important. On deinstallation, | <para>The order of these lines is important. On deinstallation, | ||||
the sample file is compared to the actual configuration file. | the sample file is compared to the actual configuration file. | ||||
Show All 15 Lines | @exec if [ ! -f %D/etc/orbit.conf ] ; then cp -p %D/%F %B/orbit.conf; fi</programlisting> | ||||
<literal>%D</literal> and related substitution markers.</para> | <literal>%D</literal> and related substitution markers.</para> | ||||
</note> | </note> | ||||
</sect1> | </sect1> | ||||
<sect1 xml:id="plist-dynamic"> | <sect1 xml:id="plist-dynamic"> | ||||
<title>Dynamic Versus Static Package List</title> | <title>Dynamic Versus Static Package List</title> | ||||
<para>A <emphasis>static package list</emphasis> is a package | <para>A <emphasis>static package list</emphasis> is a package | ||||
list which is available in the Ports Collection either as a | list which is available in the Ports Collection either as | ||||
<filename>pkg-plist</filename> file (with or without variable | <filename>pkg-plist</filename> (with or without variable | ||||
substitution), or embedded into the | substitution), or embedded into the | ||||
<filename>Makefile</filename> via | <filename>Makefile</filename> via | ||||
<varname>PLIST_FILES</varname>, <varname>PLIST_DIRS</varname>, | <varname>PLIST_FILES</varname>, <varname>PLIST_DIRS</varname>, | ||||
and <varname>PLIST_DIRSTRY</varname>. Even if the contents are | and <varname>PLIST_DIRSTRY</varname>. Even if the contents are | ||||
auto-generated by a tool or a target in the Makefile | auto-generated by a tool or a target in the Makefile | ||||
<emphasis>before</emphasis> the inclusion into the Ports | <emphasis>before</emphasis> the inclusion into the Ports | ||||
Collection by a committer (e.g., using <command>make | Collection by a committer (for example, using <command>make | ||||
makeplist></command>), this is still considered a static list, | makeplist></command>), this is still considered a static list, | ||||
since it is possible to examine it without having to download or | since it is possible to examine it without having to download or | ||||
compile the distfile.</para> | compile the distfile.</para> | ||||
<para>A <emphasis>dynamic package list</emphasis> is a package | <para>A <emphasis>dynamic package list</emphasis> is a package | ||||
list which is generated at the time the port is compiled based | list which is generated at the time the port is compiled based | ||||
upon the files and directories which are installed. It is not | upon the files and directories which are installed. It is not | ||||
possible to examine it before the source code of the ported | possible to examine it before the source code of the ported | ||||
application is downloaded and compiled, or after running a | application is downloaded and compiled, or after running a | ||||
<literal>make clean</literal>.</para> | <literal>make clean</literal>.</para> | ||||
<para>While the use of dynamic package lists is not forbidden, | <para>While the use of dynamic package lists is not forbidden, | ||||
maintainers should use static package lists wherever possible, | maintainers should use static package lists wherever possible, | ||||
as it enables users to &man.grep.1; through available ports to | as it enables users to &man.grep.1; through available ports to | ||||
discover, for example, which port installs a certain file. | discover, for example, which port installs a certain file. | ||||
Dynamic lists should be primarily used for complex ports where | Dynamic lists should be primarily used for complex ports where | ||||
the package list changes drastically based upon optional | the package list changes drastically based upon optional | ||||
features of the port (and thus maintaining a static package list | features of the port (and thus maintaining a static package list | ||||
is infeasible), or ports which change the package list based | is infeasible), or ports which change the package list based | ||||
upon the version of dependent software used (e.g., ports which | upon the version of dependent software used (for example, ports which | ||||
wblockUnsubmitted Not Done Inline ActionsBreak sentence after "used". wblock: Break sentence after "used". | |||||
generate docs with <application>Javadoc</application>).</para> | generate docs with <application>Javadoc</application>).</para> | ||||
</sect1> | </sect1> | ||||
<sect1 xml:id="plist-autoplist"> | <sect1 xml:id="plist-autoplist"> | ||||
<title>Automated Package List Creation</title> | <title>Automated Package List Creation</title> | ||||
<para>First, make sure the port is almost complete, with only | <para>First, make sure the port is almost complete, with only | ||||
<filename>pkg-plist</filename> missing. Running <command>make | <filename>pkg-plist</filename> missing. Running <command>make | ||||
makeplist</command> will show what should be put in | makeplist</command> will show an example for | ||||
<filename>pkg-plist</filename>. The output of | <filename>pkg-plist</filename>. The output of | ||||
<buildtarget>makeplist</buildtarget> must be double checked for | <buildtarget>makeplist</buildtarget> must be double checked for | ||||
correctness as it tries to automatically guess a few things, and | correctness as it tries to automatically guess a few things, and | ||||
can get it wrong.</para> | can get it wrong.</para> | ||||
<para>User configuration files should be installed as | <para>User configuration files should be installed as | ||||
<filename><replaceable>filename</replaceable>.sample</filename>, | <filename><replaceable>filename</replaceable>.sample</filename>, | ||||
as it is described in <xref linkend="plist-config"/>. The | as it is described in <xref linkend="plist-config"/>. | ||||
<filename>info/dir</filename> file should not be listed and | <filename>info/dir</filename> must not be listed and | ||||
appropriate <filename>install-info</filename> lines should be | appropriate <filename>install-info</filename> lines must be | ||||
added as noted in the <link linkend="makefile-info">info | added as noted in the <link linkend="makefile-info">info | ||||
files</link> section. Any libraries installed by the port | files</link> section. Any libraries installed by the port | ||||
should be listed as specified in the <link | must be listed as specified in the <link | ||||
linkend="porting-shlibs">shared libraries</link> | linkend="porting-shlibs">shared libraries</link> | ||||
section.</para> | section.</para> | ||||
</sect1> | </sect1> | ||||
<sect1 xml:id="plist-keywords"> | <sect1 xml:id="plist-keywords"> | ||||
<title>Expanding Package List with Keywords</title> | <title>Expanding Package List with Keywords</title> | ||||
<!-- Try and keep the keywords alphanumerically sorted --> | <!-- Try and keep the keywords alphanumerically sorted --> | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | <para>Set the internal directory pointer to point to | ||||
this directory.</para> | this directory.</para> | ||||
</sect3> | </sect3> | ||||
<sect3 xml:id="plist-keywords-base-exec"> | <sect3 xml:id="plist-keywords-base-exec"> | ||||
<title><literal>@exec</literal> | <title><literal>@exec</literal> | ||||
<replaceable>command</replaceable></title> | <replaceable>command</replaceable></title> | ||||
<para>Execute <replaceable>command</replaceable> as part of | <para>Execute <replaceable>command</replaceable> as part of | ||||
the unpacking process. If command contains any of the | the unpacking process. If command contains any of these | ||||
following sequences somewhere in it, they are expanded | sequences somewhere in it, they are expanded | ||||
inline. For the following examples, assume that | inline. For these examples, assume that | ||||
<literal>@cwd</literal> is set to <filename | <literal>@cwd</literal> is set to <filename | ||||
class="directory">/usr/local</filename> and the last | class="directory">/usr/local</filename> and the last | ||||
extracted file was <filename>bin/emacs</filename>.</para> | extracted file was <filename>bin/emacs</filename>.</para> | ||||
<variablelist> | <variablelist> | ||||
<varlistentry> | <varlistentry> | ||||
<term><literal>%F</literal></term> | <term><literal>%F</literal></term> | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | <para>This line is ignored when packing.</para> | ||||
<sect3 xml:id="plist-keywords-base-dirrm"> | <sect3 xml:id="plist-keywords-base-dirrm"> | ||||
<title><literal>@dirrm</literal> | <title><literal>@dirrm</literal> | ||||
<replaceable>directory</replaceable></title> | <replaceable>directory</replaceable></title> | ||||
<para>Declare directory name to be deleted at deinstall time. | <para>Declare directory name to be deleted at deinstall time. | ||||
By default, directories created by a package installation | By default, directories created by a package installation | ||||
are not deleted when the package is deinstalled. This | are not deleted when the package is deinstalled. This | ||||
provides an explicit directory cleanup method. These | provides an explicit directory cleanup method. These | ||||
directives should appear at the end of the package list. If | directives must appear at the end of the package list. If | ||||
the directory is not empty a warning is printed, and the | the directory is not empty a warning is printed, and the | ||||
directory is not removed.</para> | directory is not removed.</para> | ||||
</sect3> | </sect3> | ||||
<sect3 xml:id="plist-keywords-base-dirrmtry"> | <sect3 xml:id="plist-keywords-base-dirrmtry"> | ||||
<title><literal>@dirrmtry</literal> | <title><literal>@dirrmtry</literal> | ||||
<replaceable>directory</replaceable></title> | <replaceable>directory</replaceable></title> | ||||
<para>Declare directory name to be removed, as for | <para>Declare directory name to be removed, as for | ||||
<literal>@dirrm</literal>, but does not issue a warning if | <literal>@dirrm</literal>, but does not issue a warning if | ||||
the directory cannot be removed.</para> | the directory cannot be removed.</para> | ||||
</sect3> | </sect3> | ||||
</sect2> | </sect2> | ||||
<sect2 xml:id="plist-keywords-your-own"> | <sect2 xml:id="plist-keywords-creating-new"> | ||||
<title>Creating Your Own Keyword</title> | <title>Creating New Keywords</title> | ||||
<para>Package list files can be extended by keywords that are | <para>Package list files can be extended by keywords that are | ||||
defined in the <filename | defined in the <filename | ||||
class="directory">${PORTSDIR}/Keywords</filename> directory. | class="directory">${PORTSDIR}/Keywords</filename> directory. | ||||
The settings for each keyword lives in a | The settings for each keyword lives in a | ||||
<acronym>YAML</acronym> file named | <acronym>YAML</acronym> file named | ||||
<filename><replaceable>keyword</replaceable>.yaml</filename>. | <filename><replaceable>keyword</replaceable>.yaml</filename>. | ||||
The file must contain at least one of the following | The file must contain at least one of the next | ||||
sections:</para> | sections:</para> | ||||
<variablelist> | <variablelist> | ||||
<varlistentry xml:id="plist-keywords-attributes"> | <varlistentry xml:id="plist-keywords-attributes"> | ||||
<term><literal>attributes</literal></term> | <term><literal>attributes</literal></term> | ||||
<listitem> | <listitem> | ||||
<para>Changes the owner, group, or mode used by the | <para>Changes the owner, group, or mode used by the | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |
"for" can probably be removed without harm.