diff --git a/en_US.ISO8859-1/books/porters-handbook/book.sgml b/en_US.ISO8859-1/books/porters-handbook/book.sgml index 230d1a4c29..2effe2eae6 100644 --- a/en_US.ISO8859-1/books/porters-handbook/book.sgml +++ b/en_US.ISO8859-1/books/porters-handbook/book.sgml @@ -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