1.\" 2.\" Copyright (c) 1997 David E. O'Brien 3.\" 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 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. 14.\" 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. 25.\" 26.\" $Id: ports.7,v 1.7 1998/06/23 04:38:50 hoek Exp $ 27.\" 28.Dd January 25, 1998 29.Dt PORTS 7 30.Os FreeBSD 2.2 31.Sh NAME 32.Nm ports 33.Nd contributed applications 34.Sh DESCRIPTION 35The 36.Nm FreeBSD Ports Collection 37offers a simple way for users and 38administrators to install applications. 39Each 40.Em port 41contains any patches necessary to make the original 42application source code compile and run on BSD. Compiling an 43application is as simple as typing 44.Ic make build 45in the port directory! The 46.Ql Pa Makefile 47automatically fetches the 48application source code, either from a local disk or via ftp, unpacks it 49on your system, applies the patches, and compiles it. If all goes well, 50simply type 51.Ic make install 52to install the application. 53.Pp 54For more information about using ports, see 55.Nm The Ports Collection 56(file:/usr/share/doc/handbook/ports.html --or-- 57http://www.freebsd.org/handbook/ports.html). 58For information about creating new ports, see 59.Nm Porting applications 60(file:/usr/share/doc/handbook/porting.html --or-- 61http://www.freebsd.org/handbook/porting.html). 62Both are part of the FreeBSD Handbook. 63.Pp 64.Sh TARGETS 65.Pp 66Some of the targets work recursively through subdirectories. 67This lets you, for example, install all of the biology 68ports. The targets that do this are 69.Ar build , checksum , clean , configure , extract , fetch , install , 70and 71.Ar package . 72.Pp 73The following targets will be run automatically by each proceeding 74target in order. That is, 75.Ar build 76will be run 77.Pq if necessary 78by 79.Ar install , 80and so on all the way to 81.Ar fetch . 82You will usually only target 83.Ar install . 84.Bl -tag -width configure 85.It Ar fetch 86Fetch all of the files needed to build this port from the site(s) 87listed in MASTER_SITES and PATCH_SITES. See 88.Ev FETCH_CMD 89and 90.Ev MASTER_SITE_OVERRIDE . 91.It Ar checksum 92Verify that the fetched distfile matches the one the port was tested against. 93Defining 94.Ev NO_CHECKSUM 95will skip this step. 96.It Ar depends 97Install 98.Pq or compile if only compilation is necessary 99any dependencies of the current port. When called by the 100.Ar extract 101or 102.Ar fetch 103targets, this is run in piecemeal as 104.Ar fetch-depends , 105.Ar build-depends , 106etc. Defining 107.Ev NO_DEPENDS 108will skip this step. 109.It Ar extract 110Expand the distfile into a work directory. 111.It Ar patch 112Apply any patches that are necessary for the port. 113.It Ar configure 114Configure the port. Some ports will ask you questions during 115this stage. See 116.Ev INTERACTIVE 117and 118.Ev BATCH . 119.It Ar build 120Build the the port. This is the same as calling the 121.Ar all 122target. 123.It Ar install 124Install the the port and register it with the package system. This 125is all you really need to do. 126.El 127.Pp 128The following targets are not run during the normal install process. 129.Bl -tag -width fetch-list 130.It Ar fetch-list 131Show list of files needed to be fetched in order to build the port. 132.It Ar depends-list package-depends 133Print a list of all the compile and run dependencies, and dependencies 134of those dependencies. 135.It Ar clean 136Remove the expanded source code. This recurses to dependencies unless 137.Ev NOCLEANDEPENDS 138is defined. 139.It Ar distclean 140Remove the port's distfile(s) and perform the 141.Ar clean 142operation. The 143.Sq clean 144portion recurses to dependencies unless 145.Ev NOCLEANDEPENDS 146is defined, but the 147.Sq distclean 148portion never recurses 149.Pq this is perhaps a bug . 150.It Ar reinstall 151Use this to restore a port after using 152.Xr pkg_delete 1 153when you should have used 154.Ar deinstall . 155.It Ar deinstall 156Remove an installed port from the system, similar to 157.Xr pkg_delete 1 . 158.It Ar package 159Make a binary package for the port. The port will be installed if it 160hasn't already been. The package is a .tgz file that you can use to 161install the port on other machines with 162.Xr pkg_add 1 . 163If the directory specified by 164.Ev PACKAGES 165does not exist the package will be put into the current directory. 166See 167.Ev PKGREPOSITORY 168and 169.Ev PKGFILE . 170.It Ar readmes 171Create a port's 172.Pa README.html . 173You may need to 174.Xr fetch 1 175ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/ports/templates/README.port 176and set 177.Ev TEMPLATES 178to its directory. This is intended for would-be release engineers -- most 179people can just read 180.Pa pkg/COMMENT 181and 182.Pa pkg/DESCR . 183.El 184.Sh ENVIRONMENT VARIABLES 185You can change all of these. 186.Bl -tag -width MASTER_SITES 187.It Ev PORTSDIR 188Location of the ports tree. This is 189.Pa /usr/ports 190on 191.\" .Fx 192FreeBSD 193and 194.\" .Ox , 195OpenBSD 196and 197.Pa /usr/pkgsrc 198on 199.Nx . 200.It Ev DISTDIR 201Where to find/put distfiles, normally 202.Pa distfiles/ 203in 204.Ev PORTSDIR . 205.It Ev PACKAGES 206Used only for the 207.Ar package 208target; the base directory for the packages tree, normally 209.Pa packages/ 210in 211.Ev PORTSDIR . 212If this directory exists, the package tree will be (partially) constructed. 213This directory does not have to exist; if it doesn't packages will be 214placed into the current directory, or you can define one of 215.Bl -tag -width PKGREPOSITORY 216.It Ev PKGREPOSITORY 217Directory to put the package in. 218.It Ev PKGFILE 219The full path to the package. 220.El 221.It Ev PREFIX 222Where to install things in general 223.Po 224usually 225.Pa /usr/local 226or 227.Pa /usr/X11R6 228.Pc 229.It Ev MASTER_SITES 230Primary sites for distribution files if not found locally. 231.It Ev PATCH_SITES 232Primary location(s) for distribution patch files if not found 233locally. 234.It Ev MASTER_SITE_FREEBSD 235If set, go to the master FreeBSD site for all files. 236.It Ev MASTER_SITE_OVERRIDE 237Try going to this site for all files and patches, first. 238.It Ev NOCLEANDEPENDS 239If defined, don't let 240.Sq clean 241recurse to dependencies. 242.It Ev FETCH_CMD 243Command to use to fetch files. Normally 244.Xr fetch 1 . 245.It Ev FORCE_PKG_REGISTER 246If set, overwrite any existing package registration on the system. 247.It Ev MOTIFLIB 248Location of libXm.{a,so}. 249.It Ev PATCH_DEBUG 250If defined, display verbose output when applying each patch. 251.It Ev INTERACTIVE 252If defined, only operate on a port if it requires interaction. 253.It Ev BATCH 254If defined, only operate on a port if it can be installed 100% automatically. 255.El 256.Sh FILES 257.Bl -tag -width /usr/ports/xxxx -compact 258.It Pa /usr/ports 259The default ports directory (FreeBSD and OpenBSD). 260.It Pa /usr/pkgsrc 261The default ports directory (NetBSD). 262.It Pa /usr/share/mk/bsd.port.mk 263The big Kahuna. 264.Sh SEE ALSO 265.Xr make 1 , 266.Xr pkg_add 1 , 267.Xr pkg_create 1 , 268.Xr pkg_delete 1 , 269.Xr pkg_info 1 . 270.Pp 271The FreeBSD handbook 272.Pp 273http://www.FreeBSD.ORG/ports 274.Pq searchable index of all ports 275.Sh AUTHORS 276This man page was originated by 277.An David O'Brien . 278The ports collection is maintained by 279.An Satoshi Asami 280and the awesome ports team. 281.Sh HISTORY 282.Nm The Ports Collection 283appeared in 284.Fx 1.0 . 285.Sh BUGS 286Ports documentation is split over four places --- 287.Pa /usr/share/mk/bsd.port.mk , 288the 289.Dq Ports Collection 290section of the handbook, the 291.Dq Porting Existing Software 292section of the handbook, and 293.Xr ports 7 . 294.Pp 295This man page is too long. 296