"../handbook.sgml" -> "../book.sgml" in Emacs local variables section.

Fix up the list of questions and answers as a <qandaset> instead of
an <itemizedlist>.  This entails converting the <itemizedlist> element
to a <qandaset>, and wrapping each question paragraph in a <question>
and </question> pair, and each answer in a <answer>...</answer> pair.

Then, search and replace for all the "Q.  " and "A.  " and remove them,
because the stylesheet adds these for you.

Finally, some of the questions are entered as

    <para><anchor id="foo">...

Delete the anchor element, and put the id attribute on the para instead,
so you have

    <para id="foo">...

I'm not entirely sure why, but if you have that in the first form then
the stylesheets don't include the links properly in the table of
questions.  If you have it in the second form then everything works fine.
This commit is contained in:
Nik Clayton 1999-08-23 21:06:02 +00:00
parent e1302f8644
commit 4e9bf8757d
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=5431
4 changed files with 956 additions and 552 deletions
en_US.ISO8859-1/books
handbook/ports
porters-handbook
en_US.ISO_8859-1/books
handbook/ports
porters-handbook

View file

@ -1,9 +1,9 @@
<!-- <!--
The FreeBSD Documentation Project The FreeBSD Documentation Project
$Id: chapter.sgml,v 1.44 1999-08-18 18:58:10 nik Exp $ $Id: chapter.sgml,v 1.45 1999-08-23 21:06:02 nik Exp $
--> -->
<chapter id="ports"> <chapter id="ports">
<title>Installing Applications: The Ports collection</title> <title>Installing Applications: The Ports collection</title>
@ -513,31 +513,42 @@ do-install:
<sect1> <sect1>
<title>Some Questions and Answers</title> <title>Some Questions and Answers</title>
<itemizedlist> <qandaset>
<listitem> <qandaentry>
<para>Q. I thought this was going to be a discussion about <question>
<para>I thought this was going to be a discussion about
modems??!</para> modems??!</para>
</question>
<para>A. Ah. You must be thinking of the serial ports on the back of
<answer>
<para>Ah. You must be thinking of the serial ports on the back of
your computer. We are using &ldquo;port&rdquo; here to mean the your computer. We are using &ldquo;port&rdquo; here to mean the
result of &ldquo;porting&rdquo; a program from one version of Unix result of &ldquo;porting&rdquo; a program from one version of Unix
to another. (It is an unfortunate bad habit of computer people to to another. (It is an unfortunate bad habit of computer people to
use the same word to refer to several completely different use the same word to refer to several completely different
things).</para> things).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I thought you were supposed to use packages to install extra <question>
<para>I thought you were supposed to use packages to install extra
programs?</para> programs?</para>
</question>
<para>A. Yes, that is usually the quickest and easiest way of doing
<answer>
<para>Yes, that is usually the quickest and easiest way of doing
it.</para> it.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. So why bother with ports then?</para> <question>
<para>So why bother with ports then?</para>
<para>A. Several reasons:-</para> </question>
<answer>
<para>Several reasons:-</para>
<orderedlist> <orderedlist>
<listitem> <listitem>
@ -576,24 +587,32 @@ do-install:
-->;-)</para> -->;-)</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-patch"> Q. What is a patch?</para> <question>
<para id="ports-patch"> What is a patch?</para>
<para>A. A patch is a small (usually) file that specifies how to go </question>
<answer>
<para>A patch is a small (usually) file that specifies how to go
from one version of a file to another. It contains text that says, from one version of a file to another. It contains text that says,
in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add
these two lines after line 468&rdquo; or &ldquo;change line 197 to these two lines after line 468&rdquo; or &ldquo;change line 197 to
this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is
generated by a program of that name.</para> generated by a program of that name.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-tarball"> Q. What is all this about <question>
<para id="ports-tarball"> What is all this about
tarballs?</para> tarballs?</para>
</question>
<para>A. It is a file ending in <filename>.tar</filename> or
<answer>
<para>It is a file ending in <filename>.tar</filename> or
<filename>.tar.gz</filename> (with variations like <filename>.tar.gz</filename> (with variations like
<filename>.tar.Z</filename>, or even <filename>.tgz</filename> if <filename>.tar.Z</filename>, or even <filename>.tgz</filename> if
you are trying to squeeze the names into a DOS filesystem).</para> you are trying to squeeze the names into a DOS filesystem).</para>
@ -613,22 +632,28 @@ do-install:
&prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput> &prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput>
&prompt.user; <userinput>tar tvf foobar.tar</userinput> &prompt.user; <userinput>tar tvf foobar.tar</userinput>
&prompt.user; <userinput>tar xvf foobar.tar</userinput></screen> &prompt.user; <userinput>tar xvf foobar.tar</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-checksum"> Q. And a checksum?</para> <question>
<para id="ports-checksum">And a checksum?</para>
<para>A. It is a number generated by adding up all the data in the </question>
<answer>
<para>It is a number generated by adding up all the data in the
file you want to check. If any of the characters change, the file you want to check. If any of the characters change, the
checksum will no longer be equal to the total, so a simple checksum will no longer be equal to the total, so a simple
comparison will allow you to spot the difference. (In practice, it comparison will allow you to spot the difference. (In practice, it
is done in a more complicated way to spot problems like is done in a more complicated way to spot problems like
position-swapping, which will not show up with a simplistic position-swapping, which will not show up with a simplistic
addition).</para> addition).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did what you said for <link linkend="ports-cd">compiling <question>
<para>I did what you said for <link linkend="ports-cd">compiling
ports from a CDROM</link> and it worked great until I tried to ports from a CDROM</link> and it worked great until I tried to
install the kermit port:-</para> install the kermit port:-</para>
@ -637,38 +662,48 @@ do-install:
&gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen> &gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen>
<para>Why can it not be found? Have I got a dud CDROM?</para> <para>Why can it not be found? Have I got a dud CDROM?</para>
</question>
<para>A. The licensing terms for kermit do not allow us to put the
<answer>
<para>The licensing terms for kermit do not allow us to put the
tarball for it on the CDROM, so you will have to fetch it by hand tarball for it on the CDROM, so you will have to fetch it by hand
&mdash; sorry! The reason why you got all those error messages was &mdash; sorry! The reason why you got all those error messages was
because you were not connected to the Internet at the time. Once because you were not connected to the Internet at the time. Once
you have downloaded it from any of the sites above, you can re-start you have downloaded it from any of the sites above, you can re-start
the process (try and choose the nearest site to you, though, to save the process (try and choose the nearest site to you, though, to save
your time and the Internet's bandwidth).</para> your time and the Internet's bandwidth).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did that, but when I tried to put it into <question>
<para>I did that, but when I tried to put it into
<filename>/usr/ports/distfiles</filename> I got some error about not <filename>/usr/ports/distfiles</filename> I got some error about not
having permission.</para> having permission.</para>
</question>
<para>A. The ports mechanism looks for the tarball in
<answer>
<para>The ports mechanism looks for the tarball in
<filename>/usr/ports/distfiles</filename>, but you will not be able <filename>/usr/ports/distfiles</filename>, but you will not be able
to copy anything there because it is sym-linked to the CDROM, which to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by is read-only. You can tell it to look somewhere else by
doing</para> doing</para>
<screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen> <screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Does the ports scheme only work if you have everything in <question>
<para>Does the ports scheme only work if you have everything in
<filename>/usr/ports</filename>? My system administrator says I must <filename>/usr/ports</filename>? My system administrator says I must
put everything under put everything under
<filename>/u/people/guests/wurzburger</filename>, but it does not <filename>/u/people/guests/wurzburger</filename>, but it does not
seem to work.</para> seem to work.</para>
</question>
<para>A. You can use the <makevar>PORTSDIR</makevar> and
<answer>
<para>You can use the <makevar>PORTSDIR</makevar> and
<makevar>PREFIX</makevar> variables to tell the ports mechanism to <makevar>PREFIX</makevar> variables to tell the ports mechanism to
use different directories. For instance,</para> use different directories. For instance,</para>
@ -693,15 +728,19 @@ do-install:
<para>If you do not fancy typing all that in every time you install a <para>If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these port (and to be honest, who would?), it is a good idea to put these
variables into your environment.</para> variables into your environment.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I do not have a FreeBSD CDROM, but I would like to have all <question>
<para>I do not have a FreeBSD CDROM, but I would like to have all
the tarballs handy on my system so I do not have to wait for a the tarballs handy on my system so I do not have to wait for a
download every time I install a port. Is there an easy way to get download every time I install a port. Is there an easy way to get
them all at once?</para> them all at once?</para>
</question>
<para>A. To get every single tarball for the ports collection,
<answer>
<para>To get every single tarball for the ports collection,
do</para> do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
@ -714,57 +753,77 @@ do-install:
<para>and for just one port &mdash; well, I think you have guessed <para>and for just one port &mdash; well, I think you have guessed
already.</para> already.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I know it is probably faster to fetch the tarballs from one <question>
<para>I know it is probably faster to fetch the tarballs from one
of the FreeBSD mirror sites close by. Is there any way to tell the of the FreeBSD mirror sites close by. Is there any way to tell the
port to fetch them from servers other than ones listed in the port to fetch them from servers other than ones listed in the
MASTER_SITES?</para> MASTER_SITES?</para>
</question>
<para>A. Yes. If you know, for example, <hostid
<answer>
<para>Yes. If you know, for example, <hostid
role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites
listed in <makevar>MASTER_SITES</makevar>, do as following listed in <makevar>MASTER_SITES</makevar>, do as following
example.</para> example.</para>
<screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput> <screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput>
&prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen> &prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I want to know what files make is going to need before it <question>
<para>I want to know what files make is going to need before it
tries to pull them down.</para> tries to pull them down.</para>
</question>
<para>A. <command>make fetch-list</command> will display a list of
<answer>
<para><command>make fetch-list</command> will display a list of
the files needed for a port.</para> the files needed for a port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Is there any way to stop the port from compiling? I want to <question>
<para>Is there any way to stop the port from compiling? I want to
do some hacking on the source before I install it, but it is a bit do some hacking on the source before I install it, but it is a bit
tiresome having to watch it and hit control-C every time.</para> tiresome having to watch it and hit control-C every time.</para>
</question>
<para>A. Doing <command>make extract</command> will stop it after it
<answer>
<para>Doing <command>make extract</command> will stop it after it
has fetched and extracted the source code.</para> has fetched and extracted the source code.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I am trying to make my own port and I want to be able to <question>
<para>I am trying to make my own port and I want to be able to
stop it compiling until I have had a chance to see if my patches stop it compiling until I have had a chance to see if my patches
worked properly. Is there something like <command>make worked properly. Is there something like <command>make
extract</command>, but for patches?</para> extract</command>, but for patches?</para>
</question>
<para>A. Yep, <command>make patch</command> is what you want. You
<answer>
<para>Yep, <command>make patch</command> is what you want. You
will probably find the <makevar>PATCH_DEBUG</makevar> option useful will probably find the <makevar>PATCH_DEBUG</makevar> option useful
as well. And by the way, thank you for your efforts!</para> as well. And by the way, thank you for your efforts!</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I have heard that some compiler options can cause bugs. Is <question>
<para>I have heard that some compiler options can cause bugs. Is
this true? How can I make sure that I compile ports with the right this true? How can I make sure that I compile ports with the right
settings?</para> settings?</para>
</question>
<para>A. Yes, with version 2.6.3 of <command>gcc</command> (the
<answer>
<para>Yes, with version 2.6.3 of <command>gcc</command> (the
version shipped with FreeBSD 2.1.0 and 2.1.5), the version shipped with FreeBSD 2.1.0 and 2.1.5), the
<option>-O2</option> option could result in buggy code unless you <option>-O2</option> option could result in buggy code unless you
used the <option>-fno-strength-reduce</option> option as well. used the <option>-fno-strength-reduce</option> option as well.
@ -772,7 +831,6 @@ do-install:
<emphasis>should</emphasis> be able to specify the compiler options <emphasis>should</emphasis> be able to specify the compiler options
used by something like</para> used by something like</para>
<screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen> <screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen>
<para>or by editing <filename>/etc/make.conf</filename>, but <para>or by editing <filename>/etc/make.conf</filename>, but
@ -781,13 +839,17 @@ do-install:
and inspect the Makefiles by hand, but this can get tedious if the and inspect the Makefiles by hand, but this can get tedious if the
source has lots of sub-directories, each with their own source has lots of sub-directories, each with their own
Makefiles.</para> Makefiles.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. There are so many ports it is hard to find the one I want. <question>
<para>There are so many ports it is hard to find the one I want.
Is there a list anywhere of what ports are available?</para> Is there a list anywhere of what ports are available?</para>
</question>
<para>A. Look in the <filename>INDEX</filename> file in
<answer>
<para>Look in the <filename>INDEX</filename> file in
<filename>/usr/ports</filename>. If you would like to search the <filename>/usr/ports</filename>. If you would like to search the
ports collection for a keyword, you can do that too. For example, ports collection for a keyword, you can do that too. For example,
you can find ports relevant to the LISP programming language you can find ports relevant to the LISP programming language
@ -795,28 +857,36 @@ do-install:
<screen>&prompt.user; <userinput>cd /usr/ports</userinput> <screen>&prompt.user; <userinput>cd /usr/ports</userinput>
&prompt.user; <userinput>make search key=lisp</userinput></screen> &prompt.user; <userinput>make search key=lisp</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I went to install the <literal>foo</literal> port but the <question>
<para>I went to install the <literal>foo</literal> port but the
system suddenly stopped compiling it and starting compiling the system suddenly stopped compiling it and starting compiling the
<literal>bar</literal> port. What is going on?</para> <literal>bar</literal> port. What is going on?</para>
</question>
<para>A. The <literal>foo</literal> port needs something that is
<answer>
<para>The <literal>foo</literal> port needs something that is
supplied with <literal>bar</literal> &mdash; for instance, if supplied with <literal>bar</literal> &mdash; for instance, if
<literal>foo</literal> uses graphics, <literal>bar</literal> might <literal>foo</literal> uses graphics, <literal>bar</literal> might
have a library with useful graphics processing routines. Or have a library with useful graphics processing routines. Or
<literal>bar</literal> might be a tool that is needed to compile the <literal>bar</literal> might be a tool that is needed to compile the
<literal>foo</literal> port.</para> <literal>foo</literal> port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-remove"> Q. I installed the <question>
<para id="ports-remove"> I installed the
<literal>grizzle</literal> program from the ports and frankly it is <literal>grizzle</literal> program from the ports and frankly it is
a complete waste of disk space. I want to delete it but I do not a complete waste of disk space. I want to delete it but I do not
know where it put all the files. Any clues?</para> know where it put all the files. Any clues?</para>
</question>
<para>A. No problem, just do</para>
<answer>
<para>No problem, just do</para>
<screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen> <screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen>
@ -824,27 +894,35 @@ do-install:
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput>
&prompt.root; <userinput>make deinstall</userinput></screen> &prompt.root; <userinput>make deinstall</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<question>
<para> <para>
Q. Hang on a minute, you have to know the version number to use 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 that command. You do not seriously expect me to remember that, do
you??</para> you??</para>
</question>
<para>A. Not at all, you can find it out by doing</para>
<answer>
<para>Not at all, you can find it out by doing</para>
<screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput> <screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput>
Information for grizzle-6.5: Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen> grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Talking of disk space, the ports directory seems to be <question>
<para>Talking of disk space, the ports directory seems to be
taking up an awful lot of room. Is it safe to go in there and taking up an awful lot of room. Is it safe to go in there and
delete things?</para> delete things?</para>
</question>
<para>A. Yes, if you have installed the program and are fairly
<answer>
<para>Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is</para> keeping it hanging around. The best way to do this is</para>
@ -853,44 +931,60 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
<para>which will go through all the ports subdirectories and delete <para>which will go through all the ports subdirectories and delete
everything except the skeletons for each port.</para> everything except the skeletons for each port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I tried that and it still left all those tarballs or <question>
<para>I tried that and it still left all those tarballs or
whatever you called them in the <filename>distfiles</filename> whatever you called them in the <filename>distfiles</filename>
directory. Can I delete those as well?</para> directory. Can I delete those as well?</para>
</question>
<para>A. Yes, if you are sure you have finished with them, those can
<answer>
<para>Yes, if you are sure you have finished with them, those can
go as well.</para> go as well.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I like having lots and lots of programs to play with. Is <question>
<para>I like having lots and lots of programs to play with. Is
there any way of installing all the ports in one go?</para> there any way of installing all the ports in one go?</para>
</question>
<para>A. Just do</para>
<answer>
<para>Just do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make install</userinput></screen> &prompt.root; <userinput>make install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. OK, I tried that, but I thought it would take a very long <question>
<para>OK, I tried that, but I thought it would take a very long
time so I went to bed and left it to get on with it. When I looked time so I went to bed and left it to get on with it. When I looked
at the computer this morning, it had only done three and a half at the computer this morning, it had only done three and a half
ports. Did something go wrong?</para> ports. Did something go wrong?</para>
</question>
<para>A. No, the problem is that some of the ports need to ask you
<answer>
<para>No, the problem is that some of the ports need to ask you
questions that we cannot answer for you (eg &ldquo;Do you want to questions that we cannot answer for you (eg &ldquo;Do you want to
print on A4 or US letter sized paper?&rdquo;) and they need to have print on A4 or US letter sized paper?&rdquo;) and they need to have
someone on hand to answer them.</para> someone on hand to answer them.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I really do not want to spend all day staring at the <question>
<para>I really do not want to spend all day staring at the
monitor. Any better ideas?</para> monitor. Any better ideas?</para>
</question>
<para>A. OK, do this before you go to bed/work/the local
<answer>
<para>OK, do this before you go to bed/work/the local
park:-</para> park:-</para>
<screen>&prompt.root <userinput>cd /usr/ports</userinput> <screen>&prompt.root <userinput>cd /usr/ports</userinput>
@ -903,15 +997,19 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen> &prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen>
<para>to finish the job.</para> <para>to finish the job.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. At work, we are using <literal>frobble</literal>, which is <question>
<para>At work, we are using <literal>frobble</literal>, which is
in your ports collection, but we have altered it quite a bit to get in your ports collection, but we have altered it quite a bit to get
it to do what we need. Is there any way of making our own packages, it to do what we need. Is there any way of making our own packages,
so we can distribute it more easily around our sites?</para> so we can distribute it more easily around our sites?</para>
</question>
<para>A. No problem, assuming you know how to make patches for your
<answer>
<para>No problem, assuming you know how to make patches for your
changes:-</para> changes:-</para>
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput>
@ -920,24 +1018,27 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
[Apply your patches] [Apply your patches]
&prompt.root; <userinput>cd ../..</userinput> &prompt.root; <userinput>cd ../..</userinput>
&prompt.root; <userinput>make package</userinput></screen> &prompt.root; <userinput>make package</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. This ports stuff is really clever. I am desperate to find <question>
<para>This ports stuff is really clever. I am desperate to find
out how you did it. What is the secret?</para> out how you did it. What is the secret?</para>
</question>
<para>A. Nothing secret about it at all, just look at the
<answer>
<para>Nothing secret about it at all, just look at the
<filename>bsd.ports.mk</filename> and <filename>bsd.ports.mk</filename> and
<filename>bsd.ports.subdir.mk</filename> files in your <ulink <filename>bsd.ports.subdir.mk</filename> files in your <ulink
URL="file://localhost/usr/ports/Mk/">makefiles URL="file://localhost/usr/ports/Mk/">makefiles
directory.</ulink></para> directory.</ulink></para>
<note>
<para>Readers with an aversion to intricate shell-scripts are <para>Readers with an aversion to intricate shell-scripts are
advised not to follow this link...)</para> advised not to follow this link...)</para>
</note> </answer>
</listitem> </qandaentry>
</itemizedlist> </qandaset>
</sect1> </sect1>
<sect1 id="porting"> <sect1 id="porting">
@ -4674,6 +4775,6 @@ pre-install:
sgml-indent-data: t sgml-indent-data: t
sgml-omittag: nil sgml-omittag: nil
sgml-always-quote-attributes: t sgml-always-quote-attributes: t
sgml-parent-document: ("../handbook.sgml" "part" "chapter") sgml-parent-document: ("../book.sgml" "part" "chapter")
End: End:
--> -->

