- Add a PLIST_SUB @comment example to the pkg-plist section
This commit is contained in:
parent
e3b5c08faf
commit
fa4d62c51e
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=35085
1 changed files with 19 additions and 0 deletions
|
@ -8590,6 +8590,25 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}</programlisting>
|
|||
you will not have to change dozens (or in some cases, hundreds) of
|
||||
lines in the <filename>pkg-plist</filename>.</para>
|
||||
|
||||
<para>If your port installs files conditionally on the options
|
||||
set in the port, the usual way of handling it is prefixing
|
||||
the <filename>pkg-plist</filename> lines with
|
||||
a <literal>%%TAG%%</literal> and adding that <literal>TAG</literal>
|
||||
to the <makevar>PLIST_SUB</makevar> variable inside the
|
||||
<filename>Makefile</filename> with a special value of
|
||||
<literal>@comment</literal>, which makes package tools to ignore the
|
||||
line:</para>
|
||||
|
||||
<programlisting>.if defined(WITH_X11)
|
||||
PLIST_SUB+= X11=""
|
||||
.else
|
||||
PLIST_SUB+= X11="@comment "
|
||||
.endif</programlisting>
|
||||
|
||||
<para>and in the <filename>pkg-plist</filename>:</para>
|
||||
|
||||
<programlisting>%%X11%%bin/foo-gui</programlisting>
|
||||
|
||||
<para>This substitution (as well as addition of any <link
|
||||
linkend="makefile-manpages">manual pages</link>) will be done between
|
||||
the <maketarget>pre-install</maketarget> and
|
||||
|
|
Loading…
Reference in a new issue