xref: /freebsd/share/man/man7/ports.7 (revision 1b6c76a2fe091c74f08427e6c870851025a9cf67)
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
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 .
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.Pq 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.Pq 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.Po
264usually
265.Pa /usr/local
266or
267.Pa /usr/X11R6
268.Pc
269.It Ev MASTER_SITES
270Primary sites for distribution files if not found locally.
271.It Ev PATCH_SITES
272Primary location(s) for distribution patch files if not found
273locally.
274.It Ev MASTER_SITE_FREEBSD
275If set, go to the master
276.Fx
277site for all files.
278.It Ev MASTER_SITE_OVERRIDE
279Try going to this site for all files and patches, first.
280.It Ev NOCLEANDEPENDS
281If defined, don't let
282.Sq clean
283recurse to dependencies.
284.It Ev FETCH_CMD
285Command to use to fetch files.  Normally
286.Xr fetch 1 .
287.It Ev FORCE_PKG_REGISTER
288If set, overwrite any existing package registration on the system.
289.It Ev MOTIFLIB
290Location of libXm.{a,so}.
291.It Ev INTERACTIVE
292If defined, only operate on a port if it requires interaction.
293.It Ev BATCH
294If defined, only operate on a port if it can be installed 100% automatically.
295.El
296.Sh FILES
297.Bl -tag -width /usr/ports/xxxx -compact
298.It Pa /usr/ports
299The default ports directory
300.Po
301.Fx
302and
303.Ox
304.Pc .
305.It Pa /usr/pkgsrc
306The default ports directory (NetBSD).
307.It Pa /usr/ports/Mk/bsd.port.mk
308The big Kahuna.
309.El
310.Sh SEE ALSO
311.Xr make 1 ,
312.Xr pkg_add 1 ,
313.Xr pkg_create 1 ,
314.Xr pkg_delete 1 ,
315.Xr pkg_info 1 ,
316.Xr pkg_version 1
317.Pp
318The following are part of the ports collection:
319.Pp
320.Xr pib 1 ,
321.Xr portcheckout 1 ,
322.Xr portlint 1
323.Pp
324The
325.Fx
326handbook
327.Pp
328http://www.FreeBSD.org/ports
329.Pq searchable index of all ports
330.Sh AUTHORS
331.An -nosplit
332This man page was originated by
333.An David O'Brien .
334The ports collection is maintained by
335.An Satoshi Asami
336and the Awesome Ports Team.
337.Sh HISTORY
338.Nm The Ports Collection
339appeared in
340.Fx 1.0 .
341It has since spread to
342.Nx
343and
344.Ox .
345.Sh BUGS
346Ports documentation is split over four places ---
347.Pa /usr/ports/Mk/bsd.port.mk ,
348the
349.Dq Ports Collection
350section of the handbook, the
351.Dq Porting Existing Software
352section of the handbook, and
353.Xr ports 7 .
354.Pp
355This man page is too long.
356