Wrap paragraphs. Whitespace change only. Translators please ignore.

This commit is contained in:
Murray Stokely 2003-05-21 06:04:09 +00:00
parent 7d0800c30d
commit 5c30ad1cac
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=17022

View file

@ -91,27 +91,30 @@
third party applications have been made available in this third party applications have been made available in this
way.</para> way.</para>
<para>For any given application, the FreeBSD package for that application <para>For any given application, the FreeBSD package for that
is a single file which you must download. The package contains application is a single file which you must download. The
pre-compiled copies of all the commands for the application, as well as package contains pre-compiled copies of all the commands for the
any configuration files or documentation. A downloaded package file can application, as well as any configuration files or
be manipulated with FreeBSD package management commands, such as documentation. A downloaded package file can be manipulated
&man.pkg.add.1;, &man.pkg.delete.1;, &man.pkg.info.1;, and so on.</para> with FreeBSD package management commands, such as
&man.pkg.add.1;, &man.pkg.delete.1;, &man.pkg.info.1;, and so
on.</para>
<para>Installing a new application can be carried out with a single <para>Installing a new application can be carried out with a single
command.</para> command.</para>
<para>A FreeBSD port for an application is a collection of files designed <para>A FreeBSD port for an application is a collection of files
to automate the process of compiling an application from source designed to automate the process of compiling an application
code.</para> from source code.</para>
<para>Remember that there are a number of steps you would normally carry <para>Remember that there are a number of steps you would normally
out if you compiled a program yourself (downloading, unpacking, patching, compiling, carry out if you compiled a program yourself (downloading,
installing). The files that make up a port contain all the necessary unpacking, patching, compiling, installing). The files that
information to allow the system to do this for you. You run a handful make up a port contain all the necessary information to allow
of simple commands and the source code for the application is the system to do this for you. You run a handful of simple
automatically downloaded, extracted, patched, compiled, and installed commands and the source code for the application is
for you.</para> automatically downloaded, extracted, patched, compiled, and
installed for you.</para>
<para>In fact, the ports system can also be used to generate packages <para>In fact, the ports system can also be used to generate packages
which can later be manipulated with <command>pkg_add</command> which can later be manipulated with <command>pkg_add</command>
@ -119,32 +122,35 @@
shortly.</para> shortly.</para>
<para>Both packages and ports understand <para>Both packages and ports understand
<emphasis>dependencies</emphasis>. Suppose you want to install an <emphasis>dependencies</emphasis>. Suppose you want to install
application that depends on a specific library being installed. Both an application that depends on a specific library being
the application and the library have been made available as FreeBSD installed. Both the application and the library have been made
ports and packages. If you use the <command>pkg_add</command> command available as FreeBSD ports and packages. If you use the
or the ports system to add the application, both will notice that the <command>pkg_add</command> command or the ports system to add
library has not been installed, and automatically install the the application, both will notice that the library has not been
library first.</para> installed, and automatically install the library first.</para>
<para>Given that the two technologies are quite similar, you might be <para>Given that the two technologies are quite similar, you might
wondering why FreeBSD bothers with both. Packages and ports both have be wondering why FreeBSD bothers with both. Packages and ports
their own strengths, and which one you use will depend on your own both have their own strengths, and which one you use will depend
preference.</para> on your own preference.</para>
<itemizedlist> <itemizedlist>
<title>Package Benefits</title> <title>Package Benefits</title>
<listitem> <listitem>
<para>A compressed package tarball is typically smaller than the <para>A compressed package tarball is typically smaller than
compressed tarball containing the source code for the application.</para> the compressed tarball containing the source code for the
application.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Packages do not require any additional compilation. For large <para>Packages do not require any additional compilation. For
applications, such as <application>Mozilla</application>, large applications, such as
<application>KDE</application>, or <application>GNOME</application> <application>Mozilla</application>,
this can be important, particularly if you are on a slow system.</para> <application>KDE</application>, or
<application>GNOME</application> this can be important,
particularly if you are on a slow system.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -165,21 +171,22 @@
</listitem> </listitem>
<listitem> <listitem>
<para>Some applications have compile time options relating to what they <para>Some applications have compile time options relating to
can and cannot do. For example, <application>Apache</application> what they can and cannot do. For example,
can be configured with a wide variety of different built-in options. <application>Apache</application> can be configured with a
By building from the port you do not have to accept the default wide variety of different built-in options. By building
options, and can set them yourself.</para> from the port you do not have to accept the default options,
and can set them yourself.</para>
<para>In some cases, multiple packages will exist for the same <para>In some cases, multiple packages will exist for the same
application to specify certain settings. For example, application to specify certain settings. For example,
<application>Ghostscript</application> is available as a <application>Ghostscript</application> is available as a
<filename>ghostscript</filename> package and a <filename>ghostscript</filename> package and a
<filename>ghostscript-nox11</filename> package, depending on whether <filename>ghostscript-nox11</filename> package, depending on
or not you have installed an X11 server. This sort of rough whether or not you have installed an X11 server. This sort
tweaking is possible with packages, but rapidly becomes impossible of rough tweaking is possible with packages, but rapidly
if an application has more than one or two different compile time becomes impossible if an application has more than one or
options.</para> two different compile time options.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -189,9 +196,9 @@
</listitem> </listitem>
<listitem> <listitem>
<para>Some people do not trust binary distributions. At least with <para>Some people do not trust binary distributions. At least
source code, you can (in theory) read through it and look for with source code, you can (in theory) read through it and
potential problems yourself.</para> look for potential problems yourself.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -200,17 +207,18 @@
</listitem> </listitem>
<listitem> <listitem>
<para>Some people like having code around, so they can read it if they <para>Some people like having code around, so they can read it
get bored, hack it, borrow from it (license permitting, of course), if they get bored, hack it, borrow from it (license
and so on.</para> permitting, of course), and so on.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>To keep track of updated ports, subscribe to the <para>To keep track of updated ports, subscribe to the
&a.ports; and the &a.ports-bugs;.</para> &a.ports; and the &a.ports-bugs;.</para>
<para>The remainder of this chapter will explain how to use packages and <para>The remainder of this chapter will explain how to use
ports to install and manage third party software on FreeBSD.</para> packages and ports to install and manage third party software on
FreeBSD.</para>
</sect1> </sect1>
<sect1 id="ports-finding-applications"> <sect1 id="ports-finding-applications">
@ -220,14 +228,14 @@
want, and what the application is called.</para> want, and what the application is called.</para>
<para>FreeBSD's list of available applications is growing all the <para>FreeBSD's list of available applications is growing all the
time. Fortunately, there are a number of ways to time. Fortunately, there are a number of ways to find what you
find what you want:</para> want:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>The FreeBSD web site maintains an up-to-date searchable list of <para>The FreeBSD web site maintains an up-to-date searchable
all the available applications, at list of all the available applications, at <ulink
<ulink url="../../../../ports/index.html">http://www.FreeBSD.org/ports/</ulink>. url="../../../../ports/index.html">http://www.FreeBSD.org/ports/</ulink>.
The ports are divided into categories, and you may either The ports are divided into categories, and you may either
search for an application by name (if you know it), or see search for an application by name (if you know it), or see
all the applications available in a category.</para> all the applications available in a category.</para>
@ -236,21 +244,21 @@
<indexterm><primary>FreshPorts</primary></indexterm> <indexterm><primary>FreshPorts</primary></indexterm>
<listitem> <listitem>
<para>Dan Langille maintains FreshPorts, at <para>Dan Langille maintains FreshPorts, at <ulink
<ulink url="http://www.FreshPorts.org/"></ulink>. url="http://www.FreshPorts.org/"></ulink>. FreshPorts
FreshPorts tracks changes to the applications in the ports tree as tracks changes to the applications in the ports tree as they
they happen, allows you to <quote>watch</quote> one or more happen, allows you to <quote>watch</quote> one or more
ports, and can send you email when they are updated.</para> ports, and can send you email when they are updated.</para>
</listitem> </listitem>
<indexterm><primary>FreshMeat</primary></indexterm> <indexterm><primary>FreshMeat</primary></indexterm>
<listitem> <listitem>
<para>If you do not know the name of the application you want, try <para>If you do not know the name of the application you want,
using a site like FreshMeat try using a site like FreshMeat (<ulink
(<ulink url="http://www.freshmeat.net/"></ulink>) url="http://www.freshmeat.net/"></ulink>) to find an
to find an application, then check back at the FreeBSD site to see application, then check back at the FreeBSD site to see if
if the application has been ported yet.</para> the application has been ported yet.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</sect1> </sect1>
@ -313,43 +321,45 @@ local: lsof-4.56.4.tgz remote: lsof-4.56.4.tgz
<para>If you do not have a source of local packages (such as a <para>If you do not have a source of local packages (such as a
FreeBSD CD-ROM set) then it will probably be easier to use the FreeBSD CD-ROM set) then it will probably be easier to use the
<option>-r</option> option to &man.pkg.add.1;. This will cause the utility to <option>-r</option> option to &man.pkg.add.1;. This will
automatically determine the correct object format and release cause the utility to automatically determine the correct
and then fetch and install the package from an FTP site. object format and release and then fetch and install the
package from an FTP site.
</para> </para>
<indexterm> <indexterm>
<primary><command>pkg_add</command></primary></indexterm> <primary><command>pkg_add</command></primary></indexterm>
<screen>&prompt.root; <userinput>pkg_add -r <replaceable>lsof</replaceable></userinput></screen> <screen>&prompt.root; <userinput>pkg_add -r <replaceable>lsof</replaceable></userinput></screen>
<para>The example above would download the correct package and add <para>The example above would download the correct package and
it without any further user intervention. &man.pkg.add.1; uses add it without any further user intervention. &man.pkg.add.1;
&man.fetch.3; to download the files, which honors various uses &man.fetch.3; to download the files, which honors various
environment variables, including <envar>FTP_PASSIVE_MODE</envar>, environment variables, including
<envar>FTP_PROXY</envar>, and <envar>FTP_PASSWORD</envar>. You <envar>FTP_PASSIVE_MODE</envar>, <envar>FTP_PROXY</envar>, and
may need to set one or more of these if you are behind a firewall, <envar>FTP_PASSWORD</envar>. You may need to set one or more
or need to use an FTP/HTTP proxy. See &man.fetch.3; for the of these if you are behind a firewall, or need to use an
complete list. You can also note that in the example above FTP/HTTP proxy. See &man.fetch.3; for the complete list. You
can also note that in the example above
<literal>lsof</literal> is used instead of <literal>lsof</literal> is used instead of
<literal>lsof-4.56.4</literal>. When the remote fetching <literal>lsof-4.56.4</literal>. When the remote fetching
feature is used, the version number of the package must be feature is used, the version number of the package must be
removed. &man.pkg.add.1; will automatically fetch the latest removed. &man.pkg.add.1; will automatically fetch the latest
version of the application.</para> version of the application.</para>
<para>Package files are distributed in <filename>.tgz</filename> format. You can <para>Package files are distributed in <filename>.tgz</filename>
find them at <ulink format. You can find them at <ulink
url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/packages/"></ulink>, url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/packages/"></ulink>,
or on the FreeBSD CD-ROM distribution. Every CD on the or on the FreeBSD CD-ROM distribution. Every CD on the
FreeBSD 4-CD set (and the PowerPak, etc.) contains packages in FreeBSD 4-CD set (and the PowerPak, etc.) contains packages
the <filename>/packages</filename> directory. The layout of in the <filename>/packages</filename> directory. The layout
the packages is similar to that of the of the packages is similar to that of the
<filename>/usr/ports</filename> tree. Each category has its <filename>/usr/ports</filename> tree. Each category has its
own directory, and every package can be found within the own directory, and every package can be found within the
<filename>All</filename> directory. <filename>All</filename> directory.
</para> </para>
<para>The directory structure of the package system matches <para>The directory structure of the package system matches the
the ports layout; they work with each other to form the entire ports layout; they work with each other to form the entire
package/port system. package/port system.
</para> </para>
@ -386,8 +396,8 @@ docbook =
...</screen> ...</screen>
<para>The symbols in the second column indicate the relative age <para>The symbols in the second column indicate the relative age
of the installed version and the version available in the local of the installed version and the version available in the
ports tree.</para> local ports tree.</para>
<informaltable frame="none"> <informaltable frame="none">
<tgroup cols="2"> <tgroup cols="2">
@ -462,15 +472,16 @@ docbook =
<title>Obtaining the Ports Collection</title> <title>Obtaining the Ports Collection</title>
<para>Before you can install ports, you must first obtain the <para>Before you can install ports, you must first obtain the
ports collection&mdash;which is essentially a set of <filename>Makefiles</filename>, ports collection&mdash;which is essentially a set of
patches, and description files placed in <filename>Makefiles</filename>, patches, and description files
<filename>/usr/ports</filename>. placed in <filename>/usr/ports</filename>.
</para> </para>
<para>When installing your FreeBSD system, <para>When installing your FreeBSD system,
<application>Sysinstall</application> asked if you would like to <application>Sysinstall</application> asked if you would like
install the ports collection. If you chose no, you can follow to install the ports collection. If you chose no, you can
these instructions to obtain the ports collection:</para> follow these instructions to obtain the ports
collection:</para>
<procedure> <procedure>
<title>Sysinstall Method</title> <title>Sysinstall Method</title>
@ -541,7 +552,8 @@ docbook =
mentioned sections.</para> mentioned sections.</para>
<step> <step>
<para>Install the <filename role="package">net/cvsup</filename> port. See <link <para>Install the <filename
role="package">net/cvsup</filename> port. See <link
linkend="cvsup-install">CVSup Installation</link> (<xref linkend="cvsup-install">CVSup Installation</link> (<xref
linkend="cvsup-install">) for more details.</para> linkend="cvsup-install">) for more details.</para>
</step> </step>
@ -572,9 +584,9 @@ docbook =
</step> </step>
<step> <step>
<para>Running this command later will <para>Running this command later will download and apply all
download and apply all the recent changes to your ports the recent changes to your ports collection, except
collection, except actually rebuilding the ports for your own system.</para> actually rebuilding the ports for your own system.</para>
</step> </step>
</procedure> </procedure>
</sect2> </sect2>
@ -586,35 +598,38 @@ docbook =
<primary>ports</primary> <primary>ports</primary>
<secondary>installing</secondary> <secondary>installing</secondary>
</indexterm> </indexterm>
<para>The first thing that should be explained <para>The first thing that should be explained when it comes to
when it comes to the ports collection is what is actually meant the ports collection is what is actually meant by a
by a <quote>skeleton</quote>. In a nutshell, a port skeleton is a <quote>skeleton</quote>. In a nutshell, a port skeleton is a
minimal set of files that tell your FreeBSD system how to minimal set of files that tell your FreeBSD system how to
cleanly compile and install a program. Each port skeleton includes:</para> cleanly compile and install a program. Each port skeleton
includes:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>A <filename>Makefile</filename>. The <para>A <filename>Makefile</filename>. The
<filename>Makefile</filename> contains various statements that <filename>Makefile</filename> contains various statements
specify how the application should be compiled and where it that specify how the application should be compiled and
should be installed on your system.</para> where it should be installed on your system.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>A <filename>distinfo</filename> file. This file contains <para>A <filename>distinfo</filename> file. This file
information about the files that must be downloaded to build the contains information about the files that must be
port and their checksums, to verify that files have not been downloaded to build the port and their checksums, to
corrupted during the download using &man.md5.1;.</para> verify that files have not been corrupted during the
download using &man.md5.1;.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>A <filename>files</filename> directory. This directory <para>A <filename>files</filename> directory. This
contains patches to make the program compile and install on directory contains patches to make the program compile and
your FreeBSD system. Patches are basically small files that install on your FreeBSD system. Patches are basically
specify changes to particular files. They are in plain text small files that specify changes to particular files.
format, and basically say <quote>Remove line 10</quote> or They are in plain text format, and basically say
<quote>Change line 26 to this ...</quote>. Patches are also <quote>Remove line 10</quote> or <quote>Change line 26 to
known as <quote>diffs</quote> because they are generated by the this ...</quote>. Patches are also known as
<quote>diffs</quote> because they are generated by the
&man.diff.1; program.</para> &man.diff.1; program.</para>
<para>This directory may also contain other files used to build <para>This directory may also contain other files used to build
@ -640,10 +655,10 @@ docbook =
url="../porters-handbook/index.html">FreeBSD Porter's url="../porters-handbook/index.html">FreeBSD Porter's
Handbook</ulink>.</para> Handbook</ulink>.</para>
<para>Now that you have enough background information to know what <para>Now that you have enough background information to know
the ports collection is used for, you are ready to install your what the ports collection is used for, you are ready to
first port. There are two ways this can be done, and each is install your first port. There are two ways this can be done,
explained below.</para> and each is explained below.</para>
<para>Before we get into that, however, you will need to choose a <para>Before we get into that, however, you will need to choose a
port to install. There are a few ways to do this, with the port to install. There are a few ways to do this, with the
@ -654,27 +669,30 @@ docbook =
a description so you can read a bit about each port before a description so you can read a bit about each port before
deciding to install it.</para> deciding to install it.</para>
<para>Another method is to use the &man.whereis.1; <para>Another method is to use the &man.whereis.1; command.
command. Simply type <command>whereis <replaceable>file</replaceable></command>, Simply type <command>whereis
where <replaceable>file</replaceable> is the program you want to <replaceable>file</replaceable></command>, where
install. If it is found on <replaceable>file</replaceable> is the program you want to
your system, you will be told where it is, as follows:</para> install. If it is found on your system, you will be told
where it is, as follows:</para>
<screen>&prompt.root; <userinput>whereis lsof</userinput> <screen>&prompt.root; <userinput>whereis lsof</userinput>
lsof: /usr/ports/sysutils/lsof</screen> lsof: /usr/ports/sysutils/lsof</screen>
<para>This tells us that <command>lsof</command> (a system utility) <para>This tells us that <command>lsof</command> (a system
can be found in the utility) can be found in the
<filename>/usr/ports/sysutils/lsof</filename> directory.</para> <filename>/usr/ports/sysutils/lsof</filename>
directory.</para>
<para>Yet another way to find a particular port is by using the <para>Yet another way to find a particular port is by using the
ports collection's built-in search mechanism. To use the search ports collection's built-in search mechanism. To use the
feature, you will need to be in the search feature, you will need to be in the
<filename>/usr/ports</filename> directory. Once in that <filename>/usr/ports</filename> directory. Once in that
directory, run <command>make search name=<replaceable>program-name</replaceable></command> directory, run <command>make search
where <replaceable>program-name</replaceable> is the name of the program you name=<replaceable>program-name</replaceable></command> where
want to find. For example, if you were looking for <replaceable>program-name</replaceable> is the name of the
<command>lsof</command>:</para> program you want to find. For example, if you were looking
for <command>lsof</command>:</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make search name=lsof</userinput> &prompt.root; <userinput>make search name=lsof</userinput>
@ -686,18 +704,19 @@ Index: sysutils
B-deps: B-deps:
R-deps: </screen> R-deps: </screen>
<para>The part of the output you want to pay particular attention <para>The part of the output you want to pay particular
to is the <quote>Path:</quote> line, since that tells you where to attention to is the <quote>Path:</quote> line, since that
find the port. The other information provided is not needed in order tells you where to find the port. The other information
to install the port, so it will not be covered provided is not needed in order to install the port, so it
here.</para> will not be covered here.</para>
<para>For more in-depth searching you can also use <para>For more in-depth searching you can also use <command>make
<command>make search key=<replaceable>string</replaceable></command> where search key=<replaceable>string</replaceable></command> where
<replaceable>string</replaceable> is some text to search for. This searches <replaceable>string</replaceable> is some text to search for.
port names, comments, descriptions and dependencies and can be used This searches port names, comments, descriptions and
to find ports which relate to a particular subject if you don't dependencies and can be used to find ports which relate to a
know the name of the program you are looking for.</para> particular subject if you don't know the name of the program
you are looking for.</para>
<para>In both of these cases, the search string is case-insensitive. <para>In both of these cases, the search string is case-insensitive.
Searching for <quote>LSOF</quote> will yield the same results as Searching for <quote>LSOF</quote> will yield the same results as
@ -804,26 +823,27 @@ R-deps: </screen>
</note> </note>
<note> <note>
<para>Some shells keep a cache of the commands that are available in <para>Some shells keep a cache of the commands that are
the directories listed in the <envar>PATH</envar> environment available in the directories listed in the
variable, to speed up lookup operations for the executable file of <envar>PATH</envar> environment variable, to speed up
these commands. If you are using one of these shells, you might lookup operations for the executable file of these
have to use the <command>rehash</command> command after installing commands. If you are using one of these shells, you might
a port, before the newly installed commands can be used. This is have to use the <command>rehash</command> command after
true for both shells that are part of the base-system (such as installing a port, before the newly installed commands can
<command>tcsh</command>) and shells that are available as ports be used. This is true for both shells that are part of
(for instance, the base-system (such as <command>tcsh</command>) and
shells that are available as ports (for instance,
<filename role="package">shells/zsh</filename>).</para> <filename role="package">shells/zsh</filename>).</para>
</note> </note>
<note> <note>
<para>Please be aware that the licenses of a few ports do not <para>Please be aware that the licenses of a few ports do
allow for inclusion on the CD-ROM. This could be because a not allow for inclusion on the CD-ROM. This could be
registration form needs because a registration form needs to be filled out before
to be filled out before downloading or redistribution is not downloading or redistribution is not allowed, or for
allowed, or for another reason. If you wish to install a port not another reason. If you wish to install a port not
included on the CD-ROM, you will need to be online in order to included on the CD-ROM, you will need to be online in
do so (see the <link linkend="ports-inet">next order to do so (see the <link linkend="ports-inet">next
section</link>).</para> section</link>).</para>
</note> </note>
</sect3> </sect3>
@ -831,16 +851,18 @@ R-deps: </screen>
<sect3 id="ports-inet"> <sect3 id="ports-inet">
<title>Installing Ports from the Internet</title> <title>Installing Ports from the Internet</title>
<para>As with the last section, this section makes an assumption <para>As with the last section, this section makes an
that you have a working Internet connection. If you do not, assumption that you have a working Internet connection. If
you will need to perform the <link linkend="ports-cd">CD-ROM you do not, you will need to perform the <link
installation</link>, or put a copy of the distfile into <filename>/usr/ports/distfiles</filename> manually.</para> linkend="ports-cd">CD-ROM installation</link>, or put a copy
of the distfile into
<filename>/usr/ports/distfiles</filename> manually.</para>
<para>Installing a port from the Internet is done exactly the same <para>Installing a port from the Internet is done exactly the
way as it would be if you were installing from a CD-ROM. The same way as it would be if you were installing from a
only difference between the two is that the distfile CD-ROM. The only difference between the two is that the
is downloaded from the Internet instead of read from the distfile is downloaded from the Internet instead of read
CD-ROM.</para> from the CD-ROM.</para>
<para>The steps involved are identical:</para> <para>The steps involved are identical:</para>
@ -879,86 +901,100 @@ Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
<para>As you can see, the only difference is the line that tells <para>As you can see, the only difference is the line that tells
you where the system is fetching the port distfile from.</para> you where the system is fetching the port distfile from.</para>
<para>The ports system uses &man.fetch.1; to download the files, <para>The ports system uses &man.fetch.1; to download the
which honors various environment variables, including files, which honors various environment variables, including
<envar>FTP_PASSIVE_MODE</envar>, <envar>FTP_PROXY</envar>, <envar>FTP_PASSIVE_MODE</envar>, <envar>FTP_PROXY</envar>,
and <envar>FTP_PASSWORD</envar>. You may need to set one or more and <envar>FTP_PASSWORD</envar>. You may need to set one or
of these if you are behind a firewall, or need to use an FTP/HTTP more of these if you are behind a firewall, or need to use
proxy. See &man.fetch.3; for the complete list.</para> an FTP/HTTP proxy. See &man.fetch.3; for the complete
list.</para>
<para>For users which cannot be connected all the time, a the <para>For users which cannot be connected all the time, a the
<command>make <makevar>fetch</makevar></command> option is provided. <command>make <makevar>fetch</makevar></command> option is
Just run this command at the top level directory provided. Just run this command at the top level directory
(<filename>/usr/ports</filename>) and the required files will be (<filename>/usr/ports</filename>) and the required files
downloaded for you. This command will also work in the lower level will be downloaded for you. This command will also work in
categories, for example: <filename>/usr/ports/net</filename>.</para> the lower level categories, for example:
<filename>/usr/ports/net</filename>.</para>
<note><para>You can build all the ports in a category or as a whole by <note><para>You can build all the ports in a category or as a
running <command>make</command> in the top level directory, just like the whole by running <command>make</command> in the top level
aforementioned <command>make <makevar>fetch</makevar></command> method. directory, just like the aforementioned <command>make
This is dangerous, however, as some ports cannot co-exist. In other <makevar>fetch</makevar></command> method. This is
cases, some ports can install two different files with the same dangerous, however, as some ports cannot co-exist. In other
filename.</para></note> cases, some ports can install two different files with the
same filename.</para></note>
<para>In some rare cases, users may need to acquire the tarballs <para>In some rare cases, users may need to acquire the
from a site other than the <makevar>MASTER_SITES</makevar> (the location tarballs from a site other than the
where files are downloaded from). You can override the <makevar>MASTER_SITES</makevar> (the location where files
<makevar>MASTER_SITES</makevar> option with the following command:</para> are downloaded from). You can override the
<makevar>MASTER_SITES</makevar> option with the following
command:</para>
<screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput></screen> <screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput></screen>
<screen>&prompt.root; <userinput>make MASTER_SITE_OVERRIDE= \ <screen>&prompt.root; <userinput>make MASTER_SITE_OVERRIDE= \
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen> ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
<para>In this example we change the <makevar>MASTER_SITES</makevar> option to <para>In this example we change the
<hostid role="fqdn">ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/</hostid>.</para> <makevar>MASTER_SITES</makevar> option to <hostid
role="fqdn">ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/</hostid>.</para>
<note><para>Some ports require you to provide build options which can enable/disable <note><para>Some ports require you to provide build options
parts of the application which are unneeded, certain security options, which can enable/disable parts of the application which are
and other customizations. A few which come to mind are unneeded, certain security options, and other
<filename role="package">net/mozilla</filename>, customizations. A few which come to mind are <filename
<filename role="package">security/gpgme</filename>, and role="package">net/mozilla</filename>, <filename
<filename role="package">mail/sylpheed-claws</filename>. A message will be role="package">security/gpgme</filename>, and <filename
displayed when options such as these are available.</para></note> role="package">mail/sylpheed-claws</filename>. A message
will be displayed when options such as these are
available.</para></note>
</sect3> </sect3>
<sect3> <sect3>
<title>Overriding the Default Ports Directories</title> <title>Overriding the Default Ports Directories</title>
<para>Sometimes it is useful (or mandatory) to use a different distfiles <para>Sometimes it is useful (or mandatory) to use a different
and ports directory. The <makevar>PORTSDIR</makevar> and distfiles and ports directory. The
<makevar>PREFIX</makevar> variables can override the default <makevar>PORTSDIR</makevar> and <makevar>PREFIX</makevar>
directories. For example:</para> variables can override the default directories. For
example:</para>
<screen>&prompt.root; <userinput>make PORTSDIR=/usr/home/example/ports install</userinput></screen> <screen>&prompt.root; <userinput>make PORTSDIR=/usr/home/example/ports install</userinput></screen>
<para>will compile the port in <filename>/usr/home/example/ports</filename> and <para>will compile the port in
install everything under <filename>/usr/local</filename>.</para> <filename>/usr/home/example/ports</filename> and install
everything under <filename>/usr/local</filename>.</para>
<screen>&prompt.root; <userinput>make PREFIX=/usr/home/example/local install</userinput></screen> <screen>&prompt.root; <userinput>make PREFIX=/usr/home/example/local install</userinput></screen>
<para>will compile it in <filename>/usr/ports</filename> and install it in <para>will compile it in <filename>/usr/ports</filename> and
install it in
<filename>/usr/home/example/local</filename>.</para> <filename>/usr/home/example/local</filename>.</para>
<para>And of course,</para> <para>And of course,</para>
<screen>&prompt.root; <userinput>make PORTSDIR=../ports PREFIX=../local install</userinput></screen> <screen>&prompt.root; <userinput>make PORTSDIR=../ports PREFIX=../local install</userinput></screen>
<para>will combine the two (it is too long to completely write on <para>will combine the two (it is too long to completely write
this page, but it should give you the general idea).</para> on this page, but it should give you the general
idea).</para>
<para>Alternatively, these variables can also be set <para>Alternatively, these variables can also be set as part
as part of your environment. Read the manual page for your shell for of your environment. Read the manual page for your shell
instructions on doing so.</para> for instructions on doing so.</para>
</sect3> </sect3>
<sect3> <sect3>
<title>Dealing with <command>imake</command></title> <title>Dealing with <command>imake</command></title>
<para>Some ports that use <command>imake</command> (a part of the X Windows <para>Some ports that use <command>imake</command> (a part of
System) do not work well with <makevar>PREFIX</makevar>, and will insist on the X Windows System) do not work well with
installing under <filename>/usr/X11R6</filename>. Similarly, some Perl ports <makevar>PREFIX</makevar>, and will insist on installing
ignore <makevar>PREFIX</makevar> and install in the Perl tree. Making these under <filename>/usr/X11R6</filename>. Similarly, some Perl
ports respect <makevar>PREFIX</makevar> is a difficult or impossible ports ignore <makevar>PREFIX</makevar> and install in the
Perl tree. Making these ports respect
<makevar>PREFIX</makevar> is a difficult or impossible
job.</para> job.</para>
</sect3> </sect3>
@ -1008,12 +1044,13 @@ Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
<primary>ports</primary> <primary>ports</primary>
<secondary>disk-space</secondary> <secondary>disk-space</secondary>
</indexterm> </indexterm>
<para>Using the ports collection can defiantly eat up your disk space. <para>Using the ports collection can defiantly eat up your disk
For this reason you should always remember to clean up the work space. For this reason you should always remember to clean up
directories using the <command>make <makevar>clean</makevar></command> the work directories using the <command>make
option. This will remove the <filename>work</filename> directory after <makevar>clean</makevar></command> option. This will remove
a port has been built, and installed. You can also remove the tar files the <filename>work</filename> directory after a port has been
from the <filename>distfiles</filename> directory, and remove the built, and installed. You can also remove the tar files from
the <filename>distfiles</filename> directory, and remove the
installed ports when their use has delimited.</para> installed ports when their use has delimited.</para>
<para>Some users choose to limit the port categories by placing an entry <para>Some users choose to limit the port categories by placing an entry
@ -1029,41 +1066,45 @@ Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
<primary>ports</primary> <primary>ports</primary>
<secondary>upgrading</secondary> <secondary>upgrading</secondary>
</indexterm> </indexterm>
<para>Keeping your ports up to date can be a tedious job. For instance, <para>Keeping your ports up to date can be a tedious job. For
to upgrade a port you would go to the ports directory, build the port, instance, to upgrade a port you would go to the ports
deinstall the old port, install the new port, and then cleaning up directory, build the port, deinstall the old port, install the
after the build. Imagine doing that for five ports, tedious right? new port, and then cleaning up after the build. Imagine doing
This was a large problem for system administrators to deal with, that for five ports, tedious right? This was a large problem
and now we have utilities which do this for us. For instance the for system administrators to deal with, and now we have
<filename role="port">sysutils/portupgrade</filename> utility will utilities which do this for us. For instance the <filename
do everything for you! Just install it like you would any other role="port">sysutils/portupgrade</filename> utility will do
port, using the <command>make <makevar>install clean</makevar></command> everything for you! Just install it like you would any other
command.</para> port, using the <command>make <makevar>install
clean</makevar></command> command.</para>
<para>Now create a database with the <command>pkgdb -F</command> command. <para>Now create a database with the <command>pkgdb -F</command>
This will read the list of installed ports and create a database file command. This will read the list of installed ports and
in the <filename>/var/db/pkg</filename> directory. Now when you run create a database file in the <filename>/var/db/pkg</filename>
<command>portupgrade -a</command>, it will read this and the ports directory. Now when you run <command>portupgrade
<filename>INDEX</filename> file. Finally, <command>portupgrade</command> -a</command>, it will read this and the ports
will begin to download, build, backup, install, and clean the ports <filename>INDEX</filename> file. Finally,
which have been updated. Other utilities exist which will do this, <command>portupgrade</command> will begin to download, build,
check out the <filename>ports/sysutils</filename> directory and see backup, install, and clean the ports which have been updated.
what you come up with.</para> Other utilities exist which will do this, check out the
<filename>ports/sysutils</filename> directory and see what you
come up with.</para>
</sect2> </sect2>
</sect1> </sect1>
<sect1 id="ports-nextsteps"> <sect1 id="ports-nextsteps">
<title>Post-installation activities</title> <title>Post-installation activities</title>
<para>After installing a new application you will normally want to read <para>After installing a new application you will normally want to
any documentation it may have included, edit any configuration files read any documentation it may have included, edit any
that are required, ensure that the application starts at boot time (if configuration files that are required, ensure that the
it is a daemon), and so on.</para> application starts at boot time (if it is a daemon), and so
on.</para>
<para>The exact steps you need to take to configure each application will <para>The exact steps you need to take to configure each
obviously be different. However, if you have just installed a new application will obviously be different. However, if you have
application and are wondering <quote>What now?</quote> these tips might just installed a new application and are wondering <quote>What
help:</para> now?</quote> these tips might help:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
@ -1073,35 +1114,36 @@ Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
<screen>&prompt.root; <userinput>pkg_info -L foopackage-1.0.0 | less</userinput></screen> <screen>&prompt.root; <userinput>pkg_info -L foopackage-1.0.0 | less</userinput></screen>
<para>will show all the files installed by the package. Pay special <para>will show all the files installed by the package. Pay
attention to files in <filename>man/</filename> directories, which special attention to files in <filename>man/</filename>
will be manual pages, <filename>etc/</filename> directories, which directories, which will be manual pages,
will be configuration files, and <filename>doc/</filename>, which will be <filename>etc/</filename> directories, which will be
more comprehensive documentation.</para> configuration files, and <filename>doc/</filename>, which
will be more comprehensive documentation.</para>
<para>If you are not sure which version of the application was just <para>If you are not sure which version of the application was
installed, a command like this</para> just installed, a command like this</para>
<screen>&prompt.root; <userinput>pkg_info | grep <replaceable>foopackage</replaceable></userinput></screen> <screen>&prompt.root; <userinput>pkg_info | grep <replaceable>foopackage</replaceable></userinput></screen>
<para>will find all the installed packages that have <para>will find all the installed packages that have
<replaceable>foopackage</replaceable> in the package name. Replace <replaceable>foopackage</replaceable> in the package name.
<replaceable>foopackage</replaceable> in your command line as Replace <replaceable>foopackage</replaceable> in your
necessary.</para> command line as necessary.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Once you have identified where the application's manual pages <para>Once you have identified where the application's manual
have been installed, review them using &man.man.1;. Similarly, pages have been installed, review them using &man.man.1;.
look over the sample configuration files, and any additional Similarly, look over the sample configuration files, and any
documentation that may have been provided.</para> additional documentation that may have been provided.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>If the application has a web site, check it for additional <para>If the application has a web site, check it for
documentation, frequently asked questions, and so forth. If additional documentation, frequently asked questions, and so
you are not sure of the web site address it may be listed in the forth. If you are not sure of the web site address it may
output from</para> be listed in the output from</para>
<screen>&prompt.root; <userinput>pkg_info <replaceable>foopackage-1.0.0</replaceable></userinput></screen> <screen>&prompt.root; <userinput>pkg_info <replaceable>foopackage-1.0.0</replaceable></userinput></screen>
@ -1114,8 +1156,8 @@ Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
<sect1 id="ports-broken"> <sect1 id="ports-broken">
<title>Dealing with Broken Ports</title> <title>Dealing with Broken Ports</title>
<para>If you come across a port that does not work for you, there are <para>If you come across a port that does not work for you,
a few things you can do, including:</para> there are a few things you can do, including:</para>
<orderedlist> <orderedlist>
<listitem> <listitem>
@ -1128,15 +1170,16 @@ Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
<listitem> <listitem>
<para>Gripe&mdash;<emphasis>by email only</emphasis>! Send <para>Gripe&mdash;<emphasis>by email only</emphasis>! Send
email to the maintainer of the port first. Type <command>make email to the maintainer of the port first. Type
maintainer</command> or read the <filename>Makefile</filename> <command>make maintainer</command> or read the
to find the maintainer's email address. Remember to include <filename>Makefile</filename> to find the maintainer's
the name and version of the port (send the email address. Remember to include the name and version
<literal>&dollar;FreeBSD:</literal> line from the of the port (send the <literal>&dollar;FreeBSD:</literal>
<filename>Makefile</filename>) and the output leading up to the line from the <filename>Makefile</filename>) and the
error when you email the maintainer. If you do not get a output leading up to the error when you email the
response from the maintainer, you can use maintainer. If you do not get a response from the
&man.send-pr.1; to submit a bug report.</para> maintainer, you can use &man.send-pr.1; to submit a bug
report.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -1147,8 +1190,8 @@ Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
directory</ulink>, but be sure to check your local mirror directory</ulink>, but be sure to check your local mirror
<emphasis>first</emphasis>! These are more likely to work <emphasis>first</emphasis>! These are more likely to work
than trying to compile from source and are a lot faster as than trying to compile from source and are a lot faster as
well. Use the &man.pkg.add.1; program to install the package well. Use the &man.pkg.add.1; program to install the
on your system.</para> package on your system.</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</sect1> </sect1>