xref: /freebsd/share/man/man7/ports.7 (revision 2ad872c5794e4c26fdf6ed219ad3f09ca0d5304a)
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.\" $Id: ports.7,v 1.8 1998/06/29 06:54:34 hoek Exp $
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 depends-list package-depends
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 .
181You may need to
182.Xr fetch 1
183ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/ports/templates/README.port
184and set
185.Ev TEMPLATES
186to its directory.  This is intended for would-be release engineers -- most
187people can just read
188.Pa pkg/COMMENT
189and
190.Pa pkg/DESCR .
191.El
192.Sh ENVIRONMENT VARIABLES
193You can change all of these.
194.Bl -tag -width MASTER_SITES
195.It Ev PORTSDIR
196Location of the ports tree.  This is
197.Pa /usr/ports
198on
199.\" .Fx
200FreeBSD
201and
202.\" .Ox ,
203OpenBSD
204and
205.Pa /usr/pkgsrc
206on
207.Nx .
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 FreeBSD site for all files.
244.It Ev MASTER_SITE_OVERRIDE
245Try going to this site for all files and patches, first.
246.It Ev NOCLEANDEPENDS
247If defined, don't let
248.Sq clean
249recurse to dependencies.
250.It Ev FETCH_CMD
251Command to use to fetch files.  Normally
252.Xr fetch 1 .
253.It Ev FORCE_PKG_REGISTER
254If set, overwrite any existing package registration on the system.
255.It Ev MOTIFLIB
256Location of libXm.{a,so}.
257.It Ev INTERACTIVE
258If defined, only operate on a port if it requires interaction.
259.It Ev BATCH
260If defined, only operate on a port if it can be installed 100% automatically.
261.El
262.Sh FILES
263.Bl -tag -width /usr/ports/xxxx -compact
264.It Pa /usr/ports
265The default ports directory (FreeBSD and OpenBSD).
266.It Pa /usr/pkgsrc
267The default ports directory (NetBSD).
268.It Pa /usr/share/mk/bsd.port.mk
269The big Kahuna.
270.Sh SEE ALSO
271.Xr make 1 ,
272.Xr pkg_add 1 ,
273.Xr pkg_create 1 ,
274.Xr pkg_delete 1 ,
275.Xr pkg_info 1 ,
276.Xr portcheckout 1
277(a port),
278.Xr pib 1
279(also a port).
280.Pp
281The FreeBSD handbook
282.Pp
283http://www.FreeBSD.ORG/ports
284.Pq searchable index of all ports
285.Sh AUTHORS
286This man page was originated by
287.An David O'Brien .
288The ports collection is maintained by
289.An Satoshi Asami
290and the awesome ports team.
291.Sh HISTORY
292.Nm The Ports Collection
293appeared in
294.Fx 1.0 .
295.Sh BUGS
296Ports documentation is split over four places ---
297.Pa /usr/share/mk/bsd.port.mk ,
298the
299.Dq Ports Collection
300section of the handbook, the
301.Dq Porting Existing Software
302section of the handbook, and
303.Xr ports 7 .
304.Pp
305This man page is too long.
306