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