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