PORTS(7)                   OpenBSD Reference Manual                   PORTS(7)

NAME
     ports - contributed applications

DESCRIPTION
     The OpenBSD Ports Collection (shamelessly stolen from the FreeBSD Ports
     Collection) offers a simple way for users and administrators to install
     applications.  Each port contains any patches necessary to make the orig-
     inal application source code compile and run on BSD.  Compiling an appli-
     cation is as simple as typing make in the port directory!  The Makefile
     automatically fetches the application source code, either from a local
     disk or via ftp, unpacks it on your system, applies the patches, and com-
     piles it.  If all goes well, simply type make install to install the ap-
     plication.

     For more information about using ports, see The OpenBSD Ports Mechanism
     (http://www.openbsd.org/ports.html).  For information about creating new
     ports, see Building an OpenBSD Port (http://www.openbsd.org/port-
     ing.html).  Other excellent resources are the ports and porting sections
     of the FreeBSD Handbook (http://www.freebsd.org/handbook/ports.html and
     http://www.freebsd.org/handbook/porting.html) as well as the NetBSD Pack-
     age System documentation (http://www.netbsd.org/Documentation/netb-
     sd/Packages.txt).

TARGETS
     Some of the targets work recursively through subdirectories.  This lets
     you, for example, install all of the net ports.  The targets that do this
     are build, checksum, clean, configure, extract and package.

     The following targets will be run automatically by each proceeding target
     in order.  That is, build will be run (if necessary) by install, and so
     on all the way to fetch. You will usually only target install.

     fetch      Fetch all of the files needed to build this port from the
                site(s) listed in MASTER_SITES and PATCH_SITES. See FETCH_CMD
                and MASTER_SITE_OVERRIDE.

     checksum   Verify that the fetched distfile matches the one the port was
                tested against.  Defining NO_CHECKSUM will skip this step.

     depends    Install (or compile if only compilation is necessary) any de-
                pendencies of the current port.  When called by the extract or
                fetch targets, this is run in piecemeal as fetch-depends,
                build-depends, etc.  Defining NO_DEPENDS will skip this step.

     extract    Expand the distfile into a work directory.

     patch      Apply any patches that are necessary for the port.

     configure  Configure the port.  Some ports will ask you questions during
                this stage.  See INTERACTIVE and BATCH.

     build      Build the port.  This is the same as calling the all target.

     install    Install the port and register it with the package system.
                This is all you really need to do.

     The following targets are not run during the normal install process.

     fetch-list  Show list of files needed to be fetched in order to build the
                 port.

     depends-list package-depends
                 Print a list of all the compile and run dependencies, and de-

                 pendencies of those dependencies.

     clean       Remove the expanded source code.  This recurses to dependen-
                 cies unless NOCLEANDEPENDS is defined.

     distclean   Remove the port's distfile(s) and perform the clean opera-
                 tion.  The `clean' portion recurses to dependencies unless
                 NOCLEANDEPENDS is defined, but the `distclean' portion never
                 recurses (this is perhaps a bug).

     reinstall   Use this to restore a port after using pkg_delete(1).

     package     Make a binary package for the port.  The port will be in-
                 stalled if it hasn't already been.  The package is a .tgz
                 file that you can use to install the port on other machines
                 with pkg_add(1).  If the directory specified by PACKAGES does
                 not exist the package will be put into the current directory.
                 See PKGREPOSITORY and PKGFILE.

ENVIRONMENT VARIABLES
     You can change all of these.

     PORTSDIR      Location of the ports tree.  This is /usr/ports on FreeBSD
                   and OpenBSD and /usr/pkgsrc on NetBSD.

     DISTDIR       Where to find/put distfiles, normally distfiles/ in
                   PORTSDIR.

     PACKAGES      Used only for the package target; the base directory for
                   the packages tree, normally packages/ in PORTSDIR. If this
                   directory exists, the package tree will be (partially) con-
                   structed.  This directory does not have to exist; if it
                   doesn't packages will be placed into the current directory,
                   or you can define one of

                   PKGREPOSITORY  Directory to put the package in.

                   PKGFILE        The full path to the package.

     PREFIX        Where to install things in general (usually /usr/local or
                   /usr/X11R6)

     MASTER_SITES  Primary sites for distribution files if not found locally.

     PATCH_SITES   Primary location(s) for distribution patch files if not
                   found locally.

     MASTER_SITE_OPENBSD
                   If set, go to the master OpenBSD site for all files.

     MASTER_SITE_FREEBSD
                   If set, go to the master FreeBSD site for all files.

     MASTER_SITE_OVERRIDE
                   Try going to this site for all files and patches, first.

     NOCLEANDEPENDS
                   If defined, don't let `clean' recurse to dependencies.

     FETCH_CMD     Command to use to fetch files.  Normally fetch(1).

     FORCE_PKG_REGISTER
                   If set, overwrite any existing package registration on the


                   system.

     MOTIFLIB      Location of libXm.{a,so}.

     PATCH_DEBUG   If defined, display verbose output when applying each
                   patch.

     INTERACTIVE   If defined, only operate on a port if it requires interac-
                   tion.

     BATCH         If defined, only operate on a port if it can be installed
                   100% automatically.

FILES
     /usr/ports       The default ports directory (FreeBSD and OpenBSD).
     /usr/pkgsrc      The default ports directory (NetBSD).
     /usr/share/mk/bsd.port.mk
                      The big Kahuna.

SEE ALSO
     make(1),  pkg_add(1),  pkg_create(1),  pkg_delete(1),  pkg_info(1)

     The FreeBSD handbook.

AUTHORS
     This man page was originated by David O'Brien. The FreeBSD ports collec-
     tion is maintained by
     Satoshi Asami and the awesome ports team.  The OpenBSD ports collection
     is maintained by Marco S Hyman and a host of others found at ports@openb-
     sd.org.

HISTORY
     The Ports Collection appeared in FreeBSD 1.0.

BUGS
     Ports documentation is split over four places ---
     /usr/share/mk/bsd.port.mk, the ``Ports Collection'' section of the FreeB-
     SD handbook, the ``Porting Existing Software'' section of the FreeBSD
     handbook, and ports(7).  OpenBSD adds a few web pages to further confuse
     the issue.

     This man page is too long.

OpenBSD 2.6                    January 25, 1998                              3
