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