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 31.Sh NAME 32.Nm ports 33.Nd contributed applications 34.Sh DESCRIPTION 35The 36.Fx 37Ports 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 44.Bx . 45Compiling an 46application is as simple as typing 47.Nm make Cm build 48in the port directory! 49The 50.Pa Makefile 51automatically fetches the 52application source code, either from a local disk or via FTP, unpacks it 53on your system, applies the patches, and compiles it. 54If all goes well, 55simply type 56.Nm make Cm install 57to install the application. 58.Pp 59It is possible to download and use ports from the 60.Fx 61repository 62that are newer than the installed system; however it is important to 63install the appropriate 64.Dq "Upgrade Kit" 65from 66.Pa http://www.FreeBSD.org/ports/ 67first! 68The 69.Xr portcheckout 1 70script (also a port, of course!) will help to download new ports. 71.Pp 72For more information about using ports, see 73.Dq "Packages and Ports" 74in 75.%B "The FreeBSD Handbook" , 76.Pa ( file:/usr/share/doc/en_US.ISO8859-1/books/handbook/ports.html 77or 78.Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ports.html ) . 79For information about creating new ports, see 80.%B "The Porter's Handbook" 81.Pa ( file:/usr/share/doc/porters-handbook/index.html 82or 83.Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/ ) . 84.Sh TARGETS 85Some of the targets work recursively through subdirectories. 86This lets you, for example, install all of the 87.Dq Li biology 88ports. 89The targets that do this are 90.Cm build , checksum , clean , configure , 91.Cm depends , extract , fetch , install , 92and 93.Cm package . 94.Pp 95The following targets will be run automatically by each proceeding 96target in order. 97That is, 98.Cm build 99will be run 100(if necessary) 101by 102.Cm install , 103and so on all the way to 104.Cm fetch . 105Usually, you will only use the 106.Cm install 107target. 108.Bl -tag -width ".Cm configure" 109.It Cm fetch 110Fetch all of the files needed to build this port from the sites 111listed in 112.Va MASTER_SITES 113and 114.Va PATCH_SITES . 115See 116.Va FETCH_CMD 117and 118.Va MASTER_SITE_OVERRIDE . 119.It Cm checksum 120Verify that the fetched distfile's checksum matches the one the port was 121tested against. 122Defining 123.Va NO_CHECKSUM 124will skip this step. 125.It Cm depends 126Install 127(or compile if only compilation is necessary) 128any dependencies of the current port. 129When called by the 130.Cm extract 131or 132.Cm fetch 133targets, this is run in piecemeal as 134.Cm fetch-depends , build-depends , 135etc. 136Defining 137.Va NO_DEPENDS 138will skip this step. 139.It Cm extract 140Expand the distfile into a work directory. 141.It Cm patch 142Apply any patches that are necessary for the port. 143.It Cm configure 144Configure the port. 145Some ports will ask you questions during this stage. 146See 147.Va INTERACTIVE 148and 149.Va BATCH . 150.It Cm build 151Build the port. 152This is the same as calling the 153.Cm all 154target. 155.It Cm install 156Install the port and register it with the package system. 157This is all you really need to do. 158.El 159.Pp 160The following targets are not run during the normal install process. 161.Bl -tag -width ".Cm fetch-recursive" 162.It Cm fetch-list 163Show list of files needed to be fetched in order to build the port. 164.It Cm fetch-recursive 165Fetch the distfiles of the port and all its dependencies. 166.It Cm pretty-print-run-depends-list , pretty-print-build-depends-list 167Print a list of all the compile and run dependencies, and dependencies 168of those dependencies. 169.It Cm clean 170Remove the expanded source code. 171This recurses to dependencies unless 172.Va NOCLEANDEPENDS 173is defined. 174.It Cm distclean 175Remove the port's distfiles and perform the 176.Cm clean 177target. 178The 179.Cm clean 180portion recurses to dependencies unless 181.Va NOCLEANDEPENDS 182is defined, but the 183.Cm distclean 184portion never recurses 185(this is perhaps a bug). 186.It Cm reinstall 187Use this to restore a port after using 188.Xr pkg_delete 1 189when you should have used 190.Cm deinstall . 191.It Cm deinstall 192Remove an installed port from the system, similar to 193.Xr pkg_delete 1 . 194.It Cm package 195Make a binary package for the port. 196The port will be installed if it has not already been. 197The package is a 198.Pa .tgz 199file that you can use to 200install the port on other machines with 201.Xr pkg_add 1 . 202If the directory specified by 203.Va PACKAGES 204does not exist, the package will be put into the current directory. 205See 206.Va PKGREPOSITORY 207and 208.Va PKGFILE . 209.It Cm readmes 210Create a port's 211.Pa README.html . 212This can be used from 213.Pa /usr/ports 214to create a browsable web of all ports on your system! 215.It Cm search 216Search the 217.Pa INDEX 218file for the pattern specified by either the 219.Va key 220(searches the port name, comment, and dependencies) or 221.Va name 222(searches the port name only) 223.Xr make 1 224variable. 225For example, one would type: 226.Pp 227.Dl "cd /usr/ports && make search name=query" 228.Pp 229to find all ports whose 230name matches 231.Dq Li query . 232Results include the matching ports' path, comment, maintainer, 233build dependencies, and run dependencies. 234.It Cm index 235Create 236.Pa /usr/ports/INDEX , 237which is used by the 238.Cm pretty-print-* 239and 240.Cm search 241targets. 242While the master 243.Pa INDEX 244file in the CVS repository is periodically 245updated, running the 246.Cm index 247target will ensure your 248.Pa INDEX 249file is up to date with your ports tree. 250.El 251.Sh ENVIRONMENT 252You can change all of these. 253.Bl -tag -width ".Va MASTER_SITES" 254.It Va PORTSDIR 255Location of the ports tree. 256This is 257.Pa /usr/ports 258on 259.Fx 260and 261.Ox , 262and 263.Pa /usr/pkgsrc 264on 265.Nx . 266.It Va WRKDIRPREFIX 267Where to create any temporary files. 268Useful if 269.Va PORTSDIR 270is read-only (perhaps mounted from a CD-ROM). 271.It Va DISTDIR 272Where to find/put distfiles, normally 273.Pa distfiles/ 274in 275.Va PORTSDIR . 276.It Va PACKAGES 277Used only for the 278.Cm package 279target; the base directory for the packages tree, normally 280.Pa packages/ 281in 282.Va PORTSDIR . 283If this directory exists, the package tree will be (partially) constructed. 284This directory does not have to exist; if it does not, packages will be 285placed into the current directory, or you can define one of 286.Bl -tag -width ".Va PKGREPOSITORY" 287.It Va PKGREPOSITORY 288Directory to put the package in. 289.It Va PKGFILE 290The full path to the package. 291.El 292.It Va PREFIX 293Where to install things in general 294(usually 295.Pa /usr/local 296or 297.Pa /usr/X11R6 ) . 298.It Va MASTER_SITES 299Primary sites for distribution files if not found locally. 300.It Va PATCH_SITES 301Primary locations for distribution patch files if not found 302locally. 303.It Va MASTER_SITE_FREEBSD 304If set, go to the master 305.Fx 306site for all files. 307.It Va MASTER_SITE_OVERRIDE 308Try going to this site for all files and patches, first. 309.It Va NOCLEANDEPENDS 310If defined, do not let 311.Cm clean 312recurse to dependencies. 313.It Va FETCH_CMD 314Command to use to fetch files. 315Normally 316.Xr fetch 1 . 317.It Va FORCE_PKG_REGISTER 318If set, overwrite any existing package registration on the system. 319.It Va MOTIFLIB 320Location of 321.Pa libXm. Ns Brq Pa a , Ns Pa so . 322.It Va INTERACTIVE 323If defined, only operate on a port if it requires interaction. 324.It Va BATCH 325If defined, only operate on a port if it can be installed 100% automatically. 326.El 327.Sh FILES 328.Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact 329.It Pa /usr/ports 330The default ports directory 331.No ( Fx 332and 333.Ox ) . 334.It Pa /usr/pkgsrc 335The default ports directory 336.Pq Nx . 337.It Pa /usr/ports/Mk/bsd.port.mk 338The big Kahuna. 339.El 340.Sh SEE ALSO 341.Xr make 1 , 342.Xr pkg_add 1 , 343.Xr pkg_create 1 , 344.Xr pkg_delete 1 , 345.Xr pkg_info 1 , 346.Xr pkg_version 1 347.Pp 348The following are part of the ports collection: 349.Pp 350.Xr pib 1 , 351.Xr portcheckout 1 , 352.Xr portlint 1 353.Rs 354.%B "The FreeBSD Handbook" 355.Re 356.Pp 357.Pa http://www.FreeBSD.org/ports 358(searchable index of all ports) 359.Sh AUTHORS 360.An -nosplit 361This man page was originated by 362.An David O'Brien . 363The ports collection is maintained by 364.An Satoshi Asami 365and the Awesome Ports Team. 366.Sh HISTORY 367The Ports Collection 368appeared in 369.Fx 1.0 . 370It has since spread to 371.Nx 372and 373.Ox . 374.Sh BUGS 375Ports documentation is split over four places \(em 376.Pa /usr/ports/Mk/bsd.port.mk , 377.%B "The Porter's Handbook" , 378the 379.Dq "Packages and Ports" 380chapter of 381.%B "The FreeBSD Handbook" , 382and 383this man page. 384.Pp 385This man page is too long. 386