View file

@ -1,9 +1,9 @@
<!-- <!--
The FreeBSD Documentation Project The FreeBSD Documentation Project
$Id: book.sgml,v 1.44 1999-08-18 18:58:10 nik Exp $ $Id: book.sgml,v 1.45 1999-08-23 21:06:02 nik Exp $
--> -->
<chapter id="ports"> <chapter id="ports">
<title>Installing Applications: The Ports collection</title> <title>Installing Applications: The Ports collection</title>
@ -513,31 +513,42 @@ do-install:
<sect1> <sect1>
<title>Some Questions and Answers</title> <title>Some Questions and Answers</title>
<itemizedlist> <qandaset>
<listitem> <qandaentry>
<para>Q. I thought this was going to be a discussion about <question>
<para>I thought this was going to be a discussion about
modems??!</para> modems??!</para>
</question>
<para>A. Ah. You must be thinking of the serial ports on the back of
<answer>
<para>Ah. You must be thinking of the serial ports on the back of
your computer. We are using &ldquo;port&rdquo; here to mean the your computer. We are using &ldquo;port&rdquo; here to mean the
result of &ldquo;porting&rdquo; a program from one version of Unix result of &ldquo;porting&rdquo; a program from one version of Unix
to another. (It is an unfortunate bad habit of computer people to to another. (It is an unfortunate bad habit of computer people to
use the same word to refer to several completely different use the same word to refer to several completely different
things).</para> things).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I thought you were supposed to use packages to install extra <question>
<para>I thought you were supposed to use packages to install extra
programs?</para> programs?</para>
</question>
<para>A. Yes, that is usually the quickest and easiest way of doing
<answer>
<para>Yes, that is usually the quickest and easiest way of doing
it.</para> it.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. So why bother with ports then?</para> <question>
<para>So why bother with ports then?</para>
<para>A. Several reasons:-</para> </question>
<answer>
<para>Several reasons:-</para>
<orderedlist> <orderedlist>
<listitem> <listitem>
@ -576,24 +587,32 @@ do-install:
-->;-)</para> -->;-)</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-patch"> Q. What is a patch?</para> <question>
<para id="ports-patch"> What is a patch?</para>
<para>A. A patch is a small (usually) file that specifies how to go </question>
<answer>
<para>A patch is a small (usually) file that specifies how to go
from one version of a file to another. It contains text that says, from one version of a file to another. It contains text that says,
in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add
these two lines after line 468&rdquo; or &ldquo;change line 197 to these two lines after line 468&rdquo; or &ldquo;change line 197 to
this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is
generated by a program of that name.</para> generated by a program of that name.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-tarball"> Q. What is all this about <question>
<para id="ports-tarball"> What is all this about
tarballs?</para> tarballs?</para>
</question>
<para>A. It is a file ending in <filename>.tar</filename> or
<answer>
<para>It is a file ending in <filename>.tar</filename> or
<filename>.tar.gz</filename> (with variations like <filename>.tar.gz</filename> (with variations like
<filename>.tar.Z</filename>, or even <filename>.tgz</filename> if <filename>.tar.Z</filename>, or even <filename>.tgz</filename> if
you are trying to squeeze the names into a DOS filesystem).</para> you are trying to squeeze the names into a DOS filesystem).</para>
@ -613,22 +632,28 @@ do-install:
&prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput> &prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput>
&prompt.user; <userinput>tar tvf foobar.tar</userinput> &prompt.user; <userinput>tar tvf foobar.tar</userinput>
&prompt.user; <userinput>tar xvf foobar.tar</userinput></screen> &prompt.user; <userinput>tar xvf foobar.tar</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-checksum"> Q. And a checksum?</para> <question>
<para id="ports-checksum">And a checksum?</para>
<para>A. It is a number generated by adding up all the data in the </question>
<answer>
<para>It is a number generated by adding up all the data in the
file you want to check. If any of the characters change, the file you want to check. If any of the characters change, the
checksum will no longer be equal to the total, so a simple checksum will no longer be equal to the total, so a simple
comparison will allow you to spot the difference. (In practice, it comparison will allow you to spot the difference. (In practice, it
is done in a more complicated way to spot problems like is done in a more complicated way to spot problems like
position-swapping, which will not show up with a simplistic position-swapping, which will not show up with a simplistic
addition).</para> addition).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did what you said for <link linkend="ports-cd">compiling <question>
<para>I did what you said for <link linkend="ports-cd">compiling
ports from a CDROM</link> and it worked great until I tried to ports from a CDROM</link> and it worked great until I tried to
install the kermit port:-</para> install the kermit port:-</para>
@ -637,38 +662,48 @@ do-install:
&gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen> &gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen>
<para>Why can it not be found? Have I got a dud CDROM?</para> <para>Why can it not be found? Have I got a dud CDROM?</para>
</question>
<para>A. The licensing terms for kermit do not allow us to put the
<answer>
<para>The licensing terms for kermit do not allow us to put the
tarball for it on the CDROM, so you will have to fetch it by hand tarball for it on the CDROM, so you will have to fetch it by hand
&mdash; sorry! The reason why you got all those error messages was &mdash; sorry! The reason why you got all those error messages was
because you were not connected to the Internet at the time. Once because you were not connected to the Internet at the time. Once
you have downloaded it from any of the sites above, you can re-start you have downloaded it from any of the sites above, you can re-start
the process (try and choose the nearest site to you, though, to save the process (try and choose the nearest site to you, though, to save
your time and the Internet's bandwidth).</para> your time and the Internet's bandwidth).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did that, but when I tried to put it into <question>
<para>I did that, but when I tried to put it into
<filename>/usr/ports/distfiles</filename> I got some error about not <filename>/usr/ports/distfiles</filename> I got some error about not
having permission.</para> having permission.</para>
</question>
<para>A. The ports mechanism looks for the tarball in
<answer>
<para>The ports mechanism looks for the tarball in
<filename>/usr/ports/distfiles</filename>, but you will not be able <filename>/usr/ports/distfiles</filename>, but you will not be able
to copy anything there because it is sym-linked to the CDROM, which to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by is read-only. You can tell it to look somewhere else by
doing</para> doing</para>
<screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen> <screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Does the ports scheme only work if you have everything in <question>
<para>Does the ports scheme only work if you have everything in
<filename>/usr/ports</filename>? My system administrator says I must <filename>/usr/ports</filename>? My system administrator says I must
put everything under put everything under
<filename>/u/people/guests/wurzburger</filename>, but it does not <filename>/u/people/guests/wurzburger</filename>, but it does not
seem to work.</para> seem to work.</para>
</question>
<para>A. You can use the <makevar>PORTSDIR</makevar> and
<answer>
<para>You can use the <makevar>PORTSDIR</makevar> and
<makevar>PREFIX</makevar> variables to tell the ports mechanism to <makevar>PREFIX</makevar> variables to tell the ports mechanism to
use different directories. For instance,</para> use different directories. For instance,</para>
@ -693,15 +728,19 @@ do-install:
<para>If you do not fancy typing all that in every time you install a <para>If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these port (and to be honest, who would?), it is a good idea to put these
variables into your environment.</para> variables into your environment.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I do not have a FreeBSD CDROM, but I would like to have all <question>
<para>I do not have a FreeBSD CDROM, but I would like to have all
the tarballs handy on my system so I do not have to wait for a the tarballs handy on my system so I do not have to wait for a
download every time I install a port. Is there an easy way to get download every time I install a port. Is there an easy way to get
them all at once?</para> them all at once?</para>
</question>
<para>A. To get every single tarball for the ports collection,
<answer>
<para>To get every single tarball for the ports collection,
do</para> do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
@ -714,57 +753,77 @@ do-install:
<para>and for just one port &mdash; well, I think you have guessed <para>and for just one port &mdash; well, I think you have guessed
already.</para> already.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I know it is probably faster to fetch the tarballs from one <question>
<para>I know it is probably faster to fetch the tarballs from one
of the FreeBSD mirror sites close by. Is there any way to tell the of the FreeBSD mirror sites close by. Is there any way to tell the
port to fetch them from servers other than ones listed in the port to fetch them from servers other than ones listed in the
MASTER_SITES?</para> MASTER_SITES?</para>
</question>
<para>A. Yes. If you know, for example, <hostid
<answer>
<para>Yes. If you know, for example, <hostid
role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites
listed in <makevar>MASTER_SITES</makevar>, do as following listed in <makevar>MASTER_SITES</makevar>, do as following
example.</para> example.</para>
<screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput> <screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput>
&prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen> &prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I want to know what files make is going to need before it <question>
<para>I want to know what files make is going to need before it
tries to pull them down.</para> tries to pull them down.</para>
</question>
<para>A. <command>make fetch-list</command> will display a list of
<answer>
<para><command>make fetch-list</command> will display a list of
the files needed for a port.</para> the files needed for a port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Is there any way to stop the port from compiling? I want to <question>
<para>Is there any way to stop the port from compiling? I want to
do some hacking on the source before I install it, but it is a bit do some hacking on the source before I install it, but it is a bit
tiresome having to watch it and hit control-C every time.</para> tiresome having to watch it and hit control-C every time.</para>
</question>
<para>A. Doing <command>make extract</command> will stop it after it
<answer>
<para>Doing <command>make extract</command> will stop it after it
has fetched and extracted the source code.</para> has fetched and extracted the source code.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I am trying to make my own port and I want to be able to <question>
<para>I am trying to make my own port and I want to be able to
stop it compiling until I have had a chance to see if my patches stop it compiling until I have had a chance to see if my patches
worked properly. Is there something like <command>make worked properly. Is there something like <command>make
extract</command>, but for patches?</para> extract</command>, but for patches?</para>
</question>
<para>A. Yep, <command>make patch</command> is what you want. You
<answer>
<para>Yep, <command>make patch</command> is what you want. You
will probably find the <makevar>PATCH_DEBUG</makevar> option useful will probably find the <makevar>PATCH_DEBUG</makevar> option useful
as well. And by the way, thank you for your efforts!</para> as well. And by the way, thank you for your efforts!</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I have heard that some compiler options can cause bugs. Is <question>
<para>I have heard that some compiler options can cause bugs. Is
this true? How can I make sure that I compile ports with the right this true? How can I make sure that I compile ports with the right
settings?</para> settings?</para>
</question>
<para>A. Yes, with version 2.6.3 of <command>gcc</command> (the
<answer>
<para>Yes, with version 2.6.3 of <command>gcc</command> (the
version shipped with FreeBSD 2.1.0 and 2.1.5), the version shipped with FreeBSD 2.1.0 and 2.1.5), the
<option>-O2</option> option could result in buggy code unless you <option>-O2</option> option could result in buggy code unless you
used the <option>-fno-strength-reduce</option> option as well. used the <option>-fno-strength-reduce</option> option as well.
@ -772,7 +831,6 @@ do-install:
<emphasis>should</emphasis> be able to specify the compiler options <emphasis>should</emphasis> be able to specify the compiler options
used by something like</para> used by something like</para>
<screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen> <screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen>
<para>or by editing <filename>/etc/make.conf</filename>, but <para>or by editing <filename>/etc/make.conf</filename>, but
@ -781,13 +839,17 @@ do-install:
and inspect the Makefiles by hand, but this can get tedious if the and inspect the Makefiles by hand, but this can get tedious if the
source has lots of sub-directories, each with their own source has lots of sub-directories, each with their own
Makefiles.</para> Makefiles.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. There are so many ports it is hard to find the one I want. <question>
<para>There are so many ports it is hard to find the one I want.
Is there a list anywhere of what ports are available?</para> Is there a list anywhere of what ports are available?</para>
</question>
<para>A. Look in the <filename>INDEX</filename> file in
<answer>
<para>Look in the <filename>INDEX</filename> file in
<filename>/usr/ports</filename>. If you would like to search the <filename>/usr/ports</filename>. If you would like to search the
ports collection for a keyword, you can do that too. For example, ports collection for a keyword, you can do that too. For example,
you can find ports relevant to the LISP programming language you can find ports relevant to the LISP programming language
@ -795,28 +857,36 @@ do-install:
<screen>&prompt.user; <userinput>cd /usr/ports</userinput> <screen>&prompt.user; <userinput>cd /usr/ports</userinput>
&prompt.user; <userinput>make search key=lisp</userinput></screen> &prompt.user; <userinput>make search key=lisp</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I went to install the <literal>foo</literal> port but the <question>
<para>I went to install the <literal>foo</literal> port but the
system suddenly stopped compiling it and starting compiling the system suddenly stopped compiling it and starting compiling the
<literal>bar</literal> port. What is going on?</para> <literal>bar</literal> port. What is going on?</para>
</question>
<para>A. The <literal>foo</literal> port needs something that is
<answer>
<para>The <literal>foo</literal> port needs something that is
supplied with <literal>bar</literal> &mdash; for instance, if supplied with <literal>bar</literal> &mdash; for instance, if
<literal>foo</literal> uses graphics, <literal>bar</literal> might <literal>foo</literal> uses graphics, <literal>bar</literal> might
have a library with useful graphics processing routines. Or have a library with useful graphics processing routines. Or
<literal>bar</literal> might be a tool that is needed to compile the <literal>bar</literal> might be a tool that is needed to compile the
<literal>foo</literal> port.</para> <literal>foo</literal> port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-remove"> Q. I installed the <question>
<para id="ports-remove"> I installed the
<literal>grizzle</literal> program from the ports and frankly it is <literal>grizzle</literal> program from the ports and frankly it is
a complete waste of disk space. I want to delete it but I do not a complete waste of disk space. I want to delete it but I do not
know where it put all the files. Any clues?</para> know where it put all the files. Any clues?</para>
</question>
<para>A. No problem, just do</para>
<answer>
<para>No problem, just do</para>
<screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen> <screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen>
@ -824,27 +894,35 @@ do-install:
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput>
&prompt.root; <userinput>make deinstall</userinput></screen> &prompt.root; <userinput>make deinstall</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<question>
<para> <para>
Q. Hang on a minute, you have to know the version number to use 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 that command. You do not seriously expect me to remember that, do
you??</para> you??</para>
</question>
<para>A. Not at all, you can find it out by doing</para>
<answer>
<para>Not at all, you can find it out by doing</para>
<screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput> <screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput>
Information for grizzle-6.5: Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen> grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Talking of disk space, the ports directory seems to be <question>
<para>Talking of disk space, the ports directory seems to be
taking up an awful lot of room. Is it safe to go in there and taking up an awful lot of room. Is it safe to go in there and
delete things?</para> delete things?</para>
</question>
<para>A. Yes, if you have installed the program and are fairly
<answer>
<para>Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is</para> keeping it hanging around. The best way to do this is</para>
@ -853,44 +931,60 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
<para>which will go through all the ports subdirectories and delete <para>which will go through all the ports subdirectories and delete
everything except the skeletons for each port.</para> everything except the skeletons for each port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I tried that and it still left all those tarballs or <question>
<para>I tried that and it still left all those tarballs or
whatever you called them in the <filename>distfiles</filename> whatever you called them in the <filename>distfiles</filename>
directory. Can I delete those as well?</para> directory. Can I delete those as well?</para>
</question>
<para>A. Yes, if you are sure you have finished with them, those can
<answer>
<para>Yes, if you are sure you have finished with them, those can
go as well.</para> go as well.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I like having lots and lots of programs to play with. Is <question>
<para>I like having lots and lots of programs to play with. Is
there any way of installing all the ports in one go?</para> there any way of installing all the ports in one go?</para>
</question>
<para>A. Just do</para>
<answer>
<para>Just do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make install</userinput></screen> &prompt.root; <userinput>make install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. OK, I tried that, but I thought it would take a very long <question>
<para>OK, I tried that, but I thought it would take a very long
time so I went to bed and left it to get on with it. When I looked time so I went to bed and left it to get on with it. When I looked
at the computer this morning, it had only done three and a half at the computer this morning, it had only done three and a half
ports. Did something go wrong?</para> ports. Did something go wrong?</para>
</question>
<para>A. No, the problem is that some of the ports need to ask you
<answer>
<para>No, the problem is that some of the ports need to ask you
questions that we cannot answer for you (eg &ldquo;Do you want to questions that we cannot answer for you (eg &ldquo;Do you want to
print on A4 or US letter sized paper?&rdquo;) and they need to have print on A4 or US letter sized paper?&rdquo;) and they need to have
someone on hand to answer them.</para> someone on hand to answer them.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I really do not want to spend all day staring at the <question>
<para>I really do not want to spend all day staring at the
monitor. Any better ideas?</para> monitor. Any better ideas?</para>
</question>
<para>A. OK, do this before you go to bed/work/the local
<answer>
<para>OK, do this before you go to bed/work/the local
park:-</para> park:-</para>
<screen>&prompt.root <userinput>cd /usr/ports</userinput> <screen>&prompt.root <userinput>cd /usr/ports</userinput>
@ -903,15 +997,19 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen> &prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen>
<para>to finish the job.</para> <para>to finish the job.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. At work, we are using <literal>frobble</literal>, which is <question>
<para>At work, we are using <literal>frobble</literal>, which is
in your ports collection, but we have altered it quite a bit to get in your ports collection, but we have altered it quite a bit to get
it to do what we need. Is there any way of making our own packages, it to do what we need. Is there any way of making our own packages,
so we can distribute it more easily around our sites?</para> so we can distribute it more easily around our sites?</para>
</question>
<para>A. No problem, assuming you know how to make patches for your
<answer>
<para>No problem, assuming you know how to make patches for your
changes:-</para> changes:-</para>
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput>
@ -920,24 +1018,27 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
[Apply your patches] [Apply your patches]
&prompt.root; <userinput>cd ../..</userinput> &prompt.root; <userinput>cd ../..</userinput>
&prompt.root; <userinput>make package</userinput></screen> &prompt.root; <userinput>make package</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. This ports stuff is really clever. I am desperate to find <question>
<para>This ports stuff is really clever. I am desperate to find
out how you did it. What is the secret?</para> out how you did it. What is the secret?</para>
</question>
<para>A. Nothing secret about it at all, just look at the
<answer>
<para>Nothing secret about it at all, just look at the
<filename>bsd.ports.mk</filename> and <filename>bsd.ports.mk</filename> and
<filename>bsd.ports.subdir.mk</filename> files in your <ulink <filename>bsd.ports.subdir.mk</filename> files in your <ulink
URL="file://localhost/usr/ports/Mk/">makefiles URL="file://localhost/usr/ports/Mk/">makefiles
directory.</ulink></para> directory.</ulink></para>
<note>
<para>Readers with an aversion to intricate shell-scripts are <para>Readers with an aversion to intricate shell-scripts are
advised not to follow this link...)</para> advised not to follow this link...)</para>
</note> </answer>
</listitem> </qandaentry>
</itemizedlist> </qandaset>
</sect1> </sect1>
<sect1 id="porting"> <sect1 id="porting">
@ -4674,6 +4775,6 @@ pre-install:
sgml-indent-data: t sgml-indent-data: t
sgml-omittag: nil sgml-omittag: nil
sgml-always-quote-attributes: t sgml-always-quote-attributes: t
sgml-parent-document: ("../handbook.sgml" "part" "chapter") sgml-parent-document: ("../book.sgml" "part" "chapter")
End: End:
--> -->

