Replaced xchat example in ports/packages with lsof. Much shorter, wraps

properly in printed form.

Some grammar/markup changes.

Reviewed by:	murray
This commit is contained in:
Chern Lee 2001-07-25 20:12:59 +00:00
parent 4b67ca0600
commit 2f70b18746
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=10051

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/ports/chapter.sgml,v 1.129 2001/07/20 23:24:57 chern Exp $
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/ports/chapter.sgml,v 1.130 2001/07/21 19:26:13 jdp Exp $
-->
<chapter id="ports">
@ -67,8 +67,8 @@
is a single file which you must download. The package contains
pre-compiled copies of all the commands for the application, as well as
any configuration files or documentation. A downloaded package file can
be manipulated with FreeBSD <literal>pkg_*</literal> commands, such as
&man.pkg.add.1; &man.pkg.delete.1;, &man.pkg.info.1;, and so on.</para>
be manipulated 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
command.</para>
@ -86,8 +86,8 @@
for you.</para>
<para>In fact, the ports system can also be used to generate packages
which can later be manipulated with the <literal>pkg_*</literal>
commands.</para>
which can later be manipulated with the <command>pkg_add</command>
and friends commands.</para>
<para>Both packages and ports understand
<emphasis>dependencies</emphasis>. Suppose you want to install an
@ -119,7 +119,7 @@
</listitem>
<listitem>
<para>Packages do not require you to understand any of the process
<para>Packages do not require you to understand the process
involved in compiling software on FreeBSD.</para>
</listitem>
</itemizedlist>
@ -176,8 +176,9 @@
</listitem>
</itemizedlist>
<para>To keep track of updated ports, subscribe to
<emphasis>freebsd-ports</emphasis>.</para>
<para>To keep track of updated ports, subscribe to the
<email>freebsd-ports@freebsd.org</email> mailing list.</para>
<para>The remainder of this chapter will explain how to use packages and
ports to install and manage third party software on FreeBSD.</para>
</sect1>
@ -203,6 +204,8 @@
all the applications available in a category.</para>
</listitem>
<indexterm><primary>FreshPorts</primary></indexterm>
<listitem>
<para>Dan Langille maintains FreshPorts, at
<ulink url="http://www.freshports.org/">http://www.freshports.org/</ulink>.
@ -211,6 +214,8 @@
ports, and will send you an e-mail when they are updated.</para>
</listitem>
<indexterm><primary>FreshMeat</primary></indexterm>
<listitem>
<para>If you do not know the name of the application you want, try
using a site like FreshMeat
@ -254,7 +259,7 @@
<example>
<title>Downloading a package and then installing it locally</title>
<screen>&prompt.root; <userinput>ftp <replaceable>ftp2.freebsd.org</replaceable></userinput>
<screen>&prompt.root; <userinput>ftp -a <replaceable>ftp2.freebsd.org</replaceable></userinput>
Connected to ftp2.freebsd.org.
220 ftp2.freebsd.org FTP server (Version 6.00LS) ready.
331 Guest login ok, send your email address as password.
@ -266,17 +271,17 @@ Connected to ftp2.freebsd.org.
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
<prompt>ftp></prompt> <userinput>cd /pub/FreeBSD/ports/packages/irc</userinput>
<prompt>ftp></prompt> <userinput>cd /pub/FreeBSD/ports/packages/sysutils/</userinput>
250 CWD command successful.
<prompt>ftp></prompt> <userinput>get xchat-1.7.1.tgz</userinput>
local: xchat-1.7.1.tgz remote: xchat-1.7.1.tgz
150 Opening BINARY mode data connection for 'xchat-1.7.1.tgz' (471488 bytes).
100% |**************************************************| 460 KB 00:00 ETA
<prompt>ftp></prompt> <userinput>get lsof-4.56.4.tgz</userinput>
local: lsof-4.56.4.tgz remote: lsof-4.56.4.tgz
200 PORT command successful.
150 Opening BINARY mode data connection for 'lsof-4.56.4.tgz' (92375 bytes).
100% |**************************************************| 92375 00:00 ETA
226 Transfer complete.
471488 bytes received in 5.37 seconds (85.70 KB/s)
92375 bytes received in 5.60 seconds (16.11 KB/s)
<prompt>ftp></prompt> <userinput>exit</userinput>
&prompt.root; <userinput>pkg_add <replaceable>xchat-1.7.1.tgz</replaceable></userinput>
&prompt.root;</screen>
&prompt.root; <userinput>pkg_add <replaceable>lsof-4.56.4.tgz</replaceable></userinput></screen>
</example>
<para>If you don't have a source of local packages (such as a
@ -288,7 +293,7 @@ local: xchat-1.7.1.tgz remote: xchat-1.7.1.tgz
<indexterm>
<primary><command>pkg_add</command></primary></indexterm>
<screen>&prompt.root; <userinput>pkg_add -r <replaceable>xchat-1.7.1</replaceable></userinput></screen>
<screen>&prompt.root; <userinput>pkg_add -r <replaceable>lsof-4.56.4</replaceable></userinput></screen>
<para>This would download the correct package and add it without
any further user intervention.</para>
@ -315,7 +320,6 @@ local: xchat-1.7.1.tgz remote: xchat-1.7.1.tgz
<sect2>
<title>Deleting a Package</title>
<screen>&prompt.root <userinput>pkg_delete <replaceable>xchat-1.7.1</replaceable></userinput></screen>
<indexterm>
<primary><command>pkg_delete</command></primary>
</indexterm>
@ -323,9 +327,11 @@ local: xchat-1.7.1.tgz remote: xchat-1.7.1.tgz
<primary>packages</primary>
<secondary>deleting</secondary>
</indexterm>
<para>&man.pkg.delete.1; is the utility for removing
previously installed software package distributions.
<para>To remove a previously installed software package, use the
&man.pkg.delete.1; utility.
</para>
<screen>&prompt.root <userinput>pkg_delete <replaceable>xchat-1.7.1</replaceable></userinput></screen>
</sect2>
<sect2>
@ -397,9 +403,6 @@ docbook =
<sect2>
<title>Miscellaneous</title>
<para>&man.pkg.add.1; &man.pkg.delete.1; &man.pkg.info.1;
&man.pkg.version.1; &man.pkg.create.1;
</para>
<para>All package information is stored within the
<filename>/var/db/pkg</filename> directory. The listing
of contents and descriptions of each package can be found within
@ -494,12 +497,12 @@ docbook =
install&gt;</command></quote> at the prompt, and if it is found on
your system, you will be told where it is, like so:</para>
<screen>&prompt.root; <userinput>whereis xchat</userinput>
xchat: /usr/ports/irc/xchat</screen>
<screen>&prompt.root; <userinput>whereis lsof</userinput>
lsof: /usr/ports/sysutils/lsof</screen>
<para>This tells us that <command>xchat</command> (an irc client)
<para>This tells us that <command>lsof</command> (a system utility)
can be found in the
<filename>/usr/ports/irc/xchat</filename> directory.</para>
<filename>/usr/ports/sysutils/lsof</filename> directory.</para>
<para>Yet another way of finding a particular port is by using the
Ports collection's built-in search mechanism. To use the search
@ -508,19 +511,17 @@ xchat: /usr/ports/irc/xchat</screen>
directory, run <command>make search key=program-name</command>
where <quote>program-name</quote> is the name of the program you
want to find. For example, if you were looking for
<command>xchat</command>:</para>
<command>lsof</command>:</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make search key=xchat</userinput>
Port: xchat-1.3.8
Path: /usr/ports/irc/xchat
Info: An X11 IRC client using the GTK+ toolkit, and optionally, GNOME
Maint: jim@FreeBSD.org
Index: irc
B-deps: XFree86-3.3.5 bzip2-0.9.5d gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gmake-3.77 gtk-1.2.6
imlib-1.9.8 jpeg-6b png-1.0.3 tiff-3.5.1
R-deps: XFree86-3.3.5 gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gtk-1.2.6 imlib-1.9.8 jpeg-6b
png-1.0.3 tiff-3.5.1</screen>
&prompt.root; <userinput>make search key=lsof</userinput>
Port: lsof-4.56.4
Path: /usr/ports/sysutils/lsof
Info: Lists information about open files (similar to fstat(1))
Maint: obrien@FreeBSD.org
Index: sysutils
B-deps:
R-deps: </screen>
<para>The part of the output you want to pay particular attention
to is the <quote>Path:</quote> line, since that tells you where to
@ -551,12 +552,12 @@ R-deps: XFree86-3.3.5 gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gtk-1.2.6 imlib-1.
<para>Assuming that your FreeBSD CDROM is in the drive and is
mounted on <filename>/cdrom</filename> (and the mount point
<emphasis>must</emphasis> be <filename>/cdrom</filename>),
you are ready to install the port. To begin, change directories
you are ready to install the port. To begin, change
to the directory where the port you want to install lives:</para>
<screen>&prompt.root; <userinput>cd /usr/ports/irc/xchat</userinput></screen>
<screen>&prompt.root; <userinput>cd /usr/ports/sysutils/lsof</userinput></screen>
<para>Once inside the <filename>xchat</filename> directory,
<para>Once inside the <filename>lsof</filename> directory,
you will see the port
skeleton. The next step is to compile (also called build) the
port. This is done by simply typing <command>make</command> at
@ -564,22 +565,20 @@ R-deps: XFree86-3.3.5 gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gtk-1.2.6 imlib-1.
like this:</para>
<screen>&prompt.root; <userinput>make</userinput>
&gt;&gt; xchat-1.3.8.tar.bz2 doesn't seem to exist on this system.
&gt;&gt; lsof_4.57D.freebsd.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
&gt;&gt; Attempting to fetch from file:/cdrom/ports/distfiles/.
===&gt; Extracting for xchat-1.3.8
&gt;&gt; Checksum OK for xchat-1.3.8.tar.bz2.
===&gt; xchat-1.3.8 depends on executable: bzip2 - found
===&gt; xchat-1.3.8 depends on executable: gmake - found
===&gt; xchat-1.3.8 depends on shared library: gtk12.2 - found
===&gt; xchat-1.3.8 depends on shared library: Imlib.5 - found
===&gt; xchat-1.3.8 depends on shared library: X11.6 - found
===&gt; Patching for xchat-1.3.8
===&gt; Applying FreeBSD patches for xchat-1.3.8
===&gt; Configuring for xchat-1.3.8
===&gt; Extracting for lsof-4.57
...
[extraction output snipped]
...
&gt;&gt; Checksum OK for lsof_4.57D.freebsd.tar.gz.
===&gt; Patching for lsof-4.57
===&gt; Applying FreeBSD patches for lsof-4.57
===&gt; Configuring for lsof-4.57
...
[configure output snipped]
...
===&gt; Building for xchat-1.3.8
===&gt; Building for lsof-4.57
...
[compilation snipped]
...
@ -592,26 +591,31 @@ R-deps: XFree86-3.3.5 gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gtk-1.2.6 imlib-1.
<command>install</command>:</para>
<screen>&prompt.root; <userinput>make install</userinput>
===&gt; Installing for xchat-1.3.8
===&gt; xchat-1.3.8 depends on shared library: gtk12.2 - found
===&gt; xchat-1.3.8 depends on shared library: Imlib.5 - found
===&gt; xchat-1.3.8 depends on shared library: X11.6 - found
===&gt; Installing for lsof-4.57
...
[install routines snipped]
...
===&gt; Generating temporary packing list
===&gt; Installing xchat docs in /usr/X11R6/share/doc/xchat
===&gt; Registering installation for xchat-1.3.8
===&gt; Compressing manual pages for lsof-4.57
===&gt; Registering installation for lsof-4.57
===&gt; SECURITY NOTE:
This port has installed the following binaries which execute with
increased privileges.
&prompt.root;</screen>
<para>Once you are returned to your prompt, you should be able to
run the application you just installed.</para>
run the application you just installed. Since
<command>lsof</command> is a
program that runs with increased privileges, a security
warning is shown. During the building and installation of
ports, you should take heed of any other warnings that
may appear.</para>
<note>
<para>You can save an extra step by just running <command>make
install</command> instead of <command>make</command> and
<command>make install</command> as two separate steps.</para>
</note>
</note>
<note>
<para>Please be aware that the licenses of a few ports do not
@ -622,7 +626,7 @@ R-deps: XFree86-3.3.5 gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gtk-1.2.6 imlib-1.
included on the CDROM, you will need to be online in order to
do so (see the <link linkend="ports-inet">next
section</link>).</para>
</note>
</note>
</sect3>
<sect3 id="ports-inet">
@ -642,37 +646,35 @@ R-deps: XFree86-3.3.5 gettext-0.10.35 giflib-4.1.0 glib-1.2.6 gtk-1.2.6 imlib-1.
<para>The steps involved are identical:</para>
<screen>&prompt.root; <userinput>make install</userinput>
&gt;&gt; xchat-1.3.8.tar.bz2 doesn't seem to exist on this system.
&gt;&gt; Attempting to fetch from http://xchat.org/files/v1.3/.
Receiving xchat-1.3.8.tar.bz2 (305543 bytes): 100%
305543 bytes transferred in 2.9 seconds (102.81 Kbytes/s)
===&gt; Extracting for xchat-1.3.8
&gt;&gt; Checksum OK for xchat-1.3.8.tar.bz2.
===&gt; xchat-1.3.8 depends on executable: bzip2 - found
===&gt; xchat-1.3.8 depends on executable: gmake - found
===&gt; xchat-1.3.8 depends on shared library: gtk12.2 - found
===&gt; xchat-1.3.8 depends on shared library: Imlib.5 - found
===&gt; xchat-1.3.8 depends on shared library: X11.6 - found
===&gt; Patching for xchat-1.3.8
===&gt; Applying FreeBSD patches for xchat-1.3.8
===&gt; Configuring for xchat-1.3.8
&gt;&gt; lsof_4.57D.freebsd.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
&gt;&gt; Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100%
439860 bytes transferred in 18.0 seconds (23.90 kBps)
===&gt; Extracting for lsof-4.57
...
[extraction output snipped]
...
&gt;&gt; Checksum OK for lsof_4.57D.freebsd.tar.gz.
===&gt; Patching for lsof-4.57
===&gt; Applying FreeBSD patches for lsof-4.57
===&gt; Configuring for lsof-4.57
...
[configure output snipped]
...
===&gt; Building for xchat-1.3.8
===&gt; Building for lsof-4.57
...
[compilation snipped]
...
===&gt; Installing for xchat-1.3.8
===&gt; xchat-1.3.8 depends on shared library: gtk12.2 - found
===&gt; xchat-1.3.8 depends on shared library: Imlib.5 - found
===&gt; xchat-1.3.8 depends on shared library: X11.6 - found
===&gt; Installing for lsof-4.57
...
[install routines snipped]
...
===&gt; Generating temporary packing list
===&gt; Installing xchat docs in /usr/X11R6/share/doc/xchat
===&gt; Registering installation for xchat-1.3.8
===&gt; Compressing manual pages for lsof-4.57
===&gt; Registering installation for lsof-4.57
===&gt; SECURITY NOTE:
This port has installed the following binaries which execute with
increased privileges.
&prompt.root;</screen>
<para>As you can see, the only difference is the line that tells
@ -697,26 +699,24 @@ Receiving xchat-1.3.8.tar.bz2 (305543 bytes): 100%
few paragraphs will cover just that.</para>
<para>Now we will remove our previous example (which was
<command>xchat</command> for
<command>lsof</command> for
those of you not paying attention). As with installing ports,
the first thing you must do is change to the port directory,
which if you remember was
<filename>/usr/ports/irc/xchat</filename>. After you change
directories, you are ready to uninstall <command>xchat</command>.
<filename>/usr/ports/irc/lsof</filename>. After you change
directories, you are ready to uninstall <command>lsof</command>.
This is done with
the <command>make deinstall</command> command (makes sense
right?):</para>
the <command>make deinstall</command> command:</para>
<screen>&prompt.root; <userinput>cd /usr/ports/irc/xchat</userinput>
<screen>&prompt.root; <userinput>cd /usr/ports/irc/lsof</userinput>
&prompt.root; <userinput>make deinstall</userinput>
===&gt; Deinstalling for xchat-1.3.8
&prompt.root;</screen>
===&gt; Deinstalling for lsof-4.57</screen>
<para>That was easy enough. You have now managed to remove
<command>xchat</command>
<command>lsof</command>
from your system. If you would like to reinstall it, you can do
so by running <command>make reinstall</command> from the
<filename>/usr/ports/irc/xchat</filename> directory.</para>
<filename>/usr/ports/irc/lsof</filename> directory.</para>
</sect2>
</sect1>
@ -783,9 +783,10 @@ Receiving xchat-1.3.8.tar.bz2 (305543 bytes): 100%
<command>tar</command>), but it is a widely used way of
distributing program source code around the Internet.</para>
<para>You can see what files are in them, or even extract them
yourself by using the standard Unix tar program, which comes
with the base FreeBSD system, like this:</para>
<para>You can see what files are in them, or even extract
them yourself by using the standard Unix
<command>tar</command> program, which comes with the base
FreeBSD system, like this:</para>
<screen>&prompt.user; <userinput>tar tvzf foobar.tar.gz</userinput>
&prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput>
@ -892,6 +893,8 @@ Receiving xchat-1.3.8.tar.bz2 (305543 bytes): 100%
<para>will combine the two (it is too long to write fully on
the page, but it should give you the general idea).</para>
<indexterm><primary>imake</primary></indexterm>
<para>Some ports that use &man.imake.1; (a part of the X Windows
System) don't work well with <makevar>PREFIX</makevar>, and will insist on
installing under <filename>/usr/X11R6</filename>. Similarly, some Perl ports
@ -1074,11 +1077,11 @@ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
</question>
<answer>
<para>No problem, just do:</para>
<para>No problem, just type:</para>
<screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen>
<para>Alternatively, you can do:</para>
<para>Alternatively, you can type:</para>
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput>
&prompt.root; <userinput>make deinstall</userinput></screen>
@ -1089,7 +1092,7 @@ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
<question>
<para>Hang on a minute, you have to know the version number
to use that command. You do not seriously expect me to
remember that, do you??</para>
remember that, do you?</para>
</question>
<answer>
@ -1099,6 +1102,11 @@ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up
arcade game.</screen>
<para>The version number can also be found using the
<command>pkg_info</command> or by typing:
<command>ls /var/db/pkg</command></para>
</answer>
</qandaentry>
@ -1237,7 +1245,7 @@ arcade game.</screen>
directory.</ulink></para>
<para>(Readers with an aversion to intricate shell-scripts are
advised not to follow this link...)</para>
advised not to look at the files in this directory.)</para>
</answer>
</qandaentry>
</qandaset>