diff --git a/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml b/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
index a0e94950de..effafd103b 100644
--- a/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
+++ b/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
@@ -56,6 +56,14 @@
You should set PORTNAME to the base
name of your port, and PORTVERSION to the
version number of the port.
+
+
+ Package name should be unique among all of the ports
+ tree, check that there is not already a port with the same
+ PORTNAME and if there is add one of PKGNAMEPREFIX
+ or PKGNAMESUFFIX.
+
@@ -302,7 +310,7 @@ PORTEPOCH= 1
-
+ PKGNAMEPREFIX and
PKGNAMESUFFIX
@@ -439,6 +447,14 @@ PORTEPOCH= 1
+
+ Package name should be unique among all of the ports
+ tree, check that there is not already a port with the same
+ PORTNAME and if there is add one of PKGNAMEPREFIX
+ or PKGNAMESUFFIX.
+
+
Here are some (real) examples on how to convert the name
as called by the software authors to a suitable package
name:
@@ -1470,7 +1486,9 @@ PORTEPOCH= 1
DISTNAME is the name of the port as
called by the authors of the software.
DISTNAME defaults to
- ${PORTNAME}-${PORTVERSION}, so override it
+ ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX},
+ and DISTVERSION defaults to
+ ${PORTVERSION} so override it
only if necessary. DISTNAME is only used
in two places. First, the distribution file list
(DISTFILES) defaults to
@@ -1483,9 +1501,25 @@ PORTEPOCH= 1
${PORTNAME}-${PORTVERSION}-scheme can be
handled automatically by setting
DISTVERSION.
- PORTVERSION and DISTNAME
- will be derived automatically, but can of course be
- overridden. The following table lists some examples:
+ PORTVERSION will be derived from it
+ automatically.
+
+
+ Only one of PORTVERSION and
+ DISTVERSION can be set at a time. If you
+ set DISTVERSION and the derived
+ PORTVERSION is not right, do not use
+ DISTVERSION, set
+ PORTVERSION to the right value and set
+ DISTNAME with PORTNAME
+ with either some computation of
+ PORTVERSION or the verbatim upstream
+ version.
+
+
+ The following table lists some examples of
+ DISTVERSION and the derived
+ PORTVERSION:
@@ -1525,7 +1559,7 @@ PORTEPOCH= 1
PKGNAMESUFFIX do not affect
DISTNAME. Also note that if
WRKSRC is equal to
- work/${PORTNAME}-${PORTVERSION} while
+ work/${DISTNAME} while
the original source archive is named something other than
${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX},
you should probably leave DISTNAME
@@ -1558,22 +1592,20 @@ PORTEPOCH= 1
If the original tarball is part of one of the popular
archives such as SourceForge, GNU, or Perl CPAN, you may be
able refer to those sites in an easy compact form using
- MASTER_SITE_*
- (e.g., MASTER_SITE_SOURCEFORGE,
- MASTER_SITE_GNU and
- MASTER_SITE_PERL_CPAN). Simply set
- MASTER_SITES to one of these variables and
- MASTER_SITE_SUBDIR to the path within the
- archive. Here is an example:
+ predefined macros (e.g., SF,
+ GNU or CPAN). Simply
+ set MASTER_SITES to one of these values.
+ Here is an example:
+
+ MASTER_SITES= GNU/make
+
+ Or you can use the older expanded format, though there
+ really are no reason to do so:MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= make
- Or you can use a condensed format:
-
- MASTER_SITES= GNU/make
-
- These variables are defined in
+ These values and variables are defined in
/usr/ports/Mk/bsd.sites.mk. There are
new entries added all the time, so make sure to check the
latest version of this file before submitting a port.
@@ -1633,6 +1665,16 @@ MASTER_SITE_SUBDIR= stardict/WyabdcRealPeopleTTS/${PORTVERSION}
/pub/gcc/releases/${DISTNAME}
+
+ GH
+ /${GH_ACCOUNT}/${GH_PROJECT}/legacy.tar.gz/${GH_TAGNAME}?dummy=/
+
+
+
+ GHC
+ /downloads/${GH_ACCOUNT}/${GH_PROJECT}/
+
+
GNOME/pub/GNOME/sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
@@ -1643,13 +1685,28 @@ MASTER_SITE_SUBDIR= stardict/WyabdcRealPeopleTTS/${PORTVERSION}
/gnu/${PORTNAME}
+
+ HORDE
+ /pub/${PORTNAME}
+
+
+
+ LOGILAB
+ /pub/${PORTNAME}
+
+
+
+ MATE
+ /releases/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
+
+
MOZDEV/pub/mozdev/${PORTNAME:L}
- PERL_CPAN
+ CPAN/pub/CPAN/modules/by-module/${PORTNAME:C/-.*//}
@@ -1764,7 +1821,8 @@ EXTRACT_ONLY= source.tar.gz
Do not worry if the patches are compressed; they will be
decompressed automatically if the filenames end with
- .gz or .Z.
+ .Z, .gz,
+ .bz2 or .xz.If the patch is distributed with some other files, such as
documentation, in a gzipped tarball, you
@@ -3088,11 +3146,7 @@ LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar
OPTIONS_DEFINE= BAR
BAR_DESC= Bar support
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MBAR}
-LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar
-.endif
+BAR_LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar
Testing option variables is the correct method. It will
@@ -3462,17 +3516,8 @@ BAR_DESC= Support feature bar
OPTIONS_DEFAULT=FOO
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MFOO}
-CONFIGURE_ARGS+=--with-foo
-.else
-CONFIGURE_ARGS+=--without-foo
-.endif
-
-.if ${PORT_OPTIONS:MBAR}
-RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar
-.endif
+FOO_CONFIGURE_WITH= foo
+BAR_RUN_DEPENDS= bar:${PORTSDIR}/bar/bar
.include <bsd.port.mk>
@@ -3484,6 +3529,11 @@ RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar
.if ! ${PORT_OPTIONS:MEXAMPLES}
CONFIGURE_ARGS+=--without-examples
.endif
+
+ Though, you should use the following so that the
+ configure knob is really enabled and disabled when the
+ option is.
+ EXAMPLES_CONFIGURE_WITH= examples
@@ -3507,22 +3557,12 @@ SSL_DESC= Build with OpenSSL support
OPTIONS_DEFAULT= PGSQL LDAP SSL
-.include <bsd.port.options.mk>
+PGSQL_USE= pgsql=yes
+PGSQL_CONFIGURE_WITH= postgres
-.if ${PORT_OPTIONS:MPGSQL}
-USE_PGSQL= yes
-CONFIGURE_ARGS+= --with-postgres
-.else
-CONFIGURE_ARGS+= --without-postgres
-.endif
+ICU_LIB_DEPENDS= libicuuc.so:${PORTSDIR}/devel/icu
-.if ${PORT_OPTIONS:MICU}
-LIB_DEPENDS+= libicuuc.so:${PORTSDIR}/devel/icu
-.endif
-
-.if ! ${PORT_OPTIONS:MEXAMPLES}
-CONFIGURE_ARGS+= --without-examples
-.endif
+EXAMPLES_CONFIGURE_WITH= examples
# Check other OPTIONS
@@ -3559,9 +3599,9 @@ CONFIGURE_ARGS+= --without-examples
There is no need to add these to
- OPTIONS_DEFAULT. To have them show up
- in the options selection dialog, however, they must be
- added to OPTIONS_DEFINE.
+ OPTIONS_DEFAULT. To have them active,
+ and show up in the options selection dialog, however, they
+ must be added to OPTIONS_DEFINE.
@@ -3598,12 +3638,8 @@ CONFIGURE_ARGS+= --enable-foo
Correct Handling of an Option
- .if ${PORT_OPTIONS:MFOO}
-LIB_DEPENDS+= libfoo.so:${PORTSDIR}/devel/foo
-CONFIGURE_ARGS+= --enable-foo
-.else
-CONFIGURE_ARGS+= --disable-foo
-.endif
+ FOO_LIB_DEPENDS= libfoo.so:${PORTSDIR}/devel/foo
+FOO_CONFIGURE_ENABLE= fooIn the second example, the library libfoo is explicitly