2 .\" Copyright (c) 1997 David E. O'Brien
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 .Nd contributed applications
38 offers a simple way to compile and install third party applications.
39 It is also used to build packages, to be installed using
41 It can be installed and updated using
44 The ports tree, typically located at
46 consists of subdirectories, one for each category; those in turn contain
48 Each port is a directory with metadata and patches necessary to make
49 the original application source code compile and run on
52 application is as simple as typing
54 in the port directory.
57 automatically fetches the
58 application source code, either from a local disk or the network, unpacks it,
59 applies the patches, and compiles it.
60 It also recursively handles dependencies \(em other pieces of software
61 the port depends on in order to build and work.
64 installs the application.
66 For more information about using ports, see the
67 .Dq "Packages and Ports" section
69 .%B "The FreeBSD Handbook":
71 .Lk https://www.FreeBSD.org/doc/en/books/handbook/ports.html
73 For information about creating new ports, see
74 .%B "The Porter's Handbook":
76 .Lk https://www.FreeBSD.org/doc/en/books/porters-handbook/
80 targets work recursively through subdirectories.
81 This lets you, for example, install all of the
84 The targets that do this are
85 .Cm build , checksum , clean , configure ,
86 .Cm depends , extract , fetch , install ,
90 The following targets will be run automatically by each proceeding
98 and so on all the way to
100 Usually, you will only use the
103 .Bl -tag -width ".Cm configure"
110 Fetch all of the files needed to build this port from the sites
116 .Va FETCH_CMD , MASTER_SITE_OVERRIDE
118 .Va MASTER_SITE_BACKUP .
120 Verify that the fetched distfile's checksum matches the one the port was
122 If the distfile's checksum does not match, it also fetches the distfiles
123 which are missing or failed the checksum calculation.
129 (or compile if only compilation is necessary)
130 any dependencies of the current port.
135 targets, this is run in piecemeal as
136 .Cm fetch-depends , build-depends ,
142 Expand the distfile into a work directory.
144 Apply any patches that are necessary for the port.
147 Some ports will ask you questions during this stage.
154 This is the same as calling the
158 Install the port and register it with the package system.
159 This is all you really need to do.
162 The following targets are not run during the normal install process.
163 .Bl -tag -width ".Cm fetch-recursive"
167 config for this port.
168 .It Cm showconfig-recursive
171 config for this port and all its dependencies.
175 config for this port.
176 .It Cm rmconfig-recursive
179 config for this port and all its dependencies.
180 .It Cm config-conditional
181 Skip the ports which have already had their
184 .It Cm config-recursive
187 for this port and all its dependencies using
190 Show list of files to be fetched in order to build the port.
191 .It Cm fetch-recursive
192 Fetch the distfiles of the port and all its dependencies.
193 .It Cm fetch-recursive-list
194 Show list of files that would be retrieved by
195 .Cm fetch-recursive .
196 .It Cm run-depends-list , build-depends-list
197 Print a list of all the compile and run dependencies, and dependencies
198 of those dependencies, by port directory.
199 .It Cm all-depends-list
200 Print a list of all dependencies for the port.
201 .It Cm pretty-print-run-depends-list , pretty-print-build-depends-list
202 Print a list of all the compile and run dependencies, and dependencies
203 of those dependencies, by port name and version.
205 Print a list of missing dependencies to be installed for the port.
207 Remove the expanded source code.
208 This recurses to dependencies unless
212 Remove the port's distfiles and perform the
217 portion recurses to dependencies unless
221 portion never recurses
222 (this is perhaps a bug).
224 Use this to restore a port after using
226 when you should have used
229 Remove an installed port from the system, similar to
232 Remove all installed ports with the same
236 Make a binary package for the port.
237 The port will be installed if it has not already been.
240 file that you can use to
241 install the port on other machines with
243 If the directory specified by
245 does not exist, the package will be put into the current directory.
250 .It Cm package-recursive
253 but makes a package for each depending port as well.
255 Prints the name with version of the port.
259 This can be used from
261 to create a browsable web of all ports on your system!
265 file for the pattern specified by the
267 (searches the port name, comment, and dependencies),
269 (searches the port name only),
271 (searches the port path),
273 (searches the port info),
275 (searches the port maintainer),
277 (searches the port category),
279 (searches the port build-time dependency),
281 (searches the port run-time dependency),
283 (searches the port web site)
285 variables, and their exclusion counterparts:
288 For example, one would type:
290 .Dl "cd /usr/ports && make search name=query"
292 to find all ports whose
295 Results include the matching ports' path, comment, maintainer,
296 build dependencies, and run dependencies.
297 .Bd -literal -offset indent
298 cd /usr/ports && make search name=pear- \e
302 To find all ports whose
305 and which do not have apache
306 listed in build-time dependencies.
307 .Bd -literal -offset indent
308 cd /usr/ports && make search name=pear- \e
312 To find all ports whose names contain
318 .Bd -literal -offset indent
319 make search key=apache display=name,path,info keylim=1
322 To find ports that contain
324 in either of the name, path, info
325 fields, ignore the rest of the record.
327 By default the search is not case-sensitive.
328 In order to make it case-sensitive you can use the
331 .Bd -literal -offset indent
332 make search name=p5-R icase=0
338 Only display name, path and info.
340 Generate a one-line description of each port for use in the
344 Display the port maintainer's email address.
347 .Pa /usr/ports/INDEX ,
355 target will ensure your
357 file is up to date with your ports tree.
366 You can change all of these.
367 .Bl -tag -width ".Va MASTER_SITES"
369 Location of the ports tree.
381 Where to create any temporary files.
384 is read-only (perhaps mounted from a CD-ROM).
386 Where to find/put distfiles, normally
393 target; the base directory for the packages tree, normally
397 If this directory exists, the package tree will be (partially) constructed.
398 This directory does not have to exist; if it does not, packages will be
399 placed into the current directory, or you can define one of
400 .Bl -tag -width ".Va PKGREPOSITORY"
402 Directory to put the package in.
404 The full path to the package.
407 Where existing things are installed and where to search for files when
408 resolving dependencies (usually
411 Where to install this port (usually set to the same as
414 Primary sites for distribution files if not found locally.
416 Primary locations for distribution patch files if not found
418 .It Va MASTER_SITE_FREEBSD
419 If set, go to the master
422 .It Va MASTER_SITE_OVERRIDE
423 Try going to these sites for all files and patches, first.
424 .It Va MASTER_SITE_BACKUP
425 Try going to these sites for all files and patches, last.
426 .It Va RANDOMIZE_MASTER_SITES
427 Try the download locations in a random order.
429 Sort the download locations according to user supplied pattern.
431 .Dl .dk .sunet.se .se dk.php.net .no .de heanet.dl.sourceforge.net
432 .It Va MASTER_SITE_INDEX
441 .Pa https://www.FreeBSD.org/ports/ .
450 .It Va NOCLEANDEPENDS
451 If defined, do not let
453 recurse to dependencies.
455 Command to use to fetch files.
458 .It Va FORCE_PKG_REGISTER
459 If set, overwrite any existing package registration on the system.
462 .Pa libXm. Ns Brq Pa a , Ns Pa so .
464 If defined, only operate on a port if it requires interaction.
466 If defined, only operate on a port if it can be installed 100% automatically.
467 .It Va DISABLE_VULNERABILITIES
468 If defined, disable check for security vulnerabilities using
470 when installing new ports.
472 If defined, allow installation of ports marked as
474 The default behavior of the Ports framework is to abort when the
475 installation of a forbidden port is attempted.
476 Of course, these ports may not work as expected, but if you really know
477 what you are doing and are sure about installing a forbidden port, then
481 If defined, skip verifying the port's checksum.
483 If defined, attempt to build a port even if it is marked as
486 Directory where the results of configuring
493 have been configured will have a uniquely named sub-directory, containing a
498 The following list provides a name and short description for many of the
499 variables that are used when building ports.
500 More information on these and other related variables may be found in
505 .Bl -tag -width ".Va WITH_GHOSTSCRIPT_VER"
506 .It Va WITH_OPENSSL_PORT
508 If set, causes ports that make use of OpenSSL to use the OpenSSL from
511 instead of the OpenSSL from the base system.
514 If set, debugging symbols are installed for ports binaries.
515 .It Va WITH_DEBUG_PORTS
516 A list of origins for which to set
517 .Va WITH_DEBUG_PORTS .
518 .It Va WITH_SSP_PORTS
523 .It Va WITH_GHOSTSCRIPT_VER
524 If set, the version of ghostscript to be used by ports.
525 .It Va WITH_CCACHE_BUILD
527 If set, enables the use of
531 Which directory to use for the ccache data.
534 .Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact
536 The default ports directory
537 .It Pa /usr/ports/Mk/bsd.port.mk
541 Build and install Emacs:
542 .Bd -literal -offset indent
543 cd /usr/ports/editors/emacs
552 The following are part of the ports collection:
557 .%B "The FreeBSD Handbook"
560 .Pa https://www.FreeBSD.org/ports
561 (searchable index of all ports)
566 It has since spread to
572 This manual page was originated by
575 Ports documentation is split over four places \(em
576 .Pa /usr/ports/Mk/bsd.port.mk ,
577 .%B "The Porter's Handbook" ,
579 .Dq "Packages and Ports"
581 .%B "The FreeBSD Handbook" ,