View file

@ -1,9 +1,9 @@
<!-- <!--
The FreeBSD Documentation Project The FreeBSD Documentation Project
$Id: chapter.sgml,v 1.44 1999-08-18 18:58:10 nik Exp $ $Id: chapter.sgml,v 1.45 1999-08-23 21:06:02 nik Exp $
--> -->
<chapter id="ports"> <chapter id="ports">
<title>Installing Applications: The Ports collection</title> <title>Installing Applications: The Ports collection</title>
@ -513,31 +513,42 @@ do-install:
<sect1> <sect1>
<title>Some Questions and Answers</title> <title>Some Questions and Answers</title>
<itemizedlist> <qandaset>
<listitem> <qandaentry>
<para>Q. I thought this was going to be a discussion about <question>
<para>I thought this was going to be a discussion about
modems??!</para> modems??!</para>
</question>
<para>A. Ah. You must be thinking of the serial ports on the back of
<answer>
<para>Ah. You must be thinking of the serial ports on the back of
your computer. We are using &ldquo;port&rdquo; here to mean the your computer. We are using &ldquo;port&rdquo; here to mean the
result of &ldquo;porting&rdquo; a program from one version of Unix result of &ldquo;porting&rdquo; a program from one version of Unix
to another. (It is an unfortunate bad habit of computer people to to another. (It is an unfortunate bad habit of computer people to
use the same word to refer to several completely different use the same word to refer to several completely different
things).</para> things).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I thought you were supposed to use packages to install extra <question>
<para>I thought you were supposed to use packages to install extra
programs?</para> programs?</para>
</question>
<para>A. Yes, that is usually the quickest and easiest way of doing
<answer>
<para>Yes, that is usually the quickest and easiest way of doing
it.</para> it.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. So why bother with ports then?</para> <question>
<para>So why bother with ports then?</para>
<para>A. Several reasons:-</para> </question>
<answer>
<para>Several reasons:-</para>
<orderedlist> <orderedlist>
<listitem> <listitem>
@ -576,24 +587,32 @@ do-install:
-->;-)</para> -->;-)</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-patch"> Q. What is a patch?</para> <question>
<para id="ports-patch"> What is a patch?</para>
<para>A. A patch is a small (usually) file that specifies how to go </question>
<answer>
<para>A patch is a small (usually) file that specifies how to go
from one version of a file to another. It contains text that says, from one version of a file to another. It contains text that says,
in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add
these two lines after line 468&rdquo; or &ldquo;change line 197 to these two lines after line 468&rdquo; or &ldquo;change line 197 to
this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is
generated by a program of that name.</para> generated by a program of that name.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-tarball"> Q. What is all this about <question>
<para id="ports-tarball"> What is all this about
tarballs?</para> tarballs?</para>
</question>
<para>A. It is a file ending in <filename>.tar</filename> or
<answer>
<para>It is a file ending in <filename>.tar</filename> or
<filename>.tar.gz</filename> (with variations like <filename>.tar.gz</filename> (with variations like
<filename>.tar.Z</filename>, or even <filename>.tgz</filename> if <filename>.tar.Z</filename>, or even <filename>.tgz</filename> if
you are trying to squeeze the names into a DOS filesystem).</para> you are trying to squeeze the names into a DOS filesystem).</para>
@ -613,22 +632,28 @@ do-install:
&prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput> &prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput>
&prompt.user; <userinput>tar tvf foobar.tar</userinput> &prompt.user; <userinput>tar tvf foobar.tar</userinput>
&prompt.user; <userinput>tar xvf foobar.tar</userinput></screen> &prompt.user; <userinput>tar xvf foobar.tar</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-checksum"> Q. And a checksum?</para> <question>
<para id="ports-checksum">And a checksum?</para>
<para>A. It is a number generated by adding up all the data in the </question>
<answer>
<para>It is a number generated by adding up all the data in the
file you want to check. If any of the characters change, the file you want to check. If any of the characters change, the
checksum will no longer be equal to the total, so a simple checksum will no longer be equal to the total, so a simple
comparison will allow you to spot the difference. (In practice, it comparison will allow you to spot the difference. (In practice, it
is done in a more complicated way to spot problems like is done in a more complicated way to spot problems like
position-swapping, which will not show up with a simplistic position-swapping, which will not show up with a simplistic
addition).</para> addition).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did what you said for <link linkend="ports-cd">compiling <question>
<para>I did what you said for <link linkend="ports-cd">compiling
ports from a CDROM</link> and it worked great until I tried to ports from a CDROM</link> and it worked great until I tried to
install the kermit port:-</para> install the kermit port:-</para>
@ -637,38 +662,48 @@ do-install:
&gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen> &gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen>
<para>Why can it not be found? Have I got a dud CDROM?</para> <para>Why can it not be found? Have I got a dud CDROM?</para>
</question>
<para>A. The licensing terms for kermit do not allow us to put the
<answer>
<para>The licensing terms for kermit do not allow us to put the
tarball for it on the CDROM, so you will have to fetch it by hand tarball for it on the CDROM, so you will have to fetch it by hand
&mdash; sorry! The reason why you got all those error messages was &mdash; sorry! The reason why you got all those error messages was
because you were not connected to the Internet at the time. Once because you were not connected to the Internet at the time. Once
you have downloaded it from any of the sites above, you can re-start you have downloaded it from any of the sites above, you can re-start
the process (try and choose the nearest site to you, though, to save the process (try and choose the nearest site to you, though, to save
your time and the Internet's bandwidth).</para> your time and the Internet's bandwidth).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did that, but when I tried to put it into <question>
<para>I did that, but when I tried to put it into
<filename>/usr/ports/distfiles</filename> I got some error about not <filename>/usr/ports/distfiles</filename> I got some error about not
having permission.</para> having permission.</para>
</question>
<para>A. The ports mechanism looks for the tarball in
<answer>
<para>The ports mechanism looks for the tarball in
<filename>/usr/ports/distfiles</filename>, but you will not be able <filename>/usr/ports/distfiles</filename>, but you will not be able
to copy anything there because it is sym-linked to the CDROM, which to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by is read-only. You can tell it to look somewhere else by
doing</para> doing</para>
<screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen> <screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Does the ports scheme only work if you have everything in <question>
<para>Does the ports scheme only work if you have everything in
<filename>/usr/ports</filename>? My system administrator says I must <filename>/usr/ports</filename>? My system administrator says I must
put everything under put everything under
<filename>/u/people/guests/wurzburger</filename>, but it does not <filename>/u/people/guests/wurzburger</filename>, but it does not
seem to work.</para> seem to work.</para>
</question>
<para>A. You can use the <makevar>PORTSDIR</makevar> and
<answer>
<para>You can use the <makevar>PORTSDIR</makevar> and
<makevar>PREFIX</makevar> variables to tell the ports mechanism to <makevar>PREFIX</makevar> variables to tell the ports mechanism to
use different directories. For instance,</para> use different directories. For instance,</para>
@ -693,15 +728,19 @@ do-install:
<para>If you do not fancy typing all that in every time you install a <para>If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these port (and to be honest, who would?), it is a good idea to put these
variables into your environment.</para> variables into your environment.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I do not have a FreeBSD CDROM, but I would like to have all <question>
<para>I do not have a FreeBSD CDROM, but I would like to have all
the tarballs handy on my system so I do not have to wait for a the tarballs handy on my system so I do not have to wait for a
download every time I install a port. Is there an easy way to get download every time I install a port. Is there an easy way to get
them all at once?</para> them all at once?</para>
</question>
<para>A. To get every single tarball for the ports collection,
<answer>
<para>To get every single tarball for the ports collection,
do</para> do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
@ -714,57 +753,77 @@ do-install:
<para>and for just one port &mdash; well, I think you have guessed <para>and for just one port &mdash; well, I think you have guessed
already.</para> already.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I know it is probably faster to fetch the tarballs from one <question>
<para>I know it is probably faster to fetch the tarballs from one
of the FreeBSD mirror sites close by. Is there any way to tell the of the FreeBSD mirror sites close by. Is there any way to tell the
port to fetch them from servers other than ones listed in the port to fetch them from servers other than ones listed in the
MASTER_SITES?</para> MASTER_SITES?</para>
</question>
<para>A. Yes. If you know, for example, <hostid
<answer>
<para>Yes. If you know, for example, <hostid
role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites
listed in <makevar>MASTER_SITES</makevar>, do as following listed in <makevar>MASTER_SITES</makevar>, do as following
example.</para> example.</para>
<screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput> <screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput>
&prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen> &prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I want to know what files make is going to need before it <question>
<para>I want to know what files make is going to need before it
tries to pull them down.</para> tries to pull them down.</para>
</question>
<para>A. <command>make fetch-list</command> will display a list of
<answer>
<para><command>make fetch-list</command> will display a list of
the files needed for a port.</para> the files needed for a port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Is there any way to stop the port from compiling? I want to <question>
<para>Is there any way to stop the port from compiling? I want to
do some hacking on the source before I install it, but it is a bit do some hacking on the source before I install it, but it is a bit
tiresome having to watch it and hit control-C every time.</para> tiresome having to watch it and hit control-C every time.</para>
</question>
<para>A. Doing <command>make extract</command> will stop it after it
<answer>
<para>Doing <command>make extract</command> will stop it after it
has fetched and extracted the source code.</para> has fetched and extracted the source code.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I am trying to make my own port and I want to be able to <question>
<para>I am trying to make my own port and I want to be able to
stop it compiling until I have had a chance to see if my patches stop it compiling until I have had a chance to see if my patches
worked properly. Is there something like <command>make worked properly. Is there something like <command>make
extract</command>, but for patches?</para> extract</command>, but for patches?</para>
</question>
<para>A. Yep, <command>make patch</command> is what you want. You
<answer>
<para>Yep, <command>make patch</command> is what you want. You
will probably find the <makevar>PATCH_DEBUG</makevar> option useful will probably find the <makevar>PATCH_DEBUG</makevar> option useful
as well. And by the way, thank you for your efforts!</para> as well. And by the way, thank you for your efforts!</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I have heard that some compiler options can cause bugs. Is <question>
<para>I have heard that some compiler options can cause bugs. Is
this true? How can I make sure that I compile ports with the right this true? How can I make sure that I compile ports with the right
settings?</para> settings?</para>
</question>
<para>A. Yes, with version 2.6.3 of <command>gcc</command> (the
<answer>
<para>Yes, with version 2.6.3 of <command>gcc</command> (the
version shipped with FreeBSD 2.1.0 and 2.1.5), the version shipped with FreeBSD 2.1.0 and 2.1.5), the
<option>-O2</option> option could result in buggy code unless you <option>-O2</option> option could result in buggy code unless you
used the <option>-fno-strength-reduce</option> option as well. used the <option>-fno-strength-reduce</option> option as well.
@ -772,7 +831,6 @@ do-install:
<emphasis>should</emphasis> be able to specify the compiler options <emphasis>should</emphasis> be able to specify the compiler options
used by something like</para> used by something like</para>
<screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen> <screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen>
<para>or by editing <filename>/etc/make.conf</filename>, but <para>or by editing <filename>/etc/make.conf</filename>, but
@ -781,13 +839,17 @@ do-install:
and inspect the Makefiles by hand, but this can get tedious if the and inspect the Makefiles by hand, but this can get tedious if the
source has lots of sub-directories, each with their own source has lots of sub-directories, each with their own
Makefiles.</para> Makefiles.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. There are so many ports it is hard to find the one I want. <question>
<para>There are so many ports it is hard to find the one I want.
Is there a list anywhere of what ports are available?</para> Is there a list anywhere of what ports are available?</para>
</question>
<para>A. Look in the <filename>INDEX</filename> file in
<answer>
<para>Look in the <filename>INDEX</filename> file in
<filename>/usr/ports</filename>. If you would like to search the <filename>/usr/ports</filename>. If you would like to search the
ports collection for a keyword, you can do that too. For example, ports collection for a keyword, you can do that too. For example,
you can find ports relevant to the LISP programming language you can find ports relevant to the LISP programming language
@ -795,28 +857,36 @@ do-install:
<screen>&prompt.user; <userinput>cd /usr/ports</userinput> <screen>&prompt.user; <userinput>cd /usr/ports</userinput>
&prompt.user; <userinput>make search key=lisp</userinput></screen> &prompt.user; <userinput>make search key=lisp</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I went to install the <literal>foo</literal> port but the <question>
<para>I went to install the <literal>foo</literal> port but the
system suddenly stopped compiling it and starting compiling the system suddenly stopped compiling it and starting compiling the
<literal>bar</literal> port. What is going on?</para> <literal>bar</literal> port. What is going on?</para>
</question>
<para>A. The <literal>foo</literal> port needs something that is
<answer>
<para>The <literal>foo</literal> port needs something that is
supplied with <literal>bar</literal> &mdash; for instance, if supplied with <literal>bar</literal> &mdash; for instance, if
<literal>foo</literal> uses graphics, <literal>bar</literal> might <literal>foo</literal> uses graphics, <literal>bar</literal> might
have a library with useful graphics processing routines. Or have a library with useful graphics processing routines. Or
<literal>bar</literal> might be a tool that is needed to compile the <literal>bar</literal> might be a tool that is needed to compile the
<literal>foo</literal> port.</para> <literal>foo</literal> port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-remove"> Q. I installed the <question>
<para id="ports-remove"> I installed the
<literal>grizzle</literal> program from the ports and frankly it is <literal>grizzle</literal> program from the ports and frankly it is
a complete waste of disk space. I want to delete it but I do not a complete waste of disk space. I want to delete it but I do not
know where it put all the files. Any clues?</para> know where it put all the files. Any clues?</para>
</question>
<para>A. No problem, just do</para>
<answer>
<para>No problem, just do</para>
<screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen> <screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen>
@ -824,27 +894,35 @@ do-install:
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput>
&prompt.root; <userinput>make deinstall</userinput></screen> &prompt.root; <userinput>make deinstall</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<question>
<para> <para>
Q. Hang on a minute, you have to know the version number to use 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 that command. You do not seriously expect me to remember that, do
you??</para> you??</para>
</question>
<para>A. Not at all, you can find it out by doing</para>
<answer>
<para>Not at all, you can find it out by doing</para>
<screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput> <screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput>
Information for grizzle-6.5: Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen> grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Talking of disk space, the ports directory seems to be <question>
<para>Talking of disk space, the ports directory seems to be
taking up an awful lot of room. Is it safe to go in there and taking up an awful lot of room. Is it safe to go in there and
delete things?</para> delete things?</para>
</question>
<para>A. Yes, if you have installed the program and are fairly
<answer>
<para>Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is</para> keeping it hanging around. The best way to do this is</para>
@ -853,44 +931,60 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
<para>which will go through all the ports subdirectories and delete <para>which will go through all the ports subdirectories and delete
everything except the skeletons for each port.</para> everything except the skeletons for each port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I tried that and it still left all those tarballs or <question>
<para>I tried that and it still left all those tarballs or
whatever you called them in the <filename>distfiles</filename> whatever you called them in the <filename>distfiles</filename>
directory. Can I delete those as well?</para> directory. Can I delete those as well?</para>
</question>
<para>A. Yes, if you are sure you have finished with them, those can
<answer>
<para>Yes, if you are sure you have finished with them, those can
go as well.</para> go as well.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I like having lots and lots of programs to play with. Is <question>
<para>I like having lots and lots of programs to play with. Is
there any way of installing all the ports in one go?</para> there any way of installing all the ports in one go?</para>
</question>
<para>A. Just do</para>
<answer>
<para>Just do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make install</userinput></screen> &prompt.root; <userinput>make install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. OK, I tried that, but I thought it would take a very long <question>
<para>OK, I tried that, but I thought it would take a very long
time so I went to bed and left it to get on with it. When I looked time so I went to bed and left it to get on with it. When I looked
at the computer this morning, it had only done three and a half at the computer this morning, it had only done three and a half
ports. Did something go wrong?</para> ports. Did something go wrong?</para>
</question>
<para>A. No, the problem is that some of the ports need to ask you
<answer>
<para>No, the problem is that some of the ports need to ask you
questions that we cannot answer for you (eg &ldquo;Do you want to questions that we cannot answer for you (eg &ldquo;Do you want to
print on A4 or US letter sized paper?&rdquo;) and they need to have print on A4 or US letter sized paper?&rdquo;) and they need to have
someone on hand to answer them.</para> someone on hand to answer them.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I really do not want to spend all day staring at the <question>
<para>I really do not want to spend all day staring at the
monitor. Any better ideas?</para> monitor. Any better ideas?</para>
</question>
<para>A. OK, do this before you go to bed/work/the local
<answer>
<para>OK, do this before you go to bed/work/the local
park:-</para> park:-</para>
<screen>&prompt.root <userinput>cd /usr/ports</userinput> <screen>&prompt.root <userinput>cd /usr/ports</userinput>
@ -903,15 +997,19 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen> &prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen>
<para>to finish the job.</para> <para>to finish the job.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. At work, we are using <literal>frobble</literal>, which is <question>
<para>At work, we are using <literal>frobble</literal>, which is
in your ports collection, but we have altered it quite a bit to get in your ports collection, but we have altered it quite a bit to get
it to do what we need. Is there any way of making our own packages, it to do what we need. Is there any way of making our own packages,
so we can distribute it more easily around our sites?</para> so we can distribute it more easily around our sites?</para>
</question>
<para>A. No problem, assuming you know how to make patches for your
<answer>
<para>No problem, assuming you know how to make patches for your
changes:-</para> changes:-</para>
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput>
@ -920,24 +1018,27 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
[Apply your patches] [Apply your patches]
&prompt.root; <userinput>cd ../..</userinput> &prompt.root; <userinput>cd ../..</userinput>
&prompt.root; <userinput>make package</userinput></screen> &prompt.root; <userinput>make package</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. This ports stuff is really clever. I am desperate to find <question>
<para>This ports stuff is really clever. I am desperate to find
out how you did it. What is the secret?</para> out how you did it. What is the secret?</para>
</question>
<para>A. Nothing secret about it at all, just look at the
<answer>
<para>Nothing secret about it at all, just look at the
<filename>bsd.ports.mk</filename> and <filename>bsd.ports.mk</filename> and
<filename>bsd.ports.subdir.mk</filename> files in your <ulink <filename>bsd.ports.subdir.mk</filename> files in your <ulink
URL="file://localhost/usr/ports/Mk/">makefiles URL="file://localhost/usr/ports/Mk/">makefiles
directory.</ulink></para> directory.</ulink></para>
<note>
<para>Readers with an aversion to intricate shell-scripts are <para>Readers with an aversion to intricate shell-scripts are
advised not to follow this link...)</para> advised not to follow this link...)</para>
</note> </answer>
</listitem> </qandaentry>
</itemizedlist> </qandaset>
</sect1> </sect1>
<sect1 id="porting"> <sect1 id="porting">
@ -4674,6 +4775,6 @@ pre-install:
sgml-indent-data: t sgml-indent-data: t
sgml-omittag: nil sgml-omittag: nil
sgml-always-quote-attributes: t sgml-always-quote-attributes: t
sgml-parent-document: ("../handbook.sgml" "part" "chapter") sgml-parent-document: ("../book.sgml" "part" "chapter")
End: End:
--> -->

View file

@ -1,9 +1,9 @@
<!-- <!--
The FreeBSD Documentation Project The FreeBSD Documentation Project
$Id: book.sgml,v 1.44 1999-08-18 18:58:10 nik Exp $ $Id: book.sgml,v 1.45 1999-08-23 21:06:02 nik Exp $
--> -->
<chapter id="ports"> <chapter id="ports">
<title>Installing Applications: The Ports collection</title> <title>Installing Applications: The Ports collection</title>
@ -513,31 +513,42 @@ do-install:
<sect1> <sect1>
<title>Some Questions and Answers</title> <title>Some Questions and Answers</title>
<itemizedlist> <qandaset>
<listitem> <qandaentry>
<para>Q. I thought this was going to be a discussion about <question>
<para>I thought this was going to be a discussion about
modems??!</para> modems??!</para>
</question>
<para>A. Ah. You must be thinking of the serial ports on the back of
<answer>
<para>Ah. You must be thinking of the serial ports on the back of
your computer. We are using &ldquo;port&rdquo; here to mean the your computer. We are using &ldquo;port&rdquo; here to mean the
result of &ldquo;porting&rdquo; a program from one version of Unix result of &ldquo;porting&rdquo; a program from one version of Unix
to another. (It is an unfortunate bad habit of computer people to to another. (It is an unfortunate bad habit of computer people to
use the same word to refer to several completely different use the same word to refer to several completely different
things).</para> things).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I thought you were supposed to use packages to install extra <question>
<para>I thought you were supposed to use packages to install extra
programs?</para> programs?</para>
</question>
<para>A. Yes, that is usually the quickest and easiest way of doing
<answer>
<para>Yes, that is usually the quickest and easiest way of doing
it.</para> it.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. So why bother with ports then?</para> <question>
<para>So why bother with ports then?</para>
<para>A. Several reasons:-</para> </question>
<answer>
<para>Several reasons:-</para>
<orderedlist> <orderedlist>
<listitem> <listitem>
@ -576,24 +587,32 @@ do-install:
-->;-)</para> -->;-)</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-patch"> Q. What is a patch?</para> <question>
<para id="ports-patch"> What is a patch?</para>
<para>A. A patch is a small (usually) file that specifies how to go </question>
<answer>
<para>A patch is a small (usually) file that specifies how to go
from one version of a file to another. It contains text that says, from one version of a file to another. It contains text that says,
in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add in effect, things like &ldquo;delete line 23&rdquo;, &ldquo;add
these two lines after line 468&rdquo; or &ldquo;change line 197 to these two lines after line 468&rdquo; or &ldquo;change line 197 to
this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is this&rdquo;. Also known as a &ldquo;diff&rdquo;, since it is
generated by a program of that name.</para> generated by a program of that name.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-tarball"> Q. What is all this about <question>
<para id="ports-tarball"> What is all this about
tarballs?</para> tarballs?</para>
</question>
<para>A. It is a file ending in <filename>.tar</filename> or
<answer>
<para>It is a file ending in <filename>.tar</filename> or
<filename>.tar.gz</filename> (with variations like <filename>.tar.gz</filename> (with variations like
<filename>.tar.Z</filename>, or even <filename>.tgz</filename> if <filename>.tar.Z</filename>, or even <filename>.tgz</filename> if
you are trying to squeeze the names into a DOS filesystem).</para> you are trying to squeeze the names into a DOS filesystem).</para>
@ -613,22 +632,28 @@ do-install:
&prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput> &prompt.user; <userinput>tar xzvf foobar.tar.gz</userinput>
&prompt.user; <userinput>tar tvf foobar.tar</userinput> &prompt.user; <userinput>tar tvf foobar.tar</userinput>
&prompt.user; <userinput>tar xvf foobar.tar</userinput></screen> &prompt.user; <userinput>tar xvf foobar.tar</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-checksum"> Q. And a checksum?</para> <question>
<para id="ports-checksum">And a checksum?</para>
<para>A. It is a number generated by adding up all the data in the </question>
<answer>
<para>It is a number generated by adding up all the data in the
file you want to check. If any of the characters change, the file you want to check. If any of the characters change, the
checksum will no longer be equal to the total, so a simple checksum will no longer be equal to the total, so a simple
comparison will allow you to spot the difference. (In practice, it comparison will allow you to spot the difference. (In practice, it
is done in a more complicated way to spot problems like is done in a more complicated way to spot problems like
position-swapping, which will not show up with a simplistic position-swapping, which will not show up with a simplistic
addition).</para> addition).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did what you said for <link linkend="ports-cd">compiling <question>
<para>I did what you said for <link linkend="ports-cd">compiling
ports from a CDROM</link> and it worked great until I tried to ports from a CDROM</link> and it worked great until I tried to
install the kermit port:-</para> install the kermit port:-</para>
@ -637,38 +662,48 @@ do-install:
&gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen> &gt;&gt; Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.</screen>
<para>Why can it not be found? Have I got a dud CDROM?</para> <para>Why can it not be found? Have I got a dud CDROM?</para>
</question>
<para>A. The licensing terms for kermit do not allow us to put the
<answer>
<para>The licensing terms for kermit do not allow us to put the
tarball for it on the CDROM, so you will have to fetch it by hand tarball for it on the CDROM, so you will have to fetch it by hand
&mdash; sorry! The reason why you got all those error messages was &mdash; sorry! The reason why you got all those error messages was
because you were not connected to the Internet at the time. Once because you were not connected to the Internet at the time. Once
you have downloaded it from any of the sites above, you can re-start you have downloaded it from any of the sites above, you can re-start
the process (try and choose the nearest site to you, though, to save the process (try and choose the nearest site to you, though, to save
your time and the Internet's bandwidth).</para> your time and the Internet's bandwidth).</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I did that, but when I tried to put it into <question>
<para>I did that, but when I tried to put it into
<filename>/usr/ports/distfiles</filename> I got some error about not <filename>/usr/ports/distfiles</filename> I got some error about not
having permission.</para> having permission.</para>
</question>
<para>A. The ports mechanism looks for the tarball in
<answer>
<para>The ports mechanism looks for the tarball in
<filename>/usr/ports/distfiles</filename>, but you will not be able <filename>/usr/ports/distfiles</filename>, but you will not be able
to copy anything there because it is sym-linked to the CDROM, which to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by is read-only. You can tell it to look somewhere else by
doing</para> doing</para>
<screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen> <screen>&prompt.root; <userinput>make DISTDIR=<replaceable>/where/you/put/it</replaceable> install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Does the ports scheme only work if you have everything in <question>
<para>Does the ports scheme only work if you have everything in
<filename>/usr/ports</filename>? My system administrator says I must <filename>/usr/ports</filename>? My system administrator says I must
put everything under put everything under
<filename>/u/people/guests/wurzburger</filename>, but it does not <filename>/u/people/guests/wurzburger</filename>, but it does not
seem to work.</para> seem to work.</para>
</question>
<para>A. You can use the <makevar>PORTSDIR</makevar> and
<answer>
<para>You can use the <makevar>PORTSDIR</makevar> and
<makevar>PREFIX</makevar> variables to tell the ports mechanism to <makevar>PREFIX</makevar> variables to tell the ports mechanism to
use different directories. For instance,</para> use different directories. For instance,</para>
@ -693,15 +728,19 @@ do-install:
<para>If you do not fancy typing all that in every time you install a <para>If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these port (and to be honest, who would?), it is a good idea to put these
variables into your environment.</para> variables into your environment.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I do not have a FreeBSD CDROM, but I would like to have all <question>
<para>I do not have a FreeBSD CDROM, but I would like to have all
the tarballs handy on my system so I do not have to wait for a the tarballs handy on my system so I do not have to wait for a
download every time I install a port. Is there an easy way to get download every time I install a port. Is there an easy way to get
them all at once?</para> them all at once?</para>
</question>
<para>A. To get every single tarball for the ports collection,
<answer>
<para>To get every single tarball for the ports collection,
do</para> do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
@ -714,57 +753,77 @@ do-install:
<para>and for just one port &mdash; well, I think you have guessed <para>and for just one port &mdash; well, I think you have guessed
already.</para> already.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I know it is probably faster to fetch the tarballs from one <question>
<para>I know it is probably faster to fetch the tarballs from one
of the FreeBSD mirror sites close by. Is there any way to tell the of the FreeBSD mirror sites close by. Is there any way to tell the
port to fetch them from servers other than ones listed in the port to fetch them from servers other than ones listed in the
MASTER_SITES?</para> MASTER_SITES?</para>
</question>
<para>A. Yes. If you know, for example, <hostid
<answer>
<para>Yes. If you know, for example, <hostid
role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites role="fqdn">ftp.FreeBSD.org</hostid> is much closer than sites
listed in <makevar>MASTER_SITES</makevar>, do as following listed in <makevar>MASTER_SITES</makevar>, do as following
example.</para> example.</para>
<screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput> <screen>&prompt.root; <userinput>cd /usr/ports/<replaceable>directory</replaceable></userinput>
&prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen> &prompt.root; <userinput>make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I want to know what files make is going to need before it <question>
<para>I want to know what files make is going to need before it
tries to pull them down.</para> tries to pull them down.</para>
</question>
<para>A. <command>make fetch-list</command> will display a list of
<answer>
<para><command>make fetch-list</command> will display a list of
the files needed for a port.</para> the files needed for a port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Is there any way to stop the port from compiling? I want to <question>
<para>Is there any way to stop the port from compiling? I want to
do some hacking on the source before I install it, but it is a bit do some hacking on the source before I install it, but it is a bit
tiresome having to watch it and hit control-C every time.</para> tiresome having to watch it and hit control-C every time.</para>
</question>
<para>A. Doing <command>make extract</command> will stop it after it
<answer>
<para>Doing <command>make extract</command> will stop it after it
has fetched and extracted the source code.</para> has fetched and extracted the source code.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I am trying to make my own port and I want to be able to <question>
<para>I am trying to make my own port and I want to be able to
stop it compiling until I have had a chance to see if my patches stop it compiling until I have had a chance to see if my patches
worked properly. Is there something like <command>make worked properly. Is there something like <command>make
extract</command>, but for patches?</para> extract</command>, but for patches?</para>
</question>
<para>A. Yep, <command>make patch</command> is what you want. You
<answer>
<para>Yep, <command>make patch</command> is what you want. You
will probably find the <makevar>PATCH_DEBUG</makevar> option useful will probably find the <makevar>PATCH_DEBUG</makevar> option useful
as well. And by the way, thank you for your efforts!</para> as well. And by the way, thank you for your efforts!</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I have heard that some compiler options can cause bugs. Is <question>
<para>I have heard that some compiler options can cause bugs. Is
this true? How can I make sure that I compile ports with the right this true? How can I make sure that I compile ports with the right
settings?</para> settings?</para>
</question>
<para>A. Yes, with version 2.6.3 of <command>gcc</command> (the
<answer>
<para>Yes, with version 2.6.3 of <command>gcc</command> (the
version shipped with FreeBSD 2.1.0 and 2.1.5), the version shipped with FreeBSD 2.1.0 and 2.1.5), the
<option>-O2</option> option could result in buggy code unless you <option>-O2</option> option could result in buggy code unless you
used the <option>-fno-strength-reduce</option> option as well. used the <option>-fno-strength-reduce</option> option as well.
@ -772,7 +831,6 @@ do-install:
<emphasis>should</emphasis> be able to specify the compiler options <emphasis>should</emphasis> be able to specify the compiler options
used by something like</para> used by something like</para>
<screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen> <screen>&prompt.root; <userinput>make CFLAGS='-O2 -fno-strength-reduce' install</userinput></screen>
<para>or by editing <filename>/etc/make.conf</filename>, but <para>or by editing <filename>/etc/make.conf</filename>, but
@ -781,13 +839,17 @@ do-install:
and inspect the Makefiles by hand, but this can get tedious if the and inspect the Makefiles by hand, but this can get tedious if the
source has lots of sub-directories, each with their own source has lots of sub-directories, each with their own
Makefiles.</para> Makefiles.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. There are so many ports it is hard to find the one I want. <question>
<para>There are so many ports it is hard to find the one I want.
Is there a list anywhere of what ports are available?</para> Is there a list anywhere of what ports are available?</para>
</question>
<para>A. Look in the <filename>INDEX</filename> file in
<answer>
<para>Look in the <filename>INDEX</filename> file in
<filename>/usr/ports</filename>. If you would like to search the <filename>/usr/ports</filename>. If you would like to search the
ports collection for a keyword, you can do that too. For example, ports collection for a keyword, you can do that too. For example,
you can find ports relevant to the LISP programming language you can find ports relevant to the LISP programming language
@ -795,28 +857,36 @@ do-install:
<screen>&prompt.user; <userinput>cd /usr/ports</userinput> <screen>&prompt.user; <userinput>cd /usr/ports</userinput>
&prompt.user; <userinput>make search key=lisp</userinput></screen> &prompt.user; <userinput>make search key=lisp</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I went to install the <literal>foo</literal> port but the <question>
<para>I went to install the <literal>foo</literal> port but the
system suddenly stopped compiling it and starting compiling the system suddenly stopped compiling it and starting compiling the
<literal>bar</literal> port. What is going on?</para> <literal>bar</literal> port. What is going on?</para>
</question>
<para>A. The <literal>foo</literal> port needs something that is
<answer>
<para>The <literal>foo</literal> port needs something that is
supplied with <literal>bar</literal> &mdash; for instance, if supplied with <literal>bar</literal> &mdash; for instance, if
<literal>foo</literal> uses graphics, <literal>bar</literal> might <literal>foo</literal> uses graphics, <literal>bar</literal> might
have a library with useful graphics processing routines. Or have a library with useful graphics processing routines. Or
<literal>bar</literal> might be a tool that is needed to compile the <literal>bar</literal> might be a tool that is needed to compile the
<literal>foo</literal> port.</para> <literal>foo</literal> port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para><anchor id="ports-remove"> Q. I installed the <question>
<para id="ports-remove"> I installed the
<literal>grizzle</literal> program from the ports and frankly it is <literal>grizzle</literal> program from the ports and frankly it is
a complete waste of disk space. I want to delete it but I do not a complete waste of disk space. I want to delete it but I do not
know where it put all the files. Any clues?</para> know where it put all the files. Any clues?</para>
</question>
<para>A. No problem, just do</para>
<answer>
<para>No problem, just do</para>
<screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen> <screen>&prompt.root; <userinput>pkg_delete grizzle-6.5</userinput></screen>
@ -824,27 +894,35 @@ do-install:
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/grizzle</replaceable></userinput>
&prompt.root; <userinput>make deinstall</userinput></screen> &prompt.root; <userinput>make deinstall</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<question>
<para> <para>
Q. Hang on a minute, you have to know the version number to use 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 that command. You do not seriously expect me to remember that, do
you??</para> you??</para>
</question>
<para>A. Not at all, you can find it out by doing</para>
<answer>
<para>Not at all, you can find it out by doing</para>
<screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput> <screen>&prompt.root; <userinput>pkg_info -a | grep grizzle</userinput>
Information for grizzle-6.5: Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen> grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.</screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. Talking of disk space, the ports directory seems to be <question>
<para>Talking of disk space, the ports directory seems to be
taking up an awful lot of room. Is it safe to go in there and taking up an awful lot of room. Is it safe to go in there and
delete things?</para> delete things?</para>
</question>
<para>A. Yes, if you have installed the program and are fairly
<answer>
<para>Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is</para> keeping it hanging around. The best way to do this is</para>
@ -853,44 +931,60 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
<para>which will go through all the ports subdirectories and delete <para>which will go through all the ports subdirectories and delete
everything except the skeletons for each port.</para> everything except the skeletons for each port.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I tried that and it still left all those tarballs or <question>
<para>I tried that and it still left all those tarballs or
whatever you called them in the <filename>distfiles</filename> whatever you called them in the <filename>distfiles</filename>
directory. Can I delete those as well?</para> directory. Can I delete those as well?</para>
</question>
<para>A. Yes, if you are sure you have finished with them, those can
<answer>
<para>Yes, if you are sure you have finished with them, those can
go as well.</para> go as well.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I like having lots and lots of programs to play with. Is <question>
<para>I like having lots and lots of programs to play with. Is
there any way of installing all the ports in one go?</para> there any way of installing all the ports in one go?</para>
</question>
<para>A. Just do</para>
<answer>
<para>Just do</para>
<screen>&prompt.root; <userinput>cd /usr/ports</userinput> <screen>&prompt.root; <userinput>cd /usr/ports</userinput>
&prompt.root; <userinput>make install</userinput></screen> &prompt.root; <userinput>make install</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. OK, I tried that, but I thought it would take a very long <question>
<para>OK, I tried that, but I thought it would take a very long
time so I went to bed and left it to get on with it. When I looked time so I went to bed and left it to get on with it. When I looked
at the computer this morning, it had only done three and a half at the computer this morning, it had only done three and a half
ports. Did something go wrong?</para> ports. Did something go wrong?</para>
</question>
<para>A. No, the problem is that some of the ports need to ask you
<answer>
<para>No, the problem is that some of the ports need to ask you
questions that we cannot answer for you (eg &ldquo;Do you want to questions that we cannot answer for you (eg &ldquo;Do you want to
print on A4 or US letter sized paper?&rdquo;) and they need to have print on A4 or US letter sized paper?&rdquo;) and they need to have
someone on hand to answer them.</para> someone on hand to answer them.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. I really do not want to spend all day staring at the <question>
<para>I really do not want to spend all day staring at the
monitor. Any better ideas?</para> monitor. Any better ideas?</para>
</question>
<para>A. OK, do this before you go to bed/work/the local
<answer>
<para>OK, do this before you go to bed/work/the local
park:-</para> park:-</para>
<screen>&prompt.root <userinput>cd /usr/ports</userinput> <screen>&prompt.root <userinput>cd /usr/ports</userinput>
@ -903,15 +997,19 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen> &prompt.root; <userinput>make -DIS_INTERACTIVE install</userinput></screen>
<para>to finish the job.</para> <para>to finish the job.</para>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. At work, we are using <literal>frobble</literal>, which is <question>
<para>At work, we are using <literal>frobble</literal>, which is
in your ports collection, but we have altered it quite a bit to get in your ports collection, but we have altered it quite a bit to get
it to do what we need. Is there any way of making our own packages, it to do what we need. Is there any way of making our own packages,
so we can distribute it more easily around our sites?</para> so we can distribute it more easily around our sites?</para>
</question>
<para>A. No problem, assuming you know how to make patches for your
<answer>
<para>No problem, assuming you know how to make patches for your
changes:-</para> changes:-</para>
<screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput> <screen>&prompt.root; <userinput>cd <replaceable>/usr/ports/somewhere/frobble</replaceable></userinput>
@ -920,24 +1018,27 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
[Apply your patches] [Apply your patches]
&prompt.root; <userinput>cd ../..</userinput> &prompt.root; <userinput>cd ../..</userinput>
&prompt.root; <userinput>make package</userinput></screen> &prompt.root; <userinput>make package</userinput></screen>
</listitem> </answer>
</qandaentry>
<listitem> <qandaentry>
<para>Q. This ports stuff is really clever. I am desperate to find <question>
<para>This ports stuff is really clever. I am desperate to find
out how you did it. What is the secret?</para> out how you did it. What is the secret?</para>
</question>
<para>A. Nothing secret about it at all, just look at the
<answer>
<para>Nothing secret about it at all, just look at the
<filename>bsd.ports.mk</filename> and <filename>bsd.ports.mk</filename> and
<filename>bsd.ports.subdir.mk</filename> files in your <ulink <filename>bsd.ports.subdir.mk</filename> files in your <ulink
URL="file://localhost/usr/ports/Mk/">makefiles URL="file://localhost/usr/ports/Mk/">makefiles
directory.</ulink></para> directory.</ulink></para>
<note>
<para>Readers with an aversion to intricate shell-scripts are <para>Readers with an aversion to intricate shell-scripts are
advised not to follow this link...)</para> advised not to follow this link...)</para>
</note> </answer>
</listitem> </qandaentry>
</itemizedlist> </qandaset>
</sect1> </sect1>
<sect1 id="porting"> <sect1 id="porting">
@ -4674,6 +4775,6 @@ pre-install:
sgml-indent-data: t sgml-indent-data: t
sgml-omittag: nil sgml-omittag: nil
sgml-always-quote-attributes: t sgml-always-quote-attributes: t
sgml-parent-document: ("../handbook.sgml" "part" "chapter") sgml-parent-document: ("../book.sgml" "part" "chapter")
End: End:
--> -->