Date: Tue, 9 Sep 2014 15:51:33 +0000 (UTC) From: Mathieu Arnold <mat@FreeBSD.org> To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r45579 - head/en_US.ISO8859-1/books/porters-handbook/pkg-files Message-ID: <201409091551.s89FpXi6036192@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mat (ports committer) Date: Tue Sep 9 15:51:33 2014 New Revision: 45579 URL: http://svnweb.freebsd.org/changeset/doc/45579 Log: igor -Ry and some other rewording and fixes. Differential Revision: https://reviews.freebsd.org/D645 Reviewed by: wblock Sponsored by: Absolight Modified: head/en_US.ISO8859-1/books/porters-handbook/pkg-files/chapter.xml Modified: head/en_US.ISO8859-1/books/porters-handbook/pkg-files/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/pkg-files/chapter.xml Tue Sep 9 15:40:40 2014 (r45578) +++ head/en_US.ISO8859-1/books/porters-handbook/pkg-files/chapter.xml Tue Sep 9 15:51:33 2014 (r45579) @@ -9,7 +9,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="pkg-files"> - <title>The <filename>pkg-*</filename> Files</title> + <title><filename>pkg-*</filename></title> <para>There are some tricks we have not mentioned yet about the <filename>pkg-<replaceable>*</replaceable></filename> files that @@ -18,19 +18,19 @@ <sect1 xml:id="porting-message"> <title><filename>pkg-message</filename></title> - <para>If you need to display a message to the installer, you may + <para>To display a message when the package is installed, place the message in <filename>pkg-message</filename>. This capability is often useful to display additional installation steps to be taken after a <command>pkg install</command> or to display licensing information.</para> <para>When some lines about the build-time knobs or warnings - have to be displayed, use <varname>ECHO_MSG</varname>. The - <filename>pkg-message</filename> file is only for + have to be displayed, use <varname>ECHO_MSG</varname>. + <filename>pkg-message</filename> is only for post-installation steps. Likewise, the distinction between - <varname>ECHO_MSG</varname> and <varname>ECHO_CMD</varname> - should be kept in mind. The former is for printing - informational text to the screen, while the latter is for + <varname>ECHO_MSG</varname> is for printing + informational text to the screen and <varname>ECHO_CMD</varname> + is for command pipelining:</para> <programlisting>update-etc-shells: @@ -41,22 +41,22 @@ @${RM} /etc/shells.bak</programlisting> <note> - <para>The <filename>pkg-message</filename> file does not need - to be added to <filename>pkg-plist</filename>.</para> + <para>Do not add an entry for <filename>pkg-message</filename> + in <filename>pkg-plist</filename>.</para> </note> </sect1> <sect1 xml:id="pkg-install"> <title><filename>pkg-install</filename></title> - <para>If your port needs to execute commands when the binary + <para>If the port needs to execute commands when the binary package is installed with <command>pkg add</command> or - <command>pkg install</command> you can do this via the - <filename>pkg-install</filename> script. This script will - automatically be added to the package, and will be run twice by - <command>pkg</command> the first time as <literal>${SH} + <command>pkg install</command>, use + <filename>pkg-install</filename>. This script will + automatically be added to the package. It will be run twice by + <command>pkg</command>, the first time as <literal>${SH} pkg-install ${PKGNAME} PRE-INSTALL</literal> before the - package is installed and the second time as + package is installed, and the second time as <literal>${SH} pkg-install ${PKGNAME} POST-INSTALL</literal> after it has been installed. <literal>$2</literal> can be tested to determine which @@ -84,21 +84,21 @@ <sect1 xml:id="pkg-names"> <title xml:id="porting-pkgfiles">Changing the Names of - <filename>pkg-<replaceable>*</replaceable></filename> - Files</title> + <filename>pkg-<replaceable>*</replaceable></filename></title> <para>All the names of - <filename>pkg-<replaceable>*</replaceable></filename> files are - defined using variables so you can change them in your - <filename>Makefile</filename> if need be. This is especially - useful when you are sharing the same + <filename>pkg-<replaceable>*</replaceable></filename> are + defined using variables that can be changed in the + <filename>Makefile</filename> if needed. This is especially + useful when sharing the same <filename>pkg-<replaceable>*</replaceable></filename> files - among several ports or have to write to one of the above files - (see <link linkend="porting-wrkdir">writing to places other than + among several ports or when it is necessary to write to one of these files. + See <link linkend="porting-wrkdir">writing to places other than <varname>WRKDIR</varname></link> for why it is a bad idea to - write directly into the + write directly into + the directory containing the <filename>pkg-<replaceable>*</replaceable></filename> - subdirectory).</para> + files.</para> <para>Here is a list of variable names and their default values. (<varname>PKGDIR</varname> defaults to @@ -147,13 +147,13 @@ <title>Making Use of <varname>SUB_FILES</varname> and <varname>SUB_LIST</varname></title> - <para>The <varname>SUB_FILES</varname> and - <varname>SUB_LIST</varname> variables are useful for dynamic + <para><varname>SUB_FILES</varname> and + <varname>SUB_LIST</varname> are useful for dynamic values in port files, such as the installation <varname>PREFIX</varname> in <filename>pkg-message</filename>.</para> - <para>The <varname>SUB_FILES</varname> variable specifies a list + <para><varname>SUB_FILES</varname> specifies a list of files to be automatically modified. Each <filename><replaceable>file</replaceable></filename> in the <varname>SUB_FILES</varname> list must have a corresponding @@ -163,16 +163,16 @@ <filename>${WRKDIR}/<replaceable>file</replaceable></filename>. Files defined as a value of <varname>USE_RC_SUBR</varname> (or the deprecated <varname>USE_RCORDER</varname>) are automatically - added to the <varname>SUB_FILES</varname>. For the files + added to <varname>SUB_FILES</varname>. For the files <filename>pkg-message</filename>, <filename>pkg-install</filename>, and <filename>pkg-deinstall</filename>, the corresponding Makefile variable is automatically set to point to the processed version.</para> - <para>The <varname>SUB_LIST</varname> variable is a list of - <literal>VAR=VALUE</literal> pairs. For each pair - <literal>%%VAR%%</literal> will get replaced with + <para><varname>SUB_LIST</varname> is a list of + <literal>VAR=VALUE</literal> pairs. For each pair, + <literal>%%VAR%%</literal> will be replaced with <literal>VALUE</literal> in each file listed in <varname>SUB_FILES</varname>. Several common pairs are automatically defined: <varname>PREFIX</varname>, @@ -182,15 +182,15 @@ line beginning with <literal>@comment </literal> will be deleted from resulting files after a variable substitution.</para> - <para>The following example will replace + <para>This example replaces <literal>%%ARCH%%</literal> with the system architecture in a <filename>pkg-message</filename>:</para> <programlisting>SUB_FILES= pkg-message SUB_LIST= ARCH=${ARCH}</programlisting> - <para>Note that for this example, the - <filename>pkg-message.in</filename> file must exist in + <para>Note that for this example, + <filename>pkg-message.in</filename> must exist in <varname>FILESDIR</varname>.</para> <para>Example of a good
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409091551.s89FpXi6036192>