xref: /freebsd/share/man/man7/ports.7 (revision c68159a6d8eede11766cf13896d0f7670dbd51aa)
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 .
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.El
190.Sh ENVIRONMENT
191You can change all of these.
192.Bl -tag -width MASTER_SITES
193.It Ev PORTSDIR
194Location of the ports tree.  This is
195.Pa /usr/ports
196on
197.Fx
198and
199.Ox
200and
201.Pa /usr/pkgsrc
202on
203.Nx .
204.It Ev WRKDIRPREFIX
205Where to create any temporary files.  Useful if
206.Ev PORTSDIR
207is read-only (perhaps mounted from a cdrom).
208.It Ev DISTDIR
209Where to find/put distfiles, normally
210.Pa distfiles/
211in
212.Ev PORTSDIR .
213.It Ev PACKAGES
214Used only for the
215.Ar package
216target; the base directory for the packages tree, normally
217.Pa packages/
218in
219.Ev PORTSDIR .
220If this directory exists, the package tree will be (partially) constructed.
221This directory does not have to exist; if it doesn't packages will be
222placed into the current directory, or you can define one of
223.Bl -tag -width PKGREPOSITORY
224.It Ev PKGREPOSITORY
225Directory to put the package in.
226.It Ev PKGFILE
227The full path to the package.
228.El
229.It Ev PREFIX
230Where to install things in general
231.Po
232usually
233.Pa /usr/local
234or
235.Pa /usr/X11R6
236.Pc
237.It Ev MASTER_SITES
238Primary sites for distribution files if not found locally.
239.It Ev PATCH_SITES
240Primary location(s) for distribution patch files if not found
241locally.
242.It Ev MASTER_SITE_FREEBSD
243If set, go to the master
244.Fx
245site for all files.
246.It Ev MASTER_SITE_OVERRIDE
247Try going to this site for all files and patches, first.
248.It Ev NOCLEANDEPENDS
249If defined, don't let
250.Sq clean
251recurse to dependencies.
252.It Ev FETCH_CMD
253Command to use to fetch files.  Normally
254.Xr fetch 1 .
255.It Ev FORCE_PKG_REGISTER
256If set, overwrite any existing package registration on the system.
257.It Ev MOTIFLIB
258Location of libXm.{a,so}.
259.It Ev INTERACTIVE
260If defined, only operate on a port if it requires interaction.
261.It Ev BATCH
262If defined, only operate on a port if it can be installed 100% automatically.
263.El
264.Sh FILES
265.Bl -tag -width /usr/ports/xxxx -compact
266.It Pa /usr/ports
267The default ports directory
268.Po
269.Fx
270and
271.Ox
272.Pc .
273.It Pa /usr/pkgsrc
274The default ports directory (NetBSD).
275.It Pa /usr/ports/Mk/bsd.port.mk
276The big Kahuna.
277.El
278.Sh SEE ALSO
279.Xr make 1 ,
280.Xr pkg_add 1 ,
281.Xr pkg_create 1 ,
282.Xr pkg_delete 1 ,
283.Xr pkg_info 1 ,
284.Xr pkg_version 1
285.Pp
286The following are part of the ports collection:
287.Pp
288.Xr pib 1 ,
289.Xr portcheckout 1 ,
290.Xr portlint 1
291.Pp
292The
293.Fx
294handbook
295.Pp
296http://www.FreeBSD.org/ports
297.Pq searchable index of all ports
298.Sh AUTHORS
299.An -nosplit
300This man page was originated by
301.An David O'Brien .
302The ports collection is maintained by
303.An Satoshi Asami
304and the Awesome Ports Team.
305.Sh HISTORY
306.Nm The Ports Collection
307appeared in
308.Fx 1.0 .
309It has since spread to
310.Nx
311and
312.Ox .
313.Sh BUGS
314Ports documentation is split over four places ---
315.Pa /usr/ports/Mk/bsd.port.mk ,
316the
317.Dq Ports Collection
318section of the handbook, the
319.Dq Porting Existing Software
320section of the handbook, and
321.Xr ports 7 .
322.Pp
323This man page is too long.
324