- Document new COPYTREE_* macros

This commit is contained in:
Pav Lucistnik 2007-03-24 15:22:55 +00:00
parent f9d03c5643
commit ae14aa14bb
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=29861

View file

@ -4067,6 +4067,46 @@ PORTVERSION= 1.0</programlisting>
will instead exit cleanly.</para>
</sect2>
<sect2 id="install-copytree">
<title>Installing a whole tree of files</title>
<para>Sometimes, there is a need to install a big number of files,
preserving their hierarchical organization, ie. copying over a whole
directory tree from <makevar>WRKSRC</makevar> to a target directory
under <makevar>PREFIX</makevar>.</para>
<para>Two macros exists for this situation. The advantage of using
these macros instead of <command>cp</command> is that they guarantee
proper file ownership and permissions on target files. First macro,
<makevar>COPYTREE_BIN</makevar>, will set all the installed files to
be executable, thus being suitable for installing into
<filename><makevar>PREFIX</makevar>/bin</filename>. The second
macro, <makevar>COPYTREE_SHARE</makevar>, does not set executable
permissions on files, and is therefore suitable for installing files
under <filename><makevar>PREFIX</makevar>/share</filename>
target.</para>
<programlisting>post-install:
${MKDIR} ${EXAMPLESDIR}
(cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} \* ${EXAMPLESDIR})</programlisting>
<para>This example will install the contents of
<filename>examples</filename> directory in the vendor distfile to the
proper examples location of your port.</para>
<programlisting>post-install:
${MKDIR} ${DATADIR}/summer
(cd ${WRKSRC}/temperatures/ && ${COPYTREE_SHARE} "June July August" ${DATADIR}/summer/)</programlisting>
<para>And this example will install the data of summer months to the
<filename>summer</filename> subdirectory of a
<filename><makevar>DATADIR</makevar></filename>.</para>
<para>Note that these macros does not add the installed files to
<filename>pkg-plist</filename>. You still need to list them.</para>
</sect2>
<sect2 id="install-documentation">
<title>Install additional documentation</title>