diff --git a/en_US.ISO8859-1/books/porters-handbook/book.sgml b/en_US.ISO8859-1/books/porters-handbook/book.sgml
index 7224769b64..a21586c11d 100644
--- a/en_US.ISO8859-1/books/porters-handbook/book.sgml
+++ b/en_US.ISO8859-1/books/porters-handbook/book.sgml
@@ -1,9657 +1,9657 @@
 <!--
      The FreeBSD Documentation Project
 
      $FreeBSD$
 -->
 
 <!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
 <!ENTITY % books.ent PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Books Entity Set//EN">
 %books.ent;
 ]>
 
 <book>
   <bookinfo>
     <title>FreeBSD Porter's Handbook</title>
 
     <authorgroup>
       <corpauthor>The FreeBSD Documentation Project</corpauthor>
     </authorgroup>
 
     <pubdate>April 2000</pubdate>
 
     <copyright>
       <year>2000</year>
       <year>2001</year>
       <year>2002</year>
       <year>2003</year>
       <year>2004</year>
       <year>2005</year>
       <holder role="mailto:doc@FreeBSD.org">The FreeBSD Documentation
 	Project</holder>
     </copyright>
 
     &bookinfo.trademarks;
 
     &bookinfo.legalnotice;
   </bookinfo>
 
     <chapter id="why-port">
       <title>Introduction</title>
 
       <para>The FreeBSD ports collection is the way almost everyone
 	installs applications ("ports") on FreeBSD.  Like everything
 	else about FreeBSD, it is primarily a volunteer effort.
 	It is important to keep this in mind when reading this
 	document.</para>
 
       <para>In FreeBSD, anyone may submit a new port, or volunteer
 	to maintain an existing port if it is unmaintained&mdash;you
 	do not need any special commit privileges to do so.</para>
 
     </chapter>
 
     <chapter id="own-port">
       <title>Making a port yourself</title>
 
       <para>So, you are interested in making your own port or
 	upgrading an existing one?  Great!</para>
 
       <para>What follows are some guidelines for creating a new port for
 	FreeBSD.  If you want to upgrade an existing port, you should
 	read this and then read <xref linkend="port-upgrading">.</para>
 
       <para>When this document is not sufficiently detailed, you should
 	refer to <filename>/usr/ports/Mk/bsd.port.mk</filename>, which
 	all port Makefiles include.  Even if you do not hack Makefiles
 	daily, it is well commented, and you will still gain much
 	knowledge from it.  Additionally, you may send specific questions
 	to the &a.ports;.</para>
 
       <note>
 	<para>Only a fraction of the variables
 	  (<makevar><replaceable>VAR</replaceable></makevar>) that can be
 	  overridden are mentioned in this document.  Most (if not all)
 	  are documented at the start of <filename>/usr/ports/Mk/bsd.port.mk</filename>;
 	  the others probably ought to be.
 	  Note that this file uses a non-standard tab setting:
 	  <application>Emacs</application> and
 	  <application>Vim</application> should recognize the setting on
 	  loading the file.  Both &man.vi.1; and
 	  &man.ex.1; can be set to use the correct value by
 	  typing <command>:set tabstop=4</command> once the file has been
 	  loaded.</para>
       </note>
     </chapter>
 
     <chapter id="quick-porting">
       <title>Quick Porting</title>
 
       <para>This section tells you how to do a quick port.  In many cases, it
 	is not sufficient, so you will have to read further on into
 	the document.</para>
 
       <para>First, get the original tarball and put it into
 	<makevar>DISTDIR</makevar>, which defaults to
 	<filename>/usr/ports/distfiles</filename>.</para>
 
       <note>
 	<para>The following assumes that the software compiled out-of-the-box,
 	  i.e., there was absolutely no change required for the port to work
 	  on your FreeBSD box.  If you needed to change something, you will
 	  have to refer to the next section too.</para>
       </note>
 
       <sect1 id="porting-makefile">
 	<title>Writing the <filename>Makefile</filename></title>
 
 	<para>The minimal <filename>Makefile</filename> would look something
 	  like this:</para>
 
 	<programlisting># New ports collection makefile for:   oneko
 # Date created:        5 December 1994
 # Whom:                asami
 #
 # &dollar;FreeBSD&dollar;
 #
 
 PORTNAME=      oneko
 PORTVERSION=   1.1b
 CATEGORIES=    games
 MASTER_SITES=  ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/
 
 MAINTAINER=    asami@FreeBSD.org
 COMMENT=       A cat chasing a mouse all over the screen
 
 MAN1=          oneko.1
 MANCOMPRESSED= yes
 USE_IMAKE=     yes
 
 .include &lt;bsd.port.mk&gt;</programlisting>
 
 	<para>See if you can figure it out.  Do not worry about the contents
 	  of the <literal>&dollar;FreeBSD&dollar;</literal> line, it will be
 	  filled in automatically by CVS when the port is imported to our main
 	  ports tree.  You can find a more detailed example in the <link
 	    linkend="porting-samplem">sample Makefile</link> section.</para>
       </sect1>
 
       <sect1 id="porting-desc">
 	<title>Writing the description files</title>
 
 	<para>There are two description files that are required for
 	  any port, whether they actually package or not. They are
 	  <filename>pkg-descr</filename> and
 	  <filename>pkg-plist</filename>.  Their
 	  <filename>pkg-</filename> prefix distinguishes them from
 	  other files.</para>
 
 	<sect2>
 	  <title><filename>pkg-descr</filename></title>
 
 	  <para>This is a longer description of the port.  One to a few
 	    paragraphs concisely explaining what the port does is
 	    sufficient.</para>
 
 	  <note>
 	    <para>This is <emphasis>not</emphasis> a manual or an in-depth
 	      description on how to use or compile the port! <emphasis>Please
 	      be careful if you are copying from the
 	      <filename>README</filename> or manpage</emphasis>; too often
 	      they are not a concise description of the port or are in an
 	      awkward format (e.g., manpages have justified spacing).  If the
 	      ported software has an official WWW homepage, you should list it
 	      here.  Prefix <emphasis>one</emphasis> of the websites with
 	      <literal>WWW:</literal> so that automated tools will work
 	      correctly.</para>
 	  </note>
 
 	  <para>It is recommended that you sign your name at the end of this
 	    file, as in:</para>
 
 	  <programlisting>This is a port of oneko, in which a cat chases a poor mouse all over
 the screen.
  :
 (etc.)
 
 WWW: http://www.oneko.org/
 
 - Satoshi
 asami@cs.berkeley.edu</programlisting>
 	</sect2>
 
 	<sect2>
 	  <title><filename>pkg-plist</filename></title>
 
 	  <para>This file lists all the files installed by the port.  It is
 	    also called the <quote>packing list</quote> because the package is
 	    generated by packing the files listed here.  The pathnames are
 	    relative to the installation prefix (usually
 	    <filename>/usr/local</filename> or
 	    <filename>/usr/X11R6</filename>).  If you are using the
 	    <makevar>MAN<replaceable>n</replaceable></makevar> variables (as
 	    you should be), do not list any manpages here.  If the port creates
 	    directories during installation, make sure to add
 	    <literal>@dirrm</literal> lines to remove them when the package is
 	    deleted.</para>
 
 	  <para>Here is a small example:</para>
 
 	  <programlisting>bin/oneko
 lib/X11/app-defaults/Oneko
 lib/X11/oneko/cat1.xpm
 lib/X11/oneko/cat2.xpm
 lib/X11/oneko/mouse.xpm
 @dirrm lib/X11/oneko</programlisting>
 
 	  <para>Refer to the &man.pkg.create.1; manual page for details on the
 	    packing list.</para>
 
 	  <note>
 	    <para>It is recommended that you keep all the filenames in this
 	      file sorted alphabetically.  It will make verifying the changes
 	      when you upgrade the port much easier.</para>
 	  </note>
 
 	  <note>
 	    <para>Creating a packing list manually can be a very tedious
 	      task.  If the port installs a large numbers of files, <link
 		linkend="plist-autoplist">creating the packing list
 		automatically</link> might save time.</para>
 	  </note>
 
 	  <para>There is only one case when <filename>pkg-plist</filename>
 	    can be omitted from a port.  If the port installs just a handful
 	    of files, and perhaps directories, the files and directories may
 	    be listed in the variables <makevar>PLIST_FILES</makevar> and
 	    <makevar>PLIST_DIRS</makevar>, respectively, within the port's
 	    <filename>Makefile</filename>.  For instance, we could get along
 	    without <filename>pkg-plist</filename> in the above
 	    <filename>oneko</filename> port by adding the
 	    following lines to the <filename>Makefile</filename>:</para>
 
 	  <programlisting>PLIST_FILES=    bin/oneko \
                 lib/X11/app-defaults/Oneko \
                 lib/X11/oneko/cat1.xpm \
                 lib/X11/oneko/cat2.xpm \
                 lib/X11/oneko/mouse.xpm
 PLIST_DIRS=     lib/X11/oneko</programlisting>
 
 	  <para>Of course, <makevar>PLIST_DIRS</makevar> should be left
 	    unset if a port installs no directories of its own.</para>
 
 	  <para>The price for this way of listing port's files and
 	    directories is that you cannot use command sequences
 	    described in &man.pkg.create.1;.  Therefore, it is suitable
 	    only for simple ports and makes them even simpler.  At the
 	    same time, it has the advantage of reducing the number of files
 	    in the ports collection.  Please consider using this technique
 	    before you resort to <filename>pkg-plist</filename>.</para>
 
 	  <para>Later we will see how <filename>pkg-plist</filename>
 	    and <makevar>PLIST_FILES</makevar> can be used to fulfil
 	    <link linkend="plist">more sophisticated
 	    tasks</link>.</para>
 	</sect2>
       </sect1>
 
       <sect1 id="porting-checksum">
 	<title>Creating the checksum file</title>
 
 	<para>Just type <command>make makesum</command>. The ports make rules
 	  will automatically generate the file
 	  <filename>distinfo</filename>.</para>
 
 	<para>If a file fetched has its checksum changed regularly and you are
 	  certain the source is trusted (i.e. it comes from manufacturer CDs
 	  or documentation generated daily), you should specify these files in
 	  the <makevar>IGNOREFILES</makevar> variable.
 	  Then the checksum is not calculated for that file when you run
 	  <command>make makesum</command>, but set to
 	  <literal>IGNORE</literal>.</para>
       </sect1>
 
       <sect1 id="porting-testing">
 	<title>Testing the port</title>
 
 	<para>You should make sure that the port rules do exactly what you
 	  want them to do, including packaging up the port.  These are the
 	  important points you need to verify.</para>
 
 	<itemizedlist>
 	  <listitem>
 	    <para><filename>pkg-plist</filename> does not contain anything not
 	      installed by your port</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><filename>pkg-plist</filename> contains everything that is
 	      installed by your port</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>Your port can be installed multiple times using the
 	      <maketarget>reinstall</maketarget> target</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>Your port <link linkend="plist-cleaning">cleans up</link>
 	      after itself upon deinstall</para>
 	  </listitem>
 	</itemizedlist>
 
 	<procedure>
 	  <title>Recommended test ordering</title>
 
 	  <step>
 	    <para><command>make install</command></para>
 	  </step>
 
 	  <step>
 	    <para><command>make package</command></para>
 	  </step>
 
 	  <step>
 	    <para><command>make deinstall</command></para>
 	  </step>
 
 	  <step>
 	    <para><command>pkg_add <replaceable>package-name</replaceable>
 	      </command></para>
 	  </step>
 
 	  <step>
 	    <para><command>make deinstall</command></para>
 	  </step>
 
 	  <step>
 	    <para><command>make reinstall</command></para>
 	  </step>
 
 	  <step>
 	    <para><command>make package</command></para>
 	  </step>
 	</procedure>
 
 	<para>Make sure that there are not any warnings issued in any of the
 	  <maketarget>package</maketarget> and
 	  <maketarget>deinstall</maketarget> stages.  After step 3, check to
 	  see if all the new directories are correctly deleted.  Also, try
 	  using the software after step 4, to ensure that it works correctly
 	  when installed from a package.</para>
       </sect1>
 
       <sect1 id="porting-portlint">
 	<title>Checking your port with <command>portlint</command></title>
 
 	<para>Please use <command>portlint</command> to see if your port
-	  conforms to our guidelines.  The <command>portlint</command> program
-	  is part of the ports collection.  In particular, you may want to
-	  check if the <link linkend="porting-samplem">Makefile</link> is in
-	  the right shape and the <link
-	    linkend="porting-pkgname">package</link> is named
+	  conforms to our guidelines.  The <filename role="package">
+	  devel/portlint</filename> program is part of the ports collection.
+	  In particular, you may want to check if the
+	  <link linkend="porting-samplem">Makefile</link> is in the right
+	  shape and the <link linkend="porting-pkgname">package</link> is named
 	  appropriately.</para>
       </sect1>
 
       <sect1 id="porting-submitting">
 	<title>Submitting the port</title>
 
 	<para>First, make sure you have read the <link
 	    linkend="porting-dads">DOs and DON'Ts</link> section.</para>
 
 	<para>Now that you are happy with your port, the only thing remaining
 	  is to put it in the main FreeBSD ports tree and make everybody else
 	  happy about it too.  We do not need your <filename>work</filename>
 	  directory or the <filename>pkgname.tgz</filename> package, so delete
 	  them now.  Next, simply include the output of <command>shar `find
 	    port_dir`</command> in a bug report and send it with the
 	    &man.send-pr.1; program (see <ulink url="&url.articles.contributing;/contrib-how.html#CONTRIB-GENERAL">Bug
 	    Reports and General Commentary</ulink> for more information about
 	    &man.send-pr.1;).  Be sure to classify the bug report as category
 	  <literal>ports</literal> and class
 	  <literal>change-request</literal>  (Do not mark the report
 	  <literal>confidential</literal>!).
 	  Also add a short description of the program you ported
 	  to the <quote>Description</quote> field of the PR and
 	  the shar to the <quote>Fix</quote> field.</para>
 
 	<note>
 	  <para>You can make our work a lot easier, if you use a good
 	    description in the synopsis of the problem report.
 	    We prefer something like
 	    <quote>New port: &lt;category&gt;/&lt;portname&gt;
 	    &lt;short description of the port&gt;</quote> for new ports and
 	    <quote>Update port: &lt;category&gt;/&lt;portname&gt;
 	    &lt;short description of the update&gt;</quote> for port updates.
 	    If you stick to this scheme, the chance that someone will take a
 	    look at your PR soon is much better.</para>
 	</note>
 
 	<para>One more time, <emphasis>do not include the original source
 	    distfile, the <filename>work</filename> directory, or the package
 	    you built with <command>make package</command></emphasis>.</para>
 
 	<para>After you have submitted your port, please be patient.
 	  Sometimes it can take a few months before a port is included
 	  in FreeBSD, although it might only take a few days.  You can
 	  view the list of <ulink
 	  url="http://www.FreeBSD.org/cgi/query-pr-summary.cgi?category=ports">ports
 	  waiting to be committed to FreeBSD</ulink>.</para>
 
 	<para>Once we have looked at your port, we will get back to you if necessary, and put
 	  it in the tree.  Your name will also appear in the list of
 	  <ulink url="&url.articles.contributors;/contrib-additional.html">Additional FreeBSD Contributors</ulink>
 	  and other files. Isn't that great?!? <!-- smiley
 	  -->:-)</para>
       </sect1>
     </chapter>
 
     <chapter id="slow">
       <title>Slow Porting</title>
 
       <para>Ok, so it was not that simple, and the port required some
 	modifications to get it to work.  In this section, we will explain,
 	step by step, how to modify it to get it to work with the ports
 	paradigm.</para>
 
       <sect1 id="slow-work">
 	<title>How things work</title>
 
 	<para>First, this is the sequence of events which occurs when the user
 	  first types <command>make</command> in your port's directory.
 	  You may find that having <filename>bsd.port.mk</filename> in another
 	  window while you read this really helps to understand it.</para>
 
 	<para>But do not worry if you do not really understand what
 	  <filename>bsd.port.mk</filename> is doing, not many people do...
 	  <!-- smiley --><emphasis>:-&gt;</emphasis></para>
 
 	<procedure>
 
 	  <step>
 	    <para>The <maketarget>fetch</maketarget> target is run.  The
 	      <maketarget>fetch</maketarget> target is responsible for making
 	      sure that the tarball exists locally in
 	      <makevar>DISTDIR</makevar>. If <maketarget>fetch</maketarget>
 	      cannot find the required files in <makevar>DISTDIR</makevar> it
 	      will look up the URL <makevar>MASTER_SITES</makevar>, which is
 	      set in the Makefile, as well as our main FTP site at <ulink
 		url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/"></ulink>,
 	      where we put sanctioned distfiles as backup.  It will then
 	      attempt to fetch the named distribution file with
 	      <makevar>FETCH</makevar>, assuming that the requesting site has
 	      direct access to the Internet.  If that succeeds, it will save
 	      the file in <makevar>DISTDIR</makevar> for future use and
 	      proceed.</para>
 	  </step>
 
 	  <step>
 	    <para>The <maketarget>extract</maketarget> target is run.  It
 	      looks for your port's distribution file (typically a gzip'd
 	      tarball) in <makevar>DISTDIR</makevar> and unpacks it into a
 	      temporary subdirectory specified by <makevar>WRKDIR</makevar>
 	      (defaults to <filename>work</filename>).</para>
 	  </step>
 
 	  <step>
 	    <para>The <maketarget>patch</maketarget> target is run.  First,
 	      any patches defined in <makevar>PATCHFILES</makevar> are
 	      applied.  Second, if any patch files named
 	      <filename>patch-<replaceable>*</replaceable></filename> are found in
 	      <makevar>PATCHDIR</makevar> (defaults to the
 	      <filename>files</filename> subdirectory), they are applied at
 	      this time in alphabetical order.</para>
 	  </step>
 
 	  <step>
 	    <para>The <maketarget>configure</maketarget> target is run.  This
 	      can do any one of many different things.</para>
 
 	    <orderedlist>
 	      <listitem>
 		<para>If it exists, <filename>scripts/configure</filename> is
 		  run.</para>
 	      </listitem>
 
 	      <listitem>
 		<para>If <makevar>HAS_CONFIGURE</makevar> or
 		  <makevar>GNU_CONFIGURE</makevar> is set,
 		  <filename><makevar>WRKSRC</makevar>/configure</filename> is
 		  run.</para>
 	      </listitem>
 
 	      <listitem>
 		<para>If <makevar>USE_IMAKE</makevar> is set,
 		  <makevar>XMKMF</makevar> (default: <command>xmkmf
 		    -a</command>) is run.</para>
 	      </listitem>
 	    </orderedlist>
 	  </step>
 
 	  <step>
 	    <para>The <maketarget>build</maketarget> target is run.  This is
 	      responsible for descending into the port's private working
 	      directory (<makevar>WRKSRC</makevar>) and building it.  If
 	      <makevar>USE_GMAKE</makevar> is set, GNU <command>make</command>
 	      will be used, otherwise the system <command>make</command> will
 	      be used.</para>
 	  </step>
 	</procedure>
 
 	<para>The above are the default actions.  In addition, you can define
 	  targets
 	  <maketarget>pre-<replaceable>something</replaceable></maketarget> or
 	  <maketarget>post-<replaceable>something</replaceable></maketarget>,
 	  or put scripts with those names, in the <filename>scripts</filename>
 	  subdirectory, and they will be run before or after the default
 	  actions are done.</para>
 
 	<para>For example, if you have a <maketarget>post-extract</maketarget>
 	  target defined in your <filename>Makefile</filename>, and a file
 	  <filename>pre-build</filename> in the <filename>scripts</filename>
 	  subdirectory, the <maketarget>post-extract</maketarget> target will
 	  be called after the regular extraction actions, and the
 	  <filename>pre-build</filename> script will be executed before the
 	  default build rules are done.  It is recommended that you use
 	  <filename>Makefile</filename> targets if the actions are simple
 	  enough, because it will be easier for someone to figure out what
 	  kind of non-default action the port requires.</para>
 
 	<para>The default actions are done by the
 	  <filename>bsd.port.mk</filename> targets
 	  <maketarget>do-<replaceable>something</replaceable></maketarget>.
 	  For example, the commands to extract a port are in the target
 	  <maketarget>do-extract</maketarget>.  If you are not happy with the
 	  default target, you can fix it by redefining the
 	  <maketarget>do-<replaceable>something</replaceable></maketarget>
 	  target in your <filename>Makefile</filename>.</para>
 
 	<note>
 	  <para>The <quote>main</quote> targets (e.g.,
 	    <maketarget>extract</maketarget>,
 	    <maketarget>configure</maketarget>, etc.) do nothing more than
 	    make sure all  the stages up to that one are completed and call
 	    the real targets or scripts, and they are not intended to be
 	    changed.  If you want to fix the extraction, fix
 	    <maketarget>do-extract</maketarget>, but never ever change
 	    the way <maketarget>extract</maketarget> operates!</para>
 	</note>
 
 	<para>Now that you understand what goes on when the user types
 	  <command>make</command>, let us go through the recommended steps to
 	  create the perfect port.</para>
       </sect1>
 
       <sect1 id="slow-sources">
 	<title>Getting the original sources</title>
 
 	<para>Get the original sources (normally) as a compressed tarball
 	  (<filename><replaceable>foo</replaceable>.tar.gz</filename> or
 	  <filename><replaceable>foo</replaceable>.tar.Z</filename>) and copy
 	  it into <makevar>DISTDIR</makevar>.  Always use
 	  <emphasis>mainstream</emphasis> sources when and where you
 	  can.</para>
 
 	<para>You will need to set the variable <makevar>MASTER_SITES</makevar>
 	  to reflect where the original tarball resides.  You will find
 	  convenient shorthand definitions for most mainstream sites
 	  in <filename>bsd.sites.mk</filename>.  Please use these
 	  sites&mdash;and the associated definitions&mdash;if
 	  at all possible, to help avoid the problem of having the same
 	  information repeated over again many times in the source base.
 	  As these sites tend to change over time, this becomes a
 	  maintenance nightmare for everyone involved.</para>
 
 	<para>If you cannot find a FTP/HTTP site that is well-connected to the
 	  net, or can only find sites that have irritatingly non-standard
 	  formats, you might want to put a copy on a reliable FTP or HTTP
 	  server that you control (e.g., your home page).</para>
 
 	<para>If you cannot find somewhere convenient and reliable to put the
 	  distfile
 	  we can <quote>house</quote> it ourselves
 	  on <hostid>ftp.FreeBSD.org</hostid>; however, this is the
 	  least-preferred solution.
 	  The distfile must be placed into
 	  <filename>~/public_distfiles/</filename> of someone's
 	  <hostid>freefall</hostid> account.
 	  Ask the person who commits your port to do this.
 	  This person will also set <makevar>MASTER_SITES</makevar> to
 	  <makevar>MASTER_SITE_LOCAL</makevar> and
 	  <makevar>MASTER_SITE_SUBDIR</makevar> to their
 	  <hostid>freefall</hostid> username.</para>
 
 	<para>If your port's distfile changes all the time without any
 	  kind of version update by the author,
 	  consider putting the distfile on your home page and listing it as
 	  the first <makevar>MASTER_SITES</makevar>.  If you can, try
 	  to talk the port author out of doing this; it
 	  really does help to establish some kind of source code control.
 	  Hosting your own version will prevent users
 	  from getting <errorname>checksum mismatch</errorname> errors, and
 	  also reduce the workload of maintainers of our FTP site.  Also, if
 	  there is only one master site for the port, it is recommended that
 	  you house a backup at your site and list it as the second
 	  <makevar>MASTER_SITES</makevar>.</para>
 
 	<para>If your port requires some additional `patches' that are
 	  available on the Internet, fetch them too and put them in
 	  <makevar>DISTDIR</makevar>.  Do not worry if they come from a site
 	  other than where you got the main source tarball, we have a way to
 	  handle these situations (see the description of <link
 	    linkend="porting-patchfiles">PATCHFILES</link> below).</para>
       </sect1>
 
       <sect1 id="slow-modifying">
 	<title>Modifying the port</title>
 
 	<para>Unpack a copy of the tarball in a private directory and make
 	  whatever changes are necessary to get the port to compile properly
 	  under the current version of FreeBSD.  Keep <emphasis>careful
 	    track</emphasis> of everything you do, as you will be automating
 	  the process shortly.  Everything, including the deletion, addition,
 	  or modification of files should be doable using an automated script
 	  or patch file when your port is finished.</para>
 
 	<para>If your port requires significant user interaction/customization
 	  to compile or install, you should take a look at one of Larry Wall's
 	  classic <application>Configure</application> scripts and perhaps do
 	  something similar yourself.  The goal of the new ports collection is
 	  to make each port as <quote>plug-and-play</quote> as possible for the
 	  end-user while using a minimum of disk space.</para>
 
 	<note>
 	  <para>Unless explicitly stated, patch files, scripts, and other
 	    files you have created and contributed to the FreeBSD ports
 	    collection are assumed to be covered by the standard BSD copyright
 	    conditions.</para>
 	</note>
       </sect1>
 
       <sect1 id="slow-patch">
 	<title>Patching</title>
 
 	<para>In the preparation of the port, files that have been added or
 	  changed can be picked up with a recursive &man.diff.1;
 	  for later feeding to &man.patch.1;.  Each set of patches you
 	  wish to apply should be collected into a file named
 	  <filename>patch-<replaceable>*</replaceable></filename> where
 	  <replaceable>*</replaceable> indicates
 	  the pathnames of the files that are patched,
 	  such as <filename>patch-Imakefile</filename> or
 	  <filename>patch-src-config.h</filename>.  These files should
 	  be stored in <makevar>PATCHDIR</makevar>, from where they will be
 	  automatically applied.  All patches must be relative to
 	  <makevar>WRKSRC</makevar> (generally the directory your port's
 	  tarball unpacks itself into, that being where the build is done).
 	  To make fixes and upgrades easier, you should avoid having more than
 	  one patch fix the same file (e.g., <filename>patch-file</filename> and
 	  <filename>patch-file2</filename> both changing
 	  <filename><makevar>WRKSRC</makevar>/foobar.c</filename>).</para>
 
 	<para>Please only use characters <literal>[-+._a-zA-Z0-9]</literal> for
 	  naming your patches.  Do not use any other characters besides them.
 	  Do not name your patches like <filename>patch-aa</filename> or
 	  <filename>patch-ab</filename> etc, always mention path and file name
 	  in patch names.</para>
 
 	<para>Do not put RCS strings in patches.  CVS will mangle them when we
 	  put the files into the ports tree, and when we check them out again,
 	  they will come out different and the patch will fail.  RCS strings
 	  are surrounded by dollar (<literal>&dollar;</literal>) signs, and
 	  typically start with <literal>&dollar;Id</literal> or
 	  <literal>&dollar;RCS</literal>.</para>
 
 	<para>Using the recurse (<option>-r</option>) option to
 	  &man.diff.1; to generate patches is fine, but please take
 	  a look at the resulting patches to make sure you do not have any
 	  unnecessary junk in there.  In particular, diffs between two backup
 	  files, <filename>Makefile</filename>s when the port uses
 	  <command>Imake</command> or GNU <command>configure</command>, etc.,
 	  are unnecessary and should be deleted.  If you had to edit
 	  <filename>configure.in</filename> and run
 	  <command>autoconf</command> to regenerate
 	  <command>configure</command>, do not take the diffs of
 	  <command>configure</command> (it often grows to a few thousand
 	  lines!); define <literal>USE_AUTOCONF_VER=213</literal> and take the
 	  diffs of <filename>configure.in</filename>.</para>
 
 	<para>Quite often, there is a situation when the software being
 	  ported, especially if it is primarily developed on &windows;, uses
 	  the CR/LF convention for most of its source files.  This may cause
 	  problems with further patching, compiler warnings, scripts
 	  execution (<command>/bin/sh^M</command> not found), etc.  To
 	  quickly convert those files from CR/LF to just LF, you can do
 	  something like this:</para>
 
 	<programlisting>USE_REINPLACE=	yes
 
 post-extract:
 	@${FIND} -E ${WRKDIR} -type f -iregex ".*\.(c|cpp|h|txt)" -print0 | \
 		${XARGS} -0 ${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//'</programlisting>
 
 	<para>Of course, if you need to process each and every file,
 	  <option>-iregex</option> above can be omitted.  Be aware that this
 	  piece of code will strip all trailing control characters from each
 	  line of processed file (except <literal>\n</literal>).</para>
 
 	<para>Also, if you had to delete a file, then you can do it in the
 	  <maketarget>post-extract</maketarget> target rather than as part of
 	  the patch.  Once you are happy with the resulting diff, please split
 	  it up into one source file per patch file.</para>
       </sect1>
 
       <sect1 id="slow-configure">
 	<title>Configuring</title>
 
 	<para>Include any additional customization commands in your
 	  <filename>configure</filename> script and save it in the
 	  <filename>scripts</filename> subdirectory.  As mentioned above, you
 	  can also do this with <filename>Makefile</filename> targets and/or
 	  scripts with the name <filename>pre-configure</filename> or
 	  <filename>post-configure</filename>.</para>
       </sect1>
 
       <sect1 id="slow-user-input">
 	<title>Handling user input</title>
 
 	<para>If your port requires user input to build, configure, or install,
 	  you must set <makevar>IS_INTERACTIVE</makevar> in your <filename>Makefile</filename>.  This
 	  will allow <quote>overnight builds</quote> to skip your port if the
 	  user sets the variable <envar>BATCH</envar> in his environment (and
 	  if the user sets the variable <envar>INTERACTIVE</envar>, then
 	  <emphasis>only</emphasis> those ports requiring interaction are
 	  built).  This will save a lot of wasted time on the set of
 	  machines that continually build ports (see below).</para>
 
 	<para>It is also recommended that if there are reasonable default
 	  answers to the questions, you check the
 	  <makevar>PACKAGE_BUILDING</makevar> variable and turn off the
 	  interactive script when it is set.  This will allow us to build the
 	  packages for CDROMs and FTP.</para>
       </sect1>
     </chapter>
 
     <chapter id="makefile">
       <title>Configuring the Makefile</title>
 
       <para>Configuring the <filename>Makefile</filename> is pretty simple, and again we suggest
 	that you look at existing examples before starting. Also, there is a
 	<link linkend="porting-samplem">sample Makefile</link> in this
 	handbook, so take a look and please follow the ordering of variables
 	and sections in that template to make your port easier for others to
 	read.</para>
 
       <para>Now, consider the following problems in sequence as you design
 	your new <filename>Makefile</filename>:</para>
 
       <sect1 id="makefile-source">
 	<title>The original source</title>
 
 	<para>Does it live in <makevar>DISTDIR</makevar> as a standard
 	  gzip'd tarball named something like
 	  <filename>foozolix-1.2.tar.gz</filename>? If so, you can go on
 	  to the next step.  If not, you should look at overriding any of
 	  the <makevar>DISTVERSION</makevar>, <makevar>DISTNAME</makevar>,
           <makevar>EXTRACT_CMD</makevar>,
 	  <makevar>EXTRACT_BEFORE_ARGS</makevar>,
 	  <makevar>EXTRACT_AFTER_ARGS</makevar>,
 	  <makevar>EXTRACT_SUFX</makevar>, or <makevar>DISTFILES</makevar>
 	  variables, depending on how alien a format your port's
 	  distribution file is.  (The most common case is
 	  <literal>EXTRACT_SUFX=.tar.Z</literal>, when the tarball is
 	  condensed by regular <command>compress</command>, not
 	  <command>gzip</command>.)</para>
 
 	<para>In the worst case, you can simply create your own
 	  <maketarget>do-extract</maketarget> target to override the
 	  default, though this should be rarely, if ever,
 	  necessary.</para>
       </sect1>
 
     <sect1 id="makefile-naming">
       <title>Naming</title>
 
       <para>The first part of the port's <filename>Makefile</filename> names
 	the port, describes its version number, and lists it in the correct
 	category.</para>
 
       <sect2>
 	<title><makevar>PORTNAME</makevar> and <makevar>PORTVERSION</makevar></title>
 
 	<para>You should set <makevar>PORTNAME</makevar> to the
 	  base name of your port, and <makevar>PORTVERSION</makevar>
 	  to the version number of the port.</para>
       </sect2>
 
       <sect2 id="makefile-naming-revepoch">
 	<title><makevar>PORTREVISION</makevar> and
 	  <makevar>PORTEPOCH</makevar></title>
 
 	<sect3>
 	  <title><makevar>PORTREVISION</makevar></title>
 
 	  <para>The <makevar>PORTREVISION</makevar> variable is a
 	    monotonically increasing value which is reset to 0 with
 	    every increase of <makevar>PORTVERSION</makevar> (i.e.
 	    every time a new official vendor release is made), and
 	    appended to the package name if non-zero.
 	    Changes to <makevar>PORTREVISION</makevar> are
 	    used by automated tools (e.g.  &man.pkg.version.1;)
 	    to highlight the fact that a new package is
 	    available.</para>
 
 	  <para><makevar>PORTREVISION</makevar> should be increased
 	    each time a change is made to the port which significantly
 	    affects the content or structure of the derived
 	    package.</para>
 
 	  <para>Examples of when <makevar>PORTREVISION</makevar>
 	    should be bumped:</para>
 
 	  <itemizedlist>
 	    <listitem>
 	      <para>Addition of patches to correct security
 		vulnerabilities, bugs, or to add new functionality to
 		the port.</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Changes to the port <filename>Makefile</filename> to enable or disable
 		compile-time options in the package.</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Changes in the packing list or the install-time
 		behavior of the package (e.g. change to a script
 		which generates initial data for the package, like ssh
 		host keys).</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Version bump of a port's shared library dependency
 		(in this case, someone trying to install the old
 		package after installing a newer version of the
 		dependency will fail since it will look for the old
 		libfoo.x instead of libfoo.(x+1)).</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Silent changes to the port distfile which have
 		significant functional differences, i.e. changes to
 		the distfile requiring a correction to
 		<filename>distinfo</filename> with no corresponding change to
 		<makevar>PORTVERSION</makevar>, where a <command>diff
 		-ru</command> of the old and new versions shows
 		non-trivial changes to the code.</para>
 	    </listitem>
 	  </itemizedlist>
 
 	  <para>Examples of changes which do not require a
 	    <makevar>PORTREVISION</makevar> bump:</para>
 
 	  <itemizedlist>
 	    <listitem>
 	      <para>Style changes to the port skeleton with no
 		functional change to what appears in the resulting
 		package.</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Changes to <makevar>MASTER_SITES</makevar> or
 		other functional changes to the port which do not
 		affect the resulting package.</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Trivial patches to the distfile such as correction
 		of typos, which are not important enough that users of
 		the package should go to the trouble of
 		upgrading.</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Build fixes which cause a package to become
 		compilable where it was previously failing (as long as
 		the changes do not introduce any functional change on
 		any other platforms on which the port did previously
 		build). Since <makevar>PORTREVISION</makevar> reflects
 		the content of the package, if the package was not
 		previously buildable then there is no need to increase
 		<makevar>PORTREVISION</makevar> to mark a
 		change.</para>
 	    </listitem>
 	  </itemizedlist>
 
 	  <para>A rule of thumb is to ask yourself whether a change
 	    committed to a port is something which everyone
 	    would benefit from having (either because of an
 	    enhancement, fix, or by virtue that the new package will
 	    actually work at all), and weigh that against that fact
 	    that it will cause everyone who regularly updates their
 	    ports tree to be compelled to update. If yes, the
 	    <makevar>PORTREVISION</makevar> should be bumped.</para>
 	</sect3>
 
 	<sect3>
 	  <title><makevar>PORTEPOCH</makevar></title>
 
 	  <para>From time to time a software vendor or FreeBSD porter
 	    will do something silly and release a version of their
 	    software which is actually numerically less than the
 	    previous version. An example of this is a port which goes
 	    from foo-20000801 to foo-1.0 (the former will be
 	    incorrectly treated as a newer version since 20000801 is a
 	    numerically greater value than 1).</para>
 
 	  <para>In situations such as this, the
 	    <makevar>PORTEPOCH</makevar> version should be increased.
 	    If <makevar>PORTEPOCH</makevar> is nonzero it is appended
 	    to the package name as described in section 0 above.
 	    <makevar>PORTEPOCH</makevar> must never be decreased or reset
 	    to zero, because that would cause comparison to a package
 	    from an earlier epoch to fail (i.e. the package would not
 	    be detected as out of date): the new version number (e.g.
 	    <literal>1.0,1</literal> in the above example) is still
 	    numerically less than the previous version (20000801), but
 	    the <literal>,1</literal> suffix is treated specially by
 	    automated tools and found to be greater than the implied
 	    suffix <literal>,0</literal> on the earlier package.</para>
 
 	  <para>Dropping or resetting <makevar>PORTEPOCH</makevar>
 	    incorrectly leads
 	    to no end of grief; if you do not understand the above discussion,
 	    please keep after it until you do, or ask questions on
 	    the mailing lists.</para>
 
 	  <para>It is expected that <makevar>PORTEPOCH</makevar> will
 	    not be used for the majority of ports, and that sensible
 	    use of <makevar>PORTVERSION</makevar> can often pre-empt
 	    it becoming necessary if a future release of the software
 	    should change the version structure. However, care is
 	    needed by FreeBSD porters when a vendor release is made
 	    without an official version number &mdash; such as a code
 	    <quote>snapshot</quote> release.  The temptation is to label the
 	    release with the release date, which will cause problems
 	    as in the example above when a new <quote>official</quote> release is
 	    made.</para>
 
 	  <para>For example, if a snapshot release is made on the date
 	    20000917, and the previous version of the software was
 	    version 1.2, the snapshot release should be given a
 	    <makevar>PORTVERSION</makevar> of 1.2.20000917 or similar,
 	    not 20000917, so that the succeeding release, say 1.3, is
 	    still a numerically greater value.</para>
 	</sect3>
 
 	<sect3>
 	  <title>Example of <makevar>PORTREVISION</makevar> and
 	    <makevar>PORTEPOCH</makevar> usage</title>
 
 	  <para>The <literal>gtkmumble</literal> port, version
 	    <literal>0.10</literal>, is committed to the ports
 	    collection:</para>
 
 	  <programlisting>PORTNAME=       gtkmumble
 PORTVERSION=    0.10</programlisting>
 
 	  <para><makevar>PKGNAME</makevar> becomes
 	    <literal>gtkmumble-0.10</literal>.</para>
 
 	  <para>A security hole is discovered which requires a local
 	    FreeBSD patch. <makevar>PORTREVISION</makevar> is bumped
 	    accordingly.</para>
 
 	  <programlisting>PORTNAME=       gtkmumble
 PORTVERSION=    0.10
 PORTREVISION=   1</programlisting>
 
 	  <para><makevar>PKGNAME</makevar> becomes
 	    <literal>gtkmumble-0.10_1</literal></para>
 
 	  <para>A new version is released by the vendor, numbered <literal>0.2</literal>
 	    (it turns out the author actually intended
 	    <literal>0.10</literal> to actually mean
 	    <literal>0.1.0</literal>, not <quote>what comes after
 	      0.9</quote> - oops, too late now). Since the new minor
 	    version <literal>2</literal> is numerically less than the
 	    previous version <literal>10</literal>, the
 	    <makevar>PORTEPOCH</makevar> must be bumped to manually
 	    force the new package to be detected as <quote>newer</quote>. Since it
 	    is a new vendor release of the code,
 	    <makevar>PORTREVISION</makevar> is reset to 0 (or removed
 	    from the <filename>Makefile</filename>).</para>
 
 	  <programlisting>PORTNAME=       gtkmumble
 PORTVERSION=    0.2
 PORTEPOCH=      1</programlisting>
 
 	  <para><makevar>PKGNAME</makevar> becomes
 	    <literal>gtkmumble-0.2,1</literal></para>
 
 	  <para>The next release is 0.3. Since
 	    <makevar>PORTEPOCH</makevar> never decreases, the version
 	    variables are now:</para>
 
 	  <programlisting>PORTNAME=       gtkmumble
 PORTVERSION=    0.3
 PORTEPOCH=      1</programlisting>
 
 	  <para><makevar>PKGNAME</makevar> becomes
 	    <literal>gtkmumble-0.3,1</literal></para>
 
 	  <note>
 	    <para>If <makevar>PORTEPOCH</makevar> were reset
 	      to <literal>0</literal> with this upgrade, someone who had
 	      installed the <literal>gtkmumble-0.10_1</literal> package would not detect
 	      the <literal>gtkmumble-0.3</literal> package as newer, since
 	      <literal>3</literal> is still numerically less than
 	      <literal>10</literal>.  Remember, this is the whole point of
 	      <makevar>PORTEPOCH</makevar> in the first place.</para>
 	  </note>
 	</sect3>
       </sect2>
 
       <sect2>
 	<title><makevar>PKGNAMEPREFIX</makevar> and <makevar>PKGNAMESUFFIX</makevar></title>
 
 	<para>Two optional variables, <makevar>PKGNAMEPREFIX</makevar> and
 	  <makevar>PKGNAMESUFFIX</makevar>, are combined with
 	  <makevar>PORTNAME</makevar> and
 	  <makevar>PORTVERSION</makevar> to
 	  form <makevar>PKGNAME</makevar> as
 	  <literal>${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}</literal>.
 	  Make sure this conforms to our <link
 	  linkend="porting-pkgname">guidelines for a good package
 	  name</link>.  In particular, you are <emphasis>not</emphasis> allowed to use a
 	  hyphen (<literal>-</literal>) in
 	  <makevar>PORTVERSION</makevar>.  Also, if the package name
 	  has the <replaceable>language-</replaceable> or the
 	  <replaceable>-compiled.specifics</replaceable> part (see below), use
 	  <makevar>PKGNAMEPREFIX</makevar> and
 	  <makevar>PKGNAMESUFFIX</makevar>, respectively.  Do not make
 	  them part of <makevar>PORTNAME</makevar>.</para>
       </sect2>
 
     <sect2 id="porting-pkgname">
       <title>Package Naming Conventions</title>
 
       <para>The following are the conventions you should follow in naming your
 	packages.  This is to have our package directory easy to scan, as
 	there are already thousands of packages and users are going to
 	turn away if they hurt their eyes!</para>
 
       <para>The package name should look like
 	<filename><replaceable><optional>language<optional>_region</optional></optional>-name<optional><optional>-</optional>compiled.specifics</optional>-version.numbers</replaceable></filename>.</para>
 
       <para>The package name is defined as
 	<literal>${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}</literal>.
 	Make sure to set the variables to conform to that format.</para>
 
       <orderedlist>
 	<listitem>
 	  <para>FreeBSD strives to support the native language of its users.
 	    The <replaceable>language-</replaceable> part should be a two
 	    letter abbreviation of the natural language defined by ISO-639 if
 	    the port is specific to a certain language.  Examples are
 	    <literal>ja</literal> for Japanese, <literal>ru</literal> for
 	    Russian, <literal>vi</literal> for Vietnamese,
 	    <literal>zh</literal> for Chinese, <literal>ko</literal> for
 	    Korean and <literal>de</literal> for German.</para>
 
 	  <para>If the port is specific to a certain region within the
 	    language area, add the two letter country code as well.
 	    Examples are <literal>en_US</literal> for US English and
 	    <literal>fr_CH</literal> for Swiss French.</para>
 
 	  <para>The <replaceable>language-</replaceable> part should
 	    be set in the <makevar>PKGNAMEPREFIX</makevar> variable.</para>
 	</listitem>
 
 	<listitem>
 	  <para>The first letter of <filename>name</filename> part
 	    should be lowercase.  (The rest of the name can contain
 	    capital letters, so use your own discretion when you are
 	    converting a software name that has some capital letters in it.)
 	    There is a tradition of naming <literal>perl 5</literal> modules by
 	    prepending <literal>p5-</literal> and converting the double-colon
 	    separator to a hyphen; for example, the
 	    <literal>Data::Dumper</literal> module becomes
 	    <literal>p5-Data-Dumper</literal>.  If the software in question
 	    has numbers, hyphens, or underscores in its name, you may include
 	    them as well (like <literal>kinput2</literal>).</para>
 	</listitem>
 
 	<listitem>
 	  <para>If the port can be built with different <link
 	      linkend="makefile-masterdir">hardcoded defaults</link> (usually
 	    part of the directory name in a family of ports), the
 	    <replaceable>-compiled.specifics</replaceable> part should state
 	    the compiled-in defaults (the hyphen is optional).  Examples are
 	    papersize and font units.</para>
 
 	  <para>The <replaceable>-compiled.specifics</replaceable> part
 	    should be set in the <makevar>PKGNAMESUFFIX</makevar>
 	    variable.</para>
 	</listitem>
 
 	<listitem>
 	  <para>The version string should follow a dash
 	    (<literal>-</literal>) and be a period-separated list of
 	    integers and single lowercase alphabetics.  In particular,
 	    it is not permissible to have another dash inside the
 	    version string.  The only exception is the string
 	    <literal>pl</literal> (meaning <quote>patchlevel</quote>), which can be
 	    used <emphasis>only</emphasis> when there are no major and
 	    minor version numbers in the software.  If the software
 	    version has strings like <quote>alpha</quote>, <quote>beta</quote>, <quote>rc</quote>, or <quote>pre</quote>, take
 	    the first letter and put it immediately after a period.
 	    If the version string continues after those names, the
 	    numbers should follow the single alphabet without an extra
 	    period between them.</para>
 
 	  <para>The idea is to make it easier to sort ports by looking
 	    at the version string.  In particular, make sure version
 	    number components are always delimited by a period, and
 	    if the date is part of the string, use the
 	    <literal><replaceable>yyyy</replaceable>.<replaceable>mm</replaceable>.<replaceable>dd</replaceable></literal>
 	    format, not
 	    <literal><replaceable>dd</replaceable>.<replaceable>mm</replaceable>.<replaceable>yyyy</replaceable></literal>
 	    or the non-Y2K compliant
 	    <literal><replaceable>yy</replaceable>.<replaceable>mm</replaceable>.<replaceable>dd</replaceable></literal>
 	    format.</para>
 	</listitem>
       </orderedlist>
 
       <para>Here are some (real) examples on how to convert the name
 	as called by the software authors to a suitable package
 	name:</para>
 
       <informaltable frame="none" pgwide="1">
 	<tgroup cols="6">
 	  <thead>
 	    <row>
 	      <entry>Distribution Name</entry>
 	      <entry><makevar>PKGNAMEPREFIX</makevar></entry>
 	      <entry><makevar>PORTNAME</makevar></entry>
 	      <entry><makevar>PKGNAMESUFFIX</makevar></entry>
 	      <entry><makevar>PORTVERSION</makevar></entry>
 	      <entry>Reason</entry>
 	    </row>
 	  </thead>
 
 	  <tbody>
 	    <row>
 	      <entry>mule-2.2.2</entry>
 	      <entry>(empty)</entry>
 	      <entry>mule</entry>
 	      <entry>(empty)</entry>
 	      <entry>2.2.2</entry>
 	      <entry>No changes required</entry>
 	    </row>
 
 	    <row>
 	      <entry>XFree86-3.3.6</entry>
 	      <entry>(empty)</entry>
 	      <entry>XFree86</entry>
 	      <entry>(empty)</entry>
 	      <entry>3.3.6</entry>
 	      <entry>No changes required</entry>
 	    </row>
 
 	    <row>
 	      <entry>EmiClock-1.0.2</entry>
 	      <entry>(empty)</entry>
 	      <entry>emiclock</entry>
 	      <entry>(empty)</entry>
 	      <entry>1.0.2</entry>
 	      <entry>No uppercase names for single programs</entry>
 	    </row>
 
 	    <row>
 	      <entry>rdist-1.3alpha</entry>
 	      <entry>(empty)</entry>
 	      <entry>rdist</entry>
 	      <entry>(empty)</entry>
 	      <entry>1.3.a</entry>
 	      <entry>No strings like <literal>alpha</literal>
 		allowed</entry>
 	    </row>
 
 	    <row>
 	      <entry>es-0.9-beta1</entry>
 	      <entry>(empty)</entry>
 	      <entry>es</entry>
 	      <entry>(empty)</entry>
 	      <entry>0.9.b1</entry>
 	      <entry>No strings like <literal>beta</literal>
 		allowed</entry>
 	    </row>
 
 	    <row>
 	      <entry>mailman-2.0rc3</entry>
 	      <entry>(empty)</entry>
 	      <entry>mailman</entry>
 	      <entry>(empty)</entry>
 	      <entry>2.0.r3</entry>
 	      <entry>No strings like <literal>rc</literal>
 		allowed</entry>
 	    </row>
 
 	    <row>
 	      <entry>v3.3beta021.src</entry>
 	      <entry>(empty)</entry>
 	      <entry>tiff</entry>
 	      <entry>(empty)</entry>
 	      <entry>3.3</entry>
 	      <entry>What the heck was that anyway?</entry>
 	    </row>
 
 	    <row>
 	      <entry>tvtwm</entry>
 	      <entry>(empty)</entry>
 	      <entry>tvtwm</entry>
 	      <entry>(empty)</entry>
 	      <entry>pl11</entry>
 	      <entry>Version string always required</entry>
 	    </row>
 
 	    <row>
 	      <entry>piewm</entry>
 	      <entry>(empty)</entry>
 	      <entry>piewm</entry>
 	      <entry>(empty)</entry>
 	      <entry>1.0</entry>
 	      <entry>Version string always required</entry>
 	    </row>
 
 	    <row>
 	      <entry>xvgr-2.10pl1</entry>
 	      <entry>(empty)</entry>
 	      <entry>xvgr</entry>
 	      <entry>(empty)</entry>
 	      <entry>2.10.1</entry>
 	      <entry><literal>pl</literal> allowed only when no
 		major/minor version numbers</entry>
 	    </row>
 
 	    <row>
 	      <entry>gawk-2.15.6</entry>
 	      <entry>ja-</entry>
 	      <entry>gawk</entry>
 	      <entry>(empty)</entry>
 	      <entry>2.15.6</entry>
 	      <entry>Japanese language version</entry>
 	    </row>
 
 	    <row>
 	      <entry>psutils-1.13</entry>
 	      <entry>(empty)</entry>
 	      <entry>psutils</entry>
 	      <entry>-letter</entry>
 	      <entry>1.13</entry>
 	      <entry>Papersize hardcoded at package build time</entry>
 	    </row>
 
 	    <row>
 	      <entry>pkfonts</entry>
 	      <entry>(empty)</entry>
 	      <entry>pkfonts</entry>
 	      <entry>300</entry>
 	      <entry>1.0</entry>
 	      <entry>Package for 300dpi fonts</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </informaltable>
 
       <para>If there is absolutely no trace of version information in the
 	original source and it is unlikely that the original author will ever
 	release another version, just set the version string to
 	<literal>1.0</literal> (like the <literal>piewm</literal> example above).  Otherwise, ask
 	the original author or use the date string
 	(<literal><replaceable>yyyy</replaceable>.<replaceable>mm</replaceable>.<replaceable>dd</replaceable></literal>)
 	as the version.</para>
     </sect2>
     </sect1>
 
     <sect1 id="makefile-categories">
       <title>Categorization</title>
 
       <sect2>
 	<title><makevar>CATEGORIES</makevar></title>
 
 	<para>When a package is created, it is put under
 	  <filename>/usr/ports/packages/All</filename> and links are made from
 	  one or more subdirectories of
 	  <filename>/usr/ports/packages</filename>.  The names of these
 	  subdirectories are specified by the variable
 	  <makevar>CATEGORIES</makevar>.  It is intended to make life easier
 	  for the user when he is wading through the pile of packages on the
 	  FTP site or the CDROM.  Please take a look at the <link
 	    linkend="porting-categories">current list of categories</link> and pick the ones
 	  that are suitable for your port.</para>
 
 	<para>This list also determines where in the ports tree the port is
 	  imported.  If you put more than one category here, it is assumed
 	  that the port files will be put in the subdirectory with the name in
 	  the first category.  See <link
 	    linkend="choosing-categories">below</link> for more
 	  discussion about how to pick the right categories.</para>
       </sect2>
 
       <sect2 id="porting-categories">
 	<title>Current list of categories</title>
 
 	<para>Here is the current list of port categories.  Those
 	  marked with an asterisk (<literal>*</literal>) are
 	  <emphasis>virtual</emphasis> categories&mdash;those that do not have
 	  a corresponding subdirectory in the ports tree.  They are only
 	  used as secondary categories, and only for search purposes.</para>
 
 	<note>
 	  <para>For non-virtual categories, you will find a one-line
 	    description in the <makevar>COMMENT</makevar> in that
 	    subdirectory's <filename>Makefile</filename>.</para>
 	</note>
 
 	<informaltable frame="none" pgwide="1">
 	  <tgroup cols="3">
 	    <thead>
 	      <row>
 		<entry>Category</entry>
 		<entry>Description</entry>
 		<entry>Notes</entry>
 	      </row>
 	    </thead>
 
 	    <tbody>
 	      <row>
 		<entry><filename>accessibility</filename></entry>
 		<entry>Ports to help disabled users.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>afterstep*</filename></entry>
 		<entry>Ports to support the
 		  <ulink url="http://www.afterstep.org">AfterStep</ulink>
 		  window manager.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>arabic</filename></entry>
 		<entry>Arabic language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>archivers</filename></entry>
 		<entry>Archiving tools.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>astro</filename></entry>
 		<entry>Astronomical ports.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>audio</filename></entry>
 		<entry>Sound support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>benchmarks</filename></entry>
 		<entry>Benchmarking utilities.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>biology</filename></entry>
 		<entry>Biology-related software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>cad</filename></entry>
 		<entry>Computer aided design tools.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>chinese</filename></entry>
 		<entry>Chinese language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>comms</filename></entry>
 		<entry>Communication software.</entry>
 		<entry>Mostly software to talk to your serial port.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>converters</filename></entry>
 		<entry>Character code converters.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>databases</filename></entry>
 		<entry>Databases.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>deskutils</filename></entry>
 		<entry>Things that used to be on the desktop before
 		  computers were invented.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>devel</filename></entry>
 		<entry>Development utilities.</entry>
 		<entry>Do not put libraries here just because they are
 		  libraries&mdash;unless they truly do not belong anywhere
 		  else, they should not be in this category.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>dns</filename></entry>
 		<entry>DNS-related software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>editors</filename></entry>
 		<entry>General editors.</entry>
 		<entry>Specialized editors go in the section for those
 		  tools (e.g., a mathematical-formula editor will go
 		  in <filename>math</filename>).</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>elisp*</filename></entry>
 		<entry>Emacs-lisp ports.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>emulators</filename></entry>
 		<entry>Emulators for other operating systems.</entry>
 		<entry>Terminal emulators do <emphasis>not</emphasis> belong
 		  here&mdash;X-based ones should go to
 		  <filename>x11</filename> and text-based ones to either
 		  <filename>comms</filename> or <filename>misc</filename>,
 		  depending on the exact functionality.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>finance</filename></entry>
 		<entry>Monetary, financial and related applications.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>french</filename></entry>
 		<entry>French language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>ftp</filename></entry>
 		<entry>FTP client and server utilities.</entry>
 		<entry>If your port speaks both FTP and HTTP, put it in
 		  <filename>ftp</filename> with a secondary
 		  category of <filename>www</filename>.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>games</filename></entry>
 		<entry>Games.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>german</filename></entry>
 		<entry>German language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>gnome*</filename></entry>
 		<entry>Ports from the <ulink
 		  url="http://www.gnome.org">GNOME</ulink>
 		  Project.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>graphics</filename></entry>
 		<entry>Graphics utilities.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>haskell*</filename></entry>
 		<entry>Software related to the Haskell language.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>hebrew</filename></entry>
 		<entry>Hebrew language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>hungarian</filename></entry>
 		<entry>Hungarian language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>ipv6*</filename></entry>
 		<entry>IPv6 related software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>irc</filename></entry>
 		<entry>Internet Relay Chat utilities.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>japanese</filename></entry>
 		<entry>Japanese language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>java</filename></entry>
 		<entry>Software related to the Java language.</entry>
 		<entry>The <filename>java</filename> category shall not be
 		  the only one for a port. Save for ports directly related to
 		  the Java language, porters are also encouraged not to
 		  use <filename>java</filename> as the main category of a
 		  port.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>kde*</filename></entry>
 		<entry>Ports from the <ulink url="http://www.kde.org">K Desktop Environment (KDE)</ulink>
 		  Project.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>korean</filename></entry>
 		<entry>Korean language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>lang</filename></entry>
 		<entry>Programming languages.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>linux*</filename></entry>
 		<entry>Linux applications and support utilities.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>lisp*</filename></entry>
 		<entry>Software related to the Lisp language.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>mail</filename></entry>
 		<entry>Mail software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>math</filename></entry>
 		<entry>Numerical computation software and other utilities
 		  for mathematics.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>mbone</filename></entry>
 		<entry>MBone applications.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>misc</filename></entry>
 		<entry>Miscellaneous utilities</entry>
 		<entry>Basically things that
 		  do not belong anywhere else.
 		  If at all possible, try to
 		  find a better category for your port than
 		  <literal>misc</literal>, as ports tend to get overlooked
 		  in here.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>multimedia</filename></entry>
 		<entry>Multimedia software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>net</filename></entry>
 		<entry>Miscellaneous networking software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>net-mgmt</filename></entry>
 		<entry>Networking management software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>news</filename></entry>
 		<entry>USENET news software.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>offix*</filename></entry>
 		<entry>Ports from the <ulink url="http://leb.net/offix/">OffiX</ulink> suite.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>palm</filename></entry>
 		<entry>Software support for the <ulink url="http://www.palm.com/">Palm&trade;</ulink> series.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>parallel*</filename></entry>
 		<entry>Applications dealing with parallelism in computing.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>pear*</filename></entry>
 		<entry>Ports related to the Pear PHP framework.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>perl5*</filename></entry>
 		<entry>Ports that require <application>Perl</application> version 5 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>plan9*</filename></entry>
 		<entry>Various programs from <ulink url="http://www.cs.bell-labs.com/plan9dist/">Plan9</ulink>.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>polish</filename></entry>
 		<entry>Polish language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>portuguese</filename></entry>
 		<entry>Portuguese language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>print</filename></entry>
 		<entry>Printing software.</entry>
 		<entry>Desktop publishing tools
 		  (previewers, etc.) belong here too.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>python*</filename></entry>
 		<entry>Software related to the <ulink url="http://www.python.org/">Python</ulink> language.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>ruby*</filename></entry>
 		<entry>Software related to the <ulink url="http://www.ruby-lang.org/">Ruby</ulink> language.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>russian</filename></entry>
 		<entry>Russian language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>scheme*</filename></entry>
 		<entry>Software related to the Scheme language.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>science</filename></entry>
 		<entry>Scientific ports that do not fit into other
 		  categories such as <filename>astro</filename>,
 		  <filename>biology</filename> and
 		  <filename>math</filename>.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>security</filename></entry>
 		<entry>Security utilities.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>shells</filename></entry>
 		<entry>Command line shells.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>sysutils</filename></entry>
 		<entry>System utilities.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tcl80*</filename></entry>
 		<entry>Ports that use Tcl version 8.0 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tcl81*</filename></entry>
 		<entry>Ports that use Tcl version 8.1 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tcl82*</filename></entry>
 		<entry>Ports that use Tcl version 8.2 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tcl83*</filename></entry>
 		<entry>Ports that use Tcl version 8.3 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tcl84*</filename></entry>
 		<entry>Ports that use Tcl version 8.4 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>textproc</filename></entry>
 		<entry>Text processing utilities.</entry>
 		<entry>It does not include
 		  desktop publishing tools, which go to <filename>print</filename>.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tk80*</filename></entry>
 		<entry>Ports that use Tk version 8.0 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tk82*</filename></entry>
 		<entry>Ports that use Tk version 8.2 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tk83*</filename></entry>
 		<entry>Ports that use Tk version 8.3 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tk84*</filename></entry>
 		<entry>Ports that use Tk version 8.4 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>tkstep80*</filename></entry>
 		<entry>Ports that use TkSTEP version 8.0 to run.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>ukrainian</filename></entry>
 		<entry>Ukrainian language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>vietnamese</filename></entry>
 		<entry>Vietnamese language support.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>windowmaker*</filename></entry>
 		<entry>Ports to support the WindowMaker window
 		  manager.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>www</filename></entry>
 		<entry>Software related to the World Wide Web.</entry>
 		<entry>HTML language
 		  support belongs here too.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11</filename></entry>
 		<entry>The X Window System and friends.</entry>
 		<entry>This category is only
 		  for software that directly supports the window system.  Do not
 		  put regular X applications here; most of them should go
 		  into other <filename>x11-*</filename> categories (see below).
 		  If your port <emphasis>is</emphasis> an X
 		  application, define <makevar>USE_XLIB</makevar> (implied by
 		  <makevar>USE_IMAKE</makevar>) and put it in the appropriate
 		  category.</entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11-clocks</filename></entry>
 		<entry>X11 clocks.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11-fm</filename></entry>
 		<entry>X11 file managers.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11-fonts</filename></entry>
 		<entry>X11 fonts and font utilities.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11-servers</filename></entry>
 		<entry>X11 servers.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11-themes</filename></entry>
 		<entry>X11 themes.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11-toolkits</filename></entry>
 		<entry>X11 toolkits.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>x11-wm</filename></entry>
 		<entry>X11 window managers.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>xfce*</filename></entry>
 		<entry>Ports relating to the
 		  <ulink url="http://www.xfce.org/">Xfce</ulink> desktop
 		  environment.</entry>
 		<entry></entry>
 	      </row>
 
 	      <row>
 		<entry><filename>zope*</filename></entry>
 		<entry><ulink url="http://www.zope.org/">Zope</ulink> support.</entry>
 		<entry></entry>
 	      </row>
 	    </tbody>
 	  </tgroup>
 	</informaltable>
       </sect2>
 
       <sect2 id="choosing-categories">
 	<title>Choosing the right category</title>
 
 	<para>As many of the categories overlap, you often have to choose
 	  which of the categories should be the primary category of your port.
 	  There are several rules that govern this issue.  Here is the list of
 	  priorities, in decreasing order of precedence:</para>
 
 	<itemizedlist>
 	  <listitem>
 	    <para>The first category must be a physical category (see
 	      <link linkend="porting-categories">above</link>).  This is
 	      necessary to make the packaging work.  Virtual categories and
 	      physical categories may be intermixed after that.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>Language specific categories always come first.  For
 	      example, if your port installs Japanese X11 fonts, then your
 	      <makevar>CATEGORIES</makevar> line would read <filename>japanese
 		x11-fonts</filename>.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>Specific categories are listed before less-specific ones.  For
 	      instance, an HTML editor should be listed as <filename>www
 		editors</filename>, not the other way around.  Also, you should not
 	      list <filename>net</filename> when the port belongs to
 	      any of <filename>irc</filename>, <filename>mail</filename>,
 	      <filename>mbone</filename>, <filename>news</filename>,
 	      <filename>security</filename>, or <filename>www</filename>, as
 	      <filename>net</filename> is included implicitly.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><filename>x11</filename> is used as a secondary category only
 	      when the primary category is a natural language.  In particular,
 	      you should not put <filename>x11</filename> in the category line
 	      for X applications.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><application>Emacs</application> modes should be
 	      placed in the same ports category as the application
 	      supported by the mode, not in
 	      <filename>editors</filename>.  For example, an
 	      <application>Emacs</application> mode to edit source
 	      files of some programming language should go into
 	      <filename>lang</filename>.
 	      </para>
 	  </listitem>
 
 	  <listitem>
 	    <para><filename>misc</filename>
 		  should not appear with any other non-virtual category.
 		  If you have <literal>misc</literal> with something else in
 		  your <makevar>CATEGORIES</makevar> line, that means you can
 		  safely delete <literal>misc</literal> and just put the port
 		  in that other subdirectory!</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>If your port truly does not belong anywhere else, put it in
 	      <filename>misc</filename>.</para>
 	  </listitem>
 	</itemizedlist>
 
 	<para>If you are not sure about the category, please put a comment to
 	  that effect in your &man.send-pr.1; submission so we can
 	  discuss it before we import it.  If you are a committer, send a note
 	  to the &a.ports; so we can discuss it first.  Too often, new ports are
 	  imported to the wrong category only to be moved right away.
 	  This causes unnecessary and undesirable bloat in the master
 	  source repository.</para>
       </sect2>
 
       <sect2 id="proposing-categories">
 	<title>Proposing a new category</title>
 
 	<para>As the Ports Collection has grown over time, various new
 	  categories have been introduced.  New categories can either
 	  be <emphasis>virtual</emphasis> categories&mdash;those that do
 	  not have a corresponding subdirectory in the ports tree&mdash;
 	  or <emphasis>physical</emphasis> categories&mdash;those that
 	  do.  The following text discusses the issues involved in creating
 	  a new physical category so that you can understand them before
 	  you propose one.</para>
 
 	<para>Our existing practice has been to avoid creating a new
 	  physical category unless either a large number of ports would
 	  logically belong to it, or the ports that would belong to it
 	  are a logically distinct group that is of limited general
 	  interest (for instance, categories related to spoken human
 	  languages), or preferably both.</para>
 
 	<para>The rationale for this is that such a change creates a
 	  <ulink url="&url.articles.committers-guide;/#ports">
 	  fair amount of work</ulink> for both the committers and also
 	  for all users who track changes to the Ports Collection.  In
 	  addition, proposed category changes just naturally seem to
 	  attract controversy.  (Perhaps this is because there is no
 	  clear consensus on when a category is <quote>too big</quote>,
 	  nor whether categories should lend themselves to browsing (and
 	  thus what number of categories would be an ideal number), and
 	  so forth.)</para>
 
 	<para>Here is the procedure:</para>
 
 	<procedure>
 	  <step>
 	    <para>Propose the new category on &a.ports;.  You should
 	      include a detailed rationale for the new category,
 	      including why you feel the existing categories are not
 	      sufficient, and the list of existing ports proposed to move.
 	      (If there are new ports pending in
 	      <application>GNATS</application> that would fit this
 	      category, list them too.)  If you are the maintainer and/or
 	      submitter, respectively, mention that as it may help you
 	      to make your case.</para>
 	  </step>
 
 	  <step>
 	    <para>Participate in the discussion.</para>
 	  </step>
 
 	  <step>
 	    <para>If it seems that there is support for your idea,
 	      file a PR which includes both the rationale and the list
 	      of existing ports that need to be moved.  Ideally, this
 	      PR should also include patches for the following:</para>
 
 	    <itemizedlist>
 	      <listitem>
 		<para><filename>Makefile</filename>s for the
 		  new ports once they are repocopied</para>
 	      </listitem>
 
 	      <listitem>
 		<para><filename>Makefile</filename> for the
 		  new category</para>
 	      </listitem>
 
 	      <listitem>
 		<para><filename>Makefile</filename> for the
 		  old ports' categories</para>
 	      </listitem>
 
 	      <listitem>
 		<para><filename>Makefile</filename>s for ports
 		  that depend on the old ports</para>
 	      </listitem>
 
 	      <listitem>
 		<para>(for extra credit, you can include the other
 		  files that have to change, as per the procedure
 		  in the Committer's Guide.)</para>
 	      </listitem>
 	    </itemizedlist>
 	  </step>
 
 	  <step>
 	    <para>Since it affects the ports infrastructure and involves
 	      not only performing repo-copies but also possibly running
 	      regression tests on the build cluster, the PR should be
 	      assigned to the &a.portmgr;.</para>
 	  </step>
 
 	  <step>
 	    <para>If that PR is approved, a committer will need to follow
 	      the rest of the procedure that is
 	      <ulink url="&url.articles.committers-guide;/#ports">
 	      outlined in the Committer's Guide</ulink>.</para>
 	  </step>
 	</procedure>
 
 	<para>Proposing a new virtual category should be similar to
 	  the above but much less involved, since no ports will
 	  actually have to move.  In this case, the only patches to
 	  include in the PR would be those to add the new category to the
 	  <makevar>CATEGORIES</makevar>s of the affected ports.</para>
       </sect2>
 
       <sect2 id="proposing-reorg">
 	<title>Proposing reorganizing all the categories</title>
 
 	<para>Occasionally someone proposes reorganizing the categories
 	  with either a 2-level structure, or some other kind of keyword
 	  structure.  To date, nothing has come of any of these proposals
 	  because, while they are very easy to make, the effort involved to
 	  retrofit the entire existing ports collection with any kind of
 	  reorganization is daunting to say the very least.  Please read
 	  the history of these proposals in the mailing list archives before
 	  you post this idea; furthermore, you should be prepared to be
 	  challenged to offer a working prototype.</para>
       </sect2>
     </sect1>
 
     <sect1 id="makefile-distfiles">
       <title>The distribution files</title>
 
       <para>The second part of the <filename>Makefile</filename> describes the
 	files that must be downloaded in order to build the port, and where
 	they can be downloaded from.</para>
 
       <sect2>
 	<title><makevar>DISTVERSION/DISTNAME</makevar></title>
 
 	<para><makevar>DISTNAME</makevar> is the name of the port as
 	  called by the authors of the software.
 	  <makevar>DISTNAME</makevar> defaults to
 	  <literal>${PORTNAME}-${PORTVERSION}</literal>, so override it only if necessary.
 	  <makevar>DISTNAME</makevar> is only used in two places.
 	  First, the distribution file list
 	  (<makevar>DISTFILES</makevar>) defaults to
 	  <makevar>${DISTNAME}</makevar><makevar>${EXTRACT_SUFX}</makevar>.
 	  Second, the distribution file is expected to extract into a
 	  subdirectory named <makevar>WRKSRC</makevar>, which defaults
 	  to <filename>work/<makevar>${DISTNAME}</makevar></filename>.</para>
 
         <para>Some vendor's distribution names which do not fit into the
 	  <literal>${PORTNAME}-${PORTVERSION}</literal>-scheme can be handled
 	  automatically by setting <makevar>DISTVERSION</makevar>.
 	  <makevar>PORTVERSION</makevar> and <makevar>DISTNAME</makevar> will be
 	  derived automatically, but can of course be overridden.  The following
 	  table lists some examples:</para>
 
 	<informaltable frame="none" pgwide="1">
 	  <tgroup cols="2">
 	    <thead>
 	      <row>
 		<entry><makevar>DISTVERSION</makevar></entry>
 		<entry><makevar>PORTVERSION</makevar></entry>
 	      </row>
 	    </thead>
-	    
+
 	    <tbody>
 	      <row>
 		<entry>0.7.1d</entry>
 		<entry>0.7.1.d</entry>
 	      </row>
 	      <row>
 		<entry>10Alpha3</entry>
 		<entry>10.a3</entry>
 	      </row>
 	      <row>
 		<entry>3Beta7-pre2</entry>
 		<entry>3.b7.p2</entry>
 	      </row>
 	      <row>
 		<entry>8:f_17</entry>
 		<entry>8f.17</entry>
 	      </row>
 	    </tbody>
 	  </tgroup>
 	</informaltable>
 
 	<note>
 	  <para><makevar>PKGNAMEPREFIX</makevar> and
 	    <makevar>PKGNAMESUFFIX</makevar> do not affect
 	    <makevar>DISTNAME</makevar>.  Also note that if
 	    <makevar>WRKSRC</makevar> is equal to
 	    <filename>work/<makevar>${PORTNAME}-${PORTVERSION}</makevar></filename>
 	    while the original source archive is named something other than
 	    <makevar>${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}</makevar>,
 	    you should probably leave <makevar>DISTNAME</makevar>
 	    alone&mdash; you are better off defining
 	    <makevar>DISTFILES</makevar> than having to set both
 	    <makevar>DISTNAME</makevar> and <makevar>WRKSRC</makevar>
 	    (and possibly <makevar>EXTRACT_SUFX</makevar>).</para>
 	</note>
       </sect2>
 
       <sect2>
 	<title><makevar>MASTER_SITES</makevar></title>
 
 	<para>Record the directory part of the FTP/HTTP-URL pointing at the
 	  original tarball in <makevar>MASTER_SITES</makevar>.  Do not forget
 	  the trailing slash (<filename>/</filename>)!</para>
 
 	<para>The <command>make</command> macros will try to use this
 	  specification for grabbing the distribution file with
 	  <makevar>FETCH</makevar> if they cannot find it already on the
 	  system.</para>
 
 	<para>It is recommended that you put multiple sites on this list,
 	  preferably from different continents.  This will safeguard against
 	  wide-area network problems.  We are even planning to add support
 	  for automatically determining the closest master site and fetching
 	  from there; having multiple sites will go a long way towards
 	  helping this effort.</para>
 
 	<para>If the original tarball is part of one of the popular
 	  archives such as X-contrib, GNU, or Perl CPAN, you may be able
 	  refer to those sites in an easy compact form using
 	  <makevar>MASTER_SITE_<replaceable>*</replaceable></makevar>
 	  (e.g., <makevar>MASTER_SITE_XCONTRIB</makevar> and
 	  <makevar>MASTER_SITE_PERL_GNU</makevar>).  Simply set
 	  <makevar>MASTER_SITES</makevar> to one of these variables and
 	  <makevar>MASTER_SITE_SUBDIR</makevar> to the path within the
 	  archive.  Here is an example:</para>
 
 	<programlisting>MASTER_SITES=         ${MASTER_SITE_XCONTRIB}
 MASTER_SITE_SUBDIR=   applications</programlisting>
 
 	<para>These variables are defined in
 	  <filename>/usr/ports/Mk/bsd.sites.mk</filename>.  There are
 	  new entries added all the time, so make sure to check the
 	  latest version of this file before submitting a port.</para>
 
 	<para>The user can also set the <makevar>MASTER_SITE_*</makevar>
 	  variables in <filename>/etc/make.conf</filename> to override our
 	  choices, and use their favorite mirrors of these popular archives
 	  instead.</para>
       </sect2>
 
       <sect2>
 	<title><makevar>EXTRACT_SUFX</makevar></title>
 
 	<para>If you have one distribution file, and it uses an odd suffix to
 	  indicate the compression mechanism, set
 	  <makevar>EXTRACT_SUFX</makevar>.</para>
 
 	<para>For example, if the distribution file was named
 	  <filename>foo.tgz</filename> instead of the more normal
 	  <filename>foo.tar.gz</filename>, you would write:</para>
 
 	<programlisting>DISTNAME=      foo
 EXTRACT_SUFX=  .tgz</programlisting>
 
 	<para>The <makevar>USE_BZIP2</makevar> and <makevar>USE_ZIP</makevar>
 	  variables automatically set <makevar>EXTRACT_SUFX</makevar> to
 	  <literal>.tar.bz2</literal> or <literal>.zip</literal> as necessary.  If
 	  neither of these are set then <makevar>EXTRACT_SUFX</makevar>
 	  defaults to <literal>.tar.gz</literal>.</para>
 
 	<note>
 	  <para>You never need to set both <makevar>EXTRACT_SUFX</makevar> and
 	    <makevar>DISTFILES</makevar>.</para>
 	</note>
       </sect2>
 
       <sect2>
 	<title><makevar>DISTFILES</makevar></title>
 
 	<para>Sometimes the names of the files to be downloaded have no
 	  resemblance to the name of the port.  For example, it might be
 	  called <filename>source.tar.gz</filename> or similar.  In other
 	  cases the application's source code might be in several different
 	  archives, all of which must be downloaded.</para>
 
 	<para>If this is the case, set <makevar>DISTFILES</makevar> to be a
 	  space separated list of all the files that must be
 	  downloaded.</para>
 
 	<programlisting>DISTFILES=     source1.tar.gz source2.tar.gz</programlisting>
 
 	<para>If not explicitly set, <makevar>DISTFILES</makevar> defaults to
 	  <literal>${DISTNAME}${EXTRACT_SUFX}</literal>.</para>
       </sect2>
 
       <sect2>
 	<title><makevar>EXTRACT_ONLY</makevar></title>
 
 	<para>If only some of the <makevar>DISTFILES</makevar> must be
 	  extracted&mdash;for example, one of them is the source code, while
 	  another is an uncompressed document&mdash;list the filenames that
 	  must be extracted in <makevar>EXTRACT_ONLY</makevar>.</para>
 
 	<programlisting>DISTFILES=     source.tar.gz manual.html
 EXTRACT_ONLY=  source.tar.gz</programlisting>
 
 	<para>If <emphasis>none</emphasis> of the <makevar>DISTFILES</makevar>
 	  should be uncompressed then set <makevar>EXTRACT_ONLY</makevar> to
 	  the empty string.</para>
 
 	<programlisting>EXTRACT_ONLY=</programlisting>
       </sect2>
 
       <sect2 id="porting-patchfiles">
 	<title><makevar>PATCHFILES</makevar></title>
 
 	<para>If your port requires some additional patches that are available
 	  by FTP or HTTP, set <makevar>PATCHFILES</makevar> to the names of
 	  the files and <makevar>PATCH_SITES</makevar> to the URL of the
 	  directory that contains them (the format is the same as
 	  <makevar>MASTER_SITES</makevar>).</para>
 
 	<para>If the patch is not relative to the top of the source tree
 	  (i.e., <makevar>WRKSRC</makevar>) because it contains some extra
 	  pathnames, set <makevar>PATCH_DIST_STRIP</makevar> accordingly. For
 	  instance, if all the pathnames in the patch have an extra
 	  <literal>foozolix-1.0/</literal> in front of the filenames, then set
 	  <literal>PATCH_DIST_STRIP=-p1</literal>.</para>
 
 	<para>Do not worry if the patches are compressed; they will be
 	  decompressed automatically if the filenames end with
 	  <filename>.gz</filename> or <filename>.Z</filename>.</para>
 
 	<para>If the patch is distributed with some other files, such as
 	  documentation, in a gzip'd tarball, you cannot just use
 	  <makevar>PATCHFILES</makevar>.  If that is the case, add the name
 	  and the location of the patch tarball to
 	  <makevar>DISTFILES</makevar> and <makevar>MASTER_SITES</makevar>.
 	  Then, use the <makevar>EXTRA_PATCHES</makevar> variable to
 	  point to those files and <filename>bsd.port.mk</filename>
 	  will automatically apply them for you.  In particular, do
 	  <emphasis>not</emphasis> copy patch files into the
 	  <makevar>PATCHDIR</makevar> directory&mdash;that directory may
 	  not be writable.</para>
 
 	<note>
 	  <para>The tarball will have been extracted alongside the
 	    regular source by then, so there is no need to explicitly extract
 	    it if it is a regular gzip'd or compress'd tarball. If you do the
 	    latter, take extra care not to overwrite something that already
 	    exists in that directory.  Also, do not forget to add a command to
 	    remove the copied patch in the <maketarget>pre-clean</maketarget>
 	    target.</para>
 	</note>
       </sect2>
 
       <sect2 id="porting-master-sites-n">
 	<title>Multiple distribution files or patches from different
 	  sites and subdirectories
 	  (<literal>MASTER_SITES:n</literal>)</title>
 
 	<para>(Consider this to be a somewhat <quote>advanced topic</quote>;
 	  those new to this document may wish to skip this section at first).
 	  </para>
 
 	<para>This section has information on the fetching mechanism
 	  known as both <literal>MASTER_SITES:n</literal> and
 	  <literal>MASTER_SITES_NN</literal>.  We will refer to this
 	  mechanism as <literal>MASTER_SITES:n</literal>
 	  hereon.</para>
 
 	<para>A little background first.  OpenBSD has a neat feature
 	  inside both <makevar>DISTFILES</makevar> and
 	  <makevar>PATCHFILES</makevar> variables, both files and
 	  patches can be postfixed with <literal>:n</literal>
 	  identifiers where <literal>n</literal> both can be
 	  <literal>[0-9]</literal> and denote a group designation.
 	  For example:</para>
 
 	<programlisting>DISTFILES=      alpha:0 beta:1</programlisting>
 
 	<para>In OpenBSD, distribution file <filename>alpha</filename>
 	  will be associated with variable
 	  <makevar>MASTER_SITES0</makevar> instead of our common
 	  <makevar>MASTER_SITES</makevar> and
 	  <filename>beta</filename> with
 	  <makevar>MASTER_SITES1</makevar>.</para>
 
 	<para>This is a very interesting feature which can decrease
 	  that endless search for the correct download site.</para>
 
 	<para>Just picture 2 files in <makevar>DISTFILES</makevar> and
 	  20 sites in <makevar>MASTER_SITES</makevar>, the sites slow
 	  as hell where <filename>beta</filename> is carried by all
 	  sites in <makevar>MASTER_SITES</makevar>, and
 	  <filename>alpha</filename> can only be found in the 20th
 	  site.  It would be such a waste to check all of them if
 	  maintainer knew this beforehand, would it not?  Not a good
 	  start for that lovely weekend!</para>
 
 	<para>Now that you have the idea, just imagine more
 	  <makevar>DISTFILES</makevar> and more
 	  <makevar>MASTER_SITES</makevar>.  Surely our
 	  <quote>distfiles survey meister</quote> would appreciate the
 	  relief to network strain that this would bring.</para>
 
 	<para>In the next sections, information will follow on the
 	  FreeBSD implementation of this idea.	We improved a bit on
 	  OpenBSD's concept.</para>
 
 	<sect3>
 	  <title>Simplified information</title>
 
 	  <para>This section tells you how to quickly prepare fine
 	    grained fetching of multiple distribution files and
 	    patches from different sites and subdirectories.  We
 	    describe here a case of simplified
 	    <literal>MASTER_SITES:n</literal> usage.  This will be
 	    sufficient for most scenarios.  However, if you need
 	    further information, you will have to refer to the next
 	    section.</para>
 
 	  <para>Some applications consist of multiple distribution
 	    files that must be downloaded from a number of different
 	    sites.  For example,
 	    <application>Ghostscript</application> consists of the
 	    core of the program, and then a large number of driver
 	    files that are used depending on the user's printer.  Some
 	    of these driver files are supplied with the core, but many
 	    others must be downloaded from a variety of different
 	    sites.</para>
 
 	  <para>To support this, each entry in
 	    <makevar>DISTFILES</makevar> may be followed by a colon
 	    and a <quote>tag name</quote>.  Each site listed in
 	    <makevar>MASTER_SITES</makevar> is then followed by a
 	    colon, and the tag that indicates which distribution files
 	    should be downloaded from this site.</para>
 
 	  <para>For example, consider an application with the source
 	    split in two parts, <filename>source1.tar.gz</filename>
 	    and <filename>source2.tar.gz</filename>, which must be
 	    downloaded from two different sites.  The port's
 	    <filename>Makefile</filename> would include lines like
 	    <xref
 	      linkend="ports-master-sites-n-example-simple-use-one-file-per-site">.</para>
 
 	  <example
 	    id="ports-master-sites-n-example-simple-use-one-file-per-site">
 	    <title>Simplified use of <literal>MASTER_SITES:n</literal>
 	      with 1 file per site</title>
 
 	    <programlisting>MASTER_SITES=   ftp://ftp.example1.com/:source1 \
 		ftp://ftp.example2.com/:source2
 DISTFILES=      source1.tar.gz:source1 \
 		source2.tar.gz:source2</programlisting>
 	  </example>
 
 	  <para>Multiple distribution files can have the same tag.
 	    Continuing the previous example, suppose that there was a
 	    third distfile, <filename>source3.tar.gz</filename>, that
 	    should be downloaded from
 	    <hostid>ftp.example2.com</hostid>.	The
 	    <filename>Makefile</filename> would then be written like
 	    <xref
 	      linkend="ports-master-sites-n-example-simple-use-more-than-one-file-per-site">.</para>
 
 	  <example
 	    id="ports-master-sites-n-example-simple-use-more-than-one-file-per-site">
 	    <title>Simplified use of <literal>MASTER_SITES:n</literal>
 	      with more than 1 file per site</title>
 
 	    <programlisting>MASTER_SITES=   ftp://ftp.example1.com/:source1 \
 		ftp://ftp.example2.com/:source2
 DISTFILES=      source1.tar.gz:source1 \
 		source2.tar.gz:source2 \
 		source3.tar.gz:source2</programlisting>
 	  </example>
 	</sect3>
 
 	<sect3>
 	  <title>Detailed information</title>
 
 	  <para>Okay, so the previous section example did not reflect
 	    your needs?	 In this section we will explain in detail how
 	    the fine grained fetching mechanism
 	    <literal>MASTER_SITES:n</literal> works and how you can
 	    modify your ports to use it.</para>
 
 	  <orderedlist>
 	    <listitem>
 	      <para>Elements can be postfixed with
 		<literal>:<replaceable>n</replaceable></literal> where
 		<replaceable>n</replaceable> is
 		<literal>[^:,]+</literal>, i.e.,
 		<replaceable>n</replaceable> could conceptually be any
 		alphanumeric string but we will limit it to
 		<literal>[a-zA-Z_][0-9a-zA-Z_]+</literal> for
 		now.</para>
 
 	      <para>Moreover, string matching is case sensitive;
 		i.e., <literal>n</literal> is different from
 		<literal>N</literal>.</para>
 
 	      <para>However, the following words cannot be used for
 		postfixing purposes since they yield special meaning:
 		<literal>default</literal>, <literal>all</literal> and
 		<literal>ALL</literal> (they are used internally in
 		item <xref
 		  linkend="porting-master-sites-n-what-changes-in-port-targets">).
 		Furthermore, <literal>DEFAULT</literal> is a special
 		purpose word (check item <xref
 		  linkend="porting-master-sites-n-DEFAULT-group">).</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>Elements postfixed with <literal>:n</literal>
 		belong to the group <literal>n</literal>,
 		<literal>:m</literal> belong to group
 		<literal>m</literal> and so forth.</para>
 	    </listitem>
 
 	    <listitem id="porting-master-sites-n-DEFAULT-group">
 	      <para>Elements without a postfix are groupless, i.e.,
 		they all belong to the special group
 		<literal>DEFAULT</literal>.  If you postfix any
 		elements with <literal>DEFAULT</literal>, you are just
 		being redundant unless you want to have an element
 		belonging to both <literal>DEFAULT</literal> and other
 		groups at the same time (check item <xref
 		  linkend="porting-master-sites-n-comma-operator">).</para>
 
 	      <para>The following examples are equivalent but the
 		first one is preferred:</para>
 
 	      <programlisting>MASTER_SITES=   alpha
 
 MASTER_SITES=   alpha:DEFAULT</programlisting>
 	    </listitem>
 
 	    <listitem>
 	      <para>Groups are not exclusive, an element may belong to
 		several different groups at the same time and a group
 		can either have either several different elements or
 		none at all.  Repeated elements within the same group
 		will be simply that, repeated elements.</para>
 	    </listitem>
 
 	    <listitem id="porting-master-sites-n-comma-operator">
 	      <para>When you want an element to belong to several
 		groups at the same time, you can use the comma
 		operator (<literal>,</literal>).</para>
 
 	      <para>Instead of repeating it several times, each time
 		with a different postfix, we can list several groups
 		at once in a single postfix.  For instance,
 		<literal>:m,n,o</literal> marks an element that
 		belongs to group <literal>m</literal>,
 		<literal>n</literal> and <literal>o</literal>.</para>
 
 	      <para>All the following examples are equivalent but the
 		last one is preferred:</para>
 
 	      <programlisting>MASTER_SITES=   alpha alpha:SOME_SITE
 
 MASTER_SITES=   alpha:DEFAULT alpha:SOME_SITE
 
 MASTER_SITES=   alpha:SOME_SITE,DEFAULT
 
 MASTER_SITES=   alpha:DEFAULT,SOME_SITE</programlisting>
 	    </listitem>
 
 	    <listitem>
 	      <para>All sites within a given group are sorted
 		according to <makevar>MASTER_SORT_AWK</makevar>.  All
 		groups within <makevar>MASTER_SITES</makevar> and
 		<makevar>PATCH_SITES</makevar> are sorted as
 		well.</para>
 	    </listitem>
 
 	    <listitem id="porting-master-sites-n-group-semantics">
 	      <para>Group semantics can be used in any of the
 		following variables <makevar>MASTER_SITES</makevar>,
 		<makevar>PATCH_SITES</makevar>,
 		<makevar>MASTER_SITE_SUBDIR</makevar>,
 		<makevar>PATCH_SITE_SUBDIR</makevar>,
 		<makevar>DISTFILES</makevar>, and
 		<makevar>PATCHFILES</makevar> according to the
 		following syntax:</para>
 
 	      <orderedlist>
 		<listitem>
 		  <para>All <makevar>MASTER_SITES</makevar>,
 		    <makevar>PATCH_SITES</makevar>,
 		    <makevar>MASTER_SITE_SUBDIR</makevar> and
 		    <makevar>PATCH_SITE_SUBDIR</makevar> elements must
 		    be terminated with the forward slash
 		    <literal>/</literal> character.  If any elements
 		    belong to any groups, the group postfix
 		    <literal>:<replaceable>n</replaceable></literal>
 		    must come right after the terminator
 		    <literal>/</literal>.  The
 		    <literal>MASTER_SITES:n</literal> mechanism relies
 		    on the existence of the terminator
 		    <literal>/</literal> to avoid confusing elements
 		    where a <literal>:n</literal> is a valid part of
 		    the element with occurrences where
 		    <literal>:n</literal> denotes group
 		    <literal>n</literal>.  For compatibility purposes,
 		    since the <literal>/</literal> terminator was not
 		    required before in both
 		    <makevar>MASTER_SITE_SUBDIR</makevar> and
 		    <makevar>PATCH_SITE_SUBDIR</makevar> elements, if
 		    the postfix immediate preceding character is not
 		    a <literal>/</literal> then <literal>:n</literal>
 		    will be considered a valid part of the element
 		    instead of a group postfix even if an element is
 		    postfixed with <literal>:n</literal>.  See both
 		    <xref
 		      linkend="ports-master-sites-n-example-detailed-use-master-site-subdir">
 		    and <xref
 		      linkend="ports-master-sites-n-example-detailed-use-complete-example-master-sites">.</para>
 
 		  <example id="ports-master-sites-n-example-detailed-use-master-site-subdir">
 		    <title>Detailed use of
 		      <literal>MASTER_SITES:n</literal> in
 		      <makevar>MASTER_SITE_SUBDIR</makevar></title>
 
 		    <programlisting>MASTER_SITE_SUBDIR=     old:n new/:NEW</programlisting>
 
 		    <itemizedlist>
 		      <listitem>
 			<para>Directories within group
 			  <literal>DEFAULT</literal> -> old:n</para>
 		      </listitem>
 
 		      <listitem>
 			<para>Directories within group
 			  <literal>NEW</literal> -> new</para>
 		      </listitem>
 		    </itemizedlist>
 		  </example>
 
 		  <example
 		    id="ports-master-sites-n-example-detailed-use-complete-example-master-sites">
 		      <title>Detailed use of
 			<literal>MASTER_SITES:n</literal> with comma
 			operator, multiple files, multiple sites and
 			multiple subdirectories</title>
 
 		    <programlisting>MASTER_SITES=   http://site1/%SUBDIR%/ http://site2/:DEFAULT \
 		http://site3/:group3 http://site4/:group4 \
 		http://site5/:group5 http://site6/:group6 \
 		http://site7/:DEFAULT,group6 \
 		http://site8/%SUBDIR%/:group6,group7 \
 		http://site9/:group8
 DISTFILES=      file1 file2:DEFAULT file3:group3 \
 		file4:group4,group5,group6 file5:grouping \
 		file6:group7
 MASTER_SITE_SUBDIR=     directory-trial:1 directory-n/:groupn \
 			directory-one/:group6,DEFAULT \
 			directory</programlisting>
 
 		    <para>The previous example results in the
 		      following fine grained fetching.	Sites are
 		      listed in the exact order they will be
 		      used.</para>
 
 		    <itemizedlist>
 		      <listitem>
 			<para><filename>file1</filename> will be
 			  fetched from</para>
 
 			<itemizedlist>
 			  <listitem>
 			    <para><makevar>MASTER_SITE_OVERRIDE</makevar></para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site1/directory-trial:1/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site1/directory-one/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site1/directory/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site2/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site7/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para><makevar>MASTER_SITE_BACKUP</makevar></para>
 			  </listitem>
 			</itemizedlist>
 		      </listitem>
 
 		      <listitem>
 			<para><filename>file2</filename> will be
 			  fetched exactly as
 			  <filename>file1</filename> since they
 			  both belong to the same group</para>
 
 			<itemizedlist>
 			  <listitem>
 			    <para><makevar>MASTER_SITE_OVERRIDE</makevar></para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site1/directory-trial:1/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site1/directory-one/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site1/directory/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site2/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site7/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para><makevar>MASTER_SITE_BACKUP</makevar></para>
 			  </listitem>
 			</itemizedlist>
 		      </listitem>
 
 		      <listitem>
 			<para><filename>file3</filename> will be
 			  fetched from</para>
 
 			<itemizedlist>
 			  <listitem>
 			    <para><makevar>MASTER_SITE_OVERRIDE</makevar></para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site3/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para><makevar>MASTER_SITE_BACKUP</makevar></para>
 			  </listitem>
 			</itemizedlist>
 		      </listitem>
 
 		      <listitem>
 			<para><filename>file4</filename> will be
 			  fetched from</para>
 
 			<itemizedlist>
 			  <listitem>
 			    <para><makevar>MASTER_SITE_OVERRIDE</makevar></para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site4/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site5/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site6/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site7/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site8/directory-one/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para><makevar>MASTER_SITE_BACKUP</makevar></para>
 			  </listitem>
 			</itemizedlist>
 		      </listitem>
 
 		      <listitem>
 			<para><filename>file5</filename> will be
 			  fetched from</para>
 
 			<itemizedlist>
 			  <listitem>
 			    <para><makevar>MASTER_SITE_OVERRIDE</makevar></para>
 			  </listitem>
 
 			  <listitem>
 			    <para><makevar>MASTER_SITE_BACKUP</makevar></para>
 			  </listitem>
 			</itemizedlist>
 		      </listitem>
 
 		      <listitem>
 			<para><filename>file6</filename> will be
 			  fetched from</para>
 
 			<itemizedlist>
 			  <listitem>
 			    <para><makevar>MASTER_SITE_OVERRIDE</makevar></para>
 			  </listitem>
 
 			  <listitem>
 			    <para>http://site8/</para>
 			  </listitem>
 
 			  <listitem>
 			    <para><makevar>MASTER_SITE_BACKUP</makevar></para>
 			  </listitem>
 			</itemizedlist>
 		      </listitem>
 		    </itemizedlist>
 		  </example>
 		</listitem>
 	      </orderedlist>
 	    </listitem>
 
 	    <listitem>
 	      <para>How do I group one of the special variables from
 		<filename>bsd.sites.mk</filename>, e.g.,
 		<makevar>MASTER_SITE_SOURCEFORGE</makevar>?</para>
 
 	      <para>See <xref
 		  linkend="ports-master-sites-n-example-detailed-use-master-site-sourceforge">.</para>
 
 	      <example
 		id="ports-master-sites-n-example-detailed-use-master-site-sourceforge">
 		<title>Detailed use of
 		  <literal>MASTER_SITES:n</literal> with
 		  <makevar>MASTER_SITE_SOURCEFORGE</makevar></title>
 
 		<programlisting>MASTER_SITES=   http://site1/ ${MASTER_SITE_SOURCEFORGE:S/$/:sourceforge,TEST/}
 DISTFILES=      something.tar.gz:sourceforge</programlisting>
 	      </example>
 
 	      <para><filename>something.tar.gz</filename> will be
 		fetched from all sites within
 		<makevar>MASTER_SITE_SOURCEFORGE</makevar>.</para>
 	    </listitem>
 
 	    <listitem>
 	      <para>How do I use this with <makevar>PATCH*</makevar>
 		variables?</para>
 
 	      <para>All examples were done with
 		<makevar>MASTER*</makevar> variables but they work
 		exactly the same for <makevar>PATCH*</makevar> ones as
 		can be seen in <xref
 		  linkend="ports-master-sites-n-example-detailed-use-patch-sites">.</para>
 
 	      <example
 		id="ports-master-sites-n-example-detailed-use-patch-sites">
 		<title>Simplified use of
 		  <literal>MASTER_SITES:n</literal> with
 		  <makevar>PATCH_SITES</makevar>.</title>
 
 		<programlisting>PATCH_SITES=    http://site1/ http://site2/:test
 PATCHFILES=     patch1:test</programlisting>
 	      </example>
 	    </listitem>
 	  </orderedlist>
 	</sect3>
 
 	<sect3>
 	  <title>What does change for ports?  What does not?</title>
 
 	  <orderedlist numeration="lowerroman">
 	    <listitem>
 	      <para>All current ports remain the same.  The
 		<literal>MASTER_SITES:n</literal> feature code is only
 		activated if there are elements postfixed with
 		<literal>:<replaceable>n</replaceable></literal> like
 		elements according to the aforementioned syntax rules,
 		especially as shown in item <xref
 		  linkend="porting-master-sites-n-group-semantics">.</para>
 	    </listitem>
 
 	    <listitem id="porting-master-sites-n-what-changes-in-port-targets">
 	      <para>The port targets remain the same:
 		<maketarget>checksum</maketarget>,
 		<maketarget>makesum</maketarget>,
 		<maketarget>patch</maketarget>,
 		<maketarget>configure</maketarget>,
 		<maketarget>build</maketarget>, etc.  With the obvious
 		exceptions of <maketarget>do-fetch</maketarget>,
 		<maketarget>fetch-list</maketarget>,
 		<maketarget>master-sites</maketarget> and
 		<maketarget>patch-sites</maketarget>.</para>
 
 	      <itemizedlist>
 		<listitem>
 		  <para><maketarget>do-fetch</maketarget>: deploys the
 		    new grouping postfixed
 		    <makevar>DISTFILES</makevar> and
 		    <makevar>PATCHFILES</makevar> with their matching
 		    group elements within both
 		    <makevar>MASTER_SITES</makevar> and
 		    <makevar>PATCH_SITES</makevar> which use matching
 		    group elements within both
 		    <makevar>MASTER_SITE_SUBDIR</makevar> and
 		    <makevar>PATCH_SITE_SUBDIR</makevar>.  Check <xref
 		      linkend="ports-master-sites-n-example-detailed-use-complete-example-master-sites">.</para>
 		</listitem>
 
 		<listitem>
 		  <para><maketarget>fetch-list</maketarget>: works
 		    like old <maketarget>fetch-list</maketarget> with
 		    the exception that it groups just like
 		    <maketarget>do-fetch</maketarget>.</para>
 		</listitem>
 
 		<listitem>
 		  <para><maketarget>master-sites</maketarget> and
 		    <maketarget>patch-sites</maketarget>:
 		    (incompatible with older versions) only return the
 		    elements of group <literal>DEFAULT</literal>;  in
 		    fact, they execute targets
 		    <maketarget>master-sites-default</maketarget> and
 		    <maketarget>patch-sites-default</maketarget>
 		    respectively.</para>
 
 		  <para>Furthermore, using target either
 		    <maketarget>master-sites-all</maketarget> or
 		    <maketarget>patch-sites-all</maketarget> is
 		    preferred to directly checking either
 		    <maketarget>MASTER_SITES</maketarget> or
 		    <maketarget>PATCH_SITES</maketarget>.  Also,
 		    directly checking is not guaranteed to work in any
 		    future versions.  Check item <xref
 		      linkend="porting-master-sites-n-new-port-targets-master-sites-all">
 		    for more information on these new port
 		    targets.</para>
 		</listitem>
 
 	      </itemizedlist>
 	    </listitem>
 
 	    <listitem>
 	      <para>New port targets</para>
 
 	      <orderedlist>
 		<listitem>
 		  <para>There are
 		    <maketarget>master-sites-<replaceable>n</replaceable></maketarget>
 		    and
 		    <maketarget>patch-sites-<replaceable>n</replaceable></maketarget>
 		    targets which will list the elements of the
 		    respective group <replaceable>n</replaceable>
 		    within <makevar>MASTER_SITES</makevar> and
 		    <makevar>PATCH_SITES</makevar> respectively.  For
 		    instance, both
 		    <maketarget>master-sites-DEFAULT</maketarget> and
 		    <maketarget>patch-sites-DEFAULT</maketarget> will
 		    return the elements of group
 		    <literal>DEFAULT</literal>,
 		    <maketarget>master-sites-test</maketarget> and
 		    <maketarget>patch-sites-test</maketarget> of group
 		    <literal>test</literal>, and thereon.</para>
 		</listitem>
 
 		<listitem id="porting-master-sites-n-new-port-targets-master-sites-all">
 		  <para>There are new targets
 		    <maketarget>master-sites-all</maketarget> and
 		    <maketarget>patch-sites-all</maketarget> which do
 		    the work of the old
 		    <maketarget>master-sites</maketarget> and
 		    <maketarget>patch-sites</maketarget> ones.  They
 		    return the elements of all groups as if they all
 		    belonged to the same group with the caveat that it
 		    lists as many
 		    <makevar>MASTER_SITE_BACKUP</makevar> and
 		    <makevar>MASTER_SITE_OVERRIDE</makevar> as there
 		    are groups defined within either
 		    <makevar>DISTFILES</makevar> or
 		    <makevar>PATCHFILES</makevar>;  respectively for
 		    <maketarget>master-sites-all</maketarget> and
 		    <maketarget>patch-sites-all</maketarget>.</para>
 		</listitem>
 	      </orderedlist>
 	    </listitem>
 	  </orderedlist>
 	</sect3>
       </sect2>
 
       <sect2>
 	<title><makevar>DIST_SUBDIR</makevar></title>
 
 	<para>Do not let your port clutter
 	  <filename>/usr/ports/distfiles</filename>.  If your port requires a
 	  lot of files to be fetched, or contains a file that has a name that
 	  might conflict with other ports (e.g.,
 	  <filename>Makefile</filename>), set <makevar>DIST_SUBDIR</makevar>
 	  to the name of the port (<literal>${PORTNAME}</literal> or
 	  <literal>${PKGNAMEPREFIX}${PORTNAME}</literal>
 	  should work fine).  This will change
 	  <makevar>DISTDIR</makevar> from the default
 	  <filename>/usr/ports/distfiles</filename> to
 	  <filename>/usr/ports/distfiles/<makevar>DIST_SUBDIR</makevar></filename>,
 	  and in effect puts everything that is required for your port into
 	  that subdirectory.</para>
 
 	<para>It will also look at the subdirectory with the same name on the
 	  backup master site at <filename>ftp.FreeBSD.org</filename>.
 	  (Setting <makevar>DISTDIR</makevar> explicitly in your
 	  <makevar>Makefile</makevar> will not accomplish this, so please use
 	  <makevar>DIST_SUBDIR</makevar>.)</para>
 
 	<note>
 	  <para>This does not affect the <makevar>MASTER_SITES</makevar> you
 	    define in your <filename>Makefile</filename>.</para>
 	</note>
       </sect2>
     </sect1>
 
       <sect1 id="makefile-maintainer">
 	<title><makevar>MAINTAINER</makevar></title>
 
 	<para>Set your mail-address here.  Please.  <!-- smiley
 	  --><emphasis>:-)</emphasis></para>
 
 	<para>Note that only a single address without the comment part is
 	  allowed as a <makevar>MAINTAINER</makevar> value.
 	  The format used should be <literal>user@hostname.domain</literal>.
 	  Please do not include any descriptive text such as your real
 	  name in this entry&mdash;that merely confuses
 	  <filename>bsd.port.mk</filename>.  Instead, put that information
 	  into your <filename>pkg-descr</filename>.</para>
 
 	<para>For a detailed description of the responsibilities of maintainers,
 	  refer to the <ulink url="&url.books.developers-handbook;/policies.html#POLICIES-MAINTAINER">MAINTAINER on
 	    Makefiles</ulink> section.</para>
 
 	<para>If the maintainer of a port does not respond to an update
 	  request from a user after two weeks (excluding major public
 	  holidays), then that is considered a maintainer timeout, and the
 	  update may be made without explicit maintainer approval.  If the
 	  maintainer does not respond within three months, then that
 	  maintainer is considered absent without leave, and can be
 	  replaced as the maintainer of the particular port in question.
 	  Exceptions to this are anything maintained by the &a.portmgr;, or
 	  the &a.security-officer;.  No unauthorized commits may ever be
 	  made to ports maintained by those groups.</para>
 
 	<para>The &a.portmgr; reserves the right to revoke or override
 	  anyone's maintainership for any reason, and the &a.security-officer;
 	  reserves the right to revoke or override maintainership for security
 	  reasons.</para>
       </sect1>
 
       <sect1 id="makefile-comment">
 	<title><makevar>COMMENT</makevar></title>
 
 	<para>This is a one-line description of the port.
 	  <emphasis>Please</emphasis> do not include the package name (or
 	  version number of the software) in the comment.  The comment
 	  should begin with a capital and end without a period.  Here
 	  is an example:</para>
 
 	<programlisting>COMMENT=       A cat chasing a mouse all over the screen</programlisting>
 
 	<para>The COMMENT variable should immediately follow the MAINTAINER
 	  variable in the <filename>Makefile</filename>.</para>
 
 	<para>Please try to keep the COMMENT line less than 70
 	  characters, as it is displayed to users as a one-line
 	  summary of the port.</para>
       </sect1>
 
       <sect1 id="makefile-depend">
 	<title>Dependencies</title>
 
 	<para>Many ports depend on other ports.  There are seven variables that
 	  you can use to ensure that all the required bits will be on the
 	  user's machine.  There are also some pre-supported dependency
 	  variables for common cases, plus a few more to control the behavior
 	  of dependencies.</para>
 
 	<sect2>
 	  <title><makevar>LIB_DEPENDS</makevar></title>
 
 	  <para>This variable specifies the shared libraries this port depends
 	    on.  It is a list of
 	    <replaceable>lib</replaceable>:<replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>
 	    tuples where <replaceable>lib</replaceable> is the name of the
 	    shared library, <replaceable>dir</replaceable> is the
 	    directory in which to find it in case it is not available, and
 	    <replaceable>target</replaceable> is the target to call in that
 	    directory.  For example,
 	    <programlisting>LIB_DEPENDS=   jpeg.9:${PORTSDIR}/graphics/jpeg:install</programlisting>
 	    will check for a shared jpeg library with major version 9, and
 	    descend into the <filename>graphics/jpeg</filename> subdirectory
 	    of your ports tree to build and install it if it is not found.
 	    The <replaceable>target</replaceable> part can be omitted if it is
 	    equal to <makevar>DEPENDS_TARGET</makevar> (which defaults to
 	    <literal>install</literal>).</para>
 
 	  <note>
 	    <para>The <replaceable>lib</replaceable> part is a regular
 	      expression which is being looked up in the
 	      <command>ldconfig -r</command> output.  Values such as
 	      <literal>intl.[5-7]</literal> and <literal>intl</literal> are
 	      allowed.  The first pattern,
 	      <literal>intl.[5-7]</literal>, will match any of:
 	      <literal>intl.5</literal>, <literal>intl.6</literal> or
 	      <literal>intl.7</literal>.  The second pattern,
 	      <literal>intl</literal>, will match any version of the
 	      <literal>intl</literal> library.</para>
 	  </note>
 
 	  <para>The dependency is checked twice, once from within the
 	    <maketarget>extract</maketarget> target and then from within the
 	    <maketarget>install</maketarget> target.  Also, the name of the
 	    dependency is put into the package so that
 	    &man.pkg.add.1; will automatically install it if it is
 	    not on the user's system.</para>
 	</sect2>
 
 	<sect2>
 	  <title><makevar>RUN_DEPENDS</makevar></title>
 
 	  <para>This variable specifies executables or files this port depends
 	    on during run-time.  It is a list of
 	    <replaceable>path</replaceable>:<replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>
 	    tuples where <replaceable>path</replaceable> is the name of the
 	    executable or file, <replaceable>dir</replaceable> is the
 	    directory in which to find it in case it is not available, and
 	    <replaceable>target</replaceable> is the target to call in that
 	    directory.  If <replaceable>path</replaceable> starts with a slash
 	    (<literal>/</literal>), it is treated as a file and its existence
 	    is  tested with <command>test -e</command>; otherwise, it is
 	    assumed to be an executable, and <command>which -s</command> is
 	    used to determine if the program exists in the search path.</para>
 
 	  <para>For example,</para>
 
 	    <programlisting>RUN_DEPENDS=   ${LOCALBASE}/etc/innd:${PORTSDIR}/news/inn \
 	       wish8.0:${PORTSDIR}/x11-toolkits/tk80</programlisting>
 
 	  <para>will check if the file or directory
 	    <filename>/usr/local/etc/innd</filename> exists, and build and
 	    install it from the <filename>news/inn</filename> subdirectory of
 	    the ports tree if it is not found.  It will also see if an
 	    executable called <command>wish8.0</command> is in the search
 	    path, and descend into the <filename>x11-toolkits/tk80</filename>
 	    subdirectory of your ports tree to build and install it if it is
 	    not found.</para>
 
 	  <note>
 	    <para>In this case, <command>innd</command> is actually an
 	      executable; if an executable is in a place that is not expected
 	      to be in the search path, you should use the full
 	      pathname.</para>
 	  </note>
 
 	  <note>
 	    <para>The official search <envar>PATH</envar> used on the ports
 	      build cluster is</para>
 
 	    <programlisting>/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin</programlisting>
 	  </note>
 
 	  <para>The dependency is checked from within the
 	    <maketarget>install</maketarget> target.  Also, the name of the
 	    dependency is put into the  package so that
 	    &man.pkg.add.1; will automatically install it if it is
 	    not on the user's system.  The <replaceable>target</replaceable>
 	    part can be omitted if it is the same as
 	    <makevar>DEPENDS_TARGET</makevar>.</para>
 	</sect2>
 
 	<sect2>
 	  <title><makevar>BUILD_DEPENDS</makevar></title>
 
 	  <para>This variable specifies executables or files this port
 	    requires to build.  Like <makevar>RUN_DEPENDS</makevar>, it is a
 	    list of
 	    <replaceable>path</replaceable>:<replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>
 	    tuples. For example, <programlisting> BUILD_DEPENDS=
 	      unzip:${PORTSDIR}/archivers/unzip</programlisting> will check
 	    for an executable called <command>unzip</command>, and descend
 	    into the <filename>archivers/unzip</filename> subdirectory of your
 	    ports tree to build and install it if it is not found.</para>
 
 	  <note>
 	    <para><quote>build</quote> here means everything from extraction to
 	      compilation.  The dependency is checked from within the
 	      <maketarget>extract</maketarget> target.  The
 	      <replaceable>target</replaceable> part can be omitted if it is
 	      the same as <makevar>DEPENDS_TARGET</makevar></para>
 	  </note>
 	</sect2>
 
 	<sect2>
 	  <title><makevar>FETCH_DEPENDS</makevar></title>
 
 	  <para>This variable specifies executables or files this port
 	    requires to fetch.  Like the previous two, it is a list of
 	    <replaceable>path</replaceable>:<replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>
 	    tuples.  For example, <programlisting> FETCH_DEPENDS=
 	      ncftp2:${PORTSDIR}/net/ncftp2</programlisting> will check for an
 	    executable called <command>ncftp2</command>, and descend into the
 	    <filename>net/ncftp2</filename> subdirectory of your ports tree to
 	    build and install it if it is not found.</para>
 
 	  <para>The dependency is checked from within the
 	    <maketarget>fetch</maketarget> target.  The
 	    <replaceable>target</replaceable> part can be omitted if it is the
 	    same as <makevar>DEPENDS_TARGET</makevar>.</para>
 	</sect2>
 
 	<sect2>
 	  <title><makevar>EXTRACT_DEPENDS</makevar></title>
 
 	  <para>This variable specifies executables or files this port
 	    requires for extraction.  Like the previous, it is a list of
 	    <replaceable>path</replaceable>:<replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>
 	    tuples.  For example, <programlisting>EXTRACT_DEPENDS=
 	      unzip:${PORTSDIR}/archivers/unzip</programlisting> will check
 	    for an executable called <command>unzip</command>, and descend
 	    into the <filename>archivers/unzip</filename> subdirectory of
 	    your ports tree to build and install it if it is not found.</para>
 
 	  <para>The dependency is checked from within the
 	    <maketarget>extract</maketarget> target.  The
 	    <replaceable>target</replaceable> part can be omitted if it is the
 	    same as <makevar>DEPENDS_TARGET</makevar>.</para>
 
 	  <note>
 	    <para>Use this variable only if the extraction does not already
 	      work (the default assumes <command>gzip</command>) and cannot
 	      be made to work using <makevar>USE_ZIP</makevar> or
 	      <makevar>USE_BZIP2</makevar> described in <xref
 		linkend="use-vars">.</para>
 	  </note>
 	</sect2>
 
 	<sect2>
 	  <title><makevar>PATCH_DEPENDS</makevar></title>
 
 	  <para>This variable specifies executables or files this port
 	    requires to patch.  Like the previous, it is a list of
 	    <replaceable>path</replaceable>:<replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>
 	    tuples.  For example, <programlisting> PATCH_DEPENDS=
 	      ${NONEXISTENT}:${PORTSDIR}/java/jfc:extract
 		</programlisting>will descend into the
 	    <filename>java/jfc</filename> subdirectory of your ports tree to
 	    build and install it if it is not found.</para>
 
 	  <para>The dependency is checked from within the
 	    <maketarget>patch</maketarget> target.  The
 	    <replaceable>target</replaceable> part can be omitted if it is the
 	    same as <makevar>DEPENDS_TARGET</makevar>.</para>
 	</sect2>
 
 	<sect2>
 	  <title><makevar>DEPENDS</makevar></title>
 
 	  <para>If there is a dependency that does not fall into either of the
 	    above categories, or your port requires having the source of
 	    the other port extracted in addition to having it installed,
 	    then use this variable.  This is a list of
 	    <replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>,
 	    as there is nothing to check, unlike the previous four.  The
 	    <replaceable>target</replaceable> part can be omitted if it is the
 	    same as <makevar>DEPENDS_TARGET</makevar>.</para>
 	</sect2>
 
 	<sect2 id="use-vars">
 	<title><makevar>USE_<replaceable>*</replaceable></makevar></title>
 
 	<para>A number of variables exist in order to encapsulate common
 	  dependencies that many ports have.  Although their use is
 	  optional, they can help to reduce the verbosity of the port
 	  <filename>Makefile</filename>s.  Each of them is styled
 	  as <makevar>USE_<replaceable>*</replaceable></makevar>.  The
 	  usage of these variables is restricted to the port
 	  <filename>Makefile</filename>s and
 	  <filename>ports/Mk/bsd.*.mk</filename> and is not designed
 	  to encapsulate user-settable options &mdash; use
 	  <makevar>WITH_<replaceable>*</replaceable></makevar> and
 	  <makevar>WITHOUT_<replaceable>*</replaceable></makevar>
 	  for that purpose.</para>
 
 	<note>
 	  <para>It is <emphasis>always</emphasis> incorrect to set
 	    any <makevar>USE_<replaceable>*</replaceable></makevar>
 	    in <filename>/etc/make.conf</filename>.  For instance,
 	    setting <programlisting>USE_GCC=3.2</programlisting>
 	    would adds a dependency on gcc32 for every port,
 	    including gcc32 itself!</para>
 	</note>
 
 	<table frame="none">
 	  <title>The <makevar>USE_<replaceable>*</replaceable></makevar>
 	    variables</title>
 
 	  <tgroup cols="2">
 	    <thead>
 	      <row>
 		<entry>Variable</entry>
 
 		<entry>Means</entry>
 	      </row>
 	    </thead>
 
 	    <tbody>
 	      <row>
 		<entry><makevar>USE_BZIP2</makevar></entry>
 
 		<entry>The port's tarballs are compressed with
 		  <command>bzip2</command>.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>USE_ZIP</makevar></entry>
 
 		<entry>The port's tarballs are compressed with
 		  <command>zip</command>.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>USE_BISON</makevar></entry>
 
 		<entry>The port uses <command>bison</command> for
 		  building.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>USE_GCC</makevar></entry>
 
 		<entry>The port requires a specific version of
 		  <command>gcc</command> to build.  The exact version can be
 		  specified with value such as <literal>3.2</literal>.
 		  The minimal required version can be specified as
 		  <literal>3.2+</literal>.  The <command>gcc</command> from
 		  the base system is used when it satisfies the requested
 		  version, otherwise an appropriate <command>gcc</command> is
 		  compiled from ports and the <makevar>CC</makevar> and
 		  <makevar>CXX</makevar> variables are adjusted.
 		  <makevar>USE_GCC</makevar> can't be used together with
 		  <makevar>USE_LIBTOOL_VER</makevar>.</entry>
 	      </row>
 
 	    </tbody>
 	  </tgroup>
 	</table>
 
 	  <para>Variables related to <application>gmake</application>,
 	    <filename>configure</filename> script,
 	    <application>autoconf</application>,
 	    <application>automake</application> and
 	    <application>libtool</application> are described in
 	    <xref linkend="using-autotools">.  <application>Perl</application>
 	    related variables are described in <xref linkend="using-perl">.
 	    X11 variables are listed in <xref linkend="using-x11">.  <xref
 	    linkend="using-gnome"> deals with GNOME and <xref
 	    linkend="using-kde"> with KDE related variables.  <xref
 	    linkend="using-java"> documents Java variables, while <xref
 	    linkend="using-php"> contains information on
 	    <application>Apache</application>, <application>PHP</application>
 	    and PEAR modules.  <application>Python</application> is discussed
 	    in <xref linkend="using-python">, while
 	    <application>Ruby</application> in <xref linkend="using-ruby">.
 	    Finally, <xref linkend="using-sdl"> provides variables used for
 	    <application>SDL</application> applications.</para>
 
 	</sect2>
 
 	<sect2>
 	  <title>Notes on dependencies</title>
 
 	  <para>As mentioned above, the default target to call when a
 	    dependency is required is <maketarget>DEPENDS_TARGET</maketarget>.
 	    It defaults to <literal>install</literal>.  This is a user
 	    variable; it is never defined in a port's
 	    <filename>Makefile</filename>.  If your port needs a special way
 	    to handle a dependency, use the <literal>:target</literal> part of
 	    the <makevar>*_DEPENDS</makevar> variables instead of redefining
 	    <makevar>DEPENDS_TARGET</makevar>.</para>
 
 	  <para>When you type <command>make clean</command>, its dependencies
 	    are automatically cleaned too.  If you do not wish this to happen,
 	    define the variable <makevar>NOCLEANDEPENDS</makevar> in your
 	    environment.  This may be particularly desirable if the port
 	    has something that takes a long time to rebuild in its
 	    dependency list, such as KDE, GNOME or Mozilla.</para>
 
 	  <para>To depend on another port unconditionally, use the
 	    variable <makevar>${NONEXISTENT}</makevar> as the first field
 	    of <makevar>BUILD_DEPENDS</makevar> or
 	    <makevar>RUN_DEPENDS</makevar>.  Use this only when you need to
 	    get the source of the other port.  You can often save
 	    compilation time by specifying the target too.  For
 	    instance
 
 	    <programlisting>BUILD_DEPENDS=   ${NONEXISTENT}:${PORTSDIR}/graphics/jpeg:extract</programlisting>
 
 	    will always descend to the <literal>jpeg</literal> port and extract it.</para>
 
 	  <para>Do not use <makevar>DEPENDS</makevar> unless there is no other
 	    way the behavior you want can be accomplished.  It will cause the
 	    other port to always be built (and installed, by default), and the
 	    dependency will go into the packages as well.  If this is really
 	    what you need, you should probably write it as
 	    <literal>BUILD_DEPENDS</literal> and
 	    <literal>RUN_DEPENDS</literal> instead&mdash;at least the
 	    intention will be clear.</para>
 	</sect2>
 
       <sect2>
 	<title>Circular dependencies are fatal</title>
 
 	<important>
 	  <para>Do not introduce any circular dependencies into the
 	  ports tree!</para>
 	</important>
 
 	<para>The ports building technology does not tolerate
 	  circular dependencies.  If you introduce one, you will have
 	  someone, somewhere in the world, whose FreeBSD installation will
 	  break almost immediately, with many others quickly to follow.
 	  These can really be hard to detect; if in doubt, before
 	  you make that change, make sure you have done the following:
 	  <command>cd /usr/ports; make index</command>.  That process
 	  can be quite slow on older machines, but you may be able to
 	  save a large number of people&mdash;including yourself&mdash;
 	  a lot of grief in the process.</para>
       </sect2>
 
       </sect1>
 
     <sect1 id="makefile-masterdir">
       <title><makevar>MASTERDIR</makevar></title>
 
       <para>If your port needs to build slightly different versions of
 	packages by having a variable (for instance, resolution, or paper
 	size) take different values, create one subdirectory per package to
 	make it easier for users to see what to do, but try to share as many
 	files as possible between ports.  Typically you only need a very short
 	<filename>Makefile</filename> in all but one of the directories if you
 	use variables cleverly.  In the sole <filename>Makefile</filename>,
 	you can use <makevar>MASTERDIR</makevar> to specify the directory
 	where the rest of the files are.  Also, use a variable as part of
 	<link linkend="porting-pkgname"><makevar>PKGNAMESUFFIX</makevar></link> so
 	the packages will have different names.</para>
 
       <para>This will be best demonstrated by an example.  This is part of
 	<filename>japanese/xdvi300/Makefile</filename>;</para>
 
       <programlisting>PORTNAME=       xdvi
 PORTVERSION=    17
 PKGNAMEPREFIX=  ja-
 PKGNAMESUFFIX=  ${RESOLUTION}
  :
 # default
 RESOLUTION?=   300
 .if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \
        ${RESOLUTION} != 300 && ${RESOLUTION} != 400
        @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
        @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
        @${FALSE}
 .endif</programlisting>
 
       <para><filename role="package">japanese/xdvi300</filename> also has all the regular
 	patches, package files, etc.  If you type <command>make</command>
 	there, it will take the default value for the resolution (300) and
 	build the port normally.</para>
 
       <para>As for other resolutions, this is the <emphasis>entire</emphasis>
 	<filename>xdvi118/Makefile</filename>:</para>
 
       <programlisting>RESOLUTION=     118
 MASTERDIR=      ${.CURDIR}/../xdvi300
 
 .include "${MASTERDIR}/Makefile"</programlisting>
 
       <para>(<filename>xdvi240/Makefile</filename> and
 	<filename>xdvi400/Makefile</filename> are similar).  The
 	<makevar>MASTERDIR</makevar> definition tells
 	<filename>bsd.port.mk</filename> that the regular set of
 	subdirectories like <makevar>FILESDIR</makevar> and
 	<makevar>SCRIPTDIR</makevar> are to be found under
 	<filename>xdvi300</filename>.  The <literal>RESOLUTION=118</literal>
 	line will override the <literal>RESOLUTION=300</literal> line in
 	<filename>xdvi300/Makefile</filename> and the port will be built with
 	resolution set to 118.</para>
     </sect1>
 
     <sect1 id="makefile-manpages">
       <title>Manpages</title>
 
       <para>The <makevar>MAN[1-9LN]</makevar> variables will automatically add
 	any manpages to <filename>pkg-plist</filename> (this means you must
 	<emphasis>not</emphasis> list manpages in the
 	<filename>pkg-plist</filename>&mdash;see <link
 	  linkend="plist-sub">generating PLIST</link> for more).  It also
 	makes the install stage automatically compress or uncompress manpages
 	depending on the setting of <makevar>NOMANCOMPRESS</makevar> in
 	<filename>/etc/make.conf</filename>.</para>
 
       <para>If your port tries to install multiple names for manpages using
 	symlinks or hardlinks, you must use the <makevar>MLINKS</makevar>
 	variable to identify these.  The link installed by your port will
 	be destroyed and recreated by <filename>bsd.port.mk</filename>
 	to make sure it points to the correct file.  Any manpages
 	listed in MLINKS must not be listed in the
 	<filename>pkg-plist</filename>.</para>
 
       <para>To specify whether the manpages are compressed upon installation,
 	use the <makevar>MANCOMPRESSED</makevar> variable. This variable can
 	take three values, <literal>yes</literal>, <literal>no</literal> and
 	<literal>maybe</literal>. <literal>yes</literal> means manpages are
 	already installed compressed, <literal>no</literal> means they are
 	not, and <literal>maybe</literal> means the software already respects
 	the value of <makevar>NOMANCOMPRESS</makevar> so
 	<filename>bsd.port.mk</filename> does not have to do anything
 	special.</para>
 
       <para><makevar>MANCOMPRESSED</makevar> is automatically set to
 	<literal>yes</literal> if <makevar>USE_IMAKE</makevar> is set and
 	<makevar>NO_INSTALL_MANPAGES</makevar> is not set, and to
 	<literal>no</literal> otherwise.  You do not have to explicitly define
 	it unless the default is not suitable for your port.</para>
 
       <para>If your port anchors its man tree somewhere other than
 	<makevar>PREFIX</makevar>, you can use the
 	<makevar>MANPREFIX</makevar> to set it.  Also, if only manpages in
 	certain sections go in a non-standard place, such as some <literal>perl</literal> modules
 	ports, you can set individual man paths using
 	<makevar>MAN<replaceable>sect</replaceable>PREFIX</makevar> (where
 	<replaceable>sect</replaceable> is one of <literal>1-9</literal>,
 	<literal>L</literal> or <literal>N</literal>).</para>
 
       <para>If your manpages go to language-specific subdirectories, set the
 	name of the languages to <makevar>MANLANG</makevar>.  The value of
 	this variable defaults to <literal>""</literal> (i.e., English
 	only).</para>
 
       <para>Here is an example that puts it all together.</para>
 
       <programlisting>MAN1=          foo.1
 MAN3=          bar.3
 MAN4=          baz.4
 MLINKS=        foo.1 alt-name.8
 MANLANG=       "" ja
 MAN3PREFIX=    ${PREFIX}/share/foobar
 MANCOMPRESSED= yes</programlisting>
 
       <para>This states that six files are installed by this port;</para>
 
 	  <programlisting>${PREFIX}/man/man1/foo.1.gz
 ${PREFIX}/man/ja/man1/foo.1.gz
 ${PREFIX}/share/foobar/man/man3/bar.3.gz
 ${PREFIX}/share/foobar/man/ja/man3/bar.3.gz
 ${PREFIX}/man/man4/baz.4.gz
 ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
 
       <para>Additionally <filename>${PREFIX}/man/man8/alt-name.8.gz</filename>
 	may or may not be installed by your port.  Regardless, a
 	symlink will be made to join the foo(1) manpage and
 	alt-name(8) manpage.</para>
 
     </sect1>
 
     <sect1 id="makefile-info">
       <title>Info files</title>
 
       <para>If your package needs to install GNU info files, they should be
 	listed in the <makevar>INFO</makevar> variable (without the trailing
 	<literal>.info</literal>), and appropriate installation/de-installation
 	code will be automatically added to the temporary
 	<filename>pkg-plist</filename> before package registration.</para>
     </sect1>
 
       <sect1 id="makefile-options">
       <title>Makefile Options</title>
 
       <para>Some large applications can be built in a number of
 	configurations, adding functionality if one of a number of
 	libraries or applications is available.  Examples include
 	choice of natural (human) language, GUI versus command-line,
 	or type of database to support.  Since not all users
 	want those libraries or applications, the ports system
 	provides hooks that the port author can use to control which
 	configuration should be built. Supporting these properly will
 	make users happy, and effectively provide 2 or more ports for the
 	price of one.</para>
 
         <sect2>
 	  <title><makevar>WITH_<replaceable>*</replaceable></makevar> and
 	    <makevar>WITHOUT_<replaceable>*</replaceable></makevar></title>
 
 	  <para>These variables are designed to be set by the system
 	    administrator.  There are many that are standardized in
 	    <filename>ports/Mk/bsd.*.mk</filename>; others are not,
 	    which can be confusing.  If you need to add such a
 	    configuration variable, please consider using one of the
 	    ones from the following list.</para>
 
 	  <note>
 	    <para>You should not assume that a
 	      <makevar>WITH_<replaceable>*</replaceable></makevar>
 	      necessarily has a corresponding
 	      <makevar>WITHOUT_<replaceable>*</replaceable></makevar>
 	      variable and vice versa.  In general, the default is
 	      simply assumed.</para>
 	  </note>
 
 	  <note>
 	    <para>Unless otherwise specified, these variables are only
 	      tested for being set or not set, rather than being set to
 	      some kind of variable such as <literal>YES</literal> or
 	      <literal>NO</literal>.</para>
 	  </note>
 
 	  <table frame="none">
 	    <title>The <makevar>WITH_<replaceable>*</replaceable></makevar>
 	      and <makevar>WITHOUT_<replaceable>*</replaceable></makevar>
 	      variables</title>
 
 	    <tgroup cols="2">
 	      <thead>
 	        <row>
 		  <entry>Variable</entry>
 
 		  <entry>Means</entry>
 	        </row>
 	      </thead>
 
 	      <tbody>
 	        <row>
 		  <entry><makevar>WITH_APACHE2</makevar></entry>
 
 		  <entry>If set, use
 		    <filename role="package">www/apache2</filename>
 		    instead of the default of
 		    <filename role="package">www/apache</filename>.</entry>
 	        </row>
 
 	        <row>
 		  <entry><makevar>WITH_BERKELEY_DB</makevar></entry>
 
 		  <entry>Define this variable to specify the ability to
 		    use a variant of the Berkeley database package such as
 		    <filename role="package">databases/db41</filename>.
 		    An associated variable,
 		    <makevar>WITH_BDB_VER</makevar>, may be
 		    set to values such as 2, 3, 4, 41 or 42.</entry>
 	        </row>
 
 	        <row>
 		  <entry><makevar>WITH_MYSQL</makevar></entry>
 
 		  <entry>Define this variable to specify the ability to
 		    use a variant of the MySQL database package such as
 		    <filename role="package">databases/mysql40-server</filename>.
 		    An associated variable,
 		    <makevar>WANT_MYSQL_VER</makevar>, may be
 		    set to values such as 323, 40, 41, or 50.</entry>
 	        </row>
 
 	        <row>
 		  <entry><makevar>WITHOUT_NLS</makevar></entry>
 
 		  <entry>If set, says that internationalization is not
 		    needed, which can save compile time.  By default,
 		    internationalization is used.</entry>
 	        </row>
 
 	        <row>
 		  <entry><makevar>WITH_OPENSSL_BASE</makevar></entry>
 
 		  <entry>Use the version of OpenSSL in the base system.</entry>
 	        </row>
 
 	        <row>
 		  <entry><makevar>WITH_OPENSSL_PORT</makevar></entry>
 
 		  <entry>Use the version of OpenSSL from
 		    <filename role="package">security/openssh</filename>,
 		    overwriting the version that was originally installed
 		    in the base system.</entry>
 	        </row>
 
 	        <row>
 		  <entry><makevar>WITH_POSTGRESQL</makevar></entry>
 
 		  <entry>Define this variable to specify the ability to
 		    use a variant of the PostGreSQL database package such as
 		    <filename role="package">databases/postgresql72</filename>.
 		    </entry>
 	        </row>
 
 	        <row>
 		  <entry><makevar>WITHOUT_X11</makevar></entry>
 
 		  <entry>If the port can be built both with and without
 		    X support, then it should normally be built with
 		    X support. If this variable is defined, then
 		    the version that does not have X support should
 		    be built instead.</entry>
 	        </row>
 	      </tbody>
 	    </tgroup>
 	  </table>
 
       </sect2>
 
       <sect2>
 	<title><makevar>OPTIONS</makevar></title>
 
 	<sect3>
 	  <title>Background</title>
 	    <para>The <makevar>OPTIONS</makevar> variable gives the user who
 	      installs the port a dialog with the available options and saves
 	      them to <filename>/var/db/ports/portname/options</filename>.  Next
 	      time when the port has to be rebuild, the options are reused.  Never
 	      again you will have to remember all the twenty
 	      <makevar>WITH_<replaceable>*</replaceable></makevar> and
 	      <makevar>WITHOUT_<replaceable>*</replaceable></makevar> options you
 	      used to build this port!</para>
 	</sect3>
 
 	<sect3>
 	  <title>Syntax</title>
 	    <para>The syntax for the <makevar>OPTIONS</makevar> variable is:
 
 <programlisting>OPTIONS=	OPTION	"descriptive text" default ...
 </programlisting>
 
 	      The value for default is either <literal>ON</literal> or
 	      <literal>OFF</literal>.  Multiple repetitions of these three fields
 	      are allowed.</para>
 
 	    <para>When the user runs <command>make config</command> (or runs
 	      <command>make build</command> for the first time), the framework will
 	      check for <filename>/var/db/ports/<replaceable>portname</replaceable>
 	      /options</filename>.
 	      If that file does not exist, it will use the values of
 	      <makevar>OPTIONS</makevar> to create a dialogbox where the options
 	      can be enabled or disabled.  Then the options file is saved and the
 	      selected variables will be used when building the port.</para>
 
 	    <para>Use <command>make showconfig</command> to see the saved
 	      configuration.  Use <command>make rmconfig</command> to remove the
 	      saved configuration.</para>
 
 	<sect3>
 	  <title>Example</title>
 	  <example id="ports-options-simple-use">
 	    <title>Simple use of <makevar>OPTIONS</makevar></title>
 	    <para><programlisting>OPTIONS=	FOO "Enable option foo" On \
 			BAR "Support feature bar" Off
 
 .include &lt;bsd.port.pre.mk&gt;
 
 .if defined(WITHOUT_FOO)
 CONFIGURE_ARGS+=	--without-foo
 .else
 CONFIGURE_ARGS+=	--with-foo
 .endif
 
 .if defined(WITH_BAR)
 RUN_DEPENDS+=	bar:${PORTSDIR}/bar/bar
 .endif
 
 .include &lt;bsd.port.post.mk&gt;</programlisting></para>
 	  </example>
 
 	<sect3>
 	  <title>Brokenness</title>
 	  <itemizedlist>
 	    <listitem>
 	      <para><command>make index</command> does not follow
 	      <makevar>OPTIONS</makevar> yet (ports/75727)</para>
 	    </listitem>
 	    <listitem>
 	      <para><makevar>PACKAGE_BUILDING</makevar> is ignoring
 	      <makevar>OPTIONS</makevar> (ports/75727?)</para>
 	    </listitem>
 	  </itemizedlist>
 	</sect3>
 	
       </sect2>
 
     </sect1>
 
     <sect1 id="makefile-wrkdir">
       <title>Specifying the working directory</title>
 
       <para>Each port is extracted in to a working directory, which must be
 	writable.  The ports system defaults to having the
 	<makevar>DISTFILES</makevar> unpack in to a directory called
 	<literal>${DISTNAME}</literal>.  In other words, if you have
 	set:</para>
 
       <programlisting>PORTNAME=      foo
 PORTVERSION=   1.0</programlisting>
 
       <para>then the port's distribution files contain a top-level directory,
 	<filename>foo-1.0</filename>, and the rest of the files are located
 	under that directory.</para>
 
       <para>There are a number of variables you can override if that is not the
 	case.</para>
 
       <sect2>
 	<title><makevar>WRKSRC</makevar></title>
 
 	<para>The variable lists the name of the directory that is created when
 	  the application's distfiles are extracted.  If our previous example
 	  extracted into a directory called <filename>foo</filename> (and not
 	  <filename>foo-1.0</filename>) you would write:</para>
 
 	<programlisting>WRKSRC=      ${WRKDIR}/foo</programlisting>
 
 	<para>or possibly</para>
 
 	<programlisting>WRKSRC=      ${WRKDIR}/${PORTNAME}</programlisting>
       </sect2>
 
       <sect2>
 	<title><makevar>NO_WRKSUBDIR</makevar></title>
 
 	<para>If the port does not extract in to a subdirectory at all then
 	  you should set <makevar>NO_WRKSUBDIR</makevar> to indicate
 	  that.</para>
 
 	<programlisting>NO_WRKSUBDIR= yes</programlisting>
       </sect2>
     </sect1>
 
     <sect1 id="conflicts">
       <title><makevar>CONFLICTS</makevar></title>
 
 	<para>If your package cannot coexist with other packages
 	  (because of file conflicts, runtime incompatibility, etc.),
 	  list the other package names in the <makevar>CONFLICTS</makevar>
 	  variable. You can use shell globs like <literal>*</literal> and
 	  <literal>?</literal> here.  Packages names should be
 	  enumerated the same way they appear in
 	  <filename>/var/db/pkg</filename>.  Please make sure that
 	  <makevar>CONFLICTS</makevar> does not match this port's
 	  package itself, or else forcing its installation with
 	  <makevar>FORCE_PKG_REGISTER</makevar> will no longer work.
        </para>
 
       <note>
 	<para><makevar>CONFLICTS</makevar> automatically sets
 	  <makevar>IGNORE</makevar>, which is more fully documented
 	  in <xref linkend="dads-noinstall">.</para>
       </note>
     </sect1>
 
     </chapter>
 
     <chapter id="special">
       <title>Special considerations</title>
 
       <para>There are some more things you have to take into account when you
 	create a port.  This section explains the most common of those.</para>
 
       <sect1 id="porting-shlibs">
 	<title>Shared Libraries</title>
 
 	<para>If your port installs one or more shared libraries, define a
 	  <makevar>INSTALLS_SHLIB</makevar> make variable, which will instruct
 	  a <filename>bsd.port.mk</filename> to run
 	  <literal>&dollar;{LDCONFIG} -m</literal> on the directory where the
 	  new library is installed (usually
 	  <filename><makevar>PREFIX</makevar>/lib</filename>) during
 	  <maketarget>post-install</maketarget> target to register it into the
 	  shared library cache.  This variable, when defined, will also
 	  facilitate addition of an appropriate
 	  <literal>@exec /sbin/ldconfig -m</literal> and
 	  <literal>@unexec /sbin/ldconfig -R</literal> pair into your
 	  <filename>pkg-plist</filename> file, so that a user who installed
 	  the package can start using the shared library immediately and
 	  de-installation will not cause the system to still believe the
 	  library is there.</para>
 
 	<para>If you need, you can override the default location where the new
 	  library is installed by defining the <makevar>LDCONFIG_DIRS</makevar>
 	  make variable, which should contain a list of directories into which
 	  shared libraries are to be installed.  For example if your port
 	  installs shared libraries into
 	  <filename><makevar>PREFIX</makevar>/lib/foo</filename> and
 	  <filename><makevar>PREFIX</makevar>/lib/bar</filename> directories
 	  you could use the following in your
 	  <filename>Makefile</filename>:</para>
 
 	<programlisting>INSTALLS_SHLIB= yes
 LDCONFIG_DIRS=  %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
 
 	<para>Note that content of <makevar>LDCONFIG_DIRS</makevar> is passed
 	  through &man.sed.1; just like the rest of <filename>pkg-plist</filename>,
 	  so <makevar>PLIST_SUB</makevar> substitutions also apply here.  It is
 	  recommended that you use <literal>%%PREFIX%%</literal> for
 	  <makevar>PREFIX</makevar>, <literal>%%LOCALBASE%%</literal> for
 	  <makevar>LOCALBASE</makevar> and <literal>%%X11BASE%%</literal> for
 	  <makevar>X11BASE</makevar>.</para>
 
 	<para>Try to keep shared library version numbers in the
 	  <filename>libfoo.so.0</filename> format.  Our runtime linker only
 	  cares for the major (first) number.</para>
 
 	<para>When the major library version number increments in the update
 	  to the new port version, all other ports that link to the affected
 	  library should have their <makevar>PORTREVISION</makevar> incremented,
 	  to force recompilation with the new library version.</para>
 
       </sect1>
 
     <sect1 id="porting-restrictions">
       <title>Ports with distribution restrictions</title>
 
       <para>Licenses vary, and some of them place restrictions on how the
 	application can be packaged, whether it can be sold for profit, and so
 	on.</para>
 
       <important>
 	<para>It is your responsibility as a porter to read the licensing
 	  terms of the software and make sure that the FreeBSD project will
 	  not be held accountable for violating them by redistributing the
 	  source or compiled binaries either via FTP/HTTP or CD-ROM.  If in doubt,
 	  please contact the &a.ports;.</para>
       </important>
 
       <para>In situations like this, the variables described in the following
 	sections can be set.</para>
 
       <sect2>
 	<title><makevar>NO_PACKAGE</makevar></title>
 
 	<para>This variable indicates that we may not generate a binary
 	  package of the application.  For instance, the license may
 	  disallow binary redistribution, or it may prohibit distribution
 	  of packages created from patched sources.</para>
 
 	<para>However, the port's <makevar>DISTFILES</makevar> may be
 	  freely mirrored on FTP/HTTP.  They may also be distributed on
 	  a CD-ROM (or similar media) unless <makevar>NO_CDROM</makevar>
 	  is set as well.</para>
 
 	<para><makevar>NO_PACKAGE</makevar> should also be used if the binary
 	  package is not generally useful, and the application should always
 	  be compiled from the source code.  For example, if the application
 	  has configuration information that is site specific hard coded in to
 	  it at compile time, set <makevar>NO_PACKAGE</makevar>.</para>
 
 	<para><makevar>NO_PACKAGE</makevar> should be set to a string
 	  describing the reason why the package should not be
 	  generated.</para>
       </sect2>
 
       <sect2>
 	<title><makevar>NO_CDROM</makevar></title>
 
 	<para>This variable alone indicates that, although we are allowed
 	  to generate binary packages, we may put neither those packages
 	  nor the port's <makevar>DISTFILES</makevar> onto a CD-ROM (or
 	  similar media) for resale.  However, the binary packages and
 	  the port's <makevar>DISTFILES</makevar> will still be available
 	  via FTP/HTTP.</para>
 
 	<para> If this variable is set along with
 	  <makevar>NO_PACKAGE</makevar>, then only the port's
 	  <makevar>DISTFILES</makevar> will be available, and only via
 	  FTP/HTTP.</para>
 
 	<para><makevar>NO_CDROM</makevar> should be set to a string
 	  describing the reason why the port cannot be redistributed
 	  on CD-ROM.  For instance, this should be used if the port's license
 	  is for <quote>non-commercial</quote> use only.</para>
       </sect2>
 
       <sect2>
 	<title><makevar>RESTRICTED</makevar></title>
 
 	<para>Set this variable alone if the application's license permits
 	  neither mirroring the application's <makevar>DISTFILES</makevar>
 	  nor distributing the binary package in any way.</para>
 
 	<para><makevar>NO_CDROM</makevar> or <makevar>NO_PACKAGE</makevar>
 	  should not be set along with <makevar>RESTRICTED</makevar>
 	  since the latter variable implies the former ones.</para>
 
 	<para><makevar>RESTRICTED</makevar> should be set to a string
 	  describing the reason why the port cannot be redistributed.
 	  Typically, this indicates that the port contains proprietary
 	  software and that the user will need to manually download the
 	  <makevar>DISTFILES</makevar>, possibly after registering for the
 	  software or agreeing to accept the terms of an
 	  <acronym>EULA</acronym>.</para>
       </sect2>
 
       <sect2>
 	<title><makevar>RESTRICTED_FILES</makevar></title>
 
 	<para>When <makevar>RESTRICTED</makevar> or <makevar>NO_CDROM</makevar>
 	  is set, this variable defaults to <literal>${DISTFILES}
 	  ${PATCHFILES}</literal>, otherwise it is empty.  If only some of the
 	  distribution files are restricted, then set this variable to list
 	  them.</para>
 
 	<para>Note that the port committer should add an entry to
 	  <filename>/usr/ports/LEGAL</filename> for every listed distribution
 	  file, describing exactly what the restriction entails.</para>
       </sect2>
     </sect1>
 
     <sect1 id="using-autotools">
       <title>Building mechanisms</title>
 
       <sect2 id="using-make">
 	<title><command>make</command>, <command>gmake</command>, and
 	  <command>imake</command></title>
 
 	<para>If your port uses <application>GNU make</application>, set
 	  <literal>USE_GMAKE=yes</literal>.</para>
 
 	  <table frame="none">
 	    <title>Variables for ports related to gmake</title>
 
 	    <tgroup cols="2">
 	      <thead>
 		<row>
 		  <entry>Variable</entry>
 
 		  <entry>Means</entry>
 		</row>
 	      </thead>
 
 	      <tbody>
 		<row>
 		  <entry><makevar>USE_GMAKE</makevar></entry>
 
 		  <entry>The port requires <command>gmake</command> to
 		    build.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>GMAKE</makevar></entry>
 
 		  <entry>The full path for <command>gmake</command> if it is not
 		    in the <envar>PATH</envar>.</entry>
 		</row>
 	      </tbody>
 	    </tgroup>
 	  </table>
 
 	  <para>If your port is an X application that creates
 	    <filename>Makefile</filename> files from
 	    <filename>Imakefile</filename> files using
 	    <application>imake</application>, then set
 	    <literal>USE_IMAKE=yes</literal>.  This will cause the
 	    configure stage to automatically do an <command>xmkmf -a</command>.
 	    If the <option>-a</option> flag is a problem for your port, set
 	    <literal>XMKMF=xmkmf</literal>.  If the port uses
 	    <application>imake</application> but does not understand the
 	    <maketarget>install.man</maketarget> target,
 	    <literal>NO_INSTALL_MANPAGES=yes</literal> should be set.</para>
 
 	  <para>If your port's source <filename>Makefile</filename> has
 	    something else than <maketarget>all</maketarget> as the main build
 	    target, set <makevar>ALL_TARGET</makevar> accordingly.  Same goes
 	    for <maketarget>install</maketarget> and
 	    <makevar>INSTALL_TARGET</makevar>.</para>
 
 	</sect2>
 
 	<sect2 id="using-configure">
 	  <title><command>configure</command> script</title>
 
 	<para>If your port uses the <command>configure</command> script to
 	  generate <filename>Makefile</filename> files from
 	  <filename>Makefile.in</filename> files, set
 	  <literal>GNU_CONFIGURE=yes</literal>.  If you want to give extra
 	  arguments to the <command>configure</command> script (the default
 	  argument is <literal>--prefix=&dollar;{PREFIX}
 	  &dollar;{CONFIGURE_TARGET}</literal>), set those
 	  extra arguments in <makevar>CONFIGURE_ARGS</makevar>.  Extra
 	  environment variables can be passed using
 	  <makevar>CONFIGURE_ENV</makevar> variable.</para>
 
 	<para>If your package uses GNU <command>configure</command>, and
 	  the resulting executable file has a <quote>strange</quote> name
 	  like
 	  <filename>i386-portbld-freebsd4.7-</filename><replaceable>appname</replaceable>,
 	  you will need to additionally override the
 	  <makevar>CONFIGURE_TARGET</makevar> variable to specify the
 	  target in the way required by scripts generated by recent
 	  versions of <command>autoconf</command>.  Add the following line
 	  immediately after the <literal>GNU_CONFIGURE=yes</literal> line
 	  in your <filename>Makefile</filename>:</para>
 
 	<para>
 	  <literal>CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}</literal>
 	  </para>
 
 	  <table frame="none">
 	    <title>Variables for ports that use configure</title>
 
 	    <tgroup cols="2">
 	      <thead>
 		<row>
 		  <entry>Variable</entry>
 
 		  <entry>Means</entry>
 		</row>
 	      </thead>
 
 	      <tbody>
 		<row>
 		  <entry><makevar>GNU_CONFIGURE</makevar></entry>
 
 		  <entry>The port uses <command>configure</command> script to
 		    prepare build.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>HAS_CONFIGURE</makevar></entry>
 
 		  <entry>Same as <makevar>GNU_CONFIGURE</makevar>, except
 		    default configure target is not added to
 		    <makevar>CONFIGURE_ARGS</makevar>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>CONFIGURE_ARGS</makevar></entry>
 
 		  <entry>Additional arguments passed to
 		    <command>configure</command> script.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>CONFIGURE_ENV</makevar></entry>
 
 		  <entry>Additional environment variables to be set
 		    for <command>configure</command> script run.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>CONFIGURE_TARGET</makevar></entry>
 
 		  <entry>Override default configure target.  Default value is
 		    <literal>&dollar;{MACHINE_ARCH}-portbld-freebsd&dollar;{OSREL}</literal>.</entry>
 		</row>
 	      </tbody>
 	    </tgroup>
 	  </table>
 	</sect2>
 
 	<sect2 id="using-autoconf">
 	  <title><command>autoconf</command></title>
 
 	  <para>Some ports do not contain a <filename>configure</filename>
 	    script, but do contain an <application>autoconf</application> template
 	    in the <filename>configure.ac</filename> file.  You can use
 	    <makevar>USE_AUTOCONF_VER</makevar> variable to let
 	    <application>autoconf</application> create
 	    the <filename>configure</filename> script.  It is also useful for
 	    recreating the <filename>configure</filename> script after patching
 	    <filename>configure.ac</filename>.</para>
 
 	  <table frame="none">
 	    <title>Variables for ports that use autoconf</title>
 
 	    <tgroup cols="2">
 	      <thead>
 		<row>
 		  <entry>Variable</entry>
 
 		  <entry>Means</entry>
 		</row>
 	      </thead>
 
 	      <tbody>
 		<row>
 		  <entry><makevar>USE_AUTOCONF_VER</makevar></entry>
 
 		  <entry>Specifies that the port uses <command>autoconf</command>.
 		    Implies <literal>GNU_CONFIGURE</literal>.  Valid values are
 		    <literal>213</literal>, <literal>253</literal>, and
 		    <literal>259</literal>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOCONF</makevar></entry>
 
 		  <entry>Set to the path of GNU <command>autoconf</command> if it
 		    is not in the <envar>PATH</envar>.  The default is set
 		    according to the <makevar>USE_AUTOCONF_VER</makevar>
 		    variable.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOCONF_ARGS</makevar></entry>
 
 		  <entry>Command line arguments to pass to
 		    <command>autoconf</command>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOCONF_ENV</makevar></entry>
 
 		  <entry>Set these
 		    <literal><replaceable>variable</replaceable>=<replaceable>value</replaceable></literal>
 		    pairs in the environment before running
 		    <command>autoconf</command>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>USE_AUTOHEADER_VER</makevar></entry>
 
 		  <entry>Specifies that the port uses <command>autoheader</command>.
 		    Implies <literal>USE_AUTOCONF_VER</literal>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOHEADER</makevar></entry>
 
 		  <entry>Set to the path of GNU <command>autoheader</command> if
 		    it is not in the <envar>PATH</envar>.  The default is set
 		    according to <makevar>USE_AUTOCONF_VER</makevar>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTORECONF</makevar></entry>
 
 		  <entry>Set to the path of GNU <command>autoreconf</command> if
 		    it is not in the <envar>PATH</envar>.  The default is set
 		    according to <makevar>USE_AUTOCONF_VER</makevar>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOSCAN</makevar></entry>
 
 		  <entry>Set to the path of GNU <command>autoscan</command> if it
 		    is not set in the <envar>PATH</envar>.  The default is set
 		    according to <makevar>USE_AUTOCONF_VER</makevar>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOIFNAMES</makevar></entry>
 
 		  <entry>Set to the path of GNU <command>autoifnames</command> if
 		    it is not set in the <envar>PATH</envar>.  The default is set
 		    according to <makevar>USE_AUTOCONF_VER</makevar>.</entry>
 		</row>
 	      </tbody>
 	    </tgroup>
 	  </table>
 	</sect2>
 
 	<sect2 id="using-automake">
 	  <title><command>automake</command></title>
 
 	  <para>Some packages only contain <filename>Makefile.am</filename>
 	    files.  These have to be converted into
 	    <filename>Makefile.in</filename> files using
 	    <application>automake</application>.  Specify the
 	    <makevar>USE_AUTOMAKE_VER</makevar> variable.</para>
 
 	  <table frame="none">
 	    <title>Variables for ports that use automake</title>
 
 	    <tgroup cols="2">
 	      <thead>
 		<row>
 		  <entry>Variable</entry>
 
 		  <entry>Means</entry>
 		</row>
 	      </thead>
 
 	      <tbody>
 		<row>
 		  <entry><makevar>AUTOMAKE</makevar></entry>
 
 		  <entry>The full path for <command>automake</command>, if it is
 		    not in the <envar>PATH</envar>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>USE_AUTOMAKE_VER</makevar></entry>
 
 		  <entry>The port uses <command>automake</command>.  Valid values
 		    for this variable are <literal>14</literal>,
 		    <literal>15</literal>, and <literal>19</literal>, and sets
 		    the <makevar>AUTOMAKE_DIR</makevar> and
 		    <makevar>ACLOCAL_DIR</makevar> variables
 		    appropriately.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOMAKE_ARGS</makevar></entry>
 
 		  <entry>One or more command line arguments to pass to
 		    <makevar>AUTOMAKE</makevar> if
 		    <makevar>USE_AUTOMAKE_VER</makevar> is set.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOMAKE_ENV</makevar></entry>
 
 		  <entry>One or more environment variables to set (and their
 		    values) before running <makevar>AUTOMAKE</makevar>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>ACLOCAL</makevar></entry>
 
 		  <entry>Set to the path of the GNU <command>aclocal</command> if
 		    it is not in the <envar>PATH</envar>.  The default is set
 		    according to the <makevar>USE_AUTOMAKE_VER</makevar>
 		    variable.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>ACLOCAL_DIR</makevar></entry>
 
 		  <entry>Set to the path of the GNU <command>aclocal</command>
 		    shared directory.  The default is set according to the
 		    <makevar>USE_AUTOMAKE_VER</makevar> variable.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>AUTOMAKE_DIR</makevar></entry>
 
 		  <entry>Set to the path of the GNU <command>automake</command>
 		    shared directory.  The default is set according to the
 		    <makevar>USE_AUTOMAKE_VER</makevar> variable.</entry>
 		</row>
 	      </tbody>
 	    </tgroup>
 	  </table>
 
 	</sect2>
 	<sect2 id="using-libtool">
 	  <title><command>libtool</command></title>
 
 	  <para>Shared libraries using the GNU building framework usually use
 	    <application>libtool</application> to adjust the compilation
 	    and installation of shared library to match the customs of given
 	    operating system.  The Ports Collection provides a version
 	    of <application>libtool</application> modified for &os;.  Changes
 	    include suppressing of minor version numbers in names of installed
 	    files, and prevention of <filename>*.la</filename> (libtool archive)
 	    files installation.</para>
 
 	  <para>To replace copy of <application>libtool</application> included
 	    in the port with our modified copy, specify
 	    <makevar>USE_LIBTOOL_VER</makevar> variable.  If, for any reason,
 	    our modified <application>libtool</application> does not work,
 	    omit any <application>libtool</application> related variables
 	    to use bundled copy of <application>libtool</application>.</para>
 
 	  <table frame="none">
 	    <title>Variables for ports that use libtool</title>
 
 	    <tgroup cols="2">
 	      <thead>
 		<row>
 		  <entry>Variable</entry>
 
 		  <entry>Means</entry>
 		</row>
 	      </thead>
 
 	      <tbody>
 		<row>
 		  <entry><makevar>USE_LIBTOOL_VER</makevar></entry>
 
 		  <entry>The port uses <command>libtool</command>.  Implies
 		    <makevar>GNU_CONFIGURE</makevar>.
 		    The <filename>configure</filename> script will be patched
 		    to use system copy of <command>libtool</command>.
 		    Valid values are <literal>13</literal> and
 		    <literal>15</literal>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>USE_INC_LIBTOOL_VER</makevar></entry>
 
 		  <entry>Same as <makevar>USE_LIBTOOL_VER</makevar>, except
 		    the <filename>configure</filename> patching will not be
 		    performed.  You must take care of it yourself.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>LIBTOOL</makevar></entry>
 
 		  <entry>Set to the path of <command>libtool</command> if it is
 		    not set in the <envar>PATH</envar>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>LIBTOOLFILES</makevar></entry>
 
 		  <entry>The files to patch for <command>libtool</command>.
 		    Defaults to <literal>aclocal.m4</literal> if
 		    <makevar>USE_AUTOCONF</makevar> is defined,
 		    <literal>configure</literal> otherwise.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>LIBTOOLFLAGS</makevar></entry>
 
 		  <entry>Additional flags to pass to
 		    <command>ltconfig</command>.  Defaults to
 		    <literal>--disable-ltlibs</literal>.</entry>
 		</row>
 
 		<row>
 		  <entry><makevar>USE_LIBLTDL</makevar></entry>
 
 		  <entry>The port uses <command>libltdl</command>.</entry>
 		</row>
 	      </tbody>
 	    </tgroup>
 	  </table>
 
 	  <note>
 	    <para><makevar>USE_LIBTOOL_VER</makevar> does not work together
 	      with <makevar>USE_GCC</makevar>.  You have to use
 	      <makevar>USE_INC_LIBTOOL_VER</makevar> and perform manual patching.
 	      Look at <literal>patch-autotools</literal> target in
 	      <filename role="package">devel/glibmm</filename>
 	      for an example.</para>
 	  </note>
 
       </sect2>
     </sect1>
 
     <sect1 id="using-perl">
       <title>Using <literal>perl</literal></title>
 
       <table frame="none">
 	<title>Variables for ports that use <literal>perl</literal></title>
 
 	<tgroup cols="2">
 	  <thead>
 	    <row>
 	      <entry>Variable</entry>
 
 	      <entry>Means</entry>
 	    </row>
 	  </thead>
 
 	  <tbody>
 	    <row>
 	      <entry><makevar>USE_PERL5</makevar></entry>
 
 	      <entry>Says that the port uses <literal>perl 5</literal> to build and run.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_PERL5_BUILD</makevar></entry>
 
 	      <entry>Says that the port uses <literal>perl 5</literal> to build.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_PERL5_RUN</makevar></entry>
 
 	      <entry>Says that the port uses <literal>perl 5</literal> to run.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PERL</makevar></entry>
 
 	      <entry>The full path of <literal>perl 5</literal>, either in the
 		system or installed from a port, but without the version
 		number.  Use this if you need to replace
 		<quote><literal>#!</literal></quote>lines in scripts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PERL_CONFIGURE</makevar></entry>
 
 	      <entry>Configure using Perl's MakeMaker.  It implies
 		<makevar>USE_PERL5</makevar>.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PERL_MODBUILD</makevar></entry>
 
 	      <entry>Configure, build and install using Module::Build.  It
 		implies <makevar>PERL_CONFIGURE</makevar>.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
 
 	<tgroup cols="2">
 	  <thead>
 	    <row>
 	      <entry>Read only variables</entry>
 	    </row>
 	  </thead>
 
 	  <tbody>
 	    <row>
 	      <entry><makevar>PERL_VERSION</makevar></entry>
 
 	      <entry>The full version of <literal>perl</literal> installed (e.g.,
 		<literal>5.00503</literal>).</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PERL_VER</makevar></entry>
 
 	      <entry>The short version of <literal>perl</literal> installed (e.g.,
 		<literal>5.005</literal>).</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PERL_LEVEL</makevar></entry>
 
 	      <entry>The installed <literal>perl</literal> version as an integer of the form <literal>MNNNPP</literal>
 		(e.g., <literal>500503</literal>).</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PERL_ARCH</makevar></entry>
 
 	      <entry>Where <literal>perl</literal> stores architecture dependent libraries.
 		Defaults to <literal>${ARCH}-freebsd</literal>.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PERL_PORT</makevar></entry>
 
 	      <entry>Name of the <literal>perl</literal> port that is
 		installed (e.g., <literal>perl5</literal>).</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>SITE_PERL</makevar></entry>
 
 	      <entry>Directory name where site specific
 		<literal>perl</literal> packages go.
 		This value is added to PLIST_SUB.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
       <note>
 	<para>Ports of Perl modules, which do not have an official website,
 	  should link <hostid>cpan.org</hostid> in the WWW line of a
 	  <filename>pkg-descr</filename> file.  The suggested URL scheme is
 	  <literal>http://search.cpan.org/dist/Module-Name</literal>.</para>
       </note>
 
     </sect1>
 
     <sect1 id="using-x11">
       <title>Using X11</title>
 
       <sect2 id="x11-variables">
 	<title>Variable definitions</title>
 
       <table frame="none">
 	<title>Variables for ports that use X</title>
 
 	<tgroup cols="2">
 	  <tbody>
 	    <row>
 	      <entry><makevar>USE_X_PREFIX</makevar></entry>
 
 	      <entry>The port installs in <makevar>X11BASE</makevar>, not
 		<makevar>PREFIX</makevar>.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_XLIB</makevar></entry>
 
 	      <entry>The port uses the X libraries.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_MOTIF</makevar></entry>
 
 	      <entry>The port uses the Motif toolkit.  Implies
 		<makevar>USE_XPM</makevar>.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_IMAKE</makevar></entry>
 
 	      <entry>The port uses <command>imake</command>.  Implies
 		<makevar>USE_X_PREFIX</makevar>.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>XMKMF</makevar></entry>
 
 	      <entry>Set to the path of <command>xmkmf</command> if not in the
 		<envar>PATH</envar>.  Defaults to <literal>xmkmf
 		  -a</literal>.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
       <table frame="none">
 	<title>Variables for depending on individual parts of X11</title>
 
 	<tgroup cols="2">
 	  <tbody>
 	    <row>
 	      <entry><makevar>X_IMAKE_PORT</makevar></entry>
 
 	      <entry>Port providing <command>imake</command> and several
 		other utilities used to build X11.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_LIBRARIES_PORT</makevar></entry>
 
 	      <entry>Port providing X11 libraries.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_CLIENTS_PORT</makevar></entry>
 
 	      <entry>Port providing X clients.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_SERVER_PORT</makevar></entry>
 
 	      <entry>Port providing X server.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTSERVER_PORT</makevar></entry>
 
 	      <entry>Port providing font server.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_PRINTSERVER_PORT</makevar></entry>
 
 	      <entry>Port providing print server.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_VFBSERVER_PORT</makevar></entry>
 
 	      <entry>Port providing virtual framebuffer server.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_NESTSERVER_PORT</makevar></entry>
 
 	      <entry>Port providing a nested X server.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTS_ENCODINGS_PORT</makevar></entry>
 
 	      <entry>Port providing encodings for fonts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTS_MISC_PORT</makevar></entry>
 
 	      <entry>Port providing miscellaneous bitmap fonts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTS_100DPI_PORT</makevar></entry>
 
 	      <entry>Port providing 100dpi bitmap fonts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTS_75DPI_PORT</makevar></entry>
 
 	      <entry>Port providing 75dpi bitmap fonts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTS_CYRILLIC_PORT</makevar></entry>
 
 	      <entry>Port providing cyrillic bitmap fonts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTS_TTF_PORT</makevar></entry>
 
 	      <entry>Port providing &truetype; fonts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_FONTS_TYPE1_PORT</makevar></entry>
 
 	      <entry>Port providing Type1 fonts.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>X_MANUALS_PORT</makevar></entry>
 
 	      <entry>Port providing developer oriented manual pages</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
       <example id="using-x11-vars">
 	<title>Using X11 related variables in port</title>
 	<programlisting># Use X11 libraries and depend on
 # font server as well as cyrillic fonts.
 RUN_DEPENDS=   ${X11BASE}/bin/xfs:${X_FONTSERVER_PORT} \
                ${X11BASE}/lib/X11/fonts/cyrillic/crox1c.pcf.gz:${X_FONTS_CYRILLIC_PORT}
 
 USE_XLIB=      yes</programlisting>
       </example>
 
       </sect2>
 
       <sect2 id="x11-motif">
 	<title>Ports that require Motif</title>
 
 	<para>If your port requires a Motif library, define
 	  <makevar>USE_MOTIF</makevar> in the <filename>Makefile</filename>.
 	  Default Motif implementation is
 	  <filename role="package">x11-toolkits/open-motif</filename>.
 	  Users can choose
 	  <filename role="package">x11-toolkits/lesstif</filename> instead
 	  by setting <makevar>WANT_LESSTIF</makevar> variable.</para>
 
 	<para>The <makevar>MOTIFLIB</makevar> variable will be set by
 	  <filename>bsd.port.mk</filename> to reference the appropriate
 	  Motif library.  Please patch the source of your port to
 	  use <literal>&dollar;{MOTIFLIB}</literal> wherever the Motif library is referenced in the original
 	  <filename>Makefile</filename> or
 	  <filename>Imakefile</filename>.</para>
 
 	<para>There are two common cases:</para>
 
 	<itemizedlist>
 	  <listitem>
 	    <para>If the port refers to the Motif library as
 	      <literal>-lXm</literal> in its <filename>Makefile</filename> or
 	      <filename>Imakefile</filename>, simply substitute
 	      <literal>&dollar;{MOTIFLIB}</literal> for it.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>If the port uses <literal>XmClientLibs</literal> in its
 	      <filename>Imakefile</filename>, change it to
 	      <literal>&dollar;{MOTIFLIB} &dollar;{XTOOLLIB}
 		&dollar;{XLIB}</literal>.</para>
 	  </listitem>
 
 	</itemizedlist>
 
 	<para>Note that <makevar>MOTIFLIB</makevar> (usually) expands to
 	  <literal>-L/usr/X11R6/lib -lXm</literal> or
 	  <literal>/usr/X11R6/lib/libXm.a</literal>, so there is no need to
 	  add <literal>-L</literal> or <literal>-l</literal> in front.</para>
 
       </sect2>
 
       <sect2>
 	<title>X11 fonts</title>
 
 	<para>If your port installs fonts for the X Window System, put them in
 	  <filename><makevar>X11BASE</makevar>/lib/X11/fonts/local</filename>.<para>
 
       </sect2>
 
     </sect1>
 
     <sect1 id="using-gnome">
       <title>Using GNOME</title>
 
       <para>The FreeBSD/GNOME project uses its own set of variables
 	to define which GNOME components a
 	particular port uses. A
 	<ulink url="http://www.FreeBSD.org/gnome/docs/porting.html">comprehensive
 	list of these variables</ulink> exists within the FreeBSD/GNOME
 	project's homepage.</para>
 
       <note>
 	<para>Your port does not need to depend on GNOME if it merely installs
 	  <application>pkg-config</application> metadata files to
 	  <filename><makevar>PREFIX</makevar>/libdata/pkgconfig</filename>.
 	  As usual, your port should be prepared to clean up after itself
 	  and remove that directory if it becomes empty.
 	  Assuming that your port installs a file named
 	  <filename>gtkmumble.pc</filename> to the said location, just add
 	  the following lines to <filename>pkg-plist</filename>:</para>
 
 	<programlisting>libdata/pkgconfig/gtkmumble.pc
 @unexec rmdir %B 2>/dev/null || true</programlisting>
 
 	<para>The latter line must appear immediately after the former one
 	  so that <literal>%B</literal> expands correctly.  Please refer
 	  to &man.pkg.create.1; for a detailed description of the syntax
 	  used in <filename>pkg-plist</filename>.</para>
       </note>
 
     </sect1>
 
     <sect1 id="using-kde">
       <title>Using KDE</title>
 
       <table frame="none">
 	<title>Variables for ports that use KDE</title>
 
 	<tgroup cols="2">
 	  <tbody>
 	    <row>
 	      <entry><makevar>USE_QT_VER</makevar></entry>
 
 	      <entry>The port uses the Qt toolkit.  Possible values are
 		<literal>1</literal> and
 		<literal>3</literal>;  each specify the major version
 		of Qt to use.  Sets both <makevar>MOC</makevar> and
 		<makevar>QTCPPFLAGS</makevar>to default appropriate
 		values.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_KDELIBS_VER</makevar></entry>
 
 	      <entry>The port uses KDE libraries.  Possible values are
 		<literal>3</literal>;  each specify the major version
 		of KDE to use.  Implies <makevar>USE_QT_VER</makevar>
 		of the appropriate version.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_KDEBASE_VER</makevar></entry>
 
 	      <entry>The port uses KDE base.  Possible values are
 		<literal>3</literal>;  each specify the major version
 		of KDE to use.  Implies <makevar>USE_KDELIBS_VER</makevar>
 		of the appropriate version.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>MOC</makevar></entry>
 
 	      <entry>Set to the path of <command>moc</command>.
 		Default set according to <makevar>USE_QT_VER</makevar>
 		value.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>QTCPPFLAGS</makevar></entry>
 
 	      <entry>Set the <makevar>CPPFLAGS</makevar> to use when
 		processing Qt code.  Default set according to
 		<makevar>USE_QT_VER</makevar> value.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
     </sect1>
 
     <sect1 id="using-java">
       <title>Using Java</title>
 
       <sect2 id="java-variables">
 	<title>Variable definitions</title>
 
       <para>If your port needs a Java&trade; Development Kit (JDK) to
 	either build, run or even extract the distfile, then it should
 	define <makevar>USE_JAVA</makevar>.</para>
 
       <para>There are several JDKs in the ports collection, from various
 	vendors, and in several versions.  If your port must use one of
 	these versions, you can define which one.  The most current
 	version is <filename role="package">java/jdk14</filename>.</para>
 
       <table frame="none">
 	<title>Variables that may be set by ports that use Java</title>
 
 	<tgroup cols="2">
 	  <thead>
 	    <row>
 	      <entry>Variable</entry>
 	      <entry>Means</entry>
 	    </row>
 	  </thead>
 	  <tbody>
 	    <row>
 	      <entry><makevar>USE_JAVA</makevar></entry>
 	      <entry>Should be defined for the remaining variables to have any
 		effect.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_VERSION</makevar></entry>
 	      <entry>List of space-separated suitable Java versions for
 		the port.  An optional <literal>"+"</literal> allows you to
 		specify a range of versions (allowed values:
 		<literal>1.1[+] 1.2[+] 1.3[+] 1.4[+]</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_OS</makevar></entry>
 	      <entry>List of space-separated suitable JDK port operating
 		systems for the port (allowed values: <literal>native
 		linux</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_VENDOR</makevar></entry>
 	      <entry>List of space-separated suitable JDK port vendors for
 		the port (allowed values: <literal>freebsd bsdjava sun ibm
 		blackdown</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_BUILD</makevar></entry>
 	      <entry>When set, it means that the selected JDK port should
 		be added to the build dependencies of the port.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_RUN</makevar></entry>
 	      <entry>When set, it means that the selected JDK port should
 		be added to the run dependencies of the port.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_EXTRACT</makevar></entry>
 	      <entry>When set, it means that the selected JDK port should
 		be added to the extract dependencies of the port.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>USE_JIKES</makevar></entry>
 	      <entry>Whether the port should or should not use the
 		<command>jikes</command> bytecode compiler to build. When
 		no value is set for this variable, the port will use
 		<command>jikes</command> to build if available. You may
 		also explicitly forbid or enforce the use of
 		<command>jikes</command> (by setting <literal>'no'</literal>
 		or <literal>'yes'</literal>). In the later case, <filename
 		role="package">devel/jikes</filename> will be added to build
 		dependencies of the port. In any case that <command>jikes</command>
 		is actually used in place of <command>javac</command>, then the
 		<makevar>HAVE_JIKES</makevar> variable is defined by
 		<filename>bsd.java.mk</filename>.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
       <para>Below is the list of all settings a port will receive after
 	setting <makevar>USE_JAVA</makevar>:</para>
 
       <table frame="none">
 	<title>Variables provided to ports that use Java</title>
 
 	<tgroup cols="2">
 	  <thead>
 	    <row>
 	      <entry>Variable</entry>
 	      <entry>Value</entry>
 	    </row>
 	  </thead>
 	  <tbody>
 	    <row>
 	      <entry><makevar>JAVA_PORT</makevar></entry>
 	      <entry>The name of the JDK port (e.g.
 		<literal>'java/jdk14'</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_PORT_VERSION</makevar></entry>
 	      <entry>The full version of the JDK port (e.g.
 		<literal>'1.4.2'</literal>). If you only need the first
 		two digits of this version number, use
 		<makevar>${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1.\2/}</makevar>.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_PORT_OS</makevar></entry>
 	      <entry>The operating system used by the JDK port (e.g.
 		<literal>'linux'</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_PORT_VENDOR</makevar></entry>
 	      <entry>The vendor of the JDK port (e.g.
 		<literal>'sun'</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_PORT_OS_DESCRIPTION</makevar></entry>
 	      <entry>Description of the operating system used by the JDK port
 		(e.g. <literal>'Linux'</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_PORT_VENDOR_DESCRIPTION</makevar></entry>
 	      <entry>Description of the vendor of the JDK port (e.g.
 		<literal>'FreeBSD Foundation'</literal>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_HOME</makevar></entry>
 	      <entry>Path to the installation directory of the JDK (e.g.
 		<filename>'/usr/local/jdk1.3.1'</filename>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVAC</makevar></entry>
 	      <entry>Path to the Java compiler to use (e.g.
 		<filename>'/usr/local/jdk1.1.8/bin/javac'</filename> or
 		<filename>'/usr/local/bin/jikes'</filename>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAR</makevar></entry>
 	      <entry>Path to the <command>jar</command> tool to use (e.g.
 		<filename>'/usr/local/jdk1.2.2/bin/jar'</filename> or
 		<filename>'/usr/local/bin/fastjar'</filename>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>APPLETVIEWER</makevar></entry>
 	      <entry>Path to the <command>appletviewer</command> utility (e.g.
 		<filename>'/usr/local/linux-jdk1.2.2/bin/appletviewer'</filename>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA</makevar></entry>
 	      <entry>Path to the <command>java</command> executable. Use
 		this for executing Java programs (e.g.
 		<filename>'/usr/local/jdk1.3.1/bin/java'</filename>).</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVADOC</makevar></entry>
 	      <entry>Path to the <command>javadoc</command> utility
 		program.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVAH</makevar></entry>
 	      <entry>Path to the <command>javah</command> program.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVAP</makevar></entry>
 	      <entry>Path to the <command>javap</command> program.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_KEYTOOL</makevar></entry>
 	      <entry>Path to the <command>keytool</command> utility program.
 		This variable is available only if the JDK is Java 1.2 or
 		higher.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_N2A</makevar></entry>
 	      <entry>Path to the <command>native2ascii</command> tool.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_POLICYTOOL</makevar></entry>
 	      <entry>Path to the <command>policytool</command> program.
 		This variable is available only if the JDK is Java 1.2 or
 		higher.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_SERIALVER</makevar></entry>
 	      <entry>Path to the <command>serialver</command> utility
 		program.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>RMIC</makevar></entry>
 	      <entry>Path to the RMI stub/skeleton generator,
 		<command>rmic</command>.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>RMIREGISTRY</makevar></entry>
 	      <entry>Path to the RMI registry program,
 		<command>rmiregistry</command>.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>RMID</makevar></entry>
 	      <entry>Path to the RMI daemon program <command>rmid</command>.
 		This variable is only available if the JDK is Java 1.2
 		or higher.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVA_CLASSES</makevar></entry>
 	      <entry>Path to the archive that contains the JDK class
 		files. On JDK 1.2 or later, this is
 		<filename>${JAVA_HOME}/jre/lib/rt.jar</filename>.  Earlier
 		JDKs used
 		<filename>${JAVA_HOME}/lib/classes.zip</filename>.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>HAVE_JIKES</makevar></entry>
 	      <entry>Defined whenever <command>jikes</command> is used by
 	        the port (see <makevar>USE_JIKES</makevar> above).</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
       <para>You may use the <literal>java-debug</literal> make target
 	to get information for debugging your port. It will display the
 	value of many of the forecited variables.</para>
 
       <para>Additionally, the following constants are defined so all
 	Java ports may be installed in a consistent way:</para>
 
       <table frame="none">
 	<title>Constants defined for ports that use Java</title>
 
 	<tgroup cols="2">
 	  <thead>
 	    <row>
 	      <entry>Constant</entry>
 	      <entry>Value</entry>
 	    </row>
 	  </thead>
 	  <tbody>
 	    <row>
 	      <entry><makevar>JAVASHAREDIR</makevar></entry>
 	      <entry>The base directory for everything related to Java.
 		Default: <filename>${PREFIX}/share/java</filename>.
 	      </entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVAJARDIR</makevar></entry>
 	      <entry>The directory where JAR files should be installed.
 		Default:
 		<filename>${JAVASHAREDIR}/classes</filename>.</entry>
 	    </row>
 	    <row>
 	      <entry><makevar>JAVALIBDIR</makevar></entry>
 	      <entry>The directory where JAR files installed by other
 	        ports are located. Default:
 		<filename>${LOCALBASE}/share/java/classes</filename>.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
       <para>The related entries are defined in both
 	<makevar>PLIST_SUB</makevar> (documented in
 	<xref linkend="plist-sub">) and
 	<makevar>SUB_LIST</makevar>.</para>
 
       </sect2>
 
       <sect2 id="java-building-with-ant">
 	<title>Building with Ant</title>
 
 	<para>When the port is to be built using Apache Ant, it has to
 	  define <makevar>USE_ANT</makevar>. Ant is thus considered to be
 	  the sub-make command. When no <literal>do-build</literal> target
 	  is defined by the port, a default one will be set that simply
 	  runs Ant according to <makevar>MAKE_ENV</makevar>,
 	  <makevar>MAKE_ARGS</makevar> and <makevar>ALL_TARGETS</makevar>.
 	  This is similar to the <makevar>USE_GMAKE</makevar> mechanism,
 	  which is documented in <xref linkend="using-autotools">.</para>
 
 	<para>If <command>jikes</command> is used in place of
 	  <command>javac</command> (see <makevar>USE_JIKES</makevar> in
 	  <xref linkend="java-variables">), then Ant will automatically
 	  use it to build the port.</para>
 
       </sect2>
 
       <sect2 id="java-best-practices">
 	<title>Best practices</title>
 
 	<para>When porting a Java library, your port should install the
 	  JAR file(s) in <filename>${JAVAJARDIR}</filename>, and everything
 	  else under <filename>${JAVASHAREDIR}/${PORTNAME}</filename>
 	  (except for the documentation, see below). In order to reduce
 	  the packing file size, you may reference the JAR file(s) directly
 	  in the <filename>Makefile</filename>. Just use the following
 	  statement (where <filename>myport.jar</filename> is the name
 	  of the JAR file installed as part of the port):</para>
 
 	<programlisting>PLIST_FILES+= %%JAVAJARDIR%%/myport.jar</programlisting>
 
 	<para>When porting a Java application, the port usually installs
 	  everything under a single directory (including its JAR
 	  dependencies).  The use of
 	  <filename>${JAVASHAREDIR}/${PORTNAME}</filename> is strongly
 	  encouraged in this regard.  It is up the porter to decide
 	  whether the port should install the additional JAR dependencies
 	  under this directory or directly use the already installed ones
 	  (from <filename>${JAVAJARDIR}</filename>).</para>
 
 	<para>Regardless of the type of your port (library or application),
 	  the additional documentation should be installed in the
 	  <link linkend="dads-documentation">same location</link> as for
 	  any other port.  The JavaDoc tool is known to produce a
 	  different set of files depending on the version of the JDK that
 	  is used. For ports that do not enforce the use of a particular
 	  JDK, it is therefore a complex task to specify the packing list
 	  (<filename>pkg-plist</filename>).  This is one reason why
 	  porters are strongly encouraged to use the
 	  <makevar>PORTDOCS</makevar> macro.  Moreover, even if you can
 	  predict the set of files that will be generated by
 	  <command>javadoc</command>, the size of the resulting
 	  <filename>pkg-plist</filename> advocates for the use of
 	  <makevar>PORTDOCS</makevar>.</para>
 
 	<para>The default value for <makevar>DATADIR</makevar> is
 	  <filename>${PREFIX}/share/${PORTNAME}</filename>.  It is a good
 	  idea to override <makevar>DATADIR</makevar> to
 	  <filename>${JAVASHAREDIR}/${PORTNAME}</filename> for Java ports.
 	  Indeed, <makevar>DATADIR</makevar> is automatically added to
 	  <makevar>PLIST_SUB</makevar> (documented in <xref
 	  linkend="plist-sub">) so you may use
 	  <literal>%%DATADIR%%</literal> directly in
 	  <filename>pkg-plist</filename>.</para>
 
 	<para>As for the choice of building Java ports from source or
 	  directly installing them from a binary distribution, there is
 	  no defined policy at the time of writing.  However, people from
 	  the <ulink
 	  url="http://www.freebsd.org/java/">&os; Java Project</ulink>
 	  encourage porters to have their ports built from source whenever
 	  it is a trivial task.</para>
 
 	<para>All the features that have been presented in this section
 	  are implemented in <filename>bsd.java.mk</filename>. If you
 	  ever think that your port needs more sophisticated Java support,
 	  please first have a look at the <ulink
 	  url="http://www.freebsd.org/cgi/cvsweb.cgi/ports/Mk/bsd.java.mk">
 	  bsd.java.mk CVS log</ulink> as it usually takes some time to
 	  document the latest features.  Then, if you think the support
 	  you are lacking would be beneficial to many other Java ports,
 	  feel free to discuss it on the &a.java;.</para>
 
 	<para>Although there is a <literal>java</literal> category for
 	  PRs, it refers to the JDK porting effort from the &os; Java
 	  project.  Therefore, you should submit your Java port in the
 	  <literal>ports</literal> category as for any other port, unless
 	  the issue you are trying to resolve is related to either a JDK
 	  implementation or <filename>bsd.java.mk</filename>.</para>
 
 	<para>Similarly, there is a defined policy regarding the
 	  <makevar>CATEGORIES</makevar> of a Java port, which is detailed
 	  in <xref linkend="makefile-categories">.</para>
 
       </sect2>
 
     </sect1>
 
     <sect1 id="using-php">
       <title>Using Apache and PHP</title>
 
       <sect2 id="using-apache">
 	<title>Apache</title>
 
 	<table frame="none">
 	  <title>Variables for ports that use Apache</title>
 
 	  <tgroup cols="2">
 	    <tbody>
 
 	      <row>
 		<entry>USE_APACHE</entry>
 
 		<entry>The port requires Apache.</entry>
 	      </row>
 
 	      <row>
 		<entry>WITH_APACHE2</entry>
 
 		<entry>The port requires Apache 2.0.  Without this variable,
 		  the port will depend on Apache 1.3.</entry>
 	      </row>
 
 	      <row>
 		<entry>APXS</entry>
 
 		<entry>Full path to the <command>apxs</command> binary
 		  (read-only variable).</entry>
 	      </row>
 
 	    </tbody>
 	  </tgroup>
 	</table>
 
       </sect2>
 
       <sect2 id="php-variables">
 	<title>PHP</title>
 
 	<table frame="none">
 	  <title>Variables for ports that use PHP</title>
 
 	  <tgroup cols="2">
 	    <tbody>
 	      <row>
 		<entry><makevar>USE_PHP</makevar></entry>
 
 		<entry>The port requires PHP.  The value <literal>yes</literal>
 		  adds a dependency on PHP.  The list of required PHP extensions
 		  can be specified instead.  Example: <literal>pcre xml
 		  gettext</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>DEFAULT_PHP_VER</makevar></entry>
 
 		<entry>Selects which major version of PHP will be installed as
 		  a dependency when no PHP is installed yet.  Default is
 		  <literal>4</literal>. Possible values: <literal>4</literal>,
 		  <literal>5</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>BROKEN_WITH_PHP</makevar></entry>
 
 		<entry>The port does not work with PHP of the given version.
 		  Possible values: <literal>4</literal>,
 		  <literal>5</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>USE_PHPIZE</makevar></entry>
 
 		<entry>The port will be built as a PHP extension.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>USE_PHPEXT</makevar></entry>
 
 		<entry>The port will be treated as a PHP extension, including
 		  installation and registration in the extension registry.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>USE_PHP_BUILD</makevar></entry>
 
 		<entry>Set PHP as a build dependency.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>WANT_PHP_CLI</makevar></entry>
 
 		<entry>Want the CLI (command line) version of PHP.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>WANT_PHP_CGI</makevar></entry>
 
 		<entry>Want the CGI version of PHP.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>WANT_PHP_MOD</makevar></entry>
 
 		<entry>Want the Apache module version of PHP.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>WANT_PHP_SCR</makevar></entry>
 
 		<entry>Want the CLI or the CGI version of PHP.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>WANT_PHP_WEB</makevar></entry>
 
 		<entry>Want the Apache module or the CGI version of PHP.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>WANT_PHP_PEAR</makevar></entry>
 
 		<entry>Want the PEAR framework.</entry>
 	      </row>
 
 	    </tbody>
 	  </tgroup>
 	</table>
 
       </sect2>
 
       <sect2>
 	<title>PEAR modules</title>
 
 	<para>Porting PEAR modules is a very simple process.</para>
 
 	<para>Use the variables <makevar>FILES</makevar>,
 	  <makevar>TESTS</makevar>, <makevar>DATA</makevar>,
 	  <makevar>SQLS</makevar>, <makevar>SCRIPTFILES</makevar>,
 	  <makevar>DOCS</makevar> and <makevar>EXAMPLES</makevar> to list the
 	  files you want to install.  All listed files will be automatically
 	  installed into the appropriate locations and added to
 	  <filename>pkg-plist</filename>.</para>
 
 	<para>Include
 	  <filename>&dollar;{PORTSDIR}/devel/pear-PEAR/Makefile.common</filename>
 	  on the last line of the <filename>Makefile</filename>.</para>
 
 	<example id="pear-makefile">
 	  <title>Example Makefile for PEAR class</title>
 	  <programlisting>PORTNAME=       Date
 PORTVERSION=    1.4.3
 CATEGORIES=     devel www pear
 
 MAINTAINER=     example@domain.com
 COMMENT=        PEAR Date and Time Zone Classes
 
 BUILD_DEPENDS=  ${PEARDIR}/PEAR.php:${PORTSDIR}/devel/pear-PEAR
 RUN_DEPENDS=    ${BUILD_DEPENDS}
 
 FILES=          Date.php Date/Calc.php Date/Human.php Date/Span.php     \
                 Date/TimeZone.php
 TESTS=          test_calc.php test_date_methods_span.php testunit.php   \
                 testunit_date.php testunit_date_span.php wknotest.txt   \
                 bug674.php bug727_1.php bug727_2.php bug727_3.php       \
                 bug727_4.php bug967.php weeksinmonth_4_monday.txt       \
                 weeksinmonth_4_sunday.txt weeksinmonth_rdm_monday.txt   \
                 weeksinmonth_rdm_sunday.txt
 DOCS=           TODO
 _DOCSDIR=       .
 
 .include &lt;bsd.port.pre.mk&gt;
 .include "&dollar;{PORTSDIR}/devel/pear-PEAR/Makefile.common"
 .include &lt;bsd.port.post.mk&gt;</programlisting>
 
 	</example>
 
       </sect2>
 
     </sect1>
 
     <sect1 id="using-python">
       <title>Using Python</title>
 
       <table frame="none">
 	<title>Most useful variables for ports that use Python</title>
 
 	<tgroup cols="2">
 	  <tbody>
 	    <row>
 	      <entry><makevar>USE_PYTHON</makevar></entry>
 
 	      <entry>The port needs Python.  Minimal required version can be
 		specified with values such as <literal>2.3+</literal>.
 		Version ranges can also be specified, by separating two version
 		numbers with a dash, e.g.: <literal>2.1-2.3</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_PYDISTUTILS</makevar></entry>
 
 	      <entry>Use Python distutils for configuring, compiling and
 		installing.  This is required when the port comes with
-		<filename>setup.py</filename>. This overrides the 
-		<maketarget>do-build</maketarget> and 
+		<filename>setup.py</filename>. This overrides the
+		<maketarget>do-build</maketarget> and
 		<maketarget>do-install</maketarget> targets
 		and may also override <maketarget>do-configure</maketarget> if
 		<makevar>GNU_CONFIGURE</makevar> is not defined.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PYTHON_PKGNAMEPREFIX</makevar></entry>
 
 	      <entry>Used as a <makevar>PKGNAMEPREFIX</makevar> to distinguish
 		packages for different Python versions.
 		Example: <literal>py24-</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PYTHON_SITELIBDIR</makevar></entry>
 
 	      <entry>Location of the site-packages tree, that contains
 		installation path of Python (usually <makevar>LOCALBASE</makevar>).
 		The <makevar>PYTHON_SITELIBDIR</makevar> variable can be very
 	 	useful when installing Python modules.</entry>
 	    </row>
-	    
+
 	    <row>
 	      <entry><makevar>PYTHONPREFIX_SITELIBDIR</makevar></entry>
-	      
+
 	      <entry>The PREFIX-clean variant of PYTHON_SITELIBDIR.
 	      	Always use
 		<literal>%%PYTHON_SITELIBDIR%%</literal> in
 		<filename>pkg-plist</filename> when possible. The default value of
 		<literal>%%PYTHON_SITELIBDIR%%</literal> is
 		<literal>lib/python%%PYTHON_VERSION%%/site-packages</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PYTHON_CMD</makevar></entry>
-	      
+
 	      <entry>Python interpreter command line, including version
 	      number.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PYNUMERIC</makevar></entry>
 
 	      <entry>Dependency line for numeric extension.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>PYXML</makevar></entry>
 
 	      <entry>Dependency line for XML extension (not needed for
 	      Python 2.0 and higher as it is also in base distribution).</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_TWISTED</makevar></entry>
 
 	      <entry>Add dependency on twistedCore.  The list of required
 		components can be specified as a value of this
 		variable.  Example: <literal>web lore pair
 		flow</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_ZOPE</makevar></entry>
 
 	      <entry>Add dependency on Zope, a web application platform.
 		Change Python dependency to Python 2.3.  Set
 		<makevar>ZOPEBASEDIR</makevar> containing a directory with
 		Zope installation.</entry>
 	    </row>
 
 	  </tbody>
 	</tgroup>
       </table>
 
       <para>A complete list of available variables can be found in
 	<filename>/usr/ports/Mk/bsd.python.mk</filename>.</para>
 
     </sect1>
 
     <sect1 id="using-emacs">
       <title>Using Emacs</title>
 
       <para>This section is yet to be written.</para>
     </sect1>
 
     <sect1 id="using-ruby">
       <title>Using Ruby</title>
 
       <table frame="none">
 	<title>Useful variables for ports that use Ruby</title>
 
 	<tgroup cols="2">
 	  <thead>
 	    <row>
 	      <entry>Variable</entry>
 	      <entry>Description</entry>
 	    </row>
 	  </thead>
 	  <tbody>
 	    <row>
 	      <entry><makevar>USE_RUBY</makevar></entry>
 
 	      <entry>The port requires Ruby.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_RUBY_EXTCONF</makevar></entry>
 
 	      <entry>The port uses <filename>extconf.rb</filename> to
 		configure.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>USE_RUBY_SETUP</makevar></entry>
 
 	      <entry>The port uses <filename>setup.rb</filename> to
 		configure.</entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>RUBY_SETUP</makevar></entry>
 
 	      <entry>Set to the alternative name of
 		<filename>setup.rb</filename>.  Common value is
 		<filename>install.rb</filename>.</entry>
 	    </row>
 
 	  </tbody>
 	</tgroup>
       </table>
 
       <para>The following table shows the selected variables available to port
 	authors via the ports infrastructure.  These variables should be used
 	to install files into their proper locations.  Use them in
 	<filename>pkg-plist</filename> as much as possible.  These variables
 	should not be redefined in the port.</para>
 
       <table frame="none">
 	<title>Selected read-only variables for ports that use Ruby</title>
 
 	<tgroup cols="3">
 	  <thead>
 	    <row>
 	      <entry>Variable</entry>
 	      <entry>Description</entry>
 	      <entry>Example value</entry>
 	    </row>
 	  </thead>
 	  <tbody>
 
 	    <row>
 	      <entry><makevar>RUBY_PKGNAMEPREFIX</makevar></entry>
 
 	      <entry>Used as a <makevar>PKGNAMEPREFIX</makevar> to distinguish
 		packages for different Ruby versions.</entry>
 
 	      <entry><literal>ruby18-</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>RUBY_VERSION</makevar></entry>
 
 	      <entry>Full version of Ruby in the form of
 		<literal>x.y.z</literal>.</entry>
 
 	      <entry><literal>1.8.2</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>RUBY_SITELIBDIR</makevar></entry>
 
 	      <entry>Architecture independent libraries installation
 		path.</entry>
 
 	      <entry><literal>/usr/local/lib/ruby/site_ruby/1.8</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>RUBY_SITEARCHILIBDIR</makevar></entry>
 
 	      <entry>Architecture dependent libraries installation
 		path.</entry>
 
 	      <entry><literal>/usr/local/lib/ruby/site_ruby/1.8/amd64-freebsd6</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>RUBY_MODDOCDIR</makevar></entry>
 
 	      <entry>Module documentation installation path.</entry>
 
 	      <entry><literal>/usr/local/share/doc/ruby18/patsy</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><makevar>RUBY_MODEXAMPLESDIR</makevar></entry>
 
 	      <entry>Module examples installation path.</entry>
 
 	      <entry><literal>/usr/local/share/examples/ruby18/patsy</literal></entry>
 	    </row>
 
 	  </tbody>
 	</tgroup>
       </table>
 
       <para>A complete list of available variables can be found in
 	<filename>/usr/ports/Mk/bsd.ruby.mk</filename>.</para>
 
     </sect1>
 
     <sect1 id="using-sdl">
       <title>Using SDL</title>
 
       <para>The <makevar>USE_SDL</makevar> variable is used to autoconfigure
 	the dependencies for ports which use an SDL based library like
 	<filename role="package">devel/sdl12</filename> and
 	<filename role="package">x11-toolkits/sdl_gui</filename>.</para>
 
       <para>The following SDL libraries are recognized at the moment:</para>
 
       <itemizedlist>
 	<listitem>
 	  <para>sdl: <filename role="package">devel/sdl12</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>gfx: <filename role="package">graphics/sdl_gfx</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>gui: <filename role="package">x11-toolkits/sdl_gui</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>image: <filename role="package">graphics/sdl_image</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>ldbad: <filename role="package">devel/sdl_ldbad</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>mixer: <filename role="package">audio/sdl_mixer</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>mm: <filename role="package">devel/sdlmm</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>net: <filename role="package">net/sdl_net</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>sound: <filename role="package">audio/sdl_sound</filename></para>
 	</listitem>
 
 	<listitem>
 	  <para>ttf: <filename role="package">graphics/sdl_ttf</filename></para>
 	</listitem>
       </itemizedlist>
 
       <para>Therefore, if a port has a dependency on
 	<filename role="package">net/sdl_net</filename> and
 	<filename role="package">audio/sdl_mixer</filename>,
 	the syntax will be:</para>
 
       <programlisting>USE_SDL=        net mixer</programlisting>
 
       <para>The dependency <filename role="package">devel/sdl12</filename>,
 	which is required by <filename role="package">net/sdl_net</filename> and
 	<filename role="package">audio/sdl_mixer</filename>, is automatically
 	added as well.</para>
 
       <para>If you use <makevar>USE_SDL</makevar>, it will automatically:</para>
 
       <itemizedlist>
 	<listitem>
 	  <para>Add a dependency on <application>sdl12-config</application> to
 	    <makevar>BUILD_DEPENDS</makevar></para>
 	</listitem>
 
 	<listitem>
 	  <para>Add the variable <makevar>SDL_CONFIG</makevar> to
 	    <makevar>CONFIGURE_ENV</makevar></para>
 	</listitem>
 
 	<listitem>
 	  <para>Add the dependencies of the selected libraries to the
 	    <makevar>LIB_DEPENDS</makevar></para>
 	</listitem>
       </itemizedlist>
 
       <para>To check whether an SDL library is available, you can do it
 	with the <makevar>WANT_SDL</makevar> variable:</para>
 
       <programlisting>WANT_SDL=yes
 
 .include &lt;bsd.port.pre.mk&gt;
 
 .if ${HAVE_SDL:Mmixer}!=""
 USE_SDL+=   mixer
 .endif
 
 .include &lt;bsd.port.post.mk&gt;</programlisting>
 
     </sect1>
   </chapter>
 
     <chapter id="plist">
       <title>Advanced <filename>pkg-plist</filename> practices</title>
 
       <sect1 id="plist-sub">
 	<title>Changing <filename>pkg-plist</filename> based on make
 	  variables</title>
 
 	<para>Some ports, particularly the <literal>p5-</literal> ports,
 	  need to change their <filename>pkg-plist</filename> depending on
 	  what options they are configured with (or version of
 	  <literal>perl</literal>, in the case of <literal>p5-</literal>
 	  ports).  To make this easy, any instances in the
 	  <filename>pkg-plist</filename> of <literal>%%OSREL%%</literal>,
 	  <literal>%%PERL_VER%%</literal>, and
 	  <literal>%%PERL_VERSION%%</literal> will be substituted for
 	  appropriately.  The value of <literal>%%OSREL%%</literal> is the
 	  numeric revision of the operating system (e.g.,
 	  <literal>4.9</literal>).  <literal>%%PERL_VERSION%%</literal> is
 	  the full version number of <command>perl</command> (e.g.,
 	  <literal>5.00502</literal>) and <literal>%%PERL_VER%%</literal>
 	  is the <command>perl</command> version number minus
 	  the patchlevel (e.g., <literal>5.005</literal>).  Several other
 	  <literal>%%<replaceable>VARS</replaceable>%%</literal> related to
 	  port's documentation files are described in <link
 	  linkend="dads-documentation">the relevant section</link>.</para>
 
 	<para>If you need to make other substitutions, you can set the
 	  <makevar>PLIST_SUB</makevar> variable with a list of
 	  <literal><replaceable>VAR</replaceable>=<replaceable>VALUE</replaceable></literal>
 	  pairs and instances of
 	  <literal>%%<replaceable>VAR</replaceable>%%</literal> will be
 	  substituted with <replaceable>VALUE</replaceable> in the
 	  <filename>pkg-plist</filename>.</para>
 
 	<para>For instance, if you have a port that installs many files in a
 	  version-specific subdirectory, you can put something like</para>
 
 	<programlisting>OCTAVE_VERSION= 2.0.13
 PLIST_SUB=      OCTAVE_VERSION=${OCTAVE_VERSION}</programlisting>
 
 	<para>in the <filename>Makefile</filename> and use
 	  <literal>%%OCTAVE_VERSION%%</literal> wherever the version shows up
 	  in <filename>pkg-plist</filename>.  That way, when you upgrade the port,
 	  you will not have to change dozens (or in some cases, hundreds) of
 	  lines in the <filename>pkg-plist</filename>.</para>
 
 	<para>This substitution (as well as addition of any <link
 	  linkend="makefile-manpages">manual pages</link>) will be done between
 	  the <maketarget>pre-install</maketarget> and
 	  <maketarget>do-install</maketarget> targets, by reading from
 	  <filename><makevar>PLIST</makevar></filename> and writing to
 	  <filename><makevar>TMPPLIST</makevar></filename>
 	  (default:
 	  <filename><makevar>WRKDIR</makevar>/.PLIST.mktmp</filename>).  So if
 	  your port builds <filename><makevar>PLIST</makevar></filename>
 	  on the fly, do so in or
 	  before <maketarget>pre-install</maketarget>.  Also, if your port
 	  needs to edit the resulting file, do so in
 	  <maketarget>post-install</maketarget> to a file named
 	  <filename><makevar>TMPPLIST</makevar></filename>.</para>
 
 	<para>Another possibility to modify port's packing list is based
 	  on setting the variables <makevar>PLIST_FILES</makevar> and
 	  <makevar>PLIST_DIRS</makevar>.  The value of each variable
 	  is regarded as a list of pathnames to
 	  write to <filename><makevar>TMPPLIST</makevar></filename>
 	  along with <filename><makevar>PLIST</makevar></filename>
 	  contents.  Names listed in <makevar>PLIST_FILES</makevar>
 	  and <makevar>PLIST_DIRS</makevar> are subject to
 	  <literal>%%<replaceable>VAR</replaceable>%%</literal>
 	  substitution, as described above.
 	  Except for that, names from <makevar>PLIST_FILES</makevar>
 	  will appear in the final packing list unchanged,
 	  while <literal>@dirrm</literal> will be
 	  prepended to names from <makevar>PLIST_DIRS</makevar>.
 	  To take effect, <makevar>PLIST_FILES</makevar> and
 	  <makevar>PLIST_DIRS</makevar> must be set before
 	  <filename><makevar>TMPPLIST</makevar></filename> is written,
 	  i.e. in <maketarget>pre-install</maketarget> or earlier.</para>
       </sect1>
 
       <sect1 id="plist-cleaning">
 	<title>Empty directories</title>
 
 	<sect2 id="plist-dir-cleaning">
 	  <title>Cleaning up empty directories</title>
 
 	<para>Do make your ports remove empty directories when they are
 	  de-installed.  This is usually accomplished by adding
 	  <literal>@dirrm</literal> lines for all directories that are
 	  specifically created by the port.  You need to delete subdirectories
 	  before you can delete parent directories.</para>
 
 	<programlisting> :
 lib/X11/oneko/pixmaps/cat.xpm
 lib/X11/oneko/sounds/cat.au
  :
 @dirrm lib/X11/oneko/pixmaps
 @dirrm lib/X11/oneko/sounds
 @dirrm lib/X11/oneko</programlisting>
 
 	<para>However, sometimes <literal>@dirrm</literal> will give you
 	  errors because other ports share the same directory.  You
 	  can call <command>rmdir</command> from <literal>@unexec</literal> to
 	  remove only empty directories without warning.</para>
 
 	<programlisting>@unexec rmdir %D/share/doc/gimp 2>/dev/null || true</programlisting>
 
 	<para>This will neither print any error messages nor cause
 	  &man.pkg.delete.1; to exit abnormally even if
 	  <filename><makevar>PREFIX</makevar>/share/doc/gimp</filename> is not
 	  empty due to other ports installing some files in there.</para>
 	</sect2>
 
 	<sect2 id="plist-dir-empty">
 	  <title>Creating empty directories</title>
 
 	  <para>Empty directories created during port installation need special
 	    attention.  They will not get created when installing the package,
 	    because packages only store the files, and &man.pkg.add.1; creates
 	    directories for them as needed.  To make sure the empty directory
 	    is created when installing the package, add this line to
 	    <filename>pkg-plist</filename> above the corresponding
 	    <literal>@dirrm</literal> line:</para>
 
 	  <programlisting>@exec mkdir -p %D/share/foo/templates</programlisting>
 	</sect2>
 
       </sect1>
 
       <sect1 id="plist-config">
 	<title>Configuration files</title>
 
 	<para>If your port requires some configuration files in
 	  <filename><makevar>PREFIX</makevar>/etc</filename>, do
 	  <emphasis>not</emphasis> just install them and list them in
 	  <filename>pkg-plist</filename>.  That will cause
 	  &man.pkg.delete.1; to delete files carefully edited by
 	  the user and a new installation to wipe them out.</para>
 
 	<para>Instead, install sample files with a suffix
 	  (<filename><replaceable>filename</replaceable>.sample</filename>
 	  will work well).  Copy the sample file as the real configuration
 	  file, if it does not exist.  On deinstall, delete the configuration
 	  file, but only if it was not modified by the user.  You need to
 	  handle this both in the port <filename>Makefile</filename>, and in
 	  the <filename>pkg-plist</filename> (for installation from
 	  the package).</para>
 
 	<para>Example of the <filename>Makefile</filename> part:</para>
 
 	<programlisting>post-install:
 	@if [ ! -f ${PREFIX}/etc/orbit.conf ]; then \
 		${CP} -p ${PREFIX}/etc/orbit.conf.sample ${PREFIX}/etc/orbit.conf ; \
 	fi</programlisting>
 
 	<para>Example of the <filename>pkg-plist</filename> part:</para>
 
 	<programlisting>@unexec if cmp -s %D/etc/orbit.conf.sample %D/etc/orbit.conf; then rm -f %D/etc/orbit.conf; fi
 etc/orbit.conf.sample
 @exec if [ ! -f %D/etc/orbit.conf ] ; then cp -p %D/%F %B/orbit.conf; fi</programlisting>
 
 	<para>Alternatively, print out a <link
 	    linkend="porting-message">message</link> pointing out that the
 	  user has to copy and edit the file before the software can be made
 	  to work.</para>
       </sect1>
 
     <sect1 id="plist-autoplist">
       <title>Automated package list creation</title>
 
       <para>First, make sure your port is almost complete, with only
 	<filename>pkg-plist</filename> missing.</para>
 
       <para>Next, create a temporary directory tree into which your port can be
 	installed, and install any dependencies.
 	<replaceable>port-type</replaceable> should be <literal>local</literal>
 	for non-X ports and <literal>x11-4</literal> or <literal>x11</literal>
 	for ports which install into the directory hierarchy of XFree86 4
 	or an earlier XFree86 release, respectively.</para>
 
       <screen>&prompt.root; <userinput>mkdir /var/tmp/<replaceable>port-name</replaceable></userinput>
 &prompt.root; <userinput>mtree -U -f /etc/mtree/BSD.<replaceable>port-type</replaceable>.dist -d -e -p /var/tmp/<replaceable>port-name</replaceable></userinput>
 &prompt.root; <userinput>make depends PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
 
       <para>Store the directory structure in a new file.</para>
 
       <screen>&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * -type d) | sort &gt; OLD-DIRS</userinput></screen>
 
       <para>Create an empty <filename>pkg-plist</filename> file:</para>
 
       <screen>&prompt.root; <userinput>touch pkg-plist</userinput></screen>
 
       <para>If your port honors <makevar>PREFIX</makevar> (which it should)
 	you can then install the port and create the package list.</para>
 
       <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput>
 &prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * \! -type d) | sort &gt; pkg-plist</userinput></screen>
 
       <para>You must also add any newly created directories to the packing
 	list.</para>
 
       <screen>&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' &gt;&gt; pkg-plist</userinput></screen>
 
       <para>Finally, you need to tidy up the packing list by hand; it is not
 	<emphasis>all</emphasis> automated.  Manual pages should be listed in
 	the port's <filename>Makefile</filename> under
 	<makevar>MAN<replaceable>n</replaceable></makevar>, and not in the
 	package list.  User configuration files should be removed, or
 	installed as
 	<filename><replaceable>filename</replaceable>.sample</filename>.
 	The <filename>info/dir</filename> file should not be listed
 	and appropriate <filename>install-info</filename> lines should
 	be added as noted in the <link linkend="makefile-info">info
 	files</link> section.  Any
 	libraries installed by the port should be listed as specified in the
 	<link linkend="porting-shlibs">shared libraries</link> section.</para>
 
       <para>Alternatively, use the <command>plist</command> script in
 	<filename>/usr/ports/Tools/scripts/</filename> to build the
 	package list automatically.  The first step is the same as
 	above: take the first three lines, that is,
 	<command>mkdir</command>, <command>mtree</command> and
 	<command>make depends</command>.  Then build and install the
 	port:</para>
 
       <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
 
       <para>And let <command>plist</command> create the
 	<filename>pkg-plist</filename> file:</para>
 
       <screen>&prompt.root; <userinput>/usr/ports/Tools/scripts/plist -Md -m /etc/mtree/BSD.<replaceable>port-type</replaceable>.dist /var/tmp/<replaceable>port-name</replaceable> &gt; pkg-plist</userinput></screen>
 
       <para>The packing list still have to tidied up the by hand as
         stated above.</para>
 
     </sect1>
 
     </chapter>
 
     <chapter id="pkg-files">
       <title>The <filename>pkg-<replaceable>*</replaceable></filename> files</title>
 
       <para>There are some tricks we have not mentioned yet about the
 	<filename>pkg-<replaceable>*</replaceable></filename> files
 	that come in handy sometimes.</para>
 
       <sect1 id="porting-message">
 	<title><filename>pkg-message</filename></title>
 
 	<para>If you need to display a message to the installer, you may place
 	  the message in <filename>pkg-message</filename>.  This capability is
 	  often useful to display additional installation steps to be taken
 	  after a &man.pkg.add.1; or to display licensing
 	  information.</para>
 
 	<note>
 	  <para>The <filename>pkg-message</filename> file does not need to be
 	    added to <filename>pkg-plist</filename>.  Also, it will not get
 	    automatically printed if the user is using the port, not the
 	    package, so you should probably display it from the
 	    <maketarget>post-install</maketarget> target yourself.</para>
 	</note>
       </sect1>
 
       <sect1 id="pkg-install">
 	<title><filename>pkg-install</filename></title>
 
 	<para>If your port needs to execute commands when the binary package
 	  is installed with &man.pkg.add.1; you can do this via the
 	  <filename>pkg-install</filename> script.  This script will
 	  automatically be added to the package, and will be run twice by
 	  &man.pkg.add.1;: the first time as
 	  <literal>&dollar;{SH} pkg-install &dollar;{PKGNAME}
 	  PRE-INSTALL</literal> and the second time as
 	  <literal>&dollar;{SH} pkg-install &dollar;{PKGNAME} POST-INSTALL</literal>.
 	  <literal>&dollar;2</literal> can be tested to determine which mode
 	  the script is being run in.  The <envar>PKG_PREFIX</envar>
 	  environmental variable will be set to the package installation
 	  directory.  See &man.pkg.add.1; for
 	  additional information.</para>
 
 	<note>
 	  <para>This script is not run automatically if you install the port
 	    with <command>make install</command>.  If you are depending on it
 	    being run, you will have to explicitly call it from your port's
 	    <filename>Makefile</filename>, with a line like
 	    <literal>PKG_PREFIX=&dollar;{PREFIX} &dollar;{SH} &dollar;{PKGINSTALL}
 	    &dollar;{PKGNAME} PRE-INSTALL</literal>.</para>
 	</note>
       </sect1>
 
       <sect1 id="pkg-deinstall">
 	<title><filename>pkg-deinstall</filename></title>
 
 	<para>This script executes when a package is removed.</para>
 
 	<para>
 	  This script will be run twice by &man.pkg.delete.1;.
 	  The first time as <literal>&dollar;{SH} pkg-deinstall &dollar;{PKGNAME}
 	  DEINSTALL</literal> and the second time as
 	  <literal>&dollar;{SH} pkg-deinstall &dollar;{PKGNAME} POST-DEINSTALL</literal>.
 	</para>
       </sect1>
 
       <sect1 id="pkg-req">
 	<title><filename>pkg-req</filename></title>
 
 	<para>If your port needs to determine if it should install or not, you
 	  can create a <filename>pkg-req</filename> <quote>requirements</quote>
 	  script.  It will be invoked automatically at
 	  installation/de-installation time to determine whether or not
 	  installation/de-installation should proceed.</para>
 
 	<para>The script will be run at installation time by
 	  &man.pkg.add.1; as
 	  <literal>pkg-req &dollar;{PKGNAME} INSTALL</literal>.
 	  At de-installation time it will be run by
 	  &man.pkg.delete.1; as
 	  <literal>pkg-req &dollar;{PKGNAME} DEINSTALL</literal>.</para>
       </sect1>
 
       <sect1 id="pkg-names">
 	<title id="porting-pkgfiles">Changing the names of
 	  <filename>pkg-<replaceable>*</replaceable></filename> files</title>
 
 	<para>All the names of <filename>pkg-<replaceable>*</replaceable></filename> files
 	  are defined using variables so you can change them in your
 	  <filename>Makefile</filename> if need be.  This is especially useful
 	  when you are sharing the same <filename>pkg-<replaceable>*</replaceable></filename> files
 	  among  several ports or have to write to one of the above files (see
 	  <link linkend="porting-wrkdir">writing to places other than
 	  <makevar>WRKDIR</makevar></link> for why it is a bad idea to write
 	  directly into the <filename>pkg-<replaceable>*</replaceable></filename> subdirectory).</para>
 
 	<para>Here is a list of variable names and their default
 	  values.  (<makevar>PKGDIR</makevar> defaults to
 	  <makevar>${MASTERDIR}</makevar>.)</para>
 
 	<informaltable frame="none" pgwide="1">
 	  <tgroup cols="2">
 	    <thead>
 	      <row>
 		<entry>Variable</entry>
 		<entry>Default value</entry>
 	      </row>
 	    </thead>
 
 	    <tbody>
 	      <row>
 		<entry><makevar>DESCR</makevar></entry>
 		<entry><literal>${PKGDIR}/pkg-descr</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>PLIST</makevar></entry>
 		<entry><literal>${PKGDIR}/pkg-plist</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>PKGINSTALL</makevar></entry>
 		<entry><literal>${PKGDIR}/pkg-install</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>PKGDEINSTALL</makevar></entry>
 		<entry><literal>${PKGDIR}/pkg-deinstall</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>PKGREQ</makevar></entry>
 		<entry><literal>${PKGDIR}/pkg-req</literal></entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>PKGMESSAGE</makevar></entry>
 		<entry><literal>${PKGDIR}/pkg-message</literal></entry>
 	      </row>
 	    </tbody>
 	  </tgroup>
 	</informaltable>
 
 	<para>Please change these variables rather than overriding
 	  <makevar>PKG_ARGS</makevar>.  If you change
 	  <makevar>PKG_ARGS</makevar>, those files will not correctly be
 	  installed in <filename>/var/db/pkg</filename> upon install from a
 	  port.</para>
       </sect1>
 
       <sect1 id="using-sub-files">
 	<title>Making use of <makevar>SUB_FILES</makevar> and
 	  <makevar>SUB_LIST</makevar></title>
 
 	<para>The <makevar>SUB_FILES</makevar> and <makevar>SUB_LIST</makevar>
 	  variables are useful for dynamic values in port files, such as the
 	  installation <makevar>PREFIX</makevar> in
 	  <filename>pkg-message</filename>.</para>
 
 	<para>The <makevar>SUB_FILES</makevar> variable specifies a list
 	  of files to be automatically modified.  Each
 	  <replaceable>file</replaceable> in the
 	  <makevar>SUB_FILES</makevar> list must have a corresponding
 	  <filename><replaceable>file</replaceable>.in</filename> present
 	  in <makevar>FILESDIR</makevar>.  A modified version will
 	  be created in <makevar>WRKDIR</makevar>.  Files defined as a
 	  value of <makevar>USE_RC_SUBR</makevar> and
 	  <makevar>USE_RCORDER</makevar> are automatically added to
 	  <makevar>SUB_FILES</makevar>.  For the files
 	  <filename>pkg-message</filename>,
 	  <filename>pkg-install</filename>, <filename>pkg-deinstall</filename>
 	  and <filename>pkg-reg</filename>, the corresponding Makefile variable
 	  is automatically set to point to the processed version.</para>
 
 	<para>The <makevar>SUB_LIST</makevar> variable is a list of
 	  <literal>VAR=VALUE</literal> pairs.  For each pair
 	  <literal>%%VAR%%</literal> will get replaced
 	  with <literal>VALUE</literal> in each file listed in
 	  <makevar>SUB_FILES</makevar>.  Several common pairs are
 	  automatically defined: <makevar>PREFIX</makevar>,
 	  <makevar>LOCALBASE</makevar>, <makevar>X11BASE</makevar>,
 	  <makevar>DATADIR</makevar>, <makevar>DOCSDIR</makevar>,
 	  <makevar>EXAMPLESDIR</makevar>.  Any line beginning with
 	  <literal>@comment</literal> will be deleted from resulting files
 	  after a variable substitution.</para>
 
 	<para>The following example will replace <literal>%%ARCH%%</literal>
 	  with the system architecture
 	  in a <filename>pkg-message</filename>:</para>
 
 	<programlisting>SUB_FILES=     pkg-message
 SUB_LIST=      ARCH=${ARCH}</programlisting>
 
 	<para>Note that for this example, the
 	  <filename>pkg-message.in</filename> file must exist in
 	  <makevar>FILESDIR</makevar>.</para>
 
 	<para>Example of a good <filename>pkg-message.in</filename>:</para>
 
 	<programlisting>Now it's time to configure this package.
 Copy %%PREFIX%%/share/examples/putsy/%%ARCH%%.conf into your home directory
 as .putsy.conf and edit it.</programlisting>
 
       </sect1>
     </chapter>
 
   <chapter id="testing">
     <title>Testing your port</title>
 
       <sect1 id="make-describe">
 	<title>Running <command>make describe</command></title>
 
 	<para>Several of the &os; port maintenance tools, such as
 	  &man.portupgrade.1;, rely on a database called
 	  <filename>/usr/ports/INDEX</filename> which keeps track of such
 	  items as port dependencies.  <filename>INDEX</filename> is created
 	  by the top-level <filename>ports/Makefile</filename> via
 	  <command>make index</command>, which descends into each
 	  port subdirectory and executes <command>make describe</command>
 	  there.  Thus, if <command>make describe</command> fails in any
 	  port, no one can generate <filename>INDEX</filename>, and many
 	  people will quickly become unhappy.</para>
 
 	<note>
 	  <para>It is important to be able to generate this file no
 	  matter what options are present in <filename>make.conf</filename>,
 	  so please avoid doing things such as using <literal>.error</literal>
 	  statements when (for instance) a dependency is not satisfied.</para>
 	</note>
 
 	<example id="dot-error-breaks-index">
 	  <title>How to avoid using <literal>.error</literal></title>
 	  <para>Assume that someone has the line
 	    <programlisting>USE_POINTYHAT=yes</programlisting>
 	    in <filename>make.conf</filename>.  The first of
 	    the next two <filename>Makefile</filename> snippets will
 	    cause <command>make index</command> to fail, while the
 	    second one will not:</para>
 	    <programlisting>.if USE_POINTYHAT
 .error "POINTYHAT is not supported"
 .endif</programlisting>
 	    <programlisting>.if USE_POINTYHAT
 IGNORE=POINTYHAT is not supported
 .endif</programlisting>
 	</example>
 
 	<para>If <command>make describe</command> produces a string
 	  rather than an error message, you are probably safe.  See
 	  <filename>bsd.port.mk</filename> for the meaning of the
 	  string produced.</para>
 
 	<para>Also note that running a recent version of
 	  <command>portlint</command> (as specified in the next section)
 	  will cause <command>make describe</command> to be run
 	  automatically.</para>
       </sect1>
 
       <sect1 id="testing-portlint">
 	<title>Portlint</title>
 
 	<para>Do check your work with <link
 	    linkend="porting-portlint"><command>portlint</command></link>
 	  before you submit or commit it.  <command>portlint</command>
 	  warns you about many common errors, both functional and
 	  stylistic.  For a new (or repocopied) port,
 	  <command>portlint -A</command> is the most thorough; for an
 	  existing port, <command>portlint -C</command> is sufficient.</para>
 
 	<para>Since <command>portlint</command> uses heuristics to
 	  try to figure out errors, it can produce false positive
 	  warnings.  In addition, occasionally something that is
 	  flagged as a problem really cannot be done in any other
 	  way due to limitations in the ports framework.  When in
 	  doubt, the best thing to do is ask on &a.ports;.</para>
       </sect1>
 
       <sect1 id="porting-prefix">
 	<title><makevar>PREFIX</makevar></title>
 
 	<para>Do try to make your port install relative to
 	  <makevar>PREFIX</makevar>.  The value of this variable will be set
 	  to <makevar>LOCALBASE</makevar> (default
 	  <filename>/usr/local</filename>).  If
 	  <makevar>USE_X_PREFIX</makevar> or <makevar>USE_IMAKE</makevar> is
 	  set, <makevar>PREFIX</makevar> will be <makevar>X11BASE</makevar> (default
 	  <filename>/usr/X11R6</filename>).  If
 	  <makevar>USE_LINUX_PREFIX</makevar> is set, <makevar>PREFIX</makevar>
 	  will be <makevar>LINUXBASE</makevar> (default
 	  <filename>/compat/linux</filename>).</para>
 
 	<para>Avoiding the hard-coding of <filename>/usr/local</filename> or
 	  <filename>/usr/X11R6</filename> anywhere in the source will make the
 	  port much more flexible and able to cater to the needs of other
 	  sites.  For X ports that use <command>imake</command>, this is
 	  automatic; otherwise, this can often be done by simply replacing the
 	  occurrences of <filename>/usr/local</filename> (or
 	  <filename>/usr/X11R6</filename> for X ports that do not use imake)
 	  in the various <filename>scripts/Makefile</filename>s in the port to read
 	  <makevar>${PREFIX}</makevar>, as this variable is automatically passed
 	  down to every stage of the build and install processes.</para>
 
 	<para>Make sure your application is not installing things in
 	<filename>/usr/local</filename> instead of <makevar>PREFIX</makevar>.
 	A quick test for this is to do this is:</para>
 
 	<screen>&prompt.root; <userinput>make clean; make package PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
 
 	<para>If anything is installed outside of <makevar>PREFIX</makevar>,
 	the package creation process will complain that it
 	cannot find the files.</para>
 
 	<!-- XXX This paragraph is confusing and poorly indented. -->
 	<para>This does not test for the existence of internal references,
 	or correct use of <makevar>LOCALBASE</makevar> for references to
 	files from other ports.  Testing the installation in
 	<filename>/var/tmp/<replaceable>port-name</replaceable></filename>
 	to do that while you have it installed would do that.</para>
 
 	<para>Do not set <makevar>USE_X_PREFIX</makevar> unless your port
 	  truly requires it (i.e., it links against X libs or it needs to
 	  reference files in <makevar>X11BASE</makevar>).</para>
 
 	<para>The variable <makevar>PREFIX</makevar> can be reassigned in your
 	  <filename>Makefile</filename> or in the user's environment.
 	  However, it is strongly discouraged for individual ports to set this
 	  variable explicitly in the <filename>Makefile</filename>s.</para>
 
 	<para>Also, refer to programs/files from other ports with the
 	  variables mentioned above, not explicit pathnames.  For instance, if
 	  your port requires a macro <literal>PAGER</literal> to be the full
 	  pathname of <command>less</command>, use the compiler flag:
 
 	  <programlisting>-DPAGER=\"&dollar;{LOCALBASE}/bin/less\"</programlisting>
 
 	  instead of
 	  <literal>-DPAGER=\"/usr/local/bin/less\"</literal>. This way it will
 	  have a better chance of working if the system administrator has
 	  moved the whole <filename>/usr/local</filename> tree somewhere else.</para>
       </sect1>
   </chapter>
 
     <chapter id="port-upgrading">
       <title>Upgrading</title>
 
       <para>When you notice that a port is out of date compared to the latest
 	version from the original authors, you should first ensure that you
 	have the latest
 	port.  You can find them in the
 	<filename>ports/ports-current</filename> directory of the &os; FTP mirror
 	sites.  However, if you are working with more than a few
 	ports, you will probably find it easier to use
 	<application>CVSup</application> to keep your whole ports collection
 	up-to-date, as described in the
 	<ulink url="&url.books.handbook;/synching.html#CVSUP-CONFIG">Handbook</ulink>.
 	This will have the added benefit of tracking all the ports'
 	dependencies.</para>
 
       <para>The next step is to see if there is an update already pending.
 	To do this, you have two options.  There is a searchable interface
 	to the
 	<ulink url="http://www.FreeBSD.org/cgi/query-pr-summary.cgi?query">
 	FreeBSD Problem Report (PR) database</ulink> (also known as
 	<literal>GNATS</literal>).  Select <literal>ports</literal> in the
 	dropdown, and enter the name of the port.</para>
 
       <para>However, sometimes people forget to put the name of the port
 	into the Synopsis field in an unambiguous fashion.  In that case,
 	you can try the <link linkend="portsmon">
 	FreeBSD Ports Monitoring System</link> (also known as
 	<literal>portsmon</literal>).  This system attempts to classify
 	port PRs by portname.  To search for PRs about a particular port,
 	use the <ulink url="http://portsmon.FreeBSD.org/portoverview.py">
 	Overview of One Port</ulink>.</para>
 
       <para>If there is no pending PR, the next step is to send an email
 	to the port's maintainer, as shown by
 	<command>make maintainer</command>.  That person may
 	already be working on an upgrade, or have a reason to not upgrade the
 	port right now (because of, for example, stability problems of the new
 	version); you would not want to duplicate their work.  Note that
 	unmaintained ports are listed with a maintainer of
 	<literal>ports@FreeBSD.org</literal>, which is just the general
 	ports mailing list, so sending mail there
 	probably will not help in this case.</para>
 
       <para>If the maintainer asks you to do the upgrade or there is
 	no maintainer, then you have a chance to help out &os; by
 	preparing the update yourself!  Please make the changes and save
 	the result of the
 	recursive <command>diff</command> output
 	of the new and old
 	ports directories (e.g., if your modified port directory is
 	called <filename>superedit</filename> and the original is in our tree
 	as <filename>superedit.bak</filename>, then save the result of
 	<command>diff -ruN superedit.bak superedit</command>).  Either
 	unified or context diff is fine, but port committers generally
 	prefer unified diffs.  Note the use of the <literal>-N</literal>
 	option&mdash;this is the accepted way to force diff to properly
 	deal with the case of new files being added or old files being
 	deleted.  Before sending us the diff, please examine the
 	output to make sure all the changes make sense.  To
 	simplify common operations with patch files, you can use
 	<filename>/usr/ports/Tools/scripts/patchtool.py</filename>.
 	Before using it, please read
 	<filename>/usr/ports/Tools/scripts/README.patchtool</filename>.</para>
 
       <para>If the port is unmaintained, and you are actively using
 	it yourself, please consider volunteering to become its
 	maintainer.  &os; has over 2000 ports without maintainers,
 	and this is an area where more volunteers are always needed.
 	(For a detailed description of the responsibilities of maintainers,
 	refer to the
 	<ulink url="&url.books.developers-handbook;/policies.html#POLICIES-MAINTAINER">
 	MAINTAINER on Makefiles</ulink> section.)</para>
 
       <para> The best way to
 	send us the diff is by including it via &man.send-pr.1; (category
 	<literal>ports</literal>).  If you are volunteering to maintain the
 	port,
 	be sure to put <literal>[maintainer update]</literal> at the beginning
 	of your synopsis line and set the <quote>Class</quote> of your PR
 	to <literal>maintainer-update</literal>.  Otherwise, the
 	<quote>Class</quote> of your PR should be
 	<literal>change-request</literal>.  Please mention any added or
 	deleted files in the message, as they have to be explicitly specified
 	to &man.cvs.1; when doing a commit.  If the diff is more than about 20KB,
 	please compress and uuencode it; otherwise, just include it in the PR
 	as is.</para>
 
       <para>Before you &man.send-pr.1;, you should review the
 	<ulink url="&url.articles.problem-reports;/pr-writing.html">
 	Writing the problem report</ulink> section in the Problem
 	Reports article; it contains far more information about how to write
 	useful problem reports.</para>
 
       <important>
 	<para>If your upgrade is motivated by security concerns or a
 	  serious fault in the currently committed port, please notify
 	  the &a.portmgr; to request immediate rebuilding and
 	  redistribution of your port's package.  Unsuspecting users
 	  of &man.pkg.add.1; will otherwise continue to install the
 	  old version via <command>pkg_add -r</command> for several
 	  weeks.</para>
       </important>
 
       <note>
 	<para>Once again, please use &man.diff.1; and not &man.shar.1; to send
 	  updates to existing ports!</para>
       </note>
 
       <para>Now that you have done all that, you will want to read about
 	how to keep up-to-date in <xref linkend="keeping-up">.</para>
 
     </chapter>
 
     <chapter id="security">
       <title>Ports security</title>
 
       <sect1 id="security-intro">
 	<title>Why security is so important</title>
 
 	<para>Bugs are occasionally introduced to the software.
 	  Arguably, the most dangerous of them are those opening
 	  security vulnerabilities.  From the technical viewpoint,
 	  such vulnerabilities are to be closed by exterminating
 	  the bugs that caused them.  However, the policies for
 	  handling mere bugs and security vulnerabilities are
 	  very different.</para>
 
 	<para>A typical small bug affects only those users who have
 	  enabled some combination of options triggering the bug.
 	  The developer will eventually release a patch followed
 	  by a new version of the software, free of the bug, but
 	  the majority of users will not take the trouble of upgrading
 	  immediately because the bug has never vexed them.  A
 	  critical bug that may cause data loss represents a graver
 	  issue.  Nevertheless, prudent users know that a lot of
 	  possible accidents, besides software bugs, are likely to
 	  lead to data loss, and so they make backups of important
 	  data; in addition, a critical bug will be discovered
 	  really soon.</para>
 
 	<para>A security vulnerability is all different.  First,
 	  it may remain unnoticed for years because often it does
 	  not cause software malfunction.  Second, a malicious party
 	  can use it to gain unauthorized access to a vulnerable
 	  system, to destroy or alter sensitive data; and in the
 	  worst case the user will not even notice the harm caused.
 	  Third, exposing a vulnerable system often assists attackers
 	  to break into other systems that could not be compromised
 	  otherwise.  Therefore closing a vulnerability alone is
 	  not enough: the audience should be notified of it in most
 	  clear and comprehensive manner, which will allow to
 	  evaluate the danger and take appropriate actions.</para>
       </sect1>
 
       <sect1 id="security-fix">
 	<title>Fixing security vulnerabilities</title>
 
 	<para>While on the subject of ports and packages, a security
 	  vulnerability may initially appear in the original
 	  distribution or in the port files.  In the former case,
 	  the original software developer is likely to release a
 	  patch or a new version instantly, and you will
 	  only need to update the port promptly with respect to
 	  the author's fix.  If the fix is delayed for some reason,
 	  you should either <link linkend="dads-noinstall">mark the port as
 	  <makevar>FORBIDDEN</makevar></link>
 	  or introduce a patch file of your own to the port.  In
 	  the case of a vulnerable port, just fix the port as soon as
 	  possible.  In either case, <link linkend="port-upgrading">the
 	  standard procedure for submitting your change</link> should
 	  be followed unless you have rights to commit it directly
 	  to the ports tree.</para>
 
 	<important>
 	  <para>Being a ports committer is not enough to commit to
 	    an arbitrary port.  Remember that ports usually have
 	    maintainers, whom you should respect.</para>
 	</important>
 
 	<para>Please make sure that the port's revision is bumped
 	  as soon as the vulnerability has been closed.
 	  That is how the users who upgrade installed packages
 	  on a regular basis will see they need to run an update.
 	  Besides, a new package will be built and distributed
 	  over FTP and WWW mirrors, replacing the vulnerable one.
 	  <makevar>PORTREVISION</makevar> should be bumped unless
 	  <makevar>PORTVERSION</makevar> has changed in the course
 	  of correcting the vulnerability.  That is you should
 	  bump <makevar>PORTREVISION</makevar> if you have added a
 	  patch file to the port, but you should not if you have updated
 	  the port to the latest software version and thus already
 	  touched <makevar>PORTVERSION</makevar>.  Please refer to the
 	  <link linkend="makefile-naming-revepoch">corresponding section</link>
 	  for more information.</para>
       </sect1>
 
       <sect1 id="security-notify">
 	<title>Keeping the community informed</title>
 
 	<sect2 id="security-notify-vuxml-db">
 	  <title>The VuXML database</title>
 
 	  <para>A very important and urgent step to take as early as
 	    a security vulnerability is discovered is to notify the
 	    community of port users about the jeopardy.  Such
 	    notification serves two purposes.  First, should the danger
 	    be really severe, it will be wise to apply an instant workaround,
 	    e.g., stop the affected network service or even deinstall
 	    the port completely, until the vulnerability is closed.
 	    Second, a lot of users tend to upgrade installed packages
 	    just occasionally.  They will know from the notification
 	    that they <emphasis>must</emphasis> update the package
 	    without delay as soon as a corrected version is available.</para>
 
 	  <para>Given the huge number of ports in the tree,
 	    a security advisory cannot be issued on each incident
 	    without creating a flood and losing the attention of
 	    the audience by the time it comes to really serious
 	    matters.  Therefore security vulnerabilities found in
 	    ports are recorded in <ulink
 	    url="http://vuxml.freebsd.org/">the FreeBSD VuXML
 	    database</ulink>.  The Security Officer Team members
 	    are monitoring it for issues requiring their
 	    intervention.</para>
 
 	  <para>If you have committer rights, you can update the VuXML
 	    database by yourself.  So you will both help the Security
 	    Officer Team and deliver the crucial information to the
 	    community earlier.  However, if you are not a committer,
 	    or you believe you have found an exceptionally severe
 	    vulnerability, or whatever, please do not hesitate to
 	    contact the Security Officer Team directly as described
 	    on the <ulink
 	    url="http://www.freebsd.org/security/#how">FreeBSD
 	    Security Information</ulink> page.</para>
 
 	  <para>All right, you elected the hard way.  As it may be obvious
 	    from its title, the VuXML database is essentially an
 	    XML document.  Its source file <filename>vuln.xml</filename>
 	    is kept right inside the port <filename
 	    role="package">security/vuxml</filename>.  Therefore
 	    the file's full pathname will be
 	    <filename><envar>PORTSDIR</envar>/security/vuxml/vuln.xml</filename>.
 	    Each time you discover a security vulnerability in a
 	    port, please add an entry for it to that file.
 	    Until you are familiar with VuXML, the best thing you can
 	    do is to find an existing entry fitting your case, then copy
 	    it and use as a template.</para>
 	</sect2>
 
 	<sect2 id="security-notify-vuxml-intro">
 	  <title>A short introduction to VuXML</title>
 
 	  <para>The full-blown XML is complex and far beyond the scope of
 	    this book.  However, to gain basic insight on the structure
 	    of a VuXML entry, you need only the notion of tags.  XML
 	    tag names are enclosed in angle brackets.  Each opening
 	    &lt;tag&gt; must have a matching closing &lt;/tag&gt;.
 	    Tags may be nested.  If nesting, the inner tags must be
 	    closed before the outer ones.  There is a hierarchy of
 	    tags, i.e.  more complex rules of nesting them.  Sounds
 	    very similar to HTML, doesn't it?  The major difference
 	    is that XML is e<emphasis>X</emphasis>tensible, i.e. based
 	    on defining custom tags.  Due to its intrinsic structure,
 	    XML puts otherwise amorphous data into shape.  VuXML is
 	    particularly tailored to mark up descriptions of security
 	    vulnerabilities.</para>
 
 	  <para>Now let's consider a realistic VuXML entry:</para>
 
 	  <programlisting>&lt;vuln vid="f4bc80f4-da62-11d8-90ea-0004ac98a7b9"&gt; <co id="co-vx-vid">
   &lt;topic&gt;Several vulnerabilities found in Foo&lt;/topic&gt; <co id="co-vx-top">
   &lt;affects&gt;
     &lt;package&gt;
       &lt;name&gt;foo&lt;/name&gt; <co id="co-vx-nam">
       &lt;name&gt;foo-devel&lt;/name&gt;
       &lt;name&gt;ja-foo&lt;/name&gt;
       &lt;range&gt;&lt;ge&gt;1.6&lt;/ge&gt;&lt;lt&gt;1.9&lt;/lt&gt;&lt;/range&gt; <co id="co-vx-rng">
       &lt;range&gt;&lt;ge&gt;2.*&lt;/ge&gt;&lt;lt&gt;2.4_1&lt;/lt&gt;&lt;/range&gt;
       &lt;range&gt;&lt;eq&gt;3.0b1&lt;/eq&gt;&lt;/range&gt;
     &lt;/package&gt;
     &lt;package&gt;
       &lt;name&gt;openfoo&lt;/name&gt; <co id="co-vx-nm2">
       &lt;range&gt;&lt;lt&gt;1.10_7&lt;/lt&gt;&lt;/range&gt; <co id="co-vx-epo">
       &lt;range&gt;&lt;ge&gt;1.2,1&lt;/ge&gt;&lt;lt&gt;1.3_1,1&lt;/lt&gt;&lt;/range&gt;
     &lt;/package&gt;
   &lt;/affects&gt;
   &lt;description&gt;
     &lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
       &lt;p&gt;J. Random Hacker reports:&lt;/p&gt; <co id="co-vx-bdy">
       &lt;blockquote
         cite="http://j.r.hacker.com/advisories/1"&gt;
         &lt;p&gt;Several issues in the Foo software may be exploited
           via carefully crafted QUUX requests.  These requests will
           permit the injection of Bar code, mumble theft, and the
           readability of the Foo administrator account.&lt;/p&gt;
       &lt;/blockquote&gt;
     &lt;/body&gt;
   &lt;/description&gt;
   &lt;references&gt; <co id="co-vx-ref">
     &lt;freebsdsa&gt;SA-10:75.foo&lt;/freebsdsa&gt; <co id="co-vx-fsa">
     &lt;freebsdpr&gt;ports/987654&lt;/freebsdpr&gt; <co id="co-vx-fpr">
     &lt;cvename&gt;CAN-2010-0201&lt;/cvename&gt; <co id="co-vx-cve">
     &lt;cvename&gt;CAN-2010-0466&lt;/cvename&gt;
     &lt;bid&gt;96298&lt;/bid&gt; <co id="co-vx-bid">
     &lt;certsa&gt;CA-2010-99&lt;/certsa&gt; <co id="co-vx-cts">
     &lt;certvu&gt;740169&lt;/certvu&gt; <co id="co-vx-ctv">
     &lt;uscertsa&gt;SA10-99A&lt;/uscertsa&gt; <co id="co-vx-ucs">
     &lt;uscertta&gt;SA10-99A&lt;/uscertta&gt; <co id="co-vx-uct">
     &lt;mlist msgid="201075606@hacker.com"&gt;http://marc.theaimsgroup.com/?l=bugtraq&amp;amp;m=203886607825605&lt;/mlist&gt; <co id="co-vx-mls">
     &lt;url&gt;http://j.r.hacker.com/advisories/1&lt;/url&gt; <co id="co-vx-url">
   &lt;/references&gt;
   &lt;dates&gt;
     &lt;discovery&gt;2010-05-25&lt;/discovery&gt; <co id="co-vx-dsc">
     &lt;entry&gt;2010-07-13&lt;/entry&gt; <co id="co-vx-ent">
     &lt;modified&gt;2010-09-17&lt;/entry&gt; <co id="co-vx-mod">
   &lt;/dates&gt;
 &lt;/vuln&gt;</programlisting>
 
 	  <para>The tag names are supposed to be self-descriptive,
 	    so we shall take a closer look only at fields you will need
 	    to fill in by yourself:</para>
 
 	  <calloutlist>
 	    <callout arearefs="co-vx-vid">
 	      <para>This is the top-level tag of a VuXML entry.  It has
 		a mandatory attribute, <literal>vid</literal>,
 		specifying a universally unique identifier (UUID) for
 		this entry (in quotes).  You should generate a UUID
 		for each new VuXML entry (and do not forget to substitute
 		it for the template UUID unless you are writing the
 		entry from scratch).  You can use &man.uuidgen.1; in
 		FreeBSD 5.x, or you may install the port <filename
 		role="package">devel/p5-Data-UUID</filename> and issue
 		the following command:</para>
 
 	      <programlisting>perl -MData::UUID -le 'print lc new Data::UUID-&gt;create_str'</programlisting>
 	    </callout>
 
 	    <callout arearefs="co-vx-top">
 	      <para>This is a one-line description of the issue found.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-nam">
 	      <para>The names of packages affected are listed there.
 		Multiple names can be given since several packages may be
 		based on a single master port or software product.  This
 		may include stable and development branches, localized
 		versions, and slave ports featuring different choices of
 		important build-time configuration options.</para>
 
 	      <important>
 		<para>It is your responsibility to find all such related
 		  packages when writing a VuXML entry.  Keep in mind that
 		  <literal>make search name=foo</literal> is your friend.
 		  The primary points to look for are as follows:</para>
 
 		<itemizedlist>
 		  <listitem>
 		    <para>the <filename>foo-devel</filename> variant
 		      for a <filename>foo</filename> port;</para>
 		  </listitem>
 
 		  <listitem>
 		    <para>other variants with a suffix like
 		      <literal>-a4</literal> (for print-related packages),
 		      <literal>-without-gui</literal> (for packages with X
 		      support disabled), or similar;</para>
 		  </listitem>
 
 		  <listitem>
 		    <para><literal>jp-</literal>, <literal>ru-</literal>,
 		      <literal>zh-</literal>, and other possible localized
 		      variants in the corresponding national categories of
 		      the ports collection.</para>
 		  </listitem>
 		</itemizedlist>
 	      </important>
 	    </callout>
 
 	    <callout arearefs="co-vx-rng">
 	      <para>Affected versions of the package(s) are specified
 		there as one or more ranges using a combination of
 		<literal>&lt;lt&gt;</literal>, <literal>&lt;le&gt;</literal>,
 		<literal>&lt;eq&gt;</literal>, <literal>&lt;ge&gt;</literal>,
 		and <literal>&lt;gt&gt;</literal> elements.  The
 		version ranges given should not overlap.</para>
 
 	      <para>In a range specification, <literal>*</literal> (asterisk)
 		denotes the smallest version number.  In particular,
 		<literal>2.*</literal> is less than <literal>2.a</literal>.
 		Therefore an asterisk may be used for a range to match all
 		possible <literal>alpha</literal>, <literal>beta</literal>,
 		and <literal>RC</literal> versions.  For instance,
 		<literal>&lt;ge&gt;2.*&lt;/ge&gt;&lt;lt&gt;3.*&lt;/lt&gt;</literal>
 		will selectively match every <literal>2.x</literal> version while
 		<literal>&lt;ge&gt;2.0&lt;/ge&gt;&lt;lt&gt;3.0&lt;/lt&gt;</literal>
 		will obviously not since the latter misses
 		<literal>2.r3</literal> and matches
 		<literal>3.b</literal>.</para>
 
 	      <para>The above example
 		specifies that affected are versions from <literal>1.6</literal>
 		to <literal>1.9</literal> inclusive, versions
 		<literal>2.x</literal> before <literal>2.4_1</literal>,
 		and version <literal>3.0b1</literal>.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-nm2">
 	      <para>Several related package groups (essentially, ports)
 		can be listed in the <literal>&lt;affected&gt;</literal>
 		section.  This can be used if several software products
 		(say FooBar, FreeBar and OpenBar) grow from the same code base
 		and still share its bugs and vulnerabilities.  Note the
 		difference from listing multiple names within a single
 		&lt;package&gt; section.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-epo">
 	      <para>The version ranges should allow for
 		<makevar>PORTEPOCH</makevar> and
 		<makevar>PORTREVISION</makevar> if applicable.
 		Please remember that according to the collation rules,
 		a version with a non-zero <makevar>PORTEPOCH</makevar> is
 		greater than any version without
 		<makevar>PORTEPOCH</makevar>, e.g., <literal>3.0,1</literal>
 		is greater than <literal>3.1</literal> or even than
 		<literal>8.9</literal>.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-bdy">
 	      <para>This is a summary of the issue.
 		XHTML is used in this field.  At least enclosing
 		<literal>&lt;p&gt;</literal> and <literal>&lt;/p&gt;</literal>
 		should appear.  More complex mark-up may be used, but only for
 		the sake of accuracy and clarity:  No eye candy please.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-ref">
 	      <para>This section contains references to relevant documents.
 		As many references as apply are encouraged.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-fsa">
 	      <para>This is a
 		<ulink url="http://www.freebsd.org/security/#adv">FreeBSD
 		security advisory</ulink>.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-fpr">
 	      <para>This is a
 		<ulink url="http://www.freebsd.org/support.html#gnats">FreeBSD
 		problem report</ulink>.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-cve">
 	      <para>This is a <ulink url="http://www.cve.mitre.org/">Mitre
 		CVE</ulink> identifier.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-bid">
 	      <para>This is a
 		<ulink url="http://www.securityfocus.com/bid">SecurityFocus
 		Bug ID</ulink>.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-cts">
 	      <para>This is a
 		<ulink url="http://www.cert.org/">US-CERT</ulink>
 		security advisory.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-ctv">
 	      <para>This is a
 		<ulink url="http://www.cert.org/">US-CERT</ulink>
 		vulnerability note.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-ucs">
 	      <para>This is a
 		<ulink url="http://www.cert.org/">US-CERT</ulink>
 		Cyber Security Alert.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-uct">
 	      <para>This is a
 		<ulink url="http://www.cert.org/">US-CERT</ulink>
 		Technical Cyber Security Alert.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-mls">
 	      <para>This is a URL to an archived posting in a mailing list.
 		The attribute <literal>msgid</literal> is optional and
 		may specify the message ID of the posting.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-url">
 	      <para>This is a generic URL.  It should be used only if none of
 		the other reference categories apply.</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-dsc">
 	      <para>This is the date when the issue was disclosed
 		(<replaceable>YYYY-MM-DD</replaceable>).</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-ent">
 	      <para>This is the date when the entry was added
 		(<replaceable>YYYY-MM-DD</replaceable>).</para>
 	    </callout>
 
 	    <callout arearefs="co-vx-mod">
 	      <para>This is the date when any information in the entry
 		was last modified (<replaceable>YYYY-MM-DD</replaceable>).
 		New entries must not include this field.  It should be added
 		upon editing an existing entry.</para>
 	    </callout>
 	  </calloutlist>
 	</sect2>
 
 	<sect2 id="security-notify-vuxml-testing">
 	  <title>Testing your changes to the VuXML database</title>
 
 	  <para>Assume you just wrote or filled in an entry for a
 	    vulnerability in the package <literal>clamav</literal>
 	    that has been fixed in version <literal>0.65_7</literal>.</para>
 
 	  <para>As a prerequisite, you need to install fresh versions of the
 	    ports <filename role="package">security/portaudit</filename> and
 	    <filename role="package">security/portaudit-db</filename>.</para>
 
 	  <para>First, check whether there already is an entry for this
 	    vulnerability.  If there were such entry, it would match the
 	    previous version of the package,
 	    <literal>0.65_6</literal>:</para>
 
 	  <screen>&prompt.user; <userinput>packaudit</userinput>
 &prompt.user; <userinput>portaudit clamav-0.65_6</userinput></screen>
 
 	  <note>
 	    <para>To run <command>packaudit</command>, you must have
 	      permission to write to its
 	      <filename><makevar>DATABASEDIR</makevar></filename>,
 	      typically <filename>/var/db/portaudit</filename>.</para>
 	  </note>
 
 	  <para>If there is none found, you get the green light to add
 	    a new entry for this vulnerability.  Now you can generate
 	    a brand-new UUID (assume it's
 	    <literal>74a9541d-5d6c-11d8-80e3-0020ed76ef5a</literal>) and
 	    add your new entry to the VuXML database.  Please verify
 	    its syntax after that as follows:</para>
 
 	  <screen>&prompt.user; <userinput>cd ${PORTSDIR}/security/vuxml && make validate</userinput></screen>
 
 	  <note>
 	    <para>You will need at least one of the following packages
 	      installed: <filename role="package">textproc/libxml2</filename>,
 	      <filename role="package">textproc/jade</filename>.</para>
 	  </note>
 
 	  <para>Now rebuild the <command>portaudit</command> database
 	    from the VuXML file:</para>
 
 	  <screen>&prompt.user; <userinput>packaudit</userinput></screen>
 
 	  <para>To verify that the <literal>&lt;affected&gt;</literal>
 	    section of your entry will match correct package(s), issue
 	    the following command:</para>
 
 	  <screen>&prompt.user; <userinput>portaudit -f /usr/ports/INDEX -r 74a9541d-5d6c-11d8-80e3-0020ed76ef5a</userinput></screen>
 
 	  <note>
 	    <para>Please refer to &man.portaudit.1; for better understanding
 	      of the command syntax.</para>
 	  </note>
 
 	  <para>Make sure that your entry produces no spurious matches
 	    in the output.</para>
 
 	  <para>Now check whether the right package versions are matched
 	    by your entry:</para>
 
 	  <screen>&prompt.user; <userinput>portaudit clamav-0.65_6 clamav-0.65_7</userinput>
 Affected package: clamav-0.65_6 (matched by clamav&lt;0.65_7)
 Type of problem: clamav remote denial-of-service.
 Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-0020ed76ef5a.html&gt;
 
 1 problem(s) found.</screen>
 
 	  <para>Obviously, the former version should match while the
 	    latter one should not.</para>
 
 	  <para>Finally, verify whether the web page generated from the
 	    VuXML database looks like expected:</para>
 
 	  <screen>&prompt.user; <userinput>mkdir -p ~/public_html/portaudit</userinput>
 &prompt.user; <userinput>packaudit</userinput>
 &prompt.user; <userinput>lynx ~/public_html/portaudit/74a9541d-5d6c-11d8-80e3-0020ed76ef5a.html</userinput></screen>
 	</sect2>
 
 	<sect2 id="security-notify-noxml">
 	  <title>If VuXML still scares you...</title>
 
 	  <para>As an easy alternative to writing VuXML, you may opt to add
 	    a single line to a different file with much simpler syntax,
 	    <filename><envar>PORTSDIR</envar>/security/portaudit-db/database/portaudit.txt</filename>,
 	    which resides within the port <filename
 	    role="package">security/portaudit-db</filename>, and
 	    send a request for review to the Security Officer Team
 	    as described on the <ulink
 	    url="http://www.freebsd.org/security/#how">FreeBSD
 	    Security Information</ulink> page.</para>
 
 	  <para>A line in that file consists of four fields
 	    separated by <literal>|</literal>, a pipe character.
 	    The first field is a &man.pkg.version.1; pattern
 	    expression matching the vulnerable packages.  The second
 	    field contains URLs to relevant information, separated
 	    by space characters.  The third field is a one-line
 	    description of the issue.  The fourth and last field
 	    is the entry's UUID.</para>
 
 	  <para>You may want take a closer look at existing entries in
 	    <filename>portaudit.txt</filename> before adding your
 	    first line to that file.</para>
 	</sect2>
       </sect1>
     </chapter>
 
     <chapter id="porting-dads">
       <title>Dos and Don'ts</title>
 
       <sect1 id="dads-intro">
 	<title>Introduction</title>
 
       <para>Here is a list of common dos and don'ts that you encounter during
 	the porting process.  You should check your own port against this list,
 	but you can also check ports in the <ulink url="http://www.FreeBSD.org/cgi/query-pr-summary.cgi?query">PR database</ulink> that others have
 	submitted.  Submit any comments on ports you check as described in
 	<ulink url="&url.articles.contributing;/contrib-how.html#CONTRIB-GENERAL">Bug Reports and General
 	  Commentary</ulink>.  Checking ports in the PR database will both make
 	it faster for us to commit them, and prove that you know what you are
 	doing.</para>
       </sect1>
 
       <sect1 id="dads-strip">
 	<title>Stripping Binaries</title>
 
 	<para>Do not strip binaries manually unless you have to.  All binaries
 	  should be stripped, but the <maketarget>INSTALL_PROGRAM</maketarget>
 	  macro will install and strip a binary at the same time (see the next
 	  section).</para>
 
 	<para>If you need to strip a file, but do not wish to use the
 	  <makevar>INSTALL_PROGRAM</makevar> macro,
 	  <makevar>${STRIP_CMD}</makevar> will strip your program.  This is
 	  typically done within the <literal>post-install</literal>
 	  target.  For example:</para>
 
 	<programlisting>post-install:
 	${STRIP_CMD} ${PREFIX}/bin/xdl</programlisting>
 
 	<para>Use the &man.file.1; command on the installed executable to
 	  check whether the binary is stripped or not.  If it does not say
 	  <literal>not stripped</literal>, it is stripped.  Additionally,
 	  &man.strip.1; will not strip a previously stripped program; it
 	  will instead exit cleanly.</para>
       </sect1>
 
       <sect1 id="dads-install">
 	<title>INSTALL_* macros</title>
 
 	<para>Do use the macros provided in <filename>bsd.port.mk</filename>
 	  to ensure correct modes and ownership of files in your own
 	  <maketarget>*-install</maketarget> targets.</para>
 
 	<itemizedlist>
 	  <listitem>
 	    <para><makevar>INSTALL_PROGRAM</makevar> is a command to install
 	      binary executables.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><makevar>INSTALL_SCRIPT</makevar> is a command to install
 	      executable scripts.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><makevar>INSTALL_DATA</makevar> is a command to install
 	      sharable data.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><makevar>INSTALL_MAN</makevar> is a command to install
 	      manpages and other documentation (it does not compress
 	      anything).</para>
 	  </listitem>
 	</itemizedlist>
 
 	<para>These are basically the <command>install</command> command with
 	  all the appropriate flags.  See below for an example on how to use
 	  them.</para>
       </sect1>
 
       <sect1 id="porting-wrkdir">
 	<title><makevar>WRKDIR</makevar></title>
 
 	<para>Do not write anything to files outside
 	  <makevar>WRKDIR</makevar>.  <makevar>WRKDIR</makevar> is the only
 	  place that is guaranteed to be writable during the port build (see
 	  <ulink url="&url.books.handbook;/ports-using.html#PORTS-CD">
 	  installing ports from a CDROM</ulink> for an
 	  example of building ports from a read-only tree).  If you need to
 	  modify one of the <filename>pkg-<replaceable>*</replaceable></filename>
 	  files, do so by <link
 	  linkend="porting-pkgfiles">redefining a variable</link>, not by
 	  writing over it.</para>
       </sect1>
 
       <sect1 id="porting-wrkdirprefix">
 	<title><makevar>WRKDIRPREFIX</makevar></title>
 
 	<para>Make sure your port honors <makevar>WRKDIRPREFIX</makevar>.
 	  Most ports do not have to worry about this.  In particular, if you
 	  are referring to a <makevar>WRKDIR</makevar> of another port, note
 	  that the correct location is
 	  <filename><makevar>WRKDIRPREFIX</makevar><makevar>PORTSDIR</makevar>/<replaceable>subdir</replaceable>/<replaceable>name</replaceable>/work</filename> not <filename><makevar>PORTSDIR</makevar>/<replaceable>subdir</replaceable>/<replaceable>name</replaceable>/work</filename> or <filename><makevar>.CURDIR</makevar>/../../<replaceable>subdir</replaceable>/<replaceable>name</replaceable>/work</filename> or some such.</para>
 
 	<para>Also, if you are defining <makevar>WRKDIR</makevar> yourself,
 	  make sure you prepend
 	  <literal>&dollar;{WRKDIRPREFIX}&dollar;{.CURDIR}</literal> in the
 	  front.</para>
       </sect1>
 
       <sect1 id="porting-versions">
 	<title>Differentiating operating systems and OS versions</title>
 
 	<para>You may come across code that needs modifications or conditional
 	  compilation based upon what version of Unix it is running under.  If
 	  you need to make such changes to the code for conditional
 	  compilation, make sure you make the changes as general as possible
 	  so that we can back-port code to older FreeBSD systems and cross-port
 	  to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD,
 	  NetBSD, and OpenBSD.</para>
 
 	<para>The preferred way to tell 4.3BSD/Reno (1990) and newer versions
 	  of the BSD code apart is by using the <literal>BSD</literal> macro
 	  defined in
 	  <ulink url="http://cvsweb.freebsd.org/src/sys/sys/param.h">sys/param.h</ulink>.
 	  Hopefully that
 	  file is already included; if not, add the code:</para>
 
 	<programlisting>#if (defined(__unix__) || defined(unix)) &amp;&amp; !defined(USG)
 #include &lt;sys/param.h&gt;
 #endif</programlisting>
 
 	<para>to the proper place in the <filename>.c</filename> file.  We
 	  believe that every system that defines these two symbols has
 	  <filename>sys/param.h</filename>.  If you find a system that
 	  does not, we would like to know.  Please send mail to the
 	  &a.ports;.</para>
 
 	<para>Another way is to use the GNU Autoconf style of doing
 	  this:</para>
 
 	<programlisting>#ifdef HAVE_SYS_PARAM_H
 #include &lt;sys/param.h&gt;
 #endif</programlisting>
 
 	<para>Do not forget to add <literal>-DHAVE_SYS_PARAM_H</literal> to the
 	  <makevar>CFLAGS</makevar> in the <filename>Makefile</filename> for
 	  this method.</para>
 
 	<para>Once you have <filename>sys/param.h</filename> included, you may
 	  use:</para>
 
 	<programlisting>#if (defined(BSD) &amp;&amp; (BSD &gt;= 199103))</programlisting>
 
 	<para>to detect if the code is being compiled on a 4.3 Net2 code base
 	  or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386
 	  1.1 and below).</para>
 
 	<para>Use:</para>
 
 	<programlisting>#if (defined(BSD) &amp;&amp; (BSD &gt;= 199306))</programlisting>
 
 	<para>to detect if the code is being compiled on a 4.4 code base or
 	  newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or
 	  above).</para>
 
 	<para>The value of the <literal>BSD</literal> macro is
 	  <literal>199506</literal> for the 4.4BSD-Lite2 code base.  This is
 	  stated for informational purposes only.  It should not be used to
 	  distinguish between versions of FreeBSD based only on 4.4-Lite vs.
 	  versions that have merged in changes from 4.4-Lite2.  The
 	  <literal>__FreeBSD__</literal> macro should be used instead.</para>
 
 	<para>Use sparingly:</para>
 
 	<itemizedlist>
 	  <listitem>
 	    <para><literal>__FreeBSD__</literal> is defined in all versions of
 	      FreeBSD.  Use it if the change you are making
 	      <emphasis>only</emphasis> affects FreeBSD.  Porting gotchas like
 	      the use of <literal>sys_errlist[]</literal> vs
 	      <function>strerror()</function> are Berkeley-isms, not FreeBSD
 	      changes.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>In FreeBSD 2.x, <literal>__FreeBSD__</literal> is defined to
 	      be <literal>2</literal>.  In earlier versions, it is
 	      <literal>1</literal>.  Later versions always bump it to match
 	      their major version number.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para>If you need to tell the difference between a FreeBSD 1.x
 	      system and a FreeBSD 2.x or above system, usually the right answer
 	      is to use the <literal>BSD</literal> macros described above.  If
 	      there actually is a FreeBSD specific change (such as special
 	      shared library options when using <command>ld</command>) then it
 	      is OK to use <literal>__FreeBSD__</literal> and <literal>#if
 		__FreeBSD__ &gt; 1</literal> to detect a FreeBSD 2.x and later
 	      system.  If you need more granularity in detecting FreeBSD
 	      systems since 2.0-RELEASE you can use the following:</para>
 
 	    <programlisting>#if __FreeBSD__ &gt;= 2
 #include &lt;osreldate.h&gt;
 #    if __FreeBSD_version &gt;= 199504
 	 /* 2.0.5+ release specific code here */
 #    endif
 #endif</programlisting>
 	  </listitem>
 	</itemizedlist>
 
 	<para>In the hundreds of ports that have been done, there have only
 	  been one or two cases where <literal>__FreeBSD__</literal> should
 	  have been used.  Just because an earlier port screwed up and used it
 	  in the wrong place does not mean you should do so too.</para>
       </sect1>
 
       <sect1 id="freebsd-versions">
 	<title>__FreeBSD_version values</title>
 
 	  <para>Here is a convenient list of
 	    <literal>__FreeBSD_version</literal> values as defined in
 	    <ulink url="http://cvsweb.freebsd.org/src/sys/sys/param.h">sys/param.h</ulink>:</para>
 
 		<table frame="none">
 		  <title>__FreeBSD_version values</title>
 		<tgroup cols="2">
 		<thead>
 		  <row>
 		    <entry>Release</entry>
 		    <entry><literal>__FreeBSD_version</literal></entry>
 		  </row>
 		</thead>
 
 		<tbody>
 		  <row>
 		    <entry>2.0-RELEASE</entry>
 		    <entry>119411</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.1-CURRENT</entry>
 		    <entry>199501, 199503</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.0.5-RELEASE</entry>
 		    <entry>199504</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-CURRENT before 2.1</entry>
 		    <entry>199508</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.1.0-RELEASE</entry>
 		    <entry>199511</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-CURRENT before 2.1.5</entry>
 		    <entry>199512</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.1.5-RELEASE</entry>
 		    <entry>199607</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-CURRENT before 2.1.6</entry>
 		    <entry>199608</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.1.6-RELEASE</entry>
 		    <entry>199612</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.1.7-RELEASE</entry>
 		    <entry>199612</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-RELEASE</entry>
 		    <entry>220000</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2.1-RELEASE</entry>
 		    <entry>220000 (no change)</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after 2.2.1-RELEASE</entry>
 		    <entry>220000 (no change)</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after texinfo-3.9</entry>
 		    <entry>221001</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after top</entry>
 		    <entry>221002</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2.2-RELEASE</entry>
 		    <entry>222000</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after 2.2.2-RELEASE</entry>
 		    <entry>222001</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2.5-RELEASE</entry>
 		    <entry>225000</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after 2.2.5-RELEASE</entry>
 		    <entry>225001</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after ldconfig -R merge</entry>
 		    <entry>225002</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2.6-RELEASE</entry>
 		    <entry>226000</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2.7-RELEASE</entry>
 		    <entry>227000</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after 2.2.7-RELEASE</entry>
 		    <entry>227001</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after &man.semctl.2; change</entry>
 		    <entry>227002</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2.8-RELEASE</entry>
 		    <entry>228000</entry>
 		  </row>
 
 		  <row>
 		    <entry>2.2-STABLE after 2.2.8-RELEASE</entry>
 		    <entry>228001</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-CURRENT before &man.mount.2; change</entry>
 		    <entry>300000</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-CURRENT after &man.mount.2; change</entry>
 		    <entry>300001</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-CURRENT after &man.semctl.2; change</entry>
 		    <entry>300002</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-CURRENT after ioctl arg changes</entry>
 		    <entry>300003</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-CURRENT after ELF conversion</entry>
 		    <entry>300004</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-RELEASE</entry>
 		    <entry>300005</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-CURRENT after 3.0-RELEASE</entry>
 		    <entry>300006</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.0-STABLE after 3/4 branch</entry>
 		    <entry>300007</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.1-RELEASE</entry>
 		    <entry>310000</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.1-STABLE after 3.1-RELEASE</entry>
 		    <entry>310001</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.1-STABLE after C++ constructor/destructor order
 		      change</entry>
 		    <entry>310002</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.2-RELEASE</entry>
 		    <entry>320000</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.2-STABLE</entry>
 		    <entry>320001</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.2-STABLE after binary-incompatible IPFW and
 		      socket changes</entry>
 		    <entry>320002</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.3-RELEASE</entry>
 		    <entry>330000</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.3-STABLE</entry>
 		    <entry>330001</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.3-STABLE after adding &man.mkstemp.3;
 		      to libc</entry>
 		    <entry>330002</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.4-RELEASE</entry>
 		    <entry>340000</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.4-STABLE</entry>
 		    <entry>340001</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.5-RELEASE</entry>
 		    <entry>350000</entry>
 		  </row>
 
 		  <row>
 		    <entry>3.5-STABLE</entry>
 		    <entry>350001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after 3.4 branch</entry>
 		    <entry>400000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after change in dynamic linker
 		      handling</entry>
 		    <entry>400001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after C++ constructor/destructor
 		      order change</entry>
 		    <entry>400002</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after functioning &man.dladdr.3;</entry>
 		    <entry>400003</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after __deregister_frame_info dynamic
 		      linker bug fix (also 4.0-CURRENT after EGCS 1.1.2
 		      integration)
 		    </entry>
 		    <entry>400004</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after &man.suser.9; API change
 		      (also 4.0-CURRENT after newbus)</entry>
 		    <entry>400005</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after cdevsw registration change</entry>
 		    <entry>400006</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after the addition of so_cred for
 		      socket level credentials</entry>
 		    <entry>400007</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after the addition of a poll syscall
 		      wrapper to libc_r</entry>
 		    <entry>400008</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after the change of the kernel's
 		      <literal>dev_t</literal> type to <literal>struct
 		      specinfo</literal> pointer</entry>
 		    <entry>400009</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after fixing a hole
 		      in &man.jail.2;</entry>
 		    <entry>400010</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after the <literal>sigset_t</literal>
 		      datatype change</entry>
 		    <entry>400011</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after the cutover to the GCC 2.95.2
 		      compiler</entry>
 		    <entry>400012</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after adding pluggable linux-mode
 		      ioctl handlers</entry>
 		    <entry>400013</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after importing OpenSSL</entry>
 		    <entry>400014</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after the C++ ABI change in GCC 2.95.2
 		      from -fvtable-thunks to -fno-vtable-thunks by
 		      default</entry>
 		    <entry>400015</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-CURRENT after importing OpenSSH</entry>
 		    <entry>400016</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-RELEASE</entry>
 		    <entry>400017</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-STABLE after 4.0-RELEASE</entry>
 		    <entry>400018</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-STABLE after the introduction of delayed
 		      checksums.</entry>
 		    <entry>400019</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-STABLE after merging libxpg4 code into
 		      libc.</entry>
 		    <entry>400020</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.0-STABLE after upgrading Binutils to 2.10.0, ELF
 		      branding changes, and tcsh in the base system.</entry>
 		    <entry>400021</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.1-RELEASE</entry>
 		    <entry>410000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.1-STABLE after 4.1-RELEASE</entry>
 		    <entry>410001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.1-STABLE after &man.setproctitle.3; moved from
 		      libutil to libc.</entry>
 		    <entry>410002</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.1.1-RELEASE</entry>
 		    <entry>411000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.1.1-STABLE after 4.1.1-RELEASE</entry>
 		    <entry>411001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.2-RELEASE</entry>
 		    <entry>420000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.2-STABLE after combining libgcc.a and
 		      libgcc_r.a, and associated GCC linkage changes.</entry>
 		    <entry>420001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.3-RELEASE</entry>
 		    <entry>430000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.3-STABLE after wint_t introduction.</entry>
 		    <entry>430001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.3-STABLE after PCI powerstate API merge.</entry>
 		    <entry>430002</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.4-RELEASE</entry>
 		    <entry>440000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.4-STABLE after d_thread_t introduction.</entry>
 		    <entry>440001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.4-STABLE after mount structure changes (affects
 		      filesystem klds).</entry>
 		    <entry>440002</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.4-STABLE after the userland components of smbfs
 		      were imported.</entry>
 		    <entry>440003</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.5-RELEASE</entry>
 		    <entry>450000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.5-STABLE after the usb structure element rename.</entry>
 		    <entry>450001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.5-STABLE after the
 		      <literal>sendmail_enable</literal> &man.rc.conf.5;
 		      variable was made to take the value
 		      <literal>NONE</literal>.</entry>
 		    <entry>450004</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.5-STABLE after moving to XFree86 4 by default
 		      for package builds.</entry>
 		    <entry>450005</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.5-STABLE after accept filtering was fixed so
 		      that is no longer susceptible to an easy DoS.</entry>
 		    <entry>450006</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.6-RELEASE</entry>
 		    <entry>460000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.6-STABLE &man.sendfile.2; fixed to comply with
 		      documentation, not to count any headers sent against
 		      the amount of data to be sent from the file.</entry>
 		    <entry>460001</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.6.2-RELEASE</entry>
 		    <entry>460002</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.6-STABLE</entry>
 		    <entry>460100</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.6-STABLE after MFC of `sed -i'.</entry>
 		    <entry>460101</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.6-STABLE after MFC of many new pkg_install
 		      features from the HEAD.</entry>
 		    <entry>460102</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.7-RELEASE</entry>
 		    <entry>470000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.7-STABLE</entry>
 		    <entry>470100</entry>
 		  </row>
 
 		  <row>
 		    <entry>Start generated __std{in,out,err}p references rather
 		      than __sF.  This changes std{in,out,err} from a
 		      compile time expression to a runtime one.</entry>
 		    <entry>470101</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.7-STABLE after MFC of mbuf changes to replace
 		       m_aux mbufs by m_tag's</entry>
 		    <entry>470102</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.7-STABLE gets OpenSSL 0.9.7</entry>
 		    <entry>470103</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.8-RELEASE</entry>
 		    <entry>480000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.8-STABLE</entry>
 		    <entry>480100</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.8-STABLE after &man.realpath.3; has been made
 		      thread-safe</entry>
 		    <entry>480101</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.8-STABLE 3ware API changes to twe.</entry>
 		    <entry>480102</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.9-RELEASE</entry>
 		    <entry>490000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.9-STABLE</entry>
 		    <entry>490100</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.9-STABLE after e_sid was added to struct
 		      kinfo_eproc.</entry>
 		    <entry>490101</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.9-STABLE after MFC of libmap functionality
 		      for rtld.</entry>
 		    <entry>490102</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.10-RELEASE</entry>
 		    <entry>491000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.10-STABLE</entry>
 		    <entry>491100</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.10-STABLE after MFC of revision 20040629 of
 		      the package tools</entry>
 		    <entry>491101</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.10-STABLE after VM fix dealing with unwiring
 		      of fictitious pages</entry>
 		    <entry>491102</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.11-RELEASE</entry>
 		    <entry>492000</entry>
 		  </row>
 
 		  <row>
 		    <entry>4.11-STABLE</entry>
 		    <entry>492100</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT</entry>
 		    <entry>500000</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after adding addition ELF header fields,
 		      and changing our ELF binary branding method.</entry>
 		    <entry>500001</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after kld metadata changes.</entry>
 		    <entry>500002</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after buf/bio changes.</entry>
 		    <entry>500003</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after binutils upgrade.</entry>
 		    <entry>500004</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after merging libxpg4 code into
 		      libc and after TASKQ interface introduction.</entry>
 		    <entry>500005</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the addition of AGP
 		      interfaces.</entry>
 		    <entry>500006</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after Perl upgrade to 5.6.0</entry>
 		    <entry>500007</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the update of KAME code to
 		      2000/07 sources.</entry>
 		    <entry>500008</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after ether_ifattach() and
 		      ether_ifdetach() changes.</entry>
 		    <entry>500009</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after changing mtree defaults
 		      back to original variant, adding -L to follow
 		      symlinks.</entry>
 		    <entry>500010</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after kqueue API changed.</entry>
 		    <entry>500011</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after &man.setproctitle.3; moved from
 		      libutil to libc.</entry>
 		    <entry>500012</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the first SMPng commit.</entry>
 		    <entry>500013</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after &lt;sys/select.h&gt; moved to
 		      &lt;sys/selinfo.h&gt;.</entry>
 		    <entry>500014</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after combining libgcc.a and
 		      libgcc_r.a, and associated GCC linkage changes.</entry>
 		    <entry>500015</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after change allowing libc and libc_r
 		      to be linked together, deprecating -pthread
 		      option.</entry>
 		    <entry>500016</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after switch from struct ucred to
 		      struct xucred to stabilize kernel-exported API for
 		      mountd et al.</entry>
 		    <entry>500017</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after addition of CPUTYPE make variable
 		      for controlling CPU-specific optimizations.</entry>
 		    <entry>500018</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after moving machine/ioctl_fd.h to
 		      sys/fdcio.h</entry>
 		    <entry>500019</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after locale names renaming.</entry>
 		    <entry>500020</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after Bzip2 import.
 		    Also signifies removal of S/Key.</entry>
 		    <entry>500021</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after SSE support.</entry>
 		    <entry>500022</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after KSE Milestone 2.</entry>
 		    <entry>500023</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after d_thread_t,
 		      and moving UUCP to ports.</entry>
 		    <entry>500024</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after ABI change for descriptor
 		      and creds passing on 64 bit platforms.</entry>
 		    <entry>500025</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after moving to XFree86 4 by default for
 		      package builds, and after the new libc strnstr() function
 		      was added.</entry>
 		    <entry>500026</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the new libc strcasestr() function
 		      was added.</entry>
 		    <entry>500027</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the userland components of smbfs
 		      were imported.</entry>
 		    <entry>500028</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the new C99 specific-width
 		      integer types were added.</entry>
 		    <entry>(Not incremented.)</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after a change was made in the return
 		      value of &man.sendfile.2;.</entry>
 		    <entry>500029</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the introduction of the
 		      type <literal>fflags_t</literal>, which is the
 		      appropriate size for file flags.</entry>
 		    <entry>500030</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the usb structure element rename.</entry>
 		    <entry>500031</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the introduction of
 		      Perl 5.6.1.</entry>
 		    <entry>500032</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the
 		      <literal>sendmail_enable</literal> &man.rc.conf.5;
 		      variable was made to take the value
 		      <literal>NONE</literal>.</entry>
 		    <entry>500033</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after mtx_init() grew a third argument.</entry>
 		    <entry>500034</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT with Gcc 3.1.</entry>
 		    <entry>500035</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT without Perl in /usr/src</entry>
 		    <entry>500036</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the addition of &man.dlfunc.3;</entry>
 		    <entry>500037</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the types of some struct
 		      sockbuf members were changed and the structure was
 		      reordered.</entry>
 		    <entry>500038</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after GCC 3.2.1 import.
 		      Also after headers stopped using
 		      _BSD_FOO_T_ and started using _FOO_T_DECLARED.
 		      This value can also be used as a conservative
 		      estimate of the start of &man.bzip2.1; package
 		      support.</entry>
 		    <entry>500039</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after various changes to disk functions
 		      were made in the name of removing dependency on disklabel
 		      structure internals.</entry>
 		    <entry>500040</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after the addition of &man.getopt.long.3;
 		      to libc.</entry>
 		    <entry>500041</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after Binutils 2.13 upgrade, which
 		      included new FreeBSD emulation, vec, and output format.
 		      </entry>
 		    <entry>500042</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after adding weak pthread_XXX stubs
 		      to libc, obsoleting libXThrStub.so.  5.0-RELEASE.</entry>
 		    <entry>500043</entry>
 		  </row>
 
 		  <row>
 		    <entry>5.0-CURRENT after branching for RELENG_5_0</entry>
 		    <entry>500100</entry>
 		  </row>
 		  <row>
 		    <entry>&lt;sys/dkstat.h&gt; is empty and should
 		    not be included.</entry>
 		    <entry>500101</entry>
 		  </row>
 		  <row>
 		    <entry>5.0-CURRENT after the d_mmap_t interface
 		      change.</entry>
 		    <entry>500102</entry>
 		  </row>
 		  <row>
 		    <entry>5.0-CURRENT after taskqueue_swi changed to run
 		      without Giant, and taskqueue_swi_giant added to run
 		      with Giant.</entry>
 		    <entry>500103</entry>
 		  </row>
 		  <row>
 		    <entry>cdevsw_add() and cdevsw_remove() no
 		      longer exists.
 		      Appearance of MAJOR_AUTO allocation facility.</entry>
 		    <entry>500104</entry>
 		  </row>
 		  <row>
 		    <entry>5.0-CURRENT after new cdevsw initialization method.</entry>
 		    <entry>500105</entry>
 		  </row>
 		  <row>
 		    <entry>devstat_add_entry() has been replaced by
 		      devstat_new_entry()</entry>
 		    <entry>500106</entry>
 		  </row>
 		  <row>
 		    <entry>Devstat interface change; see sys/sys/param.h 1.149</entry>
 		    <entry>500107</entry>
 		  </row>
 		  <row>
 		    <entry>Token-Ring interface changes.</entry>
 		    <entry>500108</entry>
 		  </row>
 		  <row>
 		    <entry>Addition of vm_paddr_t.</entry>
 		    <entry>500109</entry>
 		  </row>
 		  <row>
 		    <entry>5.0-CURRENT after &man.realpath.3; has been made
 		      thread-safe</entry>
 		    <entry>500110</entry>
 		  </row>
 		  <row>
 		    <entry>5.0-CURRENT after &man.usbhid.3; has been synced with
 		      NetBSD</entry>
 		    <entry>500111</entry>
 		  </row>
 		  <row>
 		    <entry>5.0-CURRENT after new NSS implementation
 		      and addition of POSIX.1 getpw*_r, getgr*_r
 		      functions</entry>
 		    <entry>500112</entry>
 		  </row>
 		  <row>
 		    <entry>5.0-CURRENT after removal of the old rc system.</entry>
 		    <entry>500113</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-RELEASE.</entry>
 		    <entry>501000</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after branching for RELENG_5_1.</entry>
 		    <entry>501100</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after correcting the semantics of
 		      sigtimedwait(2) and sigwaitinfo(2).</entry>
 		    <entry>501101</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after adding the lockfunc and lockfuncarg
 		      fields to &man.bus.dma.tag.create.9;.</entry>
 		    <entry>501102</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after GCC 3.3.1-pre 20030711 snapshot
 		      integration.</entry>
 		    <entry>501103</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT 3ware API changes to twe.</entry>
 		    <entry>501104</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT dynamically-linked /bin and /sbin
 		      support and movement of libraries to /lib.</entry>
 		    <entry>501105</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after adding kernel support for
 		      Coda 6.x.</entry>
 		    <entry>501106</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after 16550 UART constants moved from
 		      <filename>&lt;dev/sio/sioreg.h&gt;</filename> to
 		      <filename>&lt;dev/ic/ns16550.h&gt;</filename>.
 		      Also when libmap functionality was unconditionally
 		      supported by rtld.</entry>
 		    <entry>501107</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after PFIL_HOOKS API update</entry>
 		    <entry>501108</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after adding kiconv(3)</entry>
 		    <entry>501109</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after changing default operations
 			for open and close in cdevsw</entry>
 		    <entry>501110</entry>
 		  </row>
 		  <row>
 		    <entry>5.1-CURRENT after changed layout of cdevsw</entry>
 		    <entry>501111</entry>
 		  </row>
 		  <row>
 		    <entry> 5.1-CURRENT after adding kobj multiple inheritance
 		    </entry>
 		    <entry>501112</entry>
 		  </row>
 		  <row>
 		    <entry> 5.1-CURRENT after the if_xname change in
 			struct ifnet</entry>
 		    <entry>501113</entry>
 		  </row>
 		  <row>
 		    <entry> 5.1-CURRENT after changing /bin and /sbin to
 			be dynamically linked</entry>
 		    <entry>501114</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-RELEASE</entry>
 		    <entry>502000</entry>
 		  </row>
 		  <row>
 		    <entry>5.2.1-RELEASE</entry>
 		    <entry>502010</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after branching for RELENG_5_2</entry>
 		    <entry>502100</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after __cxa_atexit/__cxa_finalize
 			functions were added to libc.</entry>
 		    <entry>502101</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after change of default thread library
 			from libc_r to libpthread.</entry>
 		    <entry>502102</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after device driver API megapatch.
 		    </entry>
 		    <entry>502103</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after getopt_long_only() addition.
 		    </entry>
 		    <entry>502104</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after NULL is made into ((void *)0)
 			for C, creating more warnings.
 		    </entry>
 		    <entry>502105</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after pf is linked to the build and
 			install.
 		    </entry>
 		    <entry>502106</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after time_t is changed to a
 			64-bit value on sparc64.
 		    </entry>
 		    <entry>502107</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after Intel C/C++ compiler support in some headers and execve(2) changes to be more strictly conforming to POSIX.
 		    </entry>
 		    <entry>502108</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the introduction of the
 		      bus_alloc_resource_any API
 		    </entry>
 		    <entry>502109</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the addition of UTF-8 locales
 		    </entry>
 		    <entry>502110</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the removal of the getvfsent(3)
 		      API
 		    </entry>
 		    <entry>502111</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the addition of the .warning
 		      directive for make.</entry>
 		    <entry>502112</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after ttyioctl() was made mandatory
 		      for serial drivers.</entry>
 		    <entry>502113</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after import of the ALTQ framework.
 		    </entry>
 		    <entry>502114</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after changing sema_timedwait(9) to
 		      return 0 on success and a non-zero error code on
 		      failure.
 		    </entry>
 		    <entry>502115</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after changing kernel dev_t to
 		      be pointer to struct cdev *.
 		    </entry>
 		    <entry>502116</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after changing kernel udev_t to dev_t.
 		    </entry>
 		    <entry>502117</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after adding support for CLOCK_VIRTUAL
 		      and CLOCK_PROF to clock_gettime(2) and clock_getres(2).
 		    </entry>
 		    <entry>502118</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after changing network interface
 		      cloning overhaul.
 		    </entry>
 		    <entry>502119</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the update of the package tools
 		      to revision 20040629.
 		    </entry>
 		    <entry>502120</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after marking Bluetooth code as
 		      non-i386 specific.
 		    </entry>
 		    <entry>502121</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the introduction of the KDB
 		      debugger framework, the conversion of DDB into a
 		      backend and the introduction of the GDB backend.
 		    </entry>
 		    <entry>502122</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after change to make
 		      VFS_ROOT take a struct
 		      thread argument as does vflush.  Struct kinfo_proc
 		      now has a user data pointer.
 		      The switch of the default X implementation to
 		      <literal>xorg</literal> was also made at this time.
 		    </entry>
 		    <entry>502123</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the change to separate the way
 		      ports rc.d and legacy scripts are started.
 		    </entry>
 		    <entry>502124</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the backout of the
 		      previous change.
 		    </entry>
 		    <entry>502125</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the removal of
 		      kmem_alloc_pageable() and the import of gcc 3.4.2.
 		    </entry>
 		    <entry>502126</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after changing the UMA kernel
 		      API to allow ctors/inits to fail.
 		    </entry>
 		    <entry>502127</entry>
 		  </row>
 		  <row>
 		    <entry>5.2-CURRENT after the change of the
 		      vfs_mount signature as well as global replacement of
 		      PRISON_ROOT with SUSER_ALLOWJAIL for the suser(9)
 		      API.
 		    </entry>
 		    <entry>502128</entry>
 		  </row>
 		  <row>
 		    <entry>5.3-BETA/RC before the pfil API change</entry>
 		    <entry>503000</entry>
 		  </row>
 		  <row>
 		    <entry>5.3-RELEASE</entry>
 		    <entry>503001</entry>
 		  </row>
 		  <row>
 		    <entry>5.3-STABLE after branching for RELENG_5_3</entry>
 		    <entry>503100</entry>
 		  </row>
 		  <row>
 		    <entry>5.3-STABLE after addition of glibc style
 		      &man.strftime.3; padding options.</entry>
 		    <entry>503101</entry>
 		  </row>
 		  <row>
 		    <entry>5.3-STABLE after OpenBSD's nc(1) import MFC.</entry>
 		    <entry>503102</entry>
 		  </row>
 		  <row>
 		    <entry>5.4-PRERELEASE after the MFC of the fixes in
 			<filename>&lt;src/include/stdbool.h&gt;</filename> and
 			<filename>&lt;src/sys/i386/include/_types.h&gt;</filename>
 			for using the GCC-compatibility of the Intel C/C++ compiler.</entry>
 		    <entry>503103</entry>
  		  </row>
 		  <row>
 		    <entry>5.4-PRERELEASE after the MFC of the change of
 		       ifi_epoch from wall clock time to uptime.</entry>
 		    <entry>503104</entry>
  		  </row>
 		  <row>
 		    <entry>5.4-PRERELEASE after the MFC of the fix of EOVERFLOW check in vswprintf(3).</entry>
 		    <entry>503105</entry>
 		  </row>
 		  <row>
 		    <entry>5.4-RELEASE.</entry>
 		    <entry>504000</entry>
 		  </row>
 		  <row>
 		    <entry>5.4-STABLE after branching for RELENG_5_4</entry>
 		    <entry>504100</entry>
 		  </row>
 		  <row>
 		    <entry>5.4-STABLE after increasing the default
 		      thread stacksizes</entry>
 		    <entry>504101</entry>
 		  </row>
 		  <row>
 		    <entry>5.4-STABLE after the addition of sha256</entry>
 		    <entry>504102</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT</entry>
 		    <entry>600000</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after permanently enabling PFIL_HOOKS
 		      in the kernel.
 		    </entry>
 		    <entry>600001</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after initial addition of
 		      ifi_epoch to struct if_data.  Backed out after a
 		      few days.  Do not use this value.
 		    </entry>
 		    <entry>600002</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after the re-addition of the
 		      ifi_epoch member of struct if_data.
 		    </entry>
 		    <entry>600003</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after addition of the struct inpcb
 		      argument to the pfil API.
 		    </entry>
 		    <entry>600004</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after addition of the "-d
 		      DESTDIR" argument to newsyslog.
 		    </entry>
 		    <entry>600005</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after addition of glibc style
 		      &man.strftime.3; padding options.
 		    </entry>
 		    <entry>600006</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after addition of 802.11 framework
 		      updates.
 		    </entry>
 		    <entry>600007</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after changes to VOP_*VOBJECT() functions
 		      and introduction of MNTK_MPSAFE flag for Giantfree filesystems.
 		    </entry>
 		    <entry>600008</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after addition of the cpufreq framework
 		      and drivers.
 		    </entry>
 		    <entry>600009</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after importing OpenBSD's nc(1).</entry>
 		    <entry>600010</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after removing semblance of SVID2
 			<literal>matherr()</literal> support.</entry>
 		    <entry>600011</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after increase of default thread stacks'
 			size.</entry>
 		    <entry>600012</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after fixes in
 			<filename>&lt;src/include/stdbool.h&gt;</filename> and
 			<filename>&lt;src/sys/i386/include/_types.h&gt;</filename>
 			for using the GCC-compatibility of the Intel C/C++ compiler.</entry>
 		    <entry>600013</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after EOVERFLOW checks in vswprintf(3) fixed.</entry>
 		    <entry>600014</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after changing the struct if_data
 		       member, ifi_epoch, from wall clock time to uptime.</entry>
 		    <entry>600015</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after LC_CTYPE disk format changed.</entry>
 		    <entry>600016</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after NLS catalogs disk format changed.</entry>
 		    <entry>600017</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after LC_COLLATE disk format changed.</entry>
 		    <entry>600018</entry>
 		  </row>
 		  <row>
 		    <entry>Installation of acpica includes into /usr/include.</entry>
 		    <entry>600019</entry>
 		  </row>
 		  <row>
 		    <entry>Addition of MSG_NOSIGNAL flag to send(2) API.</entry>
 		    <entry>600020</entry>
 		  </row>
 		  <row>
 		    <entry>Addition of fields to cdevsw</entry>
 		    <entry>600021</entry>
 		  </row>
 		  <row>
 		    <entry>Removed gtar from base system.</entry>
 		    <entry>600022</entry>
 		  </row>
 		  <row>
 		    <entry>LOCAL_CREDS, LOCAL_CONNWAIT socket options added to unix(4).</entry>
 		    <entry>600023</entry>
 		  </row>
 		  <row>
 		    <entry>&man.hwpmc.4; and related tools added to 6.0-CURRENT.</entry>
 		    <entry>600024</entry>
 		  </row>
 		  <row>
 		    <entry>struct icmphdr added to 6.0-CURRENT.</entry>
 		    <entry>600025</entry>
 		  </row>
 		  <row>
 		    <entry>pf updated to 3.7.</entry>
 		    <entry>600026</entry>
 		  </row>
 		  <row>
 		    <entry>Kernel libalias and ng_nat introduced.</entry>
 		    <entry>600027</entry>
 		  </row>
 		  <row>
 		    <entry>POSIX ttyname_r(3) made available through unistd.h and libc.</entry>
 		    <entry>600028</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after libpcap updated to v0.9.1 alpha 096.</entry>
 		    <entry>600029</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after importing NetBSD's if_bridge(4).</entry>
 		    <entry>600030</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after struct ifnet was broken out
 		      of the driver softcs.</entry>
 		    <entry>600031</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-CURRENT after the import of libpcap v0.9.1.</entry>
 		    <entry>600032</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-STABLE after bump of all shared library
 		      versions that had not been changed since
 		      RELENG_5.</entry>
 		    <entry>600033</entry>
 		  </row>
 		  <row>
 		    <entry>6.0-STABLE after credential argument is added to
 		      dev_clone vent handler.</entry>
 		    <entry>600034</entry>
 		  </row>
 		  <row>
 		    <entry>7.0-CURRENT.</entry>
 		    <entry>700000</entry>
 		  </row>
 		  <row>
 		    <entry>7.0-CURRENT after bump of all shared library
 		      versions that had not been changed since
 		      RELENG_5.</entry>
 		    <entry>700001</entry>
 		  </row>
 		  <row>
 		    <entry>7.0-CURRENT after credential argument is added to
 		      dev_clone vent handler.</entry>
 		    <entry>700002</entry>
 		  </row>
 		  <row>
 		    <entry>7.0-CURRENT after memmem(3) is added to libc.</entry>
 		    <entry>700003</entry>
 		  </row>
 		</tbody>
 	      </tgroup>
 	    </table>
 
 	<note>
 	  <para>Note that 2.2-STABLE sometimes identifies itself as
 	    <quote>2.2.5-STABLE</quote> after the 2.2.5-RELEASE.  The pattern
 	    used to be year followed by the month, but we decided to change it
 	    to a more straightforward major/minor system starting from 2.2.
 	    This is because the parallel development on several branches made
 	    it infeasible to classify the releases simply by their real
 	    release dates.  If you are making a port now, you do not have to
 	    worry about old -CURRENTs; they are listed here just for your
 	    reference.</para>
 	</note>
       </sect1>
 
       <sect1 id="dads-after-port-mk">
 	<title>Writing something after
 	  <filename>bsd.port.mk</filename></title>
 
 	<para>Do not write anything after the <literal>.include
 	    &lt;bsd.port.mk&gt;</literal> line.  It usually can be avoided by
 	  including <filename>bsd.port.pre.mk</filename> somewhere in the
 	  middle of your <filename>Makefile</filename> and
 	  <filename>bsd.port.post.mk</filename> at the end.</para>
 
 	<note>
 	  <para>You need to include either the
 	    <filename>bsd.port.pre.mk</filename>/<filename>bsd.port.post.mk</filename> pair or
 	    <filename>bsd.port.mk</filename> only; do not mix these two usages.</para>
 	</note>
 
 	<para><filename>bsd.port.pre.mk</filename> only defines a few
 	  variables, which can be used in tests in the
 	  <filename>Makefile</filename>, <filename>bsd.port.post.mk</filename>
 	  defines the rest.</para>
 
 	<para>Here are some important variables defined in
 	  <filename>bsd.port.pre.mk</filename> (this is not the complete list,
 	  please read <filename>bsd.port.mk</filename> for the complete
 	  list).</para>
 
 	<informaltable frame="none" pgwide="1">
 	  <tgroup cols="2">
 	    <thead>
 	      <row>
 		<entry>Variable</entry>
 		<entry>Description</entry>
 	      </row>
 	    </thead>
 
 	    <tbody>
 	      <row>
 		<entry><makevar>ARCH</makevar></entry>
 		<entry>The architecture as returned by <command>uname
 		    -m</command> (e.g., <literal>i386</literal>)</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>OPSYS</makevar></entry>
 		<entry>The operating system type, as returned by
 		  <command>uname -s</command> (e.g.,
 		  <literal>FreeBSD</literal>)</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>OSREL</makevar></entry>
 		<entry>The release version of the operating system (e.g.,
 		  <literal>2.1.5</literal> or
 		  <literal>2.2.7</literal>)</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>OSVERSION</makevar></entry>
 		<entry>The numeric version of the operating system; the same as
 		  <link
 		    linkend="freebsd-versions"><literal>__FreeBSD_version</literal></link>.</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>PORTOBJFORMAT</makevar></entry>
 		<entry>The object format of the system
 		  (<literal>elf</literal> or <literal>aout</literal>;
 		  note that for <quote>modern</quote> versions of FreeBSD,
 		  <literal>aout</literal> is deprecated.)</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>LOCALBASE</makevar></entry>
 		<entry>The base of the <quote>local</quote> tree (e.g.,
 		  <literal>/usr/local/</literal>)</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>X11BASE</makevar></entry>
 		<entry>The base of the <quote>X11</quote> tree (e.g.,
 		  <literal>/usr/X11R6</literal>)</entry>
 	      </row>
 
 	      <row>
 		<entry><makevar>PREFIX</makevar></entry>
 		<entry>Where the port installs itself (see <link
 		    linkend="porting-prefix">more on
 		    <makevar>PREFIX</makevar></link>).</entry>
 	      </row>
 	    </tbody>
 	  </tgroup>
 	</informaltable>
 
 	<note>
 	  <para>If you have to define the variables
 	    <makevar>USE_IMAKE</makevar>, <makevar>USE_X_PREFIX</makevar>, or
 	    <makevar>MASTERDIR</makevar>, do so before including
 	    <filename>bsd.port.pre.mk</filename>.</para>
 	</note>
 
 	<para>Here are some examples of things you can write after
 	  <filename>bsd.port.pre.mk</filename>:</para>
 
 	<programlisting># no need to compile lang/perl5 if perl5 is already in system
 .if ${OSVERSION} > 300003
 BROKEN= perl is in system
 .endif
 
 # only one shlib version number for ELF
 .if ${PORTOBJFORMAT} == "elf"
 TCL_LIB_FILE=  ${TCL_LIB}.${SHLIB_MAJOR}
 .else
 TCL_LIB_FILE=  ${TCL_LIB}.${SHLIB_MAJOR}.${SHLIB_MINOR}
 .endif
 
 # software already makes link for ELF, but not for a.out
 post-install:
 .if ${PORTOBJFORMAT} == "aout"
        ${LN} -sf liblinpack.so.1.0 ${PREFIX}/lib/liblinpack.so
 .endif</programlisting>
 
 	<para>You did remember to use tab instead of spaces after
 	  <literal>BROKEN=</literal> and
 	  <literal>TCL_LIB_FILE=</literal>, did you not?
 	  <!-- smiley -->:-).</para>
       </sect1>
 
       <sect1 id="dads-documentation">
 	<title>Install additional documentation</title>
 
 	<para>If your software has some documentation other than the standard
 	  man and info pages that you think is useful for the user, install it
 	  under <filename><makevar>PREFIX</makevar>/share/doc</filename>.
 	  This can be done, like the previous item, in the
 	  <maketarget>post-install</maketarget> target.</para>
 
 	<para>Create a new directory for your port.  The directory name should
 	  reflect what the port is.  This usually means
 	  <makevar>PORTNAME</makevar>. However, if you
 	  think the user might want different versions of the port to be
 	  installed at the same time, you can use the whole
 	  <makevar>PKGNAME</makevar>.</para>
 
 	<para>Make the installation dependent on the variable
 	  <makevar>NOPORTDOCS</makevar> so that users can disable it in
 	  <filename>/etc/make.conf</filename>, like this:</para>
 
 	<programlisting>post-install:
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${DOCSDIR}
 	${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${DOCSDIR}
 .endif</programlisting>
 
 	<para>Here are some handy variables and how they are expanded
 	  by default when used
 	  in the <filename>Makefile</filename>:</para>
 
 	<itemizedlist>
 	  <listitem>
 	    <para><makevar>DATADIR</makevar> gets expanded to
 	      <filename><makevar>PREFIX</makevar>/share/<makevar>PORTNAME</makevar></filename>.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><makevar>DOCSDIR</makevar> gets expanded to
 	      <filename><makevar>PREFIX</makevar>/share/doc/<makevar>PORTNAME</makevar></filename>.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><makevar>EXAMPLESDIR</makevar> gets expanded to
 	      <filename><makevar>PREFIX</makevar>/share/examples/<makevar>PORTNAME</makevar></filename>.</para>
 	  </listitem>
 	</itemizedlist>
 
 	<para>These variables are exported to <makevar>PLIST_SUB</makevar>.
 	  Their values will appear there as pathnames relative to
 	  <filename><makevar>PREFIX</makevar></filename> if possible.
 	  That is, <filename>share/doc/<makevar>PORTNAME</makevar></filename>
 	  will be substituted for <literal>%%DOCSDIR%%</literal>
 	  in the packing list by default, and so on.
 	  (See more on <filename>pkg-plist</filename> substitution
 	  <link linkend="plist-sub">here</link>.)</para>
 
 	<para>All documentation files and directories installed should
 	  be included in <filename>pkg-plist</filename> with the
 	  <literal>%%PORTDOCS%%</literal> prefix, for example:</para>
 
 	<programlisting>%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
 %%PORTDOCS%%%%DOCSDIR%%/CONTACT
 %%PORTDOCS%%@dirrm %%DOCSDIR%%</programlisting>
 
 	<para>As an alternative to enumerating the documentation files
 	  in <filename>pkg-plist</filename>, a port can set the variable
 	  <makevar>PORTDOCS</makevar> to a list of file names and shell
 	  glob patterns to add to the final packing list.
 	  The names will be relative to <makevar>DOCSDIR</makevar>.
 	  Therefore, a port that utilizes <makevar>PORTDOCS</makevar> and
 	  uses a non-default location for its documentation should set
 	  <makevar>DOCSDIR</makevar> accordingly.
 	  If a directory is listed in <makevar>PORTDOCS</makevar>
 	  or matched by a glob pattern from this variable,
 	  the entire subtree of contained files and directories will be
 	  registered in the final packing list.  <makevar>PORTDOCS</makevar>
 	  should not be set if <makevar>NOPORTDOCS</makevar> is in
 	  effect.  Installing the documentation at <makevar>PORTDOCS</makevar>
 	  as shown above remains up to the port itself.
 	  A typical example of utilizing <makevar>PORTDOCS</makevar>
 	  looks as follows:</para>
 
         <programlisting>.if !defined(NOPORTDOCS)
         PORTDOCS=       *
 .endif</programlisting>
 
 	<note>
 	  <para>You can also use the <filename>pkg-message</filename> file to
 	    display messages upon installation.  See <link
 	    linkend="porting-message">the section on using
 	    <filename>pkg-message</filename></link> for details.
 	    The <filename>pkg-message</filename> file does not need to be
 	    added to <filename>pkg-plist</filename>.</para>
 	</note>
       </sect1>
 
       <sect1 id="dads-subdirs">
 	<title>Subdirectories</title>
 
 	<para>Try to let the port put things in the right subdirectories of
 	  <makevar>PREFIX</makevar>.  Some ports lump everything and put it in
 	  the subdirectory with the port's name, which is incorrect.  Also,
 	  many ports put everything except binaries, header files and manual
 	  pages in the a subdirectory of <filename>lib</filename>, which does
 	  not work well with the BSD paradigm.  Many of the files should be
 	  moved to one of the following: <filename>etc</filename>
 	  (setup/configuration files), <filename>libexec</filename>
 	  (executables started internally), <filename>sbin</filename>
 	  (executables for superusers/managers), <filename>info</filename>
 	  (documentation for info browser) or  <filename>share</filename>
 	  (architecture independent files).  See &man.hier.7; for details;
 	  the rules governing
 	  <filename>/usr</filename> pretty much apply to
 	  <filename>/usr/local</filename> too.  The exception are ports
 	  dealing with USENET <quote>news</quote>.  They may use
 	  <filename><makevar>PREFIX</makevar>/news</filename> as a destination
 	  for their files.</para>
       </sect1>
 
       <sect1 id="dads-uid-and-gids">
 	<title>UIDs and GIDs</title>
 
 	<para>If your port requires a certain user to be on the installed
 	  system, let the <filename>pkg-install</filename> script call
 	  <command>pw</command> to create it automatically.  Look at
 	  <filename role="package">net/cvsup-mirror</filename> for an example.</para>
 
 	<para>If your port must use the same user/group ID number when it is
 	  installed as a binary package as when it was compiled, then you must
 	  choose a free UID from 50 to 999 and register it below.  Look at
 	  <filename role="package">japanese/Wnn6</filename> for an example.</para>
 
 	<para>Make sure you do not use a UID already used by the system or
 	  other ports.</para>
 
 	<para>This is the current list of UIDs between 50 and 999.</para>
 
 	<!-- Please keep this list sorted by uid -->
 	<programlisting>bind:*:53:53:Bind Sandbox:/:/sbin/nologin
 majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
 rdfdb:*:55:55:rdfDB Daemon:/var/db/rdfdb:/bin/sh
 spamd:*:58:58:SpamAssassin user:/var/spool/spamd:/sbin/nologin
 cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent
 gnats:*:61:1:GNATS database owner:/usr/local/share/gnats/gnats-db:/bin/sh
 proxy:*:62:62:Packet Filter pseudo-user:/nonexistent:/nonexistent
 uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
 xten:*:67:67:X-10 daemon:/usr/local/xten:/nonexistent
 pop:*:68:6:Post Office Owner (popper):/nonexistent:/sbin/nologin
 wnn:*:69:7:Wnn:/nonexistent:/nonexistent
 pgsql:*:70:70:PostgreSQL pseudo-user:/usr/local/pgsql:/bin/sh
 oracle:*:71:71::0:0:Oracle:/usr/local/oracle7:/sbin/nologin
 ircd:*:72:72:IRC daemon:/nonexistent:/nonexistent
 ircservices:*:73:73:IRC services:/nonexistent:/nonexistent
 simscan:*:74:74:Simscan User:/nonexistent:/sbin/nologin
 ifmail:*:75:66:Ifmail user:/nonexistent:/nonexistent
 www:*:80:80:World Wide Web Owner:/nonexistent:/sbin/nologin
 alias:*:81:81:QMail user:/var/qmail/alias:/nonexistent
 qmaild:*:82:81:QMail user:/var/qmail:/nonexistent
 qmaill:*:83:81:QMail user:/var/qmail:/nonexistent
 qmailp:*:84:81:QMail user:/var/qmail:/nonexistent
 qmailq:*:85:82:QMail user:/var/qmail:/nonexistent
 qmailr:*:86:82:QMail user:/var/qmail:/nonexistent
 qmails:*:87:82:QMail user:/var/qmail:/nonexistent
 mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
 vpopmail:*:89:89:VPop Mail User:/usr/local/vpopmail:/nonexistent
 firebird:*:90:90:Firebird Database Administrator:/usr/local/firebird:/bin/sh
 mailman:*:91:91:Mailman User:/usr/local/mailman:/sbin/nologin
 gdm:*:92:92:GDM Sandbox:/:/sbin/nologin
 jabber:*:93:93:Jabber Daemon:/nonexistent:/nonexistent
 p4admin:*:94:94:Perforce admin:/usr/local/perforce:/sbin/nologin
 interch:*:95:95:Interchange user:/usr/local/interchange:/sbin/nologin
 squeuer:*:96:96:SQueuer Owner:/nonexistent:/bin/sh
 mud:*:97:97:MUD Owner:/nonexistent:/bin/sh
 msql:*:98:98:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh
 rscsi:*:99:99:Remote SCSI:/usr/local/rscsi:/usr/local/sbin/rscsi
 squid:*:100:100:squid caching-proxy pseudo user:/usr/local/squid:/sbin/nologin
 quagga:*:101:101:Quagga route daemon pseudo user:/usr/local/etc/quagga:/sbin/nologin
 ganglia:*:102:102:Ganglia User:/nonexistent:/sbin/nologin
 sgeadmin:*:103:103:Sun Grid Engine Admin:/nonexistent:/sbin/nologin
 slimserv:*:104:104:Slim Devices SlimServer pseudo-user:/nonexistent:/sbin/nologin
 dnetc:*:105:105:distributed.net client and proxy pseudo-user:/nonexistent:/sbin/nologin
 clamav:*:106:106:Clamav Antivirus:/nonexistent:/sbin/nologin
 cacti:*:107:107:Cacti Sandbox:/nonexistent:/sbin/nologin
 webkit:*:108:108:WebKit Default User:/usr/local/www/webkit:/bin/sh
 quickml:*:109:109:quickml Server:/nonexistent:/sbin/nologin
 vscan:*:110:110:Scanning Virus Account:/var/amavis:/bin/sh
 fido:*:111:111:Fido System:/usr/local/fido:/bin/sh
 dcc:*:112:112:Distributed Checksum Clearinghouse:/nonexistent:/sbin/nologin
 amavis:*:113:113:Amavis-stats Account:/nonexistent:/sbin/nologin
 dhis:*:114:114:DHIS Daemon:/nonexistent:/sbin/nologin
 _symon:*:115:115:Symon Account:/var/empty:/sbin/nologin
 postfix:*:125:125:Postfix Mail System:/var/spool/postfix:/sbin/nologin
 rbldns:*:153:153:rbldnsd pseudo-user:/nonexistent:/sbin/nologin
 sfs:*:171:171:Self-Certifying File System:/nonexistent:/sbin/nologin
 agk:*:172:172:AquaGateKeeper:/nonexistent:/nonexistent
 polipo:*:173:173:polipo web cache:/nonexistent:/sbin/nologin
 bogomilter:*:174:174:milter-bogom:/nonexistent:/sbin/nologin
 moinmoin:*:192:192:MoinMoin User:/nonexistent:/sbin/nologin
 sympa:*:200:200:Sympa Owner:/nonexistent:/sbin/nologin
 dspam:*:202:202:Dspam:/nonexistent:/sbin/nologin
 _tor:*:256:256:Tor anonymising router:/var/db/tor:/bin/sh
 ldap:*:389:389:OpenLDAP Server:/nonexistent:/sbin/nologin
 drweb:*:426:426:Dr.Web Mail Scanner:/nonexistent:/sbin/nologin
 courier:*:465:465:Courier Mail Server:/nonexistent:/sbin/nologin
 _bbstored:*:505:505::0:0:BoxBackup Store Daemon:/nonexistent:/bin/sh
 qtss:*:554:554:Darwin Streaming Server:/nonexistent:/sbin/nologin
 ircdru:*:555:555:Russian hybrid IRC server:/nonexistent:/bin/sh
 messagebus:*:556:556:D-BUS Daemon User:/nonexistent:/sbin/nologin
 bnetd:*:700:700:Bnetd user:/nonexistent:/sbin/nologin
 bopm:*:717:717:Blitzed Open Proxy Monitor:/nonexistent:/bin/sh
 bacula:*:910:910:Bacula Daemon:/var/db/bacula:/sbin/nologin</programlisting>
 
 	<para>This is the current list of reserved GIDs.</para>
 
 	<!-- Please keep this list sorted by gid -->
 	<!-- XXX incomplete! -->
 	<programlisting>bind:*:53:
 rdfdb:*:55:
 spamd:*:58:
 cyrus:*:60:
 proxy:*:62:
 authpf:*:63:
 uucp:*:66:
 xten:*:67:
 dialer:*:68:
 network:*:69:
 pgsql:*:70:
 simscan:*:74:
 www:*:80:
 qnofiles:*:81:
 qmail:*:82:
 mysql:*:88:
 vpopmail:*:89:
 firebird:*:90:
 mailman:*:91:
 gdm:*:92:
 jabber:*:93:
 p4admin:*:94:
 interch:*:95:
 squeuer:*:96:
 mud:*:97:
 msql:*:98:
 rscsi:*:99:
 squid:*:100:
 quagga:*:101:
 ganglia:*:102:
 sgeadmin:*:103:
 slimserv:*:104:
 dnetc:*:105:
 clamav:*:106:
 cacti:*:107:
 webkit:*:108:
 quickml:*:109:
 vscan:*:110:
 fido:*:111:
 dcc:*:112:
 amavis:*:113:
 dhis:*:114:
 _symon:*:115:
 postfix:*:125:
 maildrop:*:126:
 rbldns:*:153:
 sfs:*:171:
 agk:*:172:
 polipo:*:173:
 moinmoin:*:192:
 sympa:*:200:
 dspam:*:202:
 _tor:*:256:
 ldap:*:389:
 drweb:*:426:
 courier:*:465:
 _bbstored:*:505:
 qtss:*:554:
 ircdru:*:555:
 messagebus:*:556:
 realtime:*:557:
 bnetd:*:700:
 bopm:*:717:
 bacula:*:910:</programlisting>
 
 	<para>Please include a notice when you submit a port (or an upgrade)
 	  that reserves a new UID or GID in this range.  This allows us to
 	  keep the list of reserved IDs up to date.</para>
       </sect1>
 
       <sect1 id="dads-rational">
 	<title>Do things rationally</title>
 
 	<para>The <filename>Makefile</filename> should do things simply and
 	  reasonably.  If you can make it a couple of lines shorter or more
 	  readable, then do so.  Examples include using a make
 	  <literal>.if</literal> construct instead of a shell
 	  <literal>if</literal> construct, not redefining
 	  <maketarget>do-extract</maketarget> if you can redefine
 	  <makevar>EXTRACT*</makevar> instead, and using
 	  <makevar>GNU_CONFIGURE</makevar> instead of <literal>CONFIGURE_ARGS
 	    += --prefix=&dollar;{PREFIX}</literal>.</para>
 
 	<para>If you find yourself having to write a lot
 	  of new code to try to do something, please go back and review
 	  <filename>bsd.port.mk</filename> to see if it contains an
 	  existing implementation of what you are trying to do.  While
 	  hard to read, there are a great many seemingly-hard problems for
 	  which <filename>bsd.port.mk</filename> already provides a
 	  shorthand solution.</para>
       </sect1>
 
       <sect1 id="dads-cc">
 	<title>Respect both <makevar>CC</makevar> and
 	  <makevar>CXX</makevar></title>
 
 	<para>The port should respect both <makevar>CC</makevar>
 	  and <makevar>CXX</makevar> variables.  What we mean by this
 	  is that the port should not set the values of these variables
 	  absolutely, overriding existing values; instead, it should append
 	  whatever values it needs to the existing values.  This is so that
 	  build options that affect all ports can be set globally.</para>
 
 	<para>If the port does not respect these variables,
 	  please add <literal>NO_PACKAGE=ignores either cc or
 	  cxx</literal> to the <filename>Makefile</filename>.</para>
 
 	<para>An example of a <filename>Makefile</filename> respecting
 	  both <makevar>CC</makevar> and <makevar>CXX</makevar>
 	  variables follows.  Note the <makevar>?=</makevar>:</para>
 
 	<programlisting>CC?= gcc</programlisting>
 	<programlisting>CXX?= g++</programlisting>
 
 	<para>Here is an example which respects neither
 	  <makevar>CC</makevar> nor <makevar>CXX</makevar>
 	  variables:</para>
 
 	<programlisting>CC= gcc</programlisting>
 	<programlisting>CXX= g++</programlisting>
 
 	<para>Both <makevar>CC</makevar> and <makevar>CXX</makevar>
 	  variables can be defined on FreeBSD systems in
 	  <filename>/etc/make.conf</filename>.  The first example
 	  defines a value if it was not previously set in
 	  <filename>/etc/make.conf</filename>, preserving any
 	  system-wide definitions.  The second example clobbers
 	  anything previously defined.</para>
       </sect1>
 
       <sect1 id="dads-cflags">
 	<title>Respect <makevar>CFLAGS</makevar></title>
 
 	<para>The port should respect the <makevar>CFLAGS</makevar> variable.
 	  What we mean by this is that the port should not set the value of
 	  this variable absolutely, overriding the existing value; instead,
 	  it should append whatever values it needs to the existing value.
 	  This is so that build options that affect all ports can be set
 	  globally.</para>
 
 	<para>If it does not, please add <literal>NO_PACKAGE=ignores
 	    cflags</literal> to the <filename>Makefile</filename>.</para>
 
 	<para>An example of a <filename>Makefile</filename> respecting
 	  the <makevar>CFLAGS</makevar> variable follows.  Note the
 	  <makevar>+=</makevar>:</para>
 
 	<programlisting>CFLAGS+= -Wall -Werror</programlisting>
 
 	<para>Here is an example which does not respect the
 	  <makevar>CFLAGS</makevar> variable:</para>
 
 	<programlisting>CFLAGS= -Wall -Werror</programlisting>
 
 	<para>The <makevar>CFLAGS</makevar> variable is defined on
 	  FreeBSD systems in <filename>/etc/make.conf</filename>.  The
 	  first example appends additional flags to the
 	  <makevar>CFLAGS</makevar> variable, preserving any system-wide
 	  definitions.  The second example clobbers anything previously
 	  defined.</para>
 
 	<para>You should remove optimization flags from the third party
 	  <filename>Makefile</filename>s.  System <makevar>CFLAGS</makevar>
 	  contains system-wide optimization flags.  An example from
 	  an unmodified <filename>Makefile</filename>:</para>
 
 	<programlisting>CFLAGS= -O3 -funroll-loops -DHAVE_SOUND</programlisting>
 
 	<para>Using system optimization flags, the
 	  <filename>Makefile</filename> would look similar to the
 	  following example:</para>
 
 	<programlisting>CFLAGS+= -DHAVE_SOUND</programlisting>
 
       </sect1>
 
       <sect1 id="dads-freedback">
 	<title>Feedback</title>
 
 	<para>Do send applicable changes/patches to the original
 	  author/maintainer for inclusion in next release of the code.  This
 	  will only make your job that much easier for the next
 	  release.</para>
       </sect1>
 
       <sect1 id="dads-readme">
 	<title><filename>README.html</filename></title>
 
 	<para>Do not include the <filename>README.html</filename> file.  This
 	  file is not part of the cvs collection but is generated using the
 	  <command>make readme</command> command.
 	</para>
       </sect1>
 
       <sect1 id="dads-noinstall">
 	<title>Marking a port not installable with <makevar>BROKEN</makevar>,
 	  <makevar>FORBIDDEN</makevar>, or <makevar>IGNORE</makevar></title>
 
 	<para>In certain cases users should be prevented from installing
 	  a port.  To tell a user that
 	  a port should not be installed, there are several
 	  <command>make</command> variables that can be used in a port's
 	  <filename>Makefile</filename>.  The value of the following
 	  <command>make</command> variables will be the reason that is
 	  given back to users for why the port refuses to install itself.
 	  Please use the correct <command>make</command> variable as
 	  each make variable conveys radically different meanings to
 	  both users, and to automated systems that depend on the
 	  <filename>Makefile</filename>s, such as
 	<link linkend="build-cluster">the ports build cluster</link>,
 	<link linkend="freshports">FreshPorts</link>, and
 	<link linkend="portsmon">portsmon</link>.</para>
 
 	<sect2 id="dads-noinstall-variables">
 	  <title>Variables</title>
 
 	<itemizedlist>
 	  <listitem>
 	    <para><makevar>BROKEN</makevar> is reserved for ports that
 	      currently do not compile, install, or deinstall correctly.
 	      It should be used for ports where the the problem is
 	      believed to be temporary.
 	      The build cluster will still attempt to try to build
 	      them to see if the underlying problem has been
 	      resolved.  For instance, use
 	      <makevar>BROKEN</makevar> when a port:</para>
 
 	    <itemizedlist>
 	      <listitem>
 		<para>does not compile</para>
 	      </listitem>
 
 	      <listitem>
 		<para>fails its configuration or installation process</para>
 	      </listitem>
 
 	      <listitem>
 		<para>installs files outside of
 		  <filename>${LOCALBASE}</filename> and
 		  <filename>${X11BASE}</filename></para>
 	      </listitem>
 
 	      <listitem>
 		<para>does not remove all its files cleanly upon
 		  deinstall (however, it may be acceptable, and desirable,
 		  for the port to leave user-modified files behind)</para>
 	      </listitem>
 	    </itemizedlist>
 
 	  </listitem>
 
 	  <listitem>
 	    <para><makevar>FORBIDDEN</makevar> is used for ports that
 	      do contain a security vulnerability or induce grave
 	      concern regarding the security of a FreeBSD system with
 	      a given port installed (ex: a reputably insecure program
 	      or a program that provides easily exploitable services).
 	      Ports should be marked as <makevar>FORBIDDEN</makevar>
 	      as soon as a particular piece of software has a
 	      vulnerability and there is no released upgrade.  Ideally
 	      ports should be upgraded as soon as possible when a
 	      security vulnerability is discovered so as to reduce the
 	      number of vulnerable FreeBSD hosts (we like being known
 	      for being secure), however sometimes there is a
 	      noticeable time gap between disclosure of a
 	      vulnerability and an updated release of the
 	      vulnerable software.  Do not mark a port
 	      <makevar>FORBIDDEN</makevar> for any reason other than
 	      security.</para>
 	  </listitem>
 
 	  <listitem>
 	    <para><makevar>IGNORE</makevar> is reserved for ports that
 	      should not be built for some other reason.
 	      It should be used for ports where the the problem is
 	      believed to be structural.
 	      The build
 	      cluster will not, under any
 	      circumstances, build ports marked as
 	      <makevar>IGNORE</makevar>.  For instance, use
 	      <makevar>IGNORE</makevar> when a port:</para>
 
 	    <itemizedlist>
 	      <listitem>
 		<para>compiles but does not run properly</para>
 	      </listitem>
 
 	      <listitem>
 		<para>does not work on the installed version of &os;</para>
 	      </listitem>
 
 	      <listitem>
 		<para>requires &os; kernel sources to build, but the
 		  user does not have them installed</para>
 	      </listitem>
 
 	      <listitem>
 		<para>has a distfile which may not be automatically
 		  fetched due to licensing restrictions</para>
 	      </listitem>
 
 	      <listitem>
 		<para>does not work with some other currently installed
 		  port (for instance, the port depends on
 		  <filename role="package">www/apache21</filename> but
 		  <filename role="package">www/apache13</filename>
 		  is installed)</para>
 	      </listitem>
 	    </itemizedlist>
 
 	    <note>
 	      <para>If a port would conflict with a currently installed
 		port (for example, if they install a file in the same
 		place that perfoms a different function),
 		<link linkend="conflicts">use
 		<makevar>CONFLICTS</makevar> instead</link>.
 		<makevar>CONFLICTS</makevar> will set
 		<makevar>IGNORE</makevar> by itself.</para>
 	    </note>
 	  </listitem>
 
 	  <listitem>
 	    <para>If a port sould be marked <makevar>IGNORE</makevar>
 	      only on certain architectures, there are two other
 	      convenience variables that will automatically set
 	      <makevar>IGNORE</makevar> for you:
 	      <makevar>ONLY_FOR_ARCHS</makevar> and
 	      <makevar>NOT_FOR_ARCHS</makevar>.  Examples:</para>
 
 	    <programlisting>ONLY_FOR_ARCHS= i386 amd64</programlisting>
 
 	    <programlisting>NOT_FOR_ARCHS= alpha ia64 sparc64</programlisting>
 	  </listitem>
 
 	</itemizedlist>
 
 	</sect2>
 	<sect2 id="dads-noinstall-notes">
 	  <title>Implementation Notes</title>
 
 	  <para>Due to vagaries in the usage of <makevar>IGNORECMD</makevar>
 	    in <filename>bsd.port.mk</filename> among other places,
 	    the value of <makevar>BROKEN</makevar> should be enclosed
 	    in quotes, and the value of <makevar>IGNORE</makevar> should
 	    not be enclosed in quotes.</para>
 
 	  <para>Also, the wording of the string should be somewhat
 	    different due to the way the information is shown to the
 	    user.  Examples:</para>
 
 	  <programlisting>BROKEN= "this port is unsupported on FreeBSD 5.x"</programlisting>
 
 	  <programlisting>IGNORE= is unsupported on FreeBSD 5.x</programlisting>
 
 	  <para>resulting in the following output from
 	    <command>make describe</command>:</para>
 
 	  <programlisting>===>  foobar-0.1 is marked as broken: this port is unsupported on FreeBSD 5.x.</programlisting>
 
 	  <programlisting>===>  foobar-0.1 is unsupported on FreeBSD 5.x.</programlisting>
 	</sect2>
       </sect1>
 
       <sect1 id="dads-deprecated">
 	<title>Marking a port for removal with <makevar>DEPRECATED</makevar>
 	  or <makevar>EXPIRATION_DATE</makevar></title>
 
 	<para>Do remember that <makevar>BROKEN</makevar> and
 	  <makevar>FORBIDDEN</makevar> are to be used as a
 	  temporary resort if a port is not working.  Permanently
 	  broken ports should be removed from the tree
 	  entirely.</para>
 
 	<para>When it makes sense to do so, users can be warned about
 	  a pending port removal with <makevar>DEPRECATED</makevar>
 	  and <makevar>EXPIRATION_DATE</makevar>.  The former is
 	  simply a string stating why the port is scheduled for removal;
 	  the latter is a string in ISO 8601 format (YYYY-MM-DD).  Both
 	  will be shown to the user.</para>
 
 	<para>It is possible to set <makevar>DEPRECATED</makevar>
 	  without an <makevar>EXPIRATION_DATE</makevar> (for
 	  instance, recommending a newer version of the port), but
 	  the converse does not make any sense.</para>
 
 	<para>There is no set policy on how much notice to give.
 	  Current practice seems to be one month for security-related
 	  issues and two months for build issues.  This also gives any
 	  interested committers a little time to fix the problems.</para>
       </sect1>
 
       <sect1 id="dads-workarounds">
 	<title>Necessary workarounds</title>
 
 	<para>Sometimes it is necessary to work around bugs in
 	  software included with older versions of &os;.</para>
 
 	<itemizedlist>
 	  <listitem>
 	    <para>Some versions of &man.make.1; were broken
 	      on at least 4.8 and 5.0 with respect to handling
 	      comparisons based on <makevar>OSVERSION</makevar>.
 	      This would often lead to failures during
 	      <command>make describe</command> (and thus, the overall
 	      ports <command>make index</command>).  The workaround is
 	      to enclose the conditional comparison in spaces, e.g.:
 	      <programlisting>if ( ${OSVERSION} > 500023 )</programlisting>
 	      Be aware that test-installing a port on 4.9 or 5.2
 	      will <emphasis>not</emphasis> detect this problem.</para>
 	  </listitem>
 
 	</itemizedlist>
 
       </sect1>
 
       <sect1 id="dads-misc">
 	<title>Miscellanea</title>
 
 	<para>The files
 	  <filename>pkg-descr</filename> and <filename>pkg-plist</filename>
 	  should each be double-checked.  If you are reviewing a port and feel
 	  they can be worded better, do so.</para>
 
 	<para>Do not copy more copies of the GNU General Public License into
 	  our system, please.</para>
 
 	<para>Please be careful to note any legal issues! Do not let us
 	  illegally distribute software!</para>
       </sect1>
 
     </chapter>
 
     <chapter id="porting-samplem">
       <title>A Sample <filename>Makefile</filename></title>
 
       <para>Here is a sample <filename>Makefile</filename> that you can use to
 	create a new port.  Make sure you remove all the extra comments (ones
 	between brackets)!</para>
 
       <para>It is recommended that you follow this format (ordering of
 	variables, empty lines between sections, etc.).  This format is
 	designed so that the most important information is easy to locate.  We
 	recommend that you use <link
 	  linkend="porting-portlint">portlint</link> to check the
 	<filename>Makefile</filename>.</para>
 
       <programlisting>[the header...just to make it easier for us to identify the ports.]
 # New ports collection makefile for:   xdvi
 [the "version required" line is only needed when the PORTVERSION
  variable is not specific enough to describe the port.]
 # Date created:                26 May 1995
 [this is the person who did the original port to FreeBSD, in particular, the
 person who wrote the first version of this Makefile.  Remember, this should
 not be changed when upgrading the port later.]
 # Whom:                        Satoshi Asami &lt;asami@FreeBSD.org&gt;
 #
 # &dollar;FreeBSD&dollar;
 [ ^^^^^^^^^ This will be automatically replaced with RCS ID string by CVS
 when it is committed to our repository.  If upgrading a port, do not alter
 this line back to "&dollar;FreeBSD&dollar;".  CVS deals with it automatically.]
 #
 
 [section to describe the port itself and the master site - PORTNAME
  and PORTVERSION are always first, followed by CATEGORIES,
  and then MASTER_SITES, which can be followed by MASTER_SITE_SUBDIR.
  PKGNAMEPREFIX and PKGNAMESUFFIX, if needed, will be after that.
  Then comes DISTNAME, EXTRACT_SUFX and/or DISTFILES, and then
  EXTRACT_ONLY, as necessary.]
 PORTNAME=      xdvi
 PORTVERSION=   18.2
 CATEGORIES=    print
 [do not forget the trailing slash ("/")!
  if you are not using MASTER_SITE_* macros]
 MASTER_SITES=  ${MASTER_SITE_XCONTRIB}
 MASTER_SITE_SUBDIR= applications
 PKGNAMEPREFIX= ja-
 DISTNAME=      xdvi-pl18
 [set this if the source is not in the standard ".tar.gz" form]
 EXTRACT_SUFX=  .tar.Z
 
 [section for distributed patches -- can be empty]
 PATCH_SITES=   ftp://ftp.sra.co.jp/pub/X11/japanese/
 PATCHFILES=    xdvi-18.patch1.gz xdvi-18.patch2.gz
 
 [maintainer; *mandatory*!  This is the person (preferably with commit
  privileges) whom a user can contact for questions and bug reports - this
  person should be the porter or someone who can forward questions to the
  original porter reasonably promptly.  If you really do not want to have
  your address here, set it to "ports@FreeBSD.org".]
 MAINTAINER=    asami@FreeBSD.org
 COMMENT=       A DVI Previewer for the X Window System
 
 [dependencies -- can be empty]
 RUN_DEPENDS=   gs:${PORTSDIR}/print/ghostscript
 LIB_DEPENDS=   Xpm.5:${PORTSDIR}/graphics/xpm
 
 [this section is for other standard bsd.port.mk variables that do not
  belong to any of the above]
 [If it asks questions during configure, build, install...]
 IS_INTERACTIVE=        yes
 [If it extracts to a directory other than ${DISTNAME}...]
 WRKSRC=                ${WRKDIR}/xdvi-new
 [If the distributed patches were not made relative to ${WRKSRC}, you
  may need to tweak this]
 PATCH_DIST_STRIP=      -p1
 [If it requires a "configure" script generated by GNU autoconf to be run]
 GNU_CONFIGURE= yes
 [If it requires GNU make, not /usr/bin/make, to build...]
 USE_GMAKE=     yes
 [If it is an X application and requires "xmkmf -a" to be run...]
 USE_IMAKE=     yes
 [et cetera.]
 
 [non-standard variables to be used in the rules below]
 MY_FAVORITE_RESPONSE=  "yeah, right"
 
 [then the special rules, in the order they are called]
 pre-fetch:
 	i go fetch something, yeah
 
 post-patch:
 	i need to do something after patch, great
 
 pre-install:
 	and then some more stuff before installing, wow
 
 [and then the epilogue]
 .include &lt;bsd.port.mk&gt;</programlisting>
     </chapter>
 
     <chapter id="keeping-up">
       <title>Keeping Up</title>
 
       <para>The &os; Ports Collection is constantly changing.  Here is
 	some information on how to keep up.</para>
 
       <sect1 id="freshports">
 	<title>FreshPorts</title>
 
 	<para>One of the easiest ways to learn about updates that have
 	  already been committed is by subscribing to
 	  <ulink url="http://www.FreshPorts.org/">FreshPorts</ulink>.
 	  You can select multiple ports to monitor.  Maintainers are
 	  strongly encouraged to subscribe, because they will receive
 	  notification of not only their own changes, but also any
 	  changes that any other &os; committer has made.  (These are
 	  often necessary to keep up with changes in the underlying
 	  ports framework&mdash;although it would be most polite to
 	  receive an advance heads-up from those committing such changes,
 	  sometimes this is overlooked or just simply impractical.
 	  Also, in some cases, the changes are very minor in nature.
 	  We expect everyone to use their best judgement in these
 	  cases.)</para>
 
 	<para>If you wish to use FreshPorts, all you need is an
 	  account.  If your registered email address is
 	  <literal>@FreeBSD.org</literal>, you will see the opt-in link on the
 	  right hand side of the webpages.
 	  For those of you who already have a FreshPorts account, but are not
 	  using your <literal>@FreeBSD.org</literal> email address,
 	  just change your email to <literal>@FreeBSD.org</literal>, subscribe,
 	  then change it back again.</para>
 
 	<para>FreshPorts also has
 	  a sanity test feature which automatically tests each commit to the
 	  FreeBSD ports tree.  If subscribed to this service, you will be
 	  notified of any errors which FreshPorts detects during sanity
 	  testing of your commits.</para>
       </sect1>
 
       <sect1 id="cvsweb">
 	<title>The Web Interface to the Source Repository</title>
 
 	<para>It is possible to browse the files in the source repository by
 	  using a web interface.  Changes that affect the entire port system
 	  are now documented in the
 	  <ulink url="http://cvsweb.FreeBSD.org/ports/CHANGES">
 	  CHANGES</ulink> file.  Changes that affect individual ports
 	  are now documented in the
 	  <ulink url="http://cvsweb.FreeBSD.org/ports/UPDATING">
 	  UPDATING</ulink> file.  However, the definitive answer to any
 	  question is undoubtedly to read the source code of <ulink
 	  url="http://cvsweb.FreeBSD.org/ports/Mk/bsd.port.mk">
 	  bsd.port.mk</ulink>, and associated files.</para>
 
       </sect1>
 
       <sect1 id="ports-mailling-list">
 	<title>The &os; Ports Mailing List</title>
 
 	<para>If you maintain ports, you should consider following the
 	  &a.ports;.  Important changes to the way ports work will be announced
 	  there, and then committed to <filename>CHANGES</filename>.</para>
 
       </sect1>
 
       <sect1 id="build-cluster">
 	<title>The &os; Port Building Cluster on
 	  <hostid role="hostname">pointyhat.FreeBSD.org</hostid></title>
 
 	  <para>One of the least-publicized strengths of &os; is that
 	    an entire cluster of machines is dedicated to continually
 	    building the Ports Collection, for each of the major OS
 	    releases and for each Tier-1 architecture.  You can find
 	    the results of these builds at
 	    <ulink url="http://pointyhat.FreeBSD.org/">package building logs
 	    and errors</ulink>.</para>
 
 	  <para>Individual ports are built unless they are specifically
 	    marked with <makevar>IGNORE</makevar>.  Ports that are
 	    marked with <makevar>BROKEN</makevar> will still be attempted,
 	    to see if the underlying problem has been resolved.  (This
 	    is done by passing <makevar>TRYBROKEN</makevar> to the
 	    port's <filename>Makefile</filename>.)</para>
 
       </sect1>
 
       <sect1 id="distfile-survey">
 	<title>The &os; Port Distfile Survey</title>
 
 	  <para>The build cluster is dedicated to building the latest
 	    release of each port with distfiles that have already been
 	    fetched.  However, as the Internet continually changes,
 	    distfiles can quickly go missing.  The <ulink
 	    url="http://people.FreeBSD.org/~fenner/portsurvey/">FreeBSD
 	    Ports distfiles survey</ulink> attempts to query every
 	    download site for every port to find out if each distfile
 	    is still currently available.  Maintainers are asked to
 	    check this report periodically, not only to speed up the
 	    building process for users, but to help avoid wasting
 	    bandwidth of the sites that volunteer to host all these
 	    distfiles.</para>
 
       </sect1>
 
       <sect1 id="portsmon">
 
 	<title>The &os; Ports Monitoring System</title>
 
 	<para>Another handy resource is the
 	  <ulink url="http://portsmon.FreeBSD.org">
 	  FreeBSD Ports Monitoring System</ulink> (also known as
 	  <literal>portsmon</literal>).  This system comprises a
 	  database that processes information from several sources
 	  and allows its to be browsed via a web interface.  Currently,
 	  the ports Problem Reports (PRs), the error logs from
 	  the build cluster, and individual files from the ports
 	  collection are used.  In the future, this will be expanded
 	  to include the distfile survey, as well as other sources.</para>
 
 	<para>To get started, you can view all information about a
 	  particular port by using the
 	  <ulink url="http://portsmon.FreeBSD.org/portoverview.py">
 	  Overview of One Port</ulink>.</para>
 
 	<para>As of this writing, this is the only resource available
 	  that maps GNATS PR entries to portnames.  (PR submitters
 	  do not always include the portname in their Synopsis, although
 	  we would prefer that they did.)  So, <literal>portsmon</literal>
 	  is a good place to start if you want to find out whether an
 	  existing port has any PRs filed against it and/or any build
 	  errors; or, to find out if a new port that you may be thinking
 	  about creating has already been submitted.</para>
       </sect1>
 
     </chapter>
 </book>
 
 <!--
      Local Variables:
      mode: sgml
      sgml-indent-data: t
      sgml-omittag: nil
      sgml-always-quote-attributes: t
      End:
 -->