freebsd-skq/share/man/man7/ports.7

572 lines
14 KiB
Groff
Raw Normal View History

.\"
.\" Copyright (c) 1997 David E. O'Brien
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
1999-08-28 00:22:10 +00:00
.\" $FreeBSD$
.\"
.Dd June 6, 2014
.Dt PORTS 7
.Os
.Sh NAME
.Nm ports
.Nd contributed applications
.Sh DESCRIPTION
The
2000-11-14 11:20:58 +00:00
.Fx
2002-03-18 10:07:22 +00:00
Ports Collection
offers a simple way for users and
administrators to install applications.
Each
.Em port
contains any patches necessary to make the original
application source code compile and run on
.Fx .
Compiling an
application is as simple as typing
2002-03-18 10:07:22 +00:00
.Nm make Cm build
in the port directory!
The
.Pa Makefile
automatically fetches the
2002-03-18 10:07:22 +00:00
application source code, either from a local disk or via FTP, unpacks it
on your system, applies the patches, and compiles it.
If all goes well,
simply type
2002-03-18 10:07:22 +00:00
.Nm make Cm install
to install the application.
.Pp
For more information about using ports, see
2002-03-18 10:07:22 +00:00
.Dq "Packages and Ports"
in
2002-03-18 10:07:22 +00:00
.%B "The FreeBSD Handbook" ,
.Pa ( file:/usr/share/doc/en_US.ISO8859-1/books/handbook/ports.html
2002-03-18 10:07:22 +00:00
or
.Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ports.html ) .
For information about creating new ports, see
2002-03-18 10:07:22 +00:00
.%B "The Porter's Handbook"
.Pa ( file:/usr/share/doc/en_US.ISO8859-1/books/porters-handbook/index.html
2002-03-18 10:07:22 +00:00
or
.Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/ ) .
.Sh TARGETS
Some of the targets work recursively through subdirectories.
2002-03-18 10:07:22 +00:00
This lets you, for example, install all of the
.Dq Li biology
ports.
The targets that do this are
.Cm build , checksum , clean , configure ,
.Cm depends , extract , fetch , install ,
and
2002-03-18 10:07:22 +00:00
.Cm package .
.Pp
The following targets will be run automatically by each proceeding
2002-03-18 10:07:22 +00:00
target in order.
That is,
.Cm build
will be run
(if necessary)
by
2002-03-18 10:07:22 +00:00
.Cm install ,
and so on all the way to
2002-03-18 10:07:22 +00:00
.Cm fetch .
Usually, you will only use the
2002-03-18 10:07:22 +00:00
.Cm install
target.
2002-03-18 10:07:22 +00:00
.Bl -tag -width ".Cm configure"
.It Cm config
Configure
.Va OPTIONS
for this port using
.Xr dialog4ports 1 .
2002-03-18 10:07:22 +00:00
.It Cm fetch
Fetch all of the files needed to build this port from the sites
listed in
.Va MASTER_SITES
and
2002-03-18 10:07:22 +00:00
.Va PATCH_SITES .
See
.Va FETCH_CMD , MASTER_SITE_OVERRIDE
2002-03-18 10:07:22 +00:00
and
.Va MASTER_SITE_BACKUP .
2002-03-18 10:07:22 +00:00
.It Cm checksum
Verify that the fetched distfile's checksum matches the one the port was
tested against.
If the distfile's checksum does not match, it also fetches the distfiles
which are missing or failed the checksum calculation.
Defining
2002-03-18 10:07:22 +00:00
.Va NO_CHECKSUM
will skip this step.
2002-03-18 10:07:22 +00:00
.It Cm depends
Install
(or compile if only compilation is necessary)
2002-03-18 10:07:22 +00:00
any dependencies of the current port.
When called by the
.Cm extract
or
2002-03-18 10:07:22 +00:00
.Cm fetch
targets, this is run in piecemeal as
2002-03-18 10:07:22 +00:00
.Cm fetch-depends , build-depends ,
etc.
Defining
.Va NO_DEPENDS
will skip this step.
2002-03-18 10:07:22 +00:00
.It Cm extract
Expand the distfile into a work directory.
2002-03-18 10:07:22 +00:00
.It Cm patch
Apply any patches that are necessary for the port.
2002-03-18 10:07:22 +00:00
.It Cm configure
Configure the port.
Some ports will ask you questions during this stage.
See
.Va INTERACTIVE
and
2002-03-18 10:07:22 +00:00
.Va BATCH .
.It Cm build
Build the port.
This is the same as calling the
.Cm all
target.
2002-03-18 10:07:22 +00:00
.It Cm install
Install the port and register it with the package system.
This is all you really need to do.
.El
.Pp
The following targets are not run during the normal install process.
.Bl -tag -width ".Cm fetch-recursive"
.It Cm showconfig
Display
.Va OPTIONS
config for this port.
.It Cm showconfig-recursive
Display
.Va OPTIONS
config for this port and all its dependencies.
.It Cm rmconfig
Remove
.Va OPTIONS
config for this port.
.It Cm rmconfig-recursive
Remove
.Va OPTIONS
config for this port and all its dependencies.
.It Cm config-conditional
Skip the ports which have already had their
.Va OPTIONS
configured.
.It Cm config-recursive
Configure
.Va OPTIONS
for this port and all its dependencies using
.Xr dialog4ports 1 .
2002-03-18 10:07:22 +00:00
.It Cm fetch-list
Show list of files to be fetched in order to build the port.
.It Cm fetch-recursive
Fetch the distfiles of the port and all its dependencies.
.It Cm fetch-recursive-list
Show list of files that would be retrieved by
.Cm fetch-recursive .
.It Cm run-depends-list , build-depends-list
Print a list of all the compile and run dependencies, and dependencies
of those dependencies, by port directory.
.It Cm all-depends-list
Print a list of all dependencies for the port.
2002-03-18 10:07:22 +00:00
.It Cm pretty-print-run-depends-list , pretty-print-build-depends-list
Print a list of all the compile and run dependencies, and dependencies
of those dependencies, by port name and version.
2006-07-05 20:07:59 +00:00
.It Cm missing
Print a list of missing dependencies to be installed for the port.
2002-03-18 10:07:22 +00:00
.It Cm clean
Remove the expanded source code.
This recurses to dependencies unless
.Va NOCLEANDEPENDS
is defined.
2002-03-18 10:07:22 +00:00
.It Cm distclean
Remove the port's distfiles and perform the
.Cm clean
target.
The
2002-03-18 10:07:22 +00:00
.Cm clean
portion recurses to dependencies unless
2002-03-18 10:07:22 +00:00
.Va NOCLEANDEPENDS
is defined, but the
2002-03-18 10:07:22 +00:00
.Cm distclean
portion never recurses
(this is perhaps a bug).
2002-03-18 10:07:22 +00:00
.It Cm reinstall
Use this to restore a port after using
.Xr pkg_delete 1
when you should have used
2002-03-18 10:07:22 +00:00
.Cm deinstall .
.It Cm deinstall
Remove an installed port from the system, similar to
.Xr pkg_delete 1 .
.It Cm deinstall-all
Remove all installed ports with the same
.Va PKGORIGIN
from the system.
2002-03-18 10:07:22 +00:00
.It Cm package
Make a binary package for the port.
The port will be installed if it has not already been.
The package is a
.Pa .tbz
2002-03-18 10:07:22 +00:00
file that you can use to
install the port on other machines with
.Xr pkg_add 1 .
If the directory specified by
2002-03-18 10:07:22 +00:00
.Va PACKAGES
does not exist, the package will be put into the current directory.
See
2002-03-18 10:07:22 +00:00
.Va PKGREPOSITORY
and
2002-03-18 10:07:22 +00:00
.Va PKGFILE .
.It Cm package-recursive
Like
.Cm package ,
but makes a package for each depending port as well.
.It Cm package-name
Prints the name with version of the port.
2002-03-18 10:07:22 +00:00
.It Cm readmes
Create a port's
.Pa README.html .
This can be used from
.Pa /usr/ports
to create a browsable web of all ports on your system!
2002-03-18 10:07:22 +00:00
.It Cm search
Search the
.Pa INDEX
file for the pattern specified by the
2002-03-18 10:07:22 +00:00
.Va key
(searches the port name, comment, and dependencies),
2002-03-18 10:07:22 +00:00
.Va name
(searches the port name only),
.Va path
(searches the port path),
.Va info
(searches the port info),
.Va maint
(searches the port maintainer),
.Va cat
(searches the port category),
.Va bdeps
(searches the port build-time dependency),
.Va rdeps
(searches the port run-time dependency),
.Va www
(searches the port web site)
2002-03-18 10:07:22 +00:00
.Xr make 1
variables, and their exclusion counterparts:
.Va xname , xkey
etc.
For example, one would type:
.Pp
2002-03-18 10:07:22 +00:00
.Dl "cd /usr/ports && make search name=query"
.Pp
to find all ports whose
name matches
2002-03-18 10:07:22 +00:00
.Dq Li query .
Results include the matching ports' path, comment, maintainer,
build dependencies, and run dependencies.
.Bd -literal -offset indent
cd /usr/ports && make search name=pear- \e
xbdeps=apache
.Ed
.Pp
To find all ports whose
names contain
.Dq Li pear-
and which do not have apache
listed in build-time dependencies.
.Bd -literal -offset indent
cd /usr/ports && make search name=pear- \e
xname='ht(tp|ml)'
.Ed
.Pp
To find all ports whose names contain
.Dq Li pear- ,
but not
.Dq Li html
or
.Dq Li http .
.Bd -literal -offset indent
make search key=apache display=name,path,info keylim=1
.Ed
.Pp
To find ports that contain
.Dq Li apache
in either of the name, path, info
fields, ignore the rest of the record.
.Pp
2008-12-05 22:04:52 +00:00
By default the search is not case-sensitive.
In order to make it case-sensitive you can use the
.Va icase
variable:
.Bd -literal -offset indent
make search name=p5-R icase=0
.Ed
.It Cm quicksearch
Reduced
.Cm search
output.
Only display name, path and info.
.It Cm describe
Generate a one-line description of each port for use in the
.Pa INDEX
file.
.It Cm maintainer
Display the port maintainer's email address.
2002-03-18 10:07:22 +00:00
.It Cm index
Create
.Pa /usr/ports/INDEX ,
which is used by the
2002-03-18 10:07:22 +00:00
.Cm pretty-print-*
and
2002-03-18 10:07:22 +00:00
.Cm search
targets.
Running the
2002-03-18 10:07:22 +00:00
.Cm index
target will ensure your
.Pa INDEX
file is up to date with your ports tree.
.It Cm fetchindex
Fetch the
.Pa INDEX
file from the
.Fx
cluster.
2000-12-29 09:18:45 +00:00
.El
.Sh ENVIRONMENT
You can change all of these.
2002-03-18 10:07:22 +00:00
.Bl -tag -width ".Va MASTER_SITES"
.It Va PORTSDIR
Location of the ports tree.
This is
.Pa /usr/ports
on
2000-11-14 11:20:58 +00:00
.Fx
and
2002-03-18 10:07:22 +00:00
.Ox ,
and
.Pa /usr/pkgsrc
on
.Nx .
2002-03-18 10:07:22 +00:00
.It Va WRKDIRPREFIX
Where to create any temporary files.
Useful if
.Va PORTSDIR
is read-only (perhaps mounted from a CD-ROM).
.It Va DISTDIR
Where to find/put distfiles, normally
.Pa distfiles/
in
2002-03-18 10:07:22 +00:00
.Va PORTSDIR .
.It Va PACKAGES
Used only for the
2002-03-18 10:07:22 +00:00
.Cm package
target; the base directory for the packages tree, normally
.Pa packages/
in
2002-03-18 10:07:22 +00:00
.Va PORTSDIR .
If this directory exists, the package tree will be (partially) constructed.
2002-03-18 10:07:22 +00:00
This directory does not have to exist; if it does not, packages will be
placed into the current directory, or you can define one of
2002-03-18 10:07:22 +00:00
.Bl -tag -width ".Va PKGREPOSITORY"
.It Va PKGREPOSITORY
Directory to put the package in.
2002-03-18 10:07:22 +00:00
.It Va PKGFILE
The full path to the package.
.El
.It Va LOCALBASE
Where existing things are installed and where to search for files when
resolving dependencies (usually
.Pa /usr/local ) .
.It Va PREFIX
Where to install this port (usually set to the same as
.Va LOCALBASE ) .
2002-03-18 10:07:22 +00:00
.It Va MASTER_SITES
Primary sites for distribution files if not found locally.
2002-03-18 10:07:22 +00:00
.It Va PATCH_SITES
Primary locations for distribution patch files if not found
locally.
2002-03-18 10:07:22 +00:00
.It Va MASTER_SITE_FREEBSD
2000-11-14 11:20:58 +00:00
If set, go to the master
.Fx
site for all files.
2002-03-18 10:07:22 +00:00
.It Va MASTER_SITE_OVERRIDE
Try going to these sites for all files and patches, first.
.It Va MASTER_SITE_BACKUP
Try going to these sites for all files and patches, last.
.It Va RANDOMIZE_MASTER_SITES
Try the download locations in a random order.
.It Va MASTER_SORT
Sort the download locations according to user supplied pattern.
Example:
.Dl .dk .sunet.se .se dk.php.net .no .de heanet.dl.sourceforge.net
.It Va MASTER_SITE_INDEX
Where to get
.Pa INDEX
source built on
.Fx
cluster (for
.Cm fetchindex
target).
Defaults to
.Pa http://www.FreeBSD.org/ports/ .
.It Va FETCHINDEX
Command to get
.Pa INDEX
(for
.Cm fetchindex
target).
Defaults to
.Dq Nm fetch Fl am .
2002-03-18 10:07:22 +00:00
.It Va NOCLEANDEPENDS
If defined, do not let
.Cm clean
recurse to dependencies.
2002-03-18 10:07:22 +00:00
.It Va FETCH_CMD
Command to use to fetch files.
Normally
.Xr fetch 1 .
2002-03-18 10:07:22 +00:00
.It Va FORCE_PKG_REGISTER
If set, overwrite any existing package registration on the system.
2002-03-18 10:07:22 +00:00
.It Va MOTIFLIB
Location of
.Pa libXm. Ns Brq Pa a , Ns Pa so .
.It Va INTERACTIVE
If defined, only operate on a port if it requires interaction.
2002-03-18 10:07:22 +00:00
.It Va BATCH
If defined, only operate on a port if it can be installed 100% automatically.
.It Va DISABLE_VULNERABILITIES
If defined, disable check for security vulnerabilities using
.Xr pkg-audit 8
when installing new ports.
.It Va NO_IGNORE
If defined, allow installation of ports marked as
.Aq Va FORBIDDEN .
The default behavior of the Ports framework is to abort when the
installation of a forbidden port is attempted.
Of course, these ports may not work as expected, but if you really know
what you are doing and are sure about installing a forbidden port, then
.Va NO_IGNORE
lets you do it.
.It Va NO_CHECKSUM
If defined, skip verifying the port's checksum.
.It Va TRYBROKEN
If defined, attempt to build a port even if it is marked as
.Aq Va BROKEN .
.It Va PORT_DBDIR
Directory where the results of configuring
.Va OPTIONS
are stored.
Defaults to
.Pa /var/db/ports .
Each port where
.Va OPTIONS
have been configured will have a uniquely named sub-directory, containing a
single file
.Pa options .
.El
.Sh MAKE VARIABLES
The following list provides a name and short description for many of the
variables that are used when building ports.
More information on these and other related variables may be found in
.Pa ${PORTSDIR}/Mk/*
and the
.Fx
Porter's Handbook.
.Bl -tag -width ".Va OVERRIDE_LINUX_BASE_PORT"
.It Va WITH_OPENSSL_PORT
.Pq Vt bool
If set, causes ports that make use of OpenSSL to use the OpenSSL from
ports
.Pq if available
instead of the OpenSSL from the base system.
.It Va WITH_DEBUG
.Pq Vt bool
If set, debugging symbols are installed for ports binaries.
.It Va WITH_DEBUG_PORTS
A list of origins for which to set
.Va WITH_DEBUG_PORTS .
.It Va WITH_SSP_PORTS
.Pq Vt bool
If set, enables
.Fl fstack-protector
for most ports.
.It Va WITH_GHOSTSCRIPT_VER
If set, the version of ghostscript to be used by ports.
.It Va OVERRIDE_LINUX_BASE_PORT
The default linux base to use.
.It Va WITH_CCACHE_BUILD
.Pq Vt bool
If set, enables the use of
.Xr ccache 1
for building ports.
.It Va CCACHE_DIR
Which directory to use for the ccache data.
.El
.Sh FILES
2002-03-18 10:07:22 +00:00
.Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact
.It Pa /usr/ports
2000-11-14 11:20:58 +00:00
The default ports directory
.It Pa /usr/ports/Mk/bsd.port.mk
The big Kahuna.
2000-12-29 09:18:45 +00:00
.El
.Sh SEE ALSO
.Xr make 1 ,
.Xr make.conf 5 ,
.Xr pkg 8 ,
.Xr portsnap 8
.Pp
The following are part of the ports collection:
.Pp
.Xr pkg 7 ,
1999-07-12 07:49:28 +00:00
.Xr portlint 1
2002-03-18 10:07:22 +00:00
.Rs
.%B "The FreeBSD Handbook"
.Re
.Pp
2002-03-18 10:07:22 +00:00
.Pa http://www.FreeBSD.org/ports
(searchable index of all ports)
.Sh HISTORY
2002-03-18 10:07:22 +00:00
The Ports Collection
appeared in
.Fx 1.0 .
It has since spread to
.Nx
and
.Ox .
2005-01-21 08:36:40 +00:00
.Sh AUTHORS
.An -nosplit
This manual page was originated by
.An David O'Brien .
.Sh BUGS
2002-03-18 10:07:22 +00:00
Ports documentation is split over four places \(em
1999-04-29 21:41:11 +00:00
.Pa /usr/ports/Mk/bsd.port.mk ,
2002-03-18 10:07:22 +00:00
.%B "The Porter's Handbook" ,
the
2002-03-18 10:07:22 +00:00
.Dq "Packages and Ports"
chapter of
2002-03-18 10:07:22 +00:00
.%B "The FreeBSD Handbook" ,
and
this manual page.