Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 1996 10:36:39 -0500
From:      John Clark <jrclark@felix.iupui.edu>
To:        questions@freebsd.org
Subject:   Howto use the "ports" collection
Message-ID:  <2.2.32.19960521104110.002f6864@felix.iupui.edu>

next in thread | raw e-mail | index | archive | help
To all,
 
I would like to contribute the following lines as a "howto" document, or a
supplement to the Handbook documentation, or a FAQ (wherever the
documentation maintainers feel is best).  I really felt like a fool not
knowing how to use the "ports" collection.  After figuring out how, I really
felt like a fool -- you FreeBSD people really have application porting down
to a science!  

The entire ports process is so simple, I can see why a few vital details are
missing from _any_ of the available documentation.  What I want from you all
(who care to read) is to make sure the info is accurate before submission.
I just learned (hours ago) how the whole process works.

Here it is:

--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.19960521104110.002f6864>