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