Index: en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
+++ en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
@@ -450,6 +450,48 @@
USES= dos2unix
DOS2UNIX_WRKSRC= ${WRKDIR}
+
+
+ Patching Conditionnally.
+
+ From time to time, a port will need patches that should
+ only be applied for specific &os; versions, or depending
+ whether an option is enabled or not. To apply patches
+ conditionnally, add the full path to their files to
+ EXTRA_PATCHES.
+
+
+ Applying a Patch for a Specific &os; Version.
+
+ .include <bsd.port.options.mk>
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100062
+EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fbsd10
+.endif
+
+.include <bsd.port.mk>
+
+
+
+
+ Optionnaly Applying a Patch.
+
+ When an option
+ requires a patch, use
+ opt_EXTRA_PATCHES
+ and
+ opt_EXTRA_PATCHES_OFF.
+ See for more
+ information.
+
+ OPTIONS_DEFINE= FOO BAR
+FOO_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-foo
+BAR_EXTRA_PATCHES_OFF= ${PATCHDIR}/extra-patch-bar.c \
+ ${PATCHDIR}/extra-patch-bar.h
+
+
+
+