Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 1996 09:08:53 -0400
From:      John Clark <jrclark@felix.iupui.edu>
To:        doc@freebsd.org
Subject:   FAQ Contribution
Message-ID:  <2.2.32.19960523130853.006972e4@felix.iupui.edu>

next in thread | raw e-mail | index | archive | help
Documentation Maintainers:

Recently I switched from Linux to FreeBSD.  Doing this allowed me to see
some serious holes in your documentation.  Probably among the worst is the
total lack of coherent directions for using the "ports" collection.  You
have a great deal of the documentation in place for this topic in the
handbook, however, key details are missing.  Most prominently, there is NO
mention, anywhere, that one has to type "get portname.tar.gz" to fetch the
port subdirectory from cdrom.com.  One sentence in the handbook could
rectify this.  There are other problems as far as conveying the concept of
how the port is used and its relationship to the generic internet
distribution of the "port" in question.

Anyway, I have written a FAQ to be added on this subject.  I see no FAQ
regarding "How to use the ports collection."  I would like to submit it, and
you may do with it as you please (edit, discard, etc.).  I strongly
recommend that you make such an addition to the FAQ, as a scan of the
"questions@freebsd.org" is loaded with just such questions -- it is indeed a
question that is frequently asked.  I posted this faq entry to
questions@freebsd.org requesting additions / deletions but received none.

Please review the document below, as I have been using the "ports"
collection for 2 days, and it is really a case of the blind-leading-the-blind.



--cut-here-----cut-here-----cut-here-----cut-here-----cut-here---


---------------------------------
HOW TO USE THE "PORTS" COLLECTION
---------------------------------



What is it?
-----------
The ports collection is a series of version specific patches that modify a
particular distribution for compiling under FreeBSD.  The patches do not
reside in a single file, but in a subdirectory that must be tarred and
gziped by you.


Where is it installed?
----------------------
The patches (ports) are designed to run anywhere on the system, I think.
However, in my experience, they work best in their default location: under
the "/usr/ports" subdirectory.

For example:

   How the "Apache" WWW server "port" may be installed:

   /usr/ports/distfiles/apache_1.0.5.tar.gz   : The original distribution
                                              : (from: ftp.apache.org)

   /usr/ports/apache                          : The "port"
                                              : (from: ftp.freebsd.org)

    NOTE: This would be unpacked from the portname.tar.gz 
          obtained from compressing the ports subdirectory 
          on the server (get portname.tar.gz -- see below).

   - or better yet -

   /usr/ports/net/apache                      : (see above)


As you can see there is a bit of flexibility as to where the "ports" patch
sources are located.  I think you should keep them under "/usr/ports."  If
you have many "ports" installed, the latter approach shown above may be the
better idea for organization purposes.


How to get all the files needed for a particular distribution:
--------------------------------------------------------------

You really only need to grab the files from "ftp.freebsd.org" for the
particular distribution you are interested in.  Here's how:

	go to: "ftp.freebsd.org/pub/FreeBSD/ports-2.1"

	and run: "get portname.tar.gz"

I know this seems crazy, as no such file will exist, but the site will tar
and gzip the subdirectory of interest, piping the output to your ftp
session, so you end up with "portname.tar.gz."

Now that you have the subdirectory of the "port" tarred and gziped, you can
unpack it in a subdirectory (preferably /usr/ports) and begin the "port"
process.  If you do not have the original distribution sources that the port
is based upon, the "port" itself will attempt to anonymous ftp them from
their primary site (uses "ncftp").  The default location for the original
distribution (from 3rd parties) sources (in .tgz form) is 
"/usr/ports/distfiles."  Make sure this subdirectory exists.  You can also
copy the gziped distribution file to "/usr/ports/distfiles" manually, and
the "port" script will find it automatically.  To see what files the "port"
script will call, type: "make fetch-list" in the particular "port's"
subdirectory.


How to actually compile and install a "port":
---------------------------------------------

Switch to the subdirectory containing the port you are ready to install.  In
the previous Apache WWW Server example, the directory may be
"/usr/ports/apache."

In the subdirectory, type: "make" 

   This will patch and compile the original distribution.  As 
   stated before, if the original distribution file is not found 
   in "" then it will attempt to fetch it from the Internet.  All 
   of this information is contained in the "Makefile;"
   ie.) "/usr/ports/apache/Makefile."  

Finally, type: "make install"

   This will copy the binaries just compiled, and may add manual 
   pages, among other things.

(You may also like to run: "make clean" afterward.)


This should be enough to kick start you.  Don't forget to try searching the
questions archives at: "http://www.freebsd.org/search.html."  Topics such as
"ports how" have been fruitful for me.

GOOD LUCK!


--cut-here-----cut-here-----cut-here-----cut-here-----cut-here---



		--John
		[jrclark@indy.net]




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2.2.32.19960523130853.006972e4>