<emphasis remap=..>...</emphasis> -> <makevar>...</makevar>

This commit is contained in:
Nik Clayton 1998-08-11 08:29:39 +00:00
parent ef411ca3f4
commit e1b4ca8f64
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=3322
4 changed files with 224 additions and 354 deletions

View file

@ -315,3 +315,5 @@ for example,
25. <emphasis remap=..>...</emphasis> -> <literal>...</literal>
26. <emphasis remap=..>...</emphasis> -> <makevar>...</makevar>

View file

@ -26067,8 +26067,7 @@
<para>This section tells you how to do a quick port. In many
cases, it is not enough, but we will see.</para>
<para>First, get the original tarball and put it into <emphasis
remap=tt>&#36;{DISTDIR}</emphasis>, which defaults to
<para>First, get the original tarball and put it into <makevar>&#36;{DISTDIR}</makevar>, which defaults to
<filename>/usr/ports/distfiles</filename>.</para>
<note>
@ -26266,31 +26265,28 @@
<listitem>
<para>The fetch target is run. The fetch target is
responsible for making sure that the tarball exists
locally in <emphasis remap=tt>&#36;{DISTDIR}</emphasis>.
If fetch cannot find the required files in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> it will look up the
URL <emphasis remap=tt>&#36;{MASTER_SITES}</emphasis>,
locally in <makevar>&#36;{DISTDIR}</makevar>.
If fetch cannot find the required files in <makevar>&#36;{DISTDIR}</makevar> it will look up the
URL <makevar>&#36;{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/distfiles/">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/,</ulink> where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with <emphasis remap=tt>&#36;{FETCH}</emphasis>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <emphasis remap=tt>&#36;{DISTDIR}</emphasis> for future use and proceed.
URL="ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/,</ulink> where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with <makevar>&#36;{FETCH}</makevar>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <makevar>&#36;{DISTDIR}</makevar> for future use and proceed.
</para>
</listitem>
<listitem>
<para>The extract target is run. It looks for your ports'
distribution file in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> (typically a gzip'd
distribution file in <makevar>&#36;{DISTDIR}</makevar> (typically a gzip'd
tarball) and unpacks it into a temporary subdirectory
specified by <emphasis remap=tt>&#36;{WRKDIR}</emphasis>
specified by <makevar>&#36;{WRKDIR}</makevar>
(defaults to <filename>work</filename>).
</para>
</listitem>
<listitem>
<para>The patch target is run. First, any patches defined
in <emphasis remap=tt>&#36;{PATCHFILES}</emphasis> are
applied. Second, if any patches are found in <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis> (defaults to the
in <makevar>&#36;{PATCHFILES}</makevar> are
applied. Second, if any patches are found in <makevar>&#36;{PATCHDIR}</makevar> (defaults to the
<filename>patches</filename> subdirectory), they are
applied at this time in alphabetical order.
</para>
@ -26309,9 +26305,8 @@
</listitem>
<listitem>
<para>If <emphasis
remap=tt>&#36;{HAS_CONFIGURE}</emphasis> or
<emphasis remap=tt>&#36;{GNU_CONFIGURE}</emphasis>
<para>If <makevar>&#36;{HAS_CONFIGURE}</makevar> or
<makevar>&#36;{GNU_CONFIGURE}</makevar>
is set,
<filename>&#36;{WRKSRC}/configure</filename> is
run.
@ -26319,9 +26314,8 @@
</listitem>
<listitem>
<para>If <emphasis
remap=tt>&#36;{USE_IMAKE}</emphasis> is set,
<emphasis remap=tt>&#36;{XMKMF}</emphasis>
<para>If <makevar>&#36;{USE_IMAKE}</makevar> is set,
<makevar>&#36;{XMKMF}</makevar>
(default: <command>xmkmf
-a</command>) is run.
</para>
@ -26335,9 +26329,8 @@
<listitem>
<para>The build target is run. This is responsible for
descending into the ports' private working directory
(<emphasis remap=tt>&#36;{WRKSRC}</emphasis>) and
building it. If <emphasis
remap=tt>&#36;{USE_GMAKE}</emphasis> is set, GNU
(<makevar>&#36;{WRKSRC}</makevar>) and
building it. If <makevar>&#36;{USE_GMAKE}</makevar> is set, GNU
<command>make</command> will be used,
otherwise the system <command>make</command>
will be used.
@ -26399,7 +26392,7 @@
<para>Get the original sources (normally) as a compressed
tarball (<filename>&lt;foo&gt;.tar.gz</filename> or
<filename>&lt;foo&gt;.tar.Z</filename>) and copy it into
<emphasis remap=tt>&#36;{DISTDIR}</emphasis>. Always use
<makevar>&#36;{DISTDIR}</makevar>. Always use
<emphasis>mainstream</emphasis> sources when and where you
can.</para>
@ -26410,13 +26403,12 @@
<informalexample>
<screen>ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/</screen>
</informalexample> as the last resort. Please refer to this
location as <emphasis
remap=tt>&#36;{MASTER_SITE_LOCAL}</emphasis>. Send mail to
location as <makevar>&#36;{MASTER_SITE_LOCAL}</makevar>. Send mail to
the &a.ports;if you are not sure what to do.</para>
<para>If your port requires some additional `patches' that are
available on the Internet, fetch them too and put them in
<emphasis remap=tt>&#36;{DISTDIR}</emphasis>. Do not worry if
<makevar>&#36;{DISTDIR}</makevar>. Do not worry if
they come from site other than where you got the main source
tarball, we have a way to handle these situations (see the
description of <xref linkend="porting-patchfiles"
@ -26465,15 +26457,13 @@
<emphasis>alphabetical order</emphasis>, thus <emphasis
remap=tt>aa</emphasis> first, <emphasis
remap=tt>ab</emphasis> second and so on. These files
should be stored in <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis>, from where they will be
should be stored in <makevar>&#36;{PATCHDIR}</makevar>, from where they will be
automatically applied. All patches should be relative to
<emphasis remap=tt>&#36;{WRKSRC}</emphasis> (generally the
<makevar>&#36;{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., patch-aa and patch-ab both changing <emphasis
remap=tt>&#36;{WRKSRC}</emphasis>/foobar.c).</para>
(e.g., patch-aa and patch-ab both changing <makevar>&#36;{WRKSRC}</makevar>/foobar.c).</para>
</sect4>
@ -26521,15 +26511,9 @@
<sect4>
<title>The original source</title>
<para>Does it live in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> as a standard gzip'd
<para>Does it live in <makevar>&#36;{DISTDIR}</makevar> as a standard gzip'd
tarball? If so, you can go on to the next step. If not, you
should look at overriding any of the <emphasis
remap=tt>&#36;{EXTRACT_CMD}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_BEFORE_ARGS}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_AFTER_ARGS}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_SUFX}</emphasis>, or <emphasis
remap=tt>&#36;{DISTFILES}</emphasis> variables, depending on
should look at overriding any of the <makevar>&#36;{EXTRACT_CMD}</makevar>, <makevar>&#36;{EXTRACT_BEFORE_ARGS}</makevar>, <makevar>&#36;{EXTRACT_AFTER_ARGS}</makevar>, <makevar>&#36;{EXTRACT_SUFX}</makevar>, or <makevar>&#36;{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 compress, not
@ -26545,12 +26529,10 @@
<sect4>
<title>DISTNAME</title>
<para>You should set <emphasis
remap=tt>&#36;{DISTNAME}</emphasis> to be the base name of
<para>You should set <makevar>&#36;{DISTNAME}</makevar> to be the base name of
your port. The default rules expect the distribution file
list (<emphasis remap=tt>&#36;{DISTFILES}</emphasis>) to be
named <emphasis
remap=tt>&#36;{DISTNAME}&#36;{EXTRACT_SUFX}</emphasis> by
list (<makevar>&#36;{DISTFILES}</makevar>) to be
named <makevar>&#36;{DISTNAME}&#36;{EXTRACT_SUFX}</makevar> by
default which, if it is a normal tarball, is going to be
something like:
<informalexample>
@ -26568,14 +26550,12 @@
<para>All this behavior can be overridden, of course, it simply
represents the most common time-saving defaults. For a port
requiring multiple distribution files, simply set <emphasis
remap=tt>&#36;{DISTFILES}</emphasis> explicitly. If only a
subset of <emphasis remap=tt>&#36;{DISTFILES}</emphasis> are
actual extractable archives, then set them up in <emphasis
remap=tt>&#36;{EXTRACT_ONLY}</emphasis>, which will override
the <emphasis remap=tt>&#36;{DISTFILES}</emphasis> list when
requiring multiple distribution files, simply set <makevar>&#36;{DISTFILES}</makevar> explicitly. If only a
subset of <makevar>&#36;{DISTFILES}</makevar> are
actual extractable archives, then set them up in <makevar>&#36;{EXTRACT_ONLY}</makevar>, which will override
the <makevar>&#36;{DISTFILES}</makevar> list when
it comes to extraction, and the rest will be just left in
<emphasis remap=tt>&#36;{DISTDIR}</emphasis> for later
<makevar>&#36;{DISTDIR}</makevar> for later
use.</para>
</sect4>
@ -26587,8 +26567,7 @@
<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 <emphasis
remap=tt>&#36;{CATEGORIES}</emphasis>. It is intended to
subdirectories are specified by the variable <makevar>&#36;{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 CD-ROM. Please take a
look at the existing categories (you can find them in <ulink
@ -26604,13 +26583,11 @@
<title>MASTER_SITES</title>
<para>Record the directory part of the ftp/http-URL pointing at
the original tarball in <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis>. Do not forget the
the original tarball in <makevar>&#36;{MASTER_SITES}</makevar>. Do not forget the
trailing slash (<filename>/</filename>)!</para>
<para>The make macros will try to use this specification for
grabbing the distribution file with <emphasis
remap=tt>&#36;{FETCH}</emphasis> if they cannot find it
grabbing the distribution file with <makevar>&#36;{FETCH}</makevar> if they cannot find it
already on the system.</para>
<para>It is recommended that you put multiple sites on this
@ -26644,17 +26621,14 @@
<title>PATCHFILES</title>
<para>If your port requires some additional patches that are
available by ftp or http, set <emphasis
remap=tt>&#36;{PATCHFILES}</emphasis> to the names of the
files and <emphasis remap=tt>&#36;{PATCH_SITES}</emphasis> to
available by ftp or http, set <makevar>&#36;{PATCHFILES}</makevar> to the names of the
files and <makevar>&#36;{PATCH_SITES}</makevar> to
the URL of the directory that contains them (the format is the
same as <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis>).</para>
same as <makevar>&#36;{MASTER_SITES}</makevar>).</para>
<para>If the patch is not relative to the top of the source tree
(i.e., <emphasis remap=tt>&#36;{WKRSRC}</emphasis>) because it
contains some extra pathnames, set <emphasis
remap=tt>&#36;{PATCH_DIST_STRIP}</emphasis> accordingly.
(i.e., <makevar>&#36;{WKRSRC}</makevar>) because it
contains some extra pathnames, set <makevar>&#36;{PATCH_DIST_STRIP}</makevar> accordingly.
For instance, if all the pathnames in the patch has an extra
<filename>foozolix-1.0/</filename> in front of the
filenames, then set
@ -26667,14 +26641,13 @@
<para>If the patch is distributed with some other files, such as
documentation, in a gzip'd tarball, you can't just use
<emphasis remap=tt>&#36;{PATCHFILES}</emphasis>. If that is
<makevar>&#36;{PATCHFILES}</makevar>. If that is
the case, add the name and the location of the patch tarball
to <emphasis remap=tt>&#36;{DISTFILES}</emphasis> and
<emphasis remap=tt>&#36;{MASTER_SITES}</emphasis>. Then, from
to <makevar>&#36;{DISTFILES}</makevar> and
<makevar>&#36;{MASTER_SITES}</makevar>. Then, from
the <emphasis remap=tt>pre-patch</emphasis> target, apply the
patch either by running the patch command from there, or
copying the patch file into the <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis> directory and calling it
copying the patch file into the <makevar>&#36;{PATCHDIR}</makevar> directory and calling it
<filename>patch-&lt;xx&gt;</filename>.</para>
<note>
@ -26853,8 +26826,7 @@
<literal>GNU_CONFIGURE=yes</literal>. If you want to give
some extra arguments to GNU <command>configure</command> (other than the default
<literal>--prefix=&#36;{PREFIX}</literal>), set those extra
arguments in <emphasis
remap=tt>&#36;{CONFIGURE_ARGS}</emphasis>.</para>
arguments in <makevar>&#36;{CONFIGURE_ARGS}</makevar>.</para>
<para>If your package is an X application that creates
<filename>Makefile</filename>s from
@ -26867,10 +26839,8 @@
<para>If your port's source <filename>Makefile</filename> has
something else than <emphasis remap=tt>all</emphasis> as the
main build target, set <emphasis
remap=tt>&#36;{ALL_TARGET}</emphasis> accordingly. Same
goes for <emphasis remap=tt>install</emphasis> and <emphasis
remap=tt>&#36;{INSTALL_TARGET}</emphasis>.</para>
main build target, set <makevar>&#36;{ALL_TARGET}</makevar> accordingly. Same
goes for <emphasis remap=tt>install</emphasis> and <makevar>&#36;{INSTALL_TARGET}</makevar>.</para>
</sect4>
@ -26923,22 +26893,21 @@
<listitem>
<para>If the port refers to the Motif library as
<option>-lXm</option> in its Makefile or Imakefile,
simply substitute <emphasis
remap=tt>&#36;{MOTIFLIB}</emphasis> for it.
simply substitute <makevar>&#36;{MOTIFLIB}</makevar> for it.
</para>
</listitem>
<listitem>
<para>If the port uses <literal>XmClientLibs</literal> in its Imakefile,
change it to <emphasis remap=tt>&#36;{MOTIFLIB}
&#36;{XTOOLLIB} &#36;{XLIB}</emphasis>.</para>
change it to <makevar>&#36;{MOTIFLIB}
&#36;{XTOOLLIB} &#36;{XLIB}</makevar>.</para>
</listitem>
</orderedlist>
</para>
<note>
<para><emphasis remap=tt>&#36;{MOTIFLIB}</emphasis> (usually)
<para><makevar>&#36;{MOTIFLIB}</makevar> (usually)
expands to <option>-L/usr/X11R6/lib -lXm</option> or
<filename>/usr/X11R6/lib/libXm.a</filename>, so there is
no need to add <option>-L</option> or
@ -27308,7 +27277,7 @@
<filename>work</filename> subdirectory, <command>make clean</command> will
<emphasis>nuke</emphasis> it completely! If you need
auxiliary files that are not scripts or patches, put them in
the <emphasis remap=tt>&#36;{FILESDIR}</emphasis> subdirectory
the <makevar>&#36;{FILESDIR}</makevar> subdirectory
(<filename>files</filename> by default) and use the
<emphasis remap=tt>post-extract</emphasis> target to copy them
to the <filename>work</filename> subdirectory.</para>
@ -27326,7 +27295,7 @@
<note>
<para>Note that these files are not used only for packaging
anymore, and are <emphasis>mandatory</emphasis> now, even if
<emphasis remap=tt>&#36;{NO_PACKAGE}</emphasis> is
<makevar>&#36;{NO_PACKAGE}</makevar> is
set.</para>
</note>
</sect4>
@ -27388,22 +27357,22 @@
<itemizedlist>
<listitem>
<para><emphasis remap=tt>${INSTALL_PROGRAM}</emphasis> is
<para><makevar>${INSTALL_PROGRAM}</makevar> is
a command to install binary executables.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_SCRIPT}</emphasis> is a
<para><makevar>${INSTALL_SCRIPT}</makevar> is a
command to install executable scripts.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_DATA}</emphasis> is a
<para><makevar>${INSTALL_DATA}</makevar> is a
command to install sharable data.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_MAN}</emphasis> is a
<para><makevar>${INSTALL_MAN}</makevar> is a
command to install manpages and other documentation (it
doesn't compress anything).</para>
</listitem>
@ -27466,11 +27435,10 @@
remap=tt>post-install</emphasis> target.</para>
<para>Create a new directory for your port. The directory name
should reflect what the port is. This usually means <emphasis
remap=tt>&#36;{PKGNAME}</emphasis> minus the version part.
should reflect what the port is. This usually means <makevar>&#36;{PKGNAME}</makevar> minus the version part.
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 <emphasis remap=tt>&#36;{PKGNAME}</emphasis>.</para>
whole <makevar>&#36;{PKGNAME}</makevar>.</para>
<para>Make the installation dependent to the variable
<acronym>NOPORTDOCS</acronym> so that users can disable it in
@ -27508,11 +27476,9 @@
<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.,
`Makefile'), set <emphasis
remap=tt>&#36;{DIST_SUBDIR}</emphasis> to the name of the
port (<emphasis remap=tt>&#36;{PKGNAME}</emphasis> without the
version part should work fine). This will change <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> from the default
`Makefile'), set <makevar>&#36;{DIST_SUBDIR}</makevar> to the name of the
port (<makevar>&#36;{PKGNAME}</makevar> without the
version part should work fine). This will change <makevar>&#36;{DISTDIR}</makevar> from the default
<filename>/usr/ports/distfiles</filename> to
<filename>/usr/ports/distfiles/&#36;{DIST_SUBDIR}</filename>,
and in effect puts everything that is required for your port
@ -27520,14 +27486,11 @@
<para>It will also look at the subdirectory with the same name
on the backup master site at
<filename>ftp.freebsd.org</filename>. (Setting <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> explicitly in your
Makefile will not accomplish this, so please use <emphasis
remap=tt>&#36;{DIST_SUBDIR}</emphasis>.)</para>
<filename>ftp.freebsd.org</filename>. (Setting <makevar>&#36;{DISTDIR}</makevar> explicitly in your
Makefile will not accomplish this, so please use <makevar>&#36;{DIST_SUBDIR}</makevar>.)</para>
<note>
<para>This does not affect the <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis> you define in your
<para>This does not affect the <makevar>&#36;{MASTER_SITES}</makevar> you define in your
Makefile.</para>
</note>
</sect4>
@ -27575,14 +27538,10 @@
<sect4>
<title>PREFIX</title>
<para>Do try to make your port install relative to <emphasis
remap=tt>&#36;{PREFIX}</emphasis>. (The value of this
variable will be set to <emphasis
remap=tt>&#36;{LOCALBASE}</emphasis> (default
<filename>/usr/local</filename>), unless <emphasis
remap=tt>&#36;{USE_IMAKE}</emphasis> or <emphasis
remap=tt>&#36;{USE_X11}</emphasis> is set, in which case it
will be <emphasis remap=tt>&#36;{X11BASE}</emphasis> (default
<para>Do try to make your port install relative to <makevar>&#36;{PREFIX}</makevar>. (The value of this
variable will be set to <makevar>&#36;{LOCALBASE}</makevar> (default
<filename>/usr/local</filename>), unless <makevar>&#36;{USE_IMAKE}</makevar> or <makevar>&#36;{USE_X11}</makevar> is set, in which case it
will be <makevar>&#36;{X11BASE}</makevar> (default
<filename>/usr/X11R6</filename>).)</para>
<para>Not hard-coding <filename>/usr/local</filename> or
@ -27593,11 +27552,11 @@
replacing the occurrences of <filename>/usr/local</filename>
(or <filename>/usr/X11R6</filename> for X ports that do not
use imake) in the various scripts/Makefiles in the port to
read <emphasis remap=tt>&#36;{PREFIX}</emphasis>, as this
read <makevar>&#36;{PREFIX}</makevar>, as this
variable is automatically passed down to every stage of the
build and install processes.</para>
<para>The variable <emphasis remap=tt>&#36;{PREFIX}</emphasis>
<para>The variable <makevar>&#36;{PREFIX}</makevar>
can be reassigned in your Makefile or in the user's
environment. However, it is strongly discouraged for
individual ports to set this variable explicitly in the
@ -27617,7 +27576,7 @@
<title>Subdirectories</title>
<para>Try to let the port put things in the right subdirectories
of <emphasis remap=tt>&#36;{PREFIX}</emphasis>. Some ports
of <makevar>&#36;{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
@ -27820,9 +27779,8 @@
</informalexample>
</para>
<para>If your <emphasis remap=tt>&#36;{DISTNAME}</emphasis>
doesn't look like that, set <emphasis
remap=tt>&#36;{PKGNAME}</emphasis> to something in that
<para>If your <makevar>&#36;{DISTNAME}</makevar>
doesn't look like that, set <makevar>&#36;{PKGNAME}</makevar> to something in that
format.</para>
<para>
@ -27872,9 +27830,7 @@
</orderedlist>
</para>
<para>Here are some (real) examples on how to convert a <emphasis
remap=tt>&#36;{DISTNAME}</emphasis> into a suitable <emphasis
remap=tt>&#36;{PKGNAME}</emphasis>:</para>
<para>Here are some (real) examples on how to convert a <makevar>&#36;{DISTNAME}</makevar> into a suitable <makevar>&#36;{PKGNAME}</makevar>:</para>
<para>
<informalexample>

View file

@ -26067,8 +26067,7 @@
<para>This section tells you how to do a quick port. In many
cases, it is not enough, but we will see.</para>
<para>First, get the original tarball and put it into <emphasis
remap=tt>&#36;{DISTDIR}</emphasis>, which defaults to
<para>First, get the original tarball and put it into <makevar>&#36;{DISTDIR}</makevar>, which defaults to
<filename>/usr/ports/distfiles</filename>.</para>
<note>
@ -26266,31 +26265,28 @@
<listitem>
<para>The fetch target is run. The fetch target is
responsible for making sure that the tarball exists
locally in <emphasis remap=tt>&#36;{DISTDIR}</emphasis>.
If fetch cannot find the required files in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> it will look up the
URL <emphasis remap=tt>&#36;{MASTER_SITES}</emphasis>,
locally in <makevar>&#36;{DISTDIR}</makevar>.
If fetch cannot find the required files in <makevar>&#36;{DISTDIR}</makevar> it will look up the
URL <makevar>&#36;{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/distfiles/">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/,</ulink> where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with <emphasis remap=tt>&#36;{FETCH}</emphasis>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <emphasis remap=tt>&#36;{DISTDIR}</emphasis> for future use and proceed.
URL="ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/,</ulink> where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with <makevar>&#36;{FETCH}</makevar>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <makevar>&#36;{DISTDIR}</makevar> for future use and proceed.
</para>
</listitem>
<listitem>
<para>The extract target is run. It looks for your ports'
distribution file in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> (typically a gzip'd
distribution file in <makevar>&#36;{DISTDIR}</makevar> (typically a gzip'd
tarball) and unpacks it into a temporary subdirectory
specified by <emphasis remap=tt>&#36;{WRKDIR}</emphasis>
specified by <makevar>&#36;{WRKDIR}</makevar>
(defaults to <filename>work</filename>).
</para>
</listitem>
<listitem>
<para>The patch target is run. First, any patches defined
in <emphasis remap=tt>&#36;{PATCHFILES}</emphasis> are
applied. Second, if any patches are found in <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis> (defaults to the
in <makevar>&#36;{PATCHFILES}</makevar> are
applied. Second, if any patches are found in <makevar>&#36;{PATCHDIR}</makevar> (defaults to the
<filename>patches</filename> subdirectory), they are
applied at this time in alphabetical order.
</para>
@ -26309,9 +26305,8 @@
</listitem>
<listitem>
<para>If <emphasis
remap=tt>&#36;{HAS_CONFIGURE}</emphasis> or
<emphasis remap=tt>&#36;{GNU_CONFIGURE}</emphasis>
<para>If <makevar>&#36;{HAS_CONFIGURE}</makevar> or
<makevar>&#36;{GNU_CONFIGURE}</makevar>
is set,
<filename>&#36;{WRKSRC}/configure</filename> is
run.
@ -26319,9 +26314,8 @@
</listitem>
<listitem>
<para>If <emphasis
remap=tt>&#36;{USE_IMAKE}</emphasis> is set,
<emphasis remap=tt>&#36;{XMKMF}</emphasis>
<para>If <makevar>&#36;{USE_IMAKE}</makevar> is set,
<makevar>&#36;{XMKMF}</makevar>
(default: <command>xmkmf
-a</command>) is run.
</para>
@ -26335,9 +26329,8 @@
<listitem>
<para>The build target is run. This is responsible for
descending into the ports' private working directory
(<emphasis remap=tt>&#36;{WRKSRC}</emphasis>) and
building it. If <emphasis
remap=tt>&#36;{USE_GMAKE}</emphasis> is set, GNU
(<makevar>&#36;{WRKSRC}</makevar>) and
building it. If <makevar>&#36;{USE_GMAKE}</makevar> is set, GNU
<command>make</command> will be used,
otherwise the system <command>make</command>
will be used.
@ -26399,7 +26392,7 @@
<para>Get the original sources (normally) as a compressed
tarball (<filename>&lt;foo&gt;.tar.gz</filename> or
<filename>&lt;foo&gt;.tar.Z</filename>) and copy it into
<emphasis remap=tt>&#36;{DISTDIR}</emphasis>. Always use
<makevar>&#36;{DISTDIR}</makevar>. Always use
<emphasis>mainstream</emphasis> sources when and where you
can.</para>
@ -26410,13 +26403,12 @@
<informalexample>
<screen>ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/</screen>
</informalexample> as the last resort. Please refer to this
location as <emphasis
remap=tt>&#36;{MASTER_SITE_LOCAL}</emphasis>. Send mail to
location as <makevar>&#36;{MASTER_SITE_LOCAL}</makevar>. Send mail to
the &a.ports;if you are not sure what to do.</para>
<para>If your port requires some additional `patches' that are
available on the Internet, fetch them too and put them in
<emphasis remap=tt>&#36;{DISTDIR}</emphasis>. Do not worry if
<makevar>&#36;{DISTDIR}</makevar>. Do not worry if
they come from site other than where you got the main source
tarball, we have a way to handle these situations (see the
description of <xref linkend="porting-patchfiles"
@ -26465,15 +26457,13 @@
<emphasis>alphabetical order</emphasis>, thus <emphasis
remap=tt>aa</emphasis> first, <emphasis
remap=tt>ab</emphasis> second and so on. These files
should be stored in <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis>, from where they will be
should be stored in <makevar>&#36;{PATCHDIR}</makevar>, from where they will be
automatically applied. All patches should be relative to
<emphasis remap=tt>&#36;{WRKSRC}</emphasis> (generally the
<makevar>&#36;{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., patch-aa and patch-ab both changing <emphasis
remap=tt>&#36;{WRKSRC}</emphasis>/foobar.c).</para>
(e.g., patch-aa and patch-ab both changing <makevar>&#36;{WRKSRC}</makevar>/foobar.c).</para>
</sect4>
@ -26521,15 +26511,9 @@
<sect4>
<title>The original source</title>
<para>Does it live in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> as a standard gzip'd
<para>Does it live in <makevar>&#36;{DISTDIR}</makevar> as a standard gzip'd
tarball? If so, you can go on to the next step. If not, you
should look at overriding any of the <emphasis
remap=tt>&#36;{EXTRACT_CMD}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_BEFORE_ARGS}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_AFTER_ARGS}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_SUFX}</emphasis>, or <emphasis
remap=tt>&#36;{DISTFILES}</emphasis> variables, depending on
should look at overriding any of the <makevar>&#36;{EXTRACT_CMD}</makevar>, <makevar>&#36;{EXTRACT_BEFORE_ARGS}</makevar>, <makevar>&#36;{EXTRACT_AFTER_ARGS}</makevar>, <makevar>&#36;{EXTRACT_SUFX}</makevar>, or <makevar>&#36;{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 compress, not
@ -26545,12 +26529,10 @@
<sect4>
<title>DISTNAME</title>
<para>You should set <emphasis
remap=tt>&#36;{DISTNAME}</emphasis> to be the base name of
<para>You should set <makevar>&#36;{DISTNAME}</makevar> to be the base name of
your port. The default rules expect the distribution file
list (<emphasis remap=tt>&#36;{DISTFILES}</emphasis>) to be
named <emphasis
remap=tt>&#36;{DISTNAME}&#36;{EXTRACT_SUFX}</emphasis> by
list (<makevar>&#36;{DISTFILES}</makevar>) to be
named <makevar>&#36;{DISTNAME}&#36;{EXTRACT_SUFX}</makevar> by
default which, if it is a normal tarball, is going to be
something like:
<informalexample>
@ -26568,14 +26550,12 @@
<para>All this behavior can be overridden, of course, it simply
represents the most common time-saving defaults. For a port
requiring multiple distribution files, simply set <emphasis
remap=tt>&#36;{DISTFILES}</emphasis> explicitly. If only a
subset of <emphasis remap=tt>&#36;{DISTFILES}</emphasis> are
actual extractable archives, then set them up in <emphasis
remap=tt>&#36;{EXTRACT_ONLY}</emphasis>, which will override
the <emphasis remap=tt>&#36;{DISTFILES}</emphasis> list when
requiring multiple distribution files, simply set <makevar>&#36;{DISTFILES}</makevar> explicitly. If only a
subset of <makevar>&#36;{DISTFILES}</makevar> are
actual extractable archives, then set them up in <makevar>&#36;{EXTRACT_ONLY}</makevar>, which will override
the <makevar>&#36;{DISTFILES}</makevar> list when
it comes to extraction, and the rest will be just left in
<emphasis remap=tt>&#36;{DISTDIR}</emphasis> for later
<makevar>&#36;{DISTDIR}</makevar> for later
use.</para>
</sect4>
@ -26587,8 +26567,7 @@
<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 <emphasis
remap=tt>&#36;{CATEGORIES}</emphasis>. It is intended to
subdirectories are specified by the variable <makevar>&#36;{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 CD-ROM. Please take a
look at the existing categories (you can find them in <ulink
@ -26604,13 +26583,11 @@
<title>MASTER_SITES</title>
<para>Record the directory part of the ftp/http-URL pointing at
the original tarball in <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis>. Do not forget the
the original tarball in <makevar>&#36;{MASTER_SITES}</makevar>. Do not forget the
trailing slash (<filename>/</filename>)!</para>
<para>The make macros will try to use this specification for
grabbing the distribution file with <emphasis
remap=tt>&#36;{FETCH}</emphasis> if they cannot find it
grabbing the distribution file with <makevar>&#36;{FETCH}</makevar> if they cannot find it
already on the system.</para>
<para>It is recommended that you put multiple sites on this
@ -26644,17 +26621,14 @@
<title>PATCHFILES</title>
<para>If your port requires some additional patches that are
available by ftp or http, set <emphasis
remap=tt>&#36;{PATCHFILES}</emphasis> to the names of the
files and <emphasis remap=tt>&#36;{PATCH_SITES}</emphasis> to
available by ftp or http, set <makevar>&#36;{PATCHFILES}</makevar> to the names of the
files and <makevar>&#36;{PATCH_SITES}</makevar> to
the URL of the directory that contains them (the format is the
same as <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis>).</para>
same as <makevar>&#36;{MASTER_SITES}</makevar>).</para>
<para>If the patch is not relative to the top of the source tree
(i.e., <emphasis remap=tt>&#36;{WKRSRC}</emphasis>) because it
contains some extra pathnames, set <emphasis
remap=tt>&#36;{PATCH_DIST_STRIP}</emphasis> accordingly.
(i.e., <makevar>&#36;{WKRSRC}</makevar>) because it
contains some extra pathnames, set <makevar>&#36;{PATCH_DIST_STRIP}</makevar> accordingly.
For instance, if all the pathnames in the patch has an extra
<filename>foozolix-1.0/</filename> in front of the
filenames, then set
@ -26667,14 +26641,13 @@
<para>If the patch is distributed with some other files, such as
documentation, in a gzip'd tarball, you can't just use
<emphasis remap=tt>&#36;{PATCHFILES}</emphasis>. If that is
<makevar>&#36;{PATCHFILES}</makevar>. If that is
the case, add the name and the location of the patch tarball
to <emphasis remap=tt>&#36;{DISTFILES}</emphasis> and
<emphasis remap=tt>&#36;{MASTER_SITES}</emphasis>. Then, from
to <makevar>&#36;{DISTFILES}</makevar> and
<makevar>&#36;{MASTER_SITES}</makevar>. Then, from
the <emphasis remap=tt>pre-patch</emphasis> target, apply the
patch either by running the patch command from there, or
copying the patch file into the <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis> directory and calling it
copying the patch file into the <makevar>&#36;{PATCHDIR}</makevar> directory and calling it
<filename>patch-&lt;xx&gt;</filename>.</para>
<note>
@ -26853,8 +26826,7 @@
<literal>GNU_CONFIGURE=yes</literal>. If you want to give
some extra arguments to GNU <command>configure</command> (other than the default
<literal>--prefix=&#36;{PREFIX}</literal>), set those extra
arguments in <emphasis
remap=tt>&#36;{CONFIGURE_ARGS}</emphasis>.</para>
arguments in <makevar>&#36;{CONFIGURE_ARGS}</makevar>.</para>
<para>If your package is an X application that creates
<filename>Makefile</filename>s from
@ -26867,10 +26839,8 @@
<para>If your port's source <filename>Makefile</filename> has
something else than <emphasis remap=tt>all</emphasis> as the
main build target, set <emphasis
remap=tt>&#36;{ALL_TARGET}</emphasis> accordingly. Same
goes for <emphasis remap=tt>install</emphasis> and <emphasis
remap=tt>&#36;{INSTALL_TARGET}</emphasis>.</para>
main build target, set <makevar>&#36;{ALL_TARGET}</makevar> accordingly. Same
goes for <emphasis remap=tt>install</emphasis> and <makevar>&#36;{INSTALL_TARGET}</makevar>.</para>
</sect4>
@ -26923,22 +26893,21 @@
<listitem>
<para>If the port refers to the Motif library as
<option>-lXm</option> in its Makefile or Imakefile,
simply substitute <emphasis
remap=tt>&#36;{MOTIFLIB}</emphasis> for it.
simply substitute <makevar>&#36;{MOTIFLIB}</makevar> for it.
</para>
</listitem>
<listitem>
<para>If the port uses <literal>XmClientLibs</literal> in its Imakefile,
change it to <emphasis remap=tt>&#36;{MOTIFLIB}
&#36;{XTOOLLIB} &#36;{XLIB}</emphasis>.</para>
change it to <makevar>&#36;{MOTIFLIB}
&#36;{XTOOLLIB} &#36;{XLIB}</makevar>.</para>
</listitem>
</orderedlist>
</para>
<note>
<para><emphasis remap=tt>&#36;{MOTIFLIB}</emphasis> (usually)
<para><makevar>&#36;{MOTIFLIB}</makevar> (usually)
expands to <option>-L/usr/X11R6/lib -lXm</option> or
<filename>/usr/X11R6/lib/libXm.a</filename>, so there is
no need to add <option>-L</option> or
@ -27308,7 +27277,7 @@
<filename>work</filename> subdirectory, <command>make clean</command> will
<emphasis>nuke</emphasis> it completely! If you need
auxiliary files that are not scripts or patches, put them in
the <emphasis remap=tt>&#36;{FILESDIR}</emphasis> subdirectory
the <makevar>&#36;{FILESDIR}</makevar> subdirectory
(<filename>files</filename> by default) and use the
<emphasis remap=tt>post-extract</emphasis> target to copy them
to the <filename>work</filename> subdirectory.</para>
@ -27326,7 +27295,7 @@
<note>
<para>Note that these files are not used only for packaging
anymore, and are <emphasis>mandatory</emphasis> now, even if
<emphasis remap=tt>&#36;{NO_PACKAGE}</emphasis> is
<makevar>&#36;{NO_PACKAGE}</makevar> is
set.</para>
</note>
</sect4>
@ -27388,22 +27357,22 @@
<itemizedlist>
<listitem>
<para><emphasis remap=tt>${INSTALL_PROGRAM}</emphasis> is
<para><makevar>${INSTALL_PROGRAM}</makevar> is
a command to install binary executables.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_SCRIPT}</emphasis> is a
<para><makevar>${INSTALL_SCRIPT}</makevar> is a
command to install executable scripts.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_DATA}</emphasis> is a
<para><makevar>${INSTALL_DATA}</makevar> is a
command to install sharable data.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_MAN}</emphasis> is a
<para><makevar>${INSTALL_MAN}</makevar> is a
command to install manpages and other documentation (it
doesn't compress anything).</para>
</listitem>
@ -27466,11 +27435,10 @@
remap=tt>post-install</emphasis> target.</para>
<para>Create a new directory for your port. The directory name
should reflect what the port is. This usually means <emphasis
remap=tt>&#36;{PKGNAME}</emphasis> minus the version part.
should reflect what the port is. This usually means <makevar>&#36;{PKGNAME}</makevar> minus the version part.
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 <emphasis remap=tt>&#36;{PKGNAME}</emphasis>.</para>
whole <makevar>&#36;{PKGNAME}</makevar>.</para>
<para>Make the installation dependent to the variable
<acronym>NOPORTDOCS</acronym> so that users can disable it in
@ -27508,11 +27476,9 @@
<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.,
`Makefile'), set <emphasis
remap=tt>&#36;{DIST_SUBDIR}</emphasis> to the name of the
port (<emphasis remap=tt>&#36;{PKGNAME}</emphasis> without the
version part should work fine). This will change <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> from the default
`Makefile'), set <makevar>&#36;{DIST_SUBDIR}</makevar> to the name of the
port (<makevar>&#36;{PKGNAME}</makevar> without the
version part should work fine). This will change <makevar>&#36;{DISTDIR}</makevar> from the default
<filename>/usr/ports/distfiles</filename> to
<filename>/usr/ports/distfiles/&#36;{DIST_SUBDIR}</filename>,
and in effect puts everything that is required for your port
@ -27520,14 +27486,11 @@
<para>It will also look at the subdirectory with the same name
on the backup master site at
<filename>ftp.freebsd.org</filename>. (Setting <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> explicitly in your
Makefile will not accomplish this, so please use <emphasis
remap=tt>&#36;{DIST_SUBDIR}</emphasis>.)</para>
<filename>ftp.freebsd.org</filename>. (Setting <makevar>&#36;{DISTDIR}</makevar> explicitly in your
Makefile will not accomplish this, so please use <makevar>&#36;{DIST_SUBDIR}</makevar>.)</para>
<note>
<para>This does not affect the <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis> you define in your
<para>This does not affect the <makevar>&#36;{MASTER_SITES}</makevar> you define in your
Makefile.</para>
</note>
</sect4>
@ -27575,14 +27538,10 @@
<sect4>
<title>PREFIX</title>
<para>Do try to make your port install relative to <emphasis
remap=tt>&#36;{PREFIX}</emphasis>. (The value of this
variable will be set to <emphasis
remap=tt>&#36;{LOCALBASE}</emphasis> (default
<filename>/usr/local</filename>), unless <emphasis
remap=tt>&#36;{USE_IMAKE}</emphasis> or <emphasis
remap=tt>&#36;{USE_X11}</emphasis> is set, in which case it
will be <emphasis remap=tt>&#36;{X11BASE}</emphasis> (default
<para>Do try to make your port install relative to <makevar>&#36;{PREFIX}</makevar>. (The value of this
variable will be set to <makevar>&#36;{LOCALBASE}</makevar> (default
<filename>/usr/local</filename>), unless <makevar>&#36;{USE_IMAKE}</makevar> or <makevar>&#36;{USE_X11}</makevar> is set, in which case it
will be <makevar>&#36;{X11BASE}</makevar> (default
<filename>/usr/X11R6</filename>).)</para>
<para>Not hard-coding <filename>/usr/local</filename> or
@ -27593,11 +27552,11 @@
replacing the occurrences of <filename>/usr/local</filename>
(or <filename>/usr/X11R6</filename> for X ports that do not
use imake) in the various scripts/Makefiles in the port to
read <emphasis remap=tt>&#36;{PREFIX}</emphasis>, as this
read <makevar>&#36;{PREFIX}</makevar>, as this
variable is automatically passed down to every stage of the
build and install processes.</para>
<para>The variable <emphasis remap=tt>&#36;{PREFIX}</emphasis>
<para>The variable <makevar>&#36;{PREFIX}</makevar>
can be reassigned in your Makefile or in the user's
environment. However, it is strongly discouraged for
individual ports to set this variable explicitly in the
@ -27617,7 +27576,7 @@
<title>Subdirectories</title>
<para>Try to let the port put things in the right subdirectories
of <emphasis remap=tt>&#36;{PREFIX}</emphasis>. Some ports
of <makevar>&#36;{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
@ -27820,9 +27779,8 @@
</informalexample>
</para>
<para>If your <emphasis remap=tt>&#36;{DISTNAME}</emphasis>
doesn't look like that, set <emphasis
remap=tt>&#36;{PKGNAME}</emphasis> to something in that
<para>If your <makevar>&#36;{DISTNAME}</makevar>
doesn't look like that, set <makevar>&#36;{PKGNAME}</makevar> to something in that
format.</para>
<para>
@ -27872,9 +27830,7 @@
</orderedlist>
</para>
<para>Here are some (real) examples on how to convert a <emphasis
remap=tt>&#36;{DISTNAME}</emphasis> into a suitable <emphasis
remap=tt>&#36;{PKGNAME}</emphasis>:</para>
<para>Here are some (real) examples on how to convert a <makevar>&#36;{DISTNAME}</makevar> into a suitable <makevar>&#36;{PKGNAME}</makevar>:</para>
<para>
<informalexample>

View file

@ -26067,8 +26067,7 @@
<para>This section tells you how to do a quick port. In many
cases, it is not enough, but we will see.</para>
<para>First, get the original tarball and put it into <emphasis
remap=tt>&#36;{DISTDIR}</emphasis>, which defaults to
<para>First, get the original tarball and put it into <makevar>&#36;{DISTDIR}</makevar>, which defaults to
<filename>/usr/ports/distfiles</filename>.</para>
<note>
@ -26266,31 +26265,28 @@
<listitem>
<para>The fetch target is run. The fetch target is
responsible for making sure that the tarball exists
locally in <emphasis remap=tt>&#36;{DISTDIR}</emphasis>.
If fetch cannot find the required files in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> it will look up the
URL <emphasis remap=tt>&#36;{MASTER_SITES}</emphasis>,
locally in <makevar>&#36;{DISTDIR}</makevar>.
If fetch cannot find the required files in <makevar>&#36;{DISTDIR}</makevar> it will look up the
URL <makevar>&#36;{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/distfiles/">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/,</ulink> where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with <emphasis remap=tt>&#36;{FETCH}</emphasis>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <emphasis remap=tt>&#36;{DISTDIR}</emphasis> for future use and proceed.
URL="ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/,</ulink> where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with <makevar>&#36;{FETCH}</makevar>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <makevar>&#36;{DISTDIR}</makevar> for future use and proceed.
</para>
</listitem>
<listitem>
<para>The extract target is run. It looks for your ports'
distribution file in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> (typically a gzip'd
distribution file in <makevar>&#36;{DISTDIR}</makevar> (typically a gzip'd
tarball) and unpacks it into a temporary subdirectory
specified by <emphasis remap=tt>&#36;{WRKDIR}</emphasis>
specified by <makevar>&#36;{WRKDIR}</makevar>
(defaults to <filename>work</filename>).
</para>
</listitem>
<listitem>
<para>The patch target is run. First, any patches defined
in <emphasis remap=tt>&#36;{PATCHFILES}</emphasis> are
applied. Second, if any patches are found in <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis> (defaults to the
in <makevar>&#36;{PATCHFILES}</makevar> are
applied. Second, if any patches are found in <makevar>&#36;{PATCHDIR}</makevar> (defaults to the
<filename>patches</filename> subdirectory), they are
applied at this time in alphabetical order.
</para>
@ -26309,9 +26305,8 @@
</listitem>
<listitem>
<para>If <emphasis
remap=tt>&#36;{HAS_CONFIGURE}</emphasis> or
<emphasis remap=tt>&#36;{GNU_CONFIGURE}</emphasis>
<para>If <makevar>&#36;{HAS_CONFIGURE}</makevar> or
<makevar>&#36;{GNU_CONFIGURE}</makevar>
is set,
<filename>&#36;{WRKSRC}/configure</filename> is
run.
@ -26319,9 +26314,8 @@
</listitem>
<listitem>
<para>If <emphasis
remap=tt>&#36;{USE_IMAKE}</emphasis> is set,
<emphasis remap=tt>&#36;{XMKMF}</emphasis>
<para>If <makevar>&#36;{USE_IMAKE}</makevar> is set,
<makevar>&#36;{XMKMF}</makevar>
(default: <command>xmkmf
-a</command>) is run.
</para>
@ -26335,9 +26329,8 @@
<listitem>
<para>The build target is run. This is responsible for
descending into the ports' private working directory
(<emphasis remap=tt>&#36;{WRKSRC}</emphasis>) and
building it. If <emphasis
remap=tt>&#36;{USE_GMAKE}</emphasis> is set, GNU
(<makevar>&#36;{WRKSRC}</makevar>) and
building it. If <makevar>&#36;{USE_GMAKE}</makevar> is set, GNU
<command>make</command> will be used,
otherwise the system <command>make</command>
will be used.
@ -26399,7 +26392,7 @@
<para>Get the original sources (normally) as a compressed
tarball (<filename>&lt;foo&gt;.tar.gz</filename> or
<filename>&lt;foo&gt;.tar.Z</filename>) and copy it into
<emphasis remap=tt>&#36;{DISTDIR}</emphasis>. Always use
<makevar>&#36;{DISTDIR}</makevar>. Always use
<emphasis>mainstream</emphasis> sources when and where you
can.</para>
@ -26410,13 +26403,12 @@
<informalexample>
<screen>ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/</screen>
</informalexample> as the last resort. Please refer to this
location as <emphasis
remap=tt>&#36;{MASTER_SITE_LOCAL}</emphasis>. Send mail to
location as <makevar>&#36;{MASTER_SITE_LOCAL}</makevar>. Send mail to
the &a.ports;if you are not sure what to do.</para>
<para>If your port requires some additional `patches' that are
available on the Internet, fetch them too and put them in
<emphasis remap=tt>&#36;{DISTDIR}</emphasis>. Do not worry if
<makevar>&#36;{DISTDIR}</makevar>. Do not worry if
they come from site other than where you got the main source
tarball, we have a way to handle these situations (see the
description of <xref linkend="porting-patchfiles"
@ -26465,15 +26457,13 @@
<emphasis>alphabetical order</emphasis>, thus <emphasis
remap=tt>aa</emphasis> first, <emphasis
remap=tt>ab</emphasis> second and so on. These files
should be stored in <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis>, from where they will be
should be stored in <makevar>&#36;{PATCHDIR}</makevar>, from where they will be
automatically applied. All patches should be relative to
<emphasis remap=tt>&#36;{WRKSRC}</emphasis> (generally the
<makevar>&#36;{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., patch-aa and patch-ab both changing <emphasis
remap=tt>&#36;{WRKSRC}</emphasis>/foobar.c).</para>
(e.g., patch-aa and patch-ab both changing <makevar>&#36;{WRKSRC}</makevar>/foobar.c).</para>
</sect4>
@ -26521,15 +26511,9 @@
<sect4>
<title>The original source</title>
<para>Does it live in <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> as a standard gzip'd
<para>Does it live in <makevar>&#36;{DISTDIR}</makevar> as a standard gzip'd
tarball? If so, you can go on to the next step. If not, you
should look at overriding any of the <emphasis
remap=tt>&#36;{EXTRACT_CMD}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_BEFORE_ARGS}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_AFTER_ARGS}</emphasis>, <emphasis
remap=tt>&#36;{EXTRACT_SUFX}</emphasis>, or <emphasis
remap=tt>&#36;{DISTFILES}</emphasis> variables, depending on
should look at overriding any of the <makevar>&#36;{EXTRACT_CMD}</makevar>, <makevar>&#36;{EXTRACT_BEFORE_ARGS}</makevar>, <makevar>&#36;{EXTRACT_AFTER_ARGS}</makevar>, <makevar>&#36;{EXTRACT_SUFX}</makevar>, or <makevar>&#36;{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 compress, not
@ -26545,12 +26529,10 @@
<sect4>
<title>DISTNAME</title>
<para>You should set <emphasis
remap=tt>&#36;{DISTNAME}</emphasis> to be the base name of
<para>You should set <makevar>&#36;{DISTNAME}</makevar> to be the base name of
your port. The default rules expect the distribution file
list (<emphasis remap=tt>&#36;{DISTFILES}</emphasis>) to be
named <emphasis
remap=tt>&#36;{DISTNAME}&#36;{EXTRACT_SUFX}</emphasis> by
list (<makevar>&#36;{DISTFILES}</makevar>) to be
named <makevar>&#36;{DISTNAME}&#36;{EXTRACT_SUFX}</makevar> by
default which, if it is a normal tarball, is going to be
something like:
<informalexample>
@ -26568,14 +26550,12 @@
<para>All this behavior can be overridden, of course, it simply
represents the most common time-saving defaults. For a port
requiring multiple distribution files, simply set <emphasis
remap=tt>&#36;{DISTFILES}</emphasis> explicitly. If only a
subset of <emphasis remap=tt>&#36;{DISTFILES}</emphasis> are
actual extractable archives, then set them up in <emphasis
remap=tt>&#36;{EXTRACT_ONLY}</emphasis>, which will override
the <emphasis remap=tt>&#36;{DISTFILES}</emphasis> list when
requiring multiple distribution files, simply set <makevar>&#36;{DISTFILES}</makevar> explicitly. If only a
subset of <makevar>&#36;{DISTFILES}</makevar> are
actual extractable archives, then set them up in <makevar>&#36;{EXTRACT_ONLY}</makevar>, which will override
the <makevar>&#36;{DISTFILES}</makevar> list when
it comes to extraction, and the rest will be just left in
<emphasis remap=tt>&#36;{DISTDIR}</emphasis> for later
<makevar>&#36;{DISTDIR}</makevar> for later
use.</para>
</sect4>
@ -26587,8 +26567,7 @@
<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 <emphasis
remap=tt>&#36;{CATEGORIES}</emphasis>. It is intended to
subdirectories are specified by the variable <makevar>&#36;{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 CD-ROM. Please take a
look at the existing categories (you can find them in <ulink
@ -26604,13 +26583,11 @@
<title>MASTER_SITES</title>
<para>Record the directory part of the ftp/http-URL pointing at
the original tarball in <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis>. Do not forget the
the original tarball in <makevar>&#36;{MASTER_SITES}</makevar>. Do not forget the
trailing slash (<filename>/</filename>)!</para>
<para>The make macros will try to use this specification for
grabbing the distribution file with <emphasis
remap=tt>&#36;{FETCH}</emphasis> if they cannot find it
grabbing the distribution file with <makevar>&#36;{FETCH}</makevar> if they cannot find it
already on the system.</para>
<para>It is recommended that you put multiple sites on this
@ -26644,17 +26621,14 @@
<title>PATCHFILES</title>
<para>If your port requires some additional patches that are
available by ftp or http, set <emphasis
remap=tt>&#36;{PATCHFILES}</emphasis> to the names of the
files and <emphasis remap=tt>&#36;{PATCH_SITES}</emphasis> to
available by ftp or http, set <makevar>&#36;{PATCHFILES}</makevar> to the names of the
files and <makevar>&#36;{PATCH_SITES}</makevar> to
the URL of the directory that contains them (the format is the
same as <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis>).</para>
same as <makevar>&#36;{MASTER_SITES}</makevar>).</para>
<para>If the patch is not relative to the top of the source tree
(i.e., <emphasis remap=tt>&#36;{WKRSRC}</emphasis>) because it
contains some extra pathnames, set <emphasis
remap=tt>&#36;{PATCH_DIST_STRIP}</emphasis> accordingly.
(i.e., <makevar>&#36;{WKRSRC}</makevar>) because it
contains some extra pathnames, set <makevar>&#36;{PATCH_DIST_STRIP}</makevar> accordingly.
For instance, if all the pathnames in the patch has an extra
<filename>foozolix-1.0/</filename> in front of the
filenames, then set
@ -26667,14 +26641,13 @@
<para>If the patch is distributed with some other files, such as
documentation, in a gzip'd tarball, you can't just use
<emphasis remap=tt>&#36;{PATCHFILES}</emphasis>. If that is
<makevar>&#36;{PATCHFILES}</makevar>. If that is
the case, add the name and the location of the patch tarball
to <emphasis remap=tt>&#36;{DISTFILES}</emphasis> and
<emphasis remap=tt>&#36;{MASTER_SITES}</emphasis>. Then, from
to <makevar>&#36;{DISTFILES}</makevar> and
<makevar>&#36;{MASTER_SITES}</makevar>. Then, from
the <emphasis remap=tt>pre-patch</emphasis> target, apply the
patch either by running the patch command from there, or
copying the patch file into the <emphasis
remap=tt>&#36;{PATCHDIR}</emphasis> directory and calling it
copying the patch file into the <makevar>&#36;{PATCHDIR}</makevar> directory and calling it
<filename>patch-&lt;xx&gt;</filename>.</para>
<note>
@ -26853,8 +26826,7 @@
<literal>GNU_CONFIGURE=yes</literal>. If you want to give
some extra arguments to GNU <command>configure</command> (other than the default
<literal>--prefix=&#36;{PREFIX}</literal>), set those extra
arguments in <emphasis
remap=tt>&#36;{CONFIGURE_ARGS}</emphasis>.</para>
arguments in <makevar>&#36;{CONFIGURE_ARGS}</makevar>.</para>
<para>If your package is an X application that creates
<filename>Makefile</filename>s from
@ -26867,10 +26839,8 @@
<para>If your port's source <filename>Makefile</filename> has
something else than <emphasis remap=tt>all</emphasis> as the
main build target, set <emphasis
remap=tt>&#36;{ALL_TARGET}</emphasis> accordingly. Same
goes for <emphasis remap=tt>install</emphasis> and <emphasis
remap=tt>&#36;{INSTALL_TARGET}</emphasis>.</para>
main build target, set <makevar>&#36;{ALL_TARGET}</makevar> accordingly. Same
goes for <emphasis remap=tt>install</emphasis> and <makevar>&#36;{INSTALL_TARGET}</makevar>.</para>
</sect4>
@ -26923,22 +26893,21 @@
<listitem>
<para>If the port refers to the Motif library as
<option>-lXm</option> in its Makefile or Imakefile,
simply substitute <emphasis
remap=tt>&#36;{MOTIFLIB}</emphasis> for it.
simply substitute <makevar>&#36;{MOTIFLIB}</makevar> for it.
</para>
</listitem>
<listitem>
<para>If the port uses <literal>XmClientLibs</literal> in its Imakefile,
change it to <emphasis remap=tt>&#36;{MOTIFLIB}
&#36;{XTOOLLIB} &#36;{XLIB}</emphasis>.</para>
change it to <makevar>&#36;{MOTIFLIB}
&#36;{XTOOLLIB} &#36;{XLIB}</makevar>.</para>
</listitem>
</orderedlist>
</para>
<note>
<para><emphasis remap=tt>&#36;{MOTIFLIB}</emphasis> (usually)
<para><makevar>&#36;{MOTIFLIB}</makevar> (usually)
expands to <option>-L/usr/X11R6/lib -lXm</option> or
<filename>/usr/X11R6/lib/libXm.a</filename>, so there is
no need to add <option>-L</option> or
@ -27308,7 +27277,7 @@
<filename>work</filename> subdirectory, <command>make clean</command> will
<emphasis>nuke</emphasis> it completely! If you need
auxiliary files that are not scripts or patches, put them in
the <emphasis remap=tt>&#36;{FILESDIR}</emphasis> subdirectory
the <makevar>&#36;{FILESDIR}</makevar> subdirectory
(<filename>files</filename> by default) and use the
<emphasis remap=tt>post-extract</emphasis> target to copy them
to the <filename>work</filename> subdirectory.</para>
@ -27326,7 +27295,7 @@
<note>
<para>Note that these files are not used only for packaging
anymore, and are <emphasis>mandatory</emphasis> now, even if
<emphasis remap=tt>&#36;{NO_PACKAGE}</emphasis> is
<makevar>&#36;{NO_PACKAGE}</makevar> is
set.</para>
</note>
</sect4>
@ -27388,22 +27357,22 @@
<itemizedlist>
<listitem>
<para><emphasis remap=tt>${INSTALL_PROGRAM}</emphasis> is
<para><makevar>${INSTALL_PROGRAM}</makevar> is
a command to install binary executables.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_SCRIPT}</emphasis> is a
<para><makevar>${INSTALL_SCRIPT}</makevar> is a
command to install executable scripts.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_DATA}</emphasis> is a
<para><makevar>${INSTALL_DATA}</makevar> is a
command to install sharable data.</para>
</listitem>
<listitem>
<para><emphasis remap=tt>${INSTALL_MAN}</emphasis> is a
<para><makevar>${INSTALL_MAN}</makevar> is a
command to install manpages and other documentation (it
doesn't compress anything).</para>
</listitem>
@ -27466,11 +27435,10 @@
remap=tt>post-install</emphasis> target.</para>
<para>Create a new directory for your port. The directory name
should reflect what the port is. This usually means <emphasis
remap=tt>&#36;{PKGNAME}</emphasis> minus the version part.
should reflect what the port is. This usually means <makevar>&#36;{PKGNAME}</makevar> minus the version part.
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 <emphasis remap=tt>&#36;{PKGNAME}</emphasis>.</para>
whole <makevar>&#36;{PKGNAME}</makevar>.</para>
<para>Make the installation dependent to the variable
<acronym>NOPORTDOCS</acronym> so that users can disable it in
@ -27508,11 +27476,9 @@
<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.,
`Makefile'), set <emphasis
remap=tt>&#36;{DIST_SUBDIR}</emphasis> to the name of the
port (<emphasis remap=tt>&#36;{PKGNAME}</emphasis> without the
version part should work fine). This will change <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> from the default
`Makefile'), set <makevar>&#36;{DIST_SUBDIR}</makevar> to the name of the
port (<makevar>&#36;{PKGNAME}</makevar> without the
version part should work fine). This will change <makevar>&#36;{DISTDIR}</makevar> from the default
<filename>/usr/ports/distfiles</filename> to
<filename>/usr/ports/distfiles/&#36;{DIST_SUBDIR}</filename>,
and in effect puts everything that is required for your port
@ -27520,14 +27486,11 @@
<para>It will also look at the subdirectory with the same name
on the backup master site at
<filename>ftp.freebsd.org</filename>. (Setting <emphasis
remap=tt>&#36;{DISTDIR}</emphasis> explicitly in your
Makefile will not accomplish this, so please use <emphasis
remap=tt>&#36;{DIST_SUBDIR}</emphasis>.)</para>
<filename>ftp.freebsd.org</filename>. (Setting <makevar>&#36;{DISTDIR}</makevar> explicitly in your
Makefile will not accomplish this, so please use <makevar>&#36;{DIST_SUBDIR}</makevar>.)</para>
<note>
<para>This does not affect the <emphasis
remap=tt>&#36;{MASTER_SITES}</emphasis> you define in your
<para>This does not affect the <makevar>&#36;{MASTER_SITES}</makevar> you define in your
Makefile.</para>
</note>
</sect4>
@ -27575,14 +27538,10 @@
<sect4>
<title>PREFIX</title>
<para>Do try to make your port install relative to <emphasis
remap=tt>&#36;{PREFIX}</emphasis>. (The value of this
variable will be set to <emphasis
remap=tt>&#36;{LOCALBASE}</emphasis> (default
<filename>/usr/local</filename>), unless <emphasis
remap=tt>&#36;{USE_IMAKE}</emphasis> or <emphasis
remap=tt>&#36;{USE_X11}</emphasis> is set, in which case it
will be <emphasis remap=tt>&#36;{X11BASE}</emphasis> (default
<para>Do try to make your port install relative to <makevar>&#36;{PREFIX}</makevar>. (The value of this
variable will be set to <makevar>&#36;{LOCALBASE}</makevar> (default
<filename>/usr/local</filename>), unless <makevar>&#36;{USE_IMAKE}</makevar> or <makevar>&#36;{USE_X11}</makevar> is set, in which case it
will be <makevar>&#36;{X11BASE}</makevar> (default
<filename>/usr/X11R6</filename>).)</para>
<para>Not hard-coding <filename>/usr/local</filename> or
@ -27593,11 +27552,11 @@
replacing the occurrences of <filename>/usr/local</filename>
(or <filename>/usr/X11R6</filename> for X ports that do not
use imake) in the various scripts/Makefiles in the port to
read <emphasis remap=tt>&#36;{PREFIX}</emphasis>, as this
read <makevar>&#36;{PREFIX}</makevar>, as this
variable is automatically passed down to every stage of the
build and install processes.</para>
<para>The variable <emphasis remap=tt>&#36;{PREFIX}</emphasis>
<para>The variable <makevar>&#36;{PREFIX}</makevar>
can be reassigned in your Makefile or in the user's
environment. However, it is strongly discouraged for
individual ports to set this variable explicitly in the
@ -27617,7 +27576,7 @@
<title>Subdirectories</title>
<para>Try to let the port put things in the right subdirectories
of <emphasis remap=tt>&#36;{PREFIX}</emphasis>. Some ports
of <makevar>&#36;{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
@ -27820,9 +27779,8 @@
</informalexample>
</para>
<para>If your <emphasis remap=tt>&#36;{DISTNAME}</emphasis>
doesn't look like that, set <emphasis
remap=tt>&#36;{PKGNAME}</emphasis> to something in that
<para>If your <makevar>&#36;{DISTNAME}</makevar>
doesn't look like that, set <makevar>&#36;{PKGNAME}</makevar> to something in that
format.</para>
<para>
@ -27872,9 +27830,7 @@
</orderedlist>
</para>
<para>Here are some (real) examples on how to convert a <emphasis
remap=tt>&#36;{DISTNAME}</emphasis> into a suitable <emphasis
remap=tt>&#36;{PKGNAME}</emphasis>:</para>
<para>Here are some (real) examples on how to convert a <makevar>&#36;{DISTNAME}</makevar> into a suitable <makevar>&#36;{PKGNAME}</makevar>:</para>
<para>
<informalexample>