Index: head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
===================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
+++ head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
@@ -72,23 +72,67 @@
post-install target. Avoid using
absolute paths whenever possible.
- When creating a symlink, STAGEDIR
- is prepended to the target path only. For
- example:
+
+ Ports that install kernel modules must prepend
+ STAGEDIR to their destination, by default
+ /boot/modules.
+
- ${LN} -sf libfoo.so.42 ${STAGEDIR}${PREFIX}/lib/libfoo.so
+
+ Handling Symbolic Links
- The source path
- ${PREFIX}/lib/libfoo.so.42
- looks fine but could, in fact, be incorrect. Absolute paths can
- point to a wrong location, like when a remote file system has
- been mounted with NFS under a non-root mount
- point. Relative paths are less fragile, and often much
- shorter.
+ When creating a symlink, there are two cases, either the
+ source and target are both within
+ ${PREFIX}. In that case, use
+ ${RLN}. In the other case, if one or both
+ of the paths are outside of ${PREFIX}
+ use ${LN} -s and only prepend
+ ${STAGEDIR} to the target's path.
- Ports that install kernel modules must prepend
- STAGEDIR to their destination, by default
- /boot/modules.
+
+ Inside ${PREFIX}, Create Relative
+ Symbolic Links
+
+ ${RLN} uses &man.install.1;'s
+ relative symbolic feature which frees the porter of
+ computing the relative path.
+
+ ${RLN} ${STAGEDIR}${PREFIX}/lib/libfoo.so.42 ${STAGEDIR}${PREFIX}/lib/libfoo.so
+
+ Will generate:
+
+ &prompt.user; ls -lF ${STAGEDIR}${PREFIX}/lib
+ lrwxr-xr-x 1 nobody nobody 181 Aug 3 11:27 libfoo.so@ -> libfoo.so.42
+ -rwxr-xr-x 1 nobody nobody 15 Aug 3 11:24 libfoo.so.42*
+
+ When used with paths not in the same directory:
+
+ ${RLN} ${STAGEDIR}${PREFIX}/libexec/foo/bar ${STAGEDIR}${PREFIX}/bin/bar
+
+ Will automatically generate the relative symbolic
+ links:
+
+ &prompt.user; ls -lF ${STAGEDIR}${PREFIX}/bin
+ lrwxr-xr-x 1 nobody nobody 181 Aug 3 11:27 bar@ -> ../libexec/foo/bar
+
+
+
+ Outside ${PREFIX}, Create Absolute
+ Symbolic Links
+
+ When creating a symbolic link outside of
+ ${PREFIX}, the source must not contain
+ ${STAGEDIR}, the target, however,
+ must:
+
+ ${LN} -sf /var/cache/${PORTNAME} ${STAGEDIR}${PREFIX}/share/${PORTNAME}
+
+ Will generate:
+
+ &prompt.user; ls -lF ${STAGEDIRDIR}${PREFIX}/share
+ lrwxr-xr-x 1 nobody nobody 181 Aug 3 11:27 foo@ -> /var/cache/foo
+
+