1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
.\"
.\" Copyright (c) 1997 David E. O'Brien
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd January 25, 1998
.Dt PORTS 7
.Os
.Sh NAME
.Nm ports
.Nd contributed applications
.Sh DESCRIPTION
The
.Fx
Ports Collection
offers a simple way for users and
administrators to install applications.
Each
.Em port
contains any patches necessary to make the original
application source code compile and run on
.Bx .
Compiling an
application is as simple as typing
.Nm make Cm build
in the port directory!
The
.Pa Makefile
automatically fetches the
application source code, either from a local disk or via FTP, unpacks it
on your system, applies the patches, and compiles it.
If all goes well,
simply type
.Nm make Cm install
to install the application.
.Pp
It is possible to download and use ports from the
.Fx
repository
that are newer than the installed system; however it is important to
install the appropriate
.Dq "Upgrade Kit"
from
.Pa http://www.FreeBSD.org/ports/
first!
The
.Xr portcheckout 1
script (also a port, of course!) will help to download new ports.
.Pp
For more information about using ports, see
.Dq "Packages and Ports"
in
.%B "The FreeBSD Handbook" ,
.Pa ( file:/usr/share/doc/handbook/ports.html
or
.Pa http://www.FreeBSD.org/handbook/ports.html ) .
For information about creating new ports, see
.%B "The Porter's Handbook"
.Pa ( file:/usr/share/doc/porters-handbook/index.html
or
.Pa http://www.FreeBSD.org/porters-handbook/index.html ) .
.Sh TARGETS
Some of the targets work recursively through subdirectories.
This lets you, for example, install all of the
.Dq Li biology
ports.
The targets that do this are
.Cm build , checksum , clean , configure ,
.Cm depends , extract , fetch , install ,
and
.Cm package .
.Pp
The following targets will be run automatically by each proceeding
target in order.
That is,
.Cm build
will be run
(if necessary)
by
.Cm install ,
and so on all the way to
.Cm fetch .
Usually, you will only use the
.Cm install
target.
.Bl -tag -width ".Cm configure"
.It Cm fetch
Fetch all of the files needed to build this port from the sites
listed in
.Va MASTER_SITES
and
.Va PATCH_SITES .
See
.Va FETCH_CMD
and
.Va MASTER_SITE_OVERRIDE .
.It Cm checksum
Verify that the fetched distfile's checksum matches the one the port was
tested against.
Defining
.Va NO_CHECKSUM
will skip this step.
.It Cm depends
Install
(or compile if only compilation is necessary)
any dependencies of the current port.
When called by the
.Cm extract
or
.Cm fetch
targets, this is run in piecemeal as
.Cm fetch-depends , build-depends ,
etc.
Defining
.Va NO_DEPENDS
will skip this step.
.It Cm extract
Expand the distfile into a work directory.
.It Cm patch
Apply any patches that are necessary for the port.
.It Cm configure
Configure the port.
Some ports will ask you questions during this stage.
See
.Va INTERACTIVE
and
.Va BATCH .
.It Cm build
Build the port.
This is the same as calling the
.Cm all
target.
.It Cm install
Install the port and register it with the package system.
This is all you really need to do.
.El
.Pp
The following targets are not run during the normal install process.
.Bl -tag -width ".Cm fetch-list"
.It Cm fetch-list
Show list of files needed to be fetched in order to build the port.
.It Cm pretty-print-run-depends-list , pretty-print-build-depends-list
Print a list of all the compile and run dependencies, and dependencies
of those dependencies.
.It Cm clean
Remove the expanded source code.
This recurses to dependencies unless
.Va NOCLEANDEPENDS
is defined.
.It Cm distclean
Remove the port's distfiles and perform the
.Cm clean
target.
The
.Cm clean
portion recurses to dependencies unless
.Va NOCLEANDEPENDS
is defined, but the
.Cm distclean
portion never recurses
(this is perhaps a bug).
.It Cm reinstall
Use this to restore a port after using
.Xr pkg_delete 1
when you should have used
.Cm deinstall .
.It Cm deinstall
Remove an installed port from the system, similar to
.Xr pkg_delete 1 .
.It Cm package
Make a binary package for the port.
The port will be installed if it has not already been.
The package is a
.Pa .tgz
file that you can use to
install the port on other machines with
.Xr pkg_add 1 .
If the directory specified by
.Va PACKAGES
does not exist, the package will be put into the current directory.
See
.Va PKGREPOSITORY
and
.Va PKGFILE .
.It Cm readmes
Create a port's
.Pa README.html .
This can be used from
.Pa /usr/ports
to create a browsable web of all ports on your system!
.It Cm search
Search the
.Pa INDEX
file for the pattern specified by either the
.Va key
(searches the port name, comment, and dependencies) or
.Va name
(searches the port name only)
.Xr make 1
variable.
For example, one would type:
.Pp
.Dl "cd /usr/ports && make search name=query"
.Pp
to find all ports whose
name matches
.Dq Li query .
Results include the matching ports' path, comment, maintainer,
build dependencies, and run dependencies.
.It Cm index
Create
.Pa /usr/ports/INDEX ,
which is used by the
.Cm pretty-print-*
and
.Cm search
targets.
While the master
.Pa INDEX
file in the CVS repository is periodically
updated, running the
.Cm index
target will ensure your
.Pa INDEX
file is up to date with your ports tree.
.El
.Sh ENVIRONMENT
You can change all of these.
.Bl -tag -width ".Va MASTER_SITES"
.It Va PORTSDIR
Location of the ports tree.
This is
.Pa /usr/ports
on
.Fx
and
.Ox ,
and
.Pa /usr/pkgsrc
on
.Nx .
.It Va WRKDIRPREFIX
Where to create any temporary files.
Useful if
.Va PORTSDIR
is read-only (perhaps mounted from a CD-ROM).
.It Va DISTDIR
Where to find/put distfiles, normally
.Pa distfiles/
in
.Va PORTSDIR .
.It Va PACKAGES
Used only for the
.Cm package
target; the base directory for the packages tree, normally
.Pa packages/
in
.Va PORTSDIR .
If this directory exists, the package tree will be (partially) constructed.
This directory does not have to exist; if it does not, packages will be
placed into the current directory, or you can define one of
.Bl -tag -width ".Va PKGREPOSITORY"
.It Va PKGREPOSITORY
Directory to put the package in.
.It Va PKGFILE
The full path to the package.
.El
.It Va PREFIX
Where to install things in general
(usually
.Pa /usr/local
or
.Pa /usr/X11R6 ) .
.It Va MASTER_SITES
Primary sites for distribution files if not found locally.
.It Va PATCH_SITES
Primary locations for distribution patch files if not found
locally.
.It Va MASTER_SITE_FREEBSD
If set, go to the master
.Fx
site for all files.
.It Va MASTER_SITE_OVERRIDE
Try going to this site for all files and patches, first.
.It Va NOCLEANDEPENDS
If defined, do not let
.Cm clean
recurse to dependencies.
.It Va FETCH_CMD
Command to use to fetch files.
Normally
.Xr fetch 1 .
.It Va FORCE_PKG_REGISTER
If set, overwrite any existing package registration on the system.
.It Va MOTIFLIB
Location of
.Pa libXm. Ns Brq Pa a , Ns Pa so .
.It Va INTERACTIVE
If defined, only operate on a port if it requires interaction.
.It Va BATCH
If defined, only operate on a port if it can be installed 100% automatically.
.El
.Sh FILES
.Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact
.It Pa /usr/ports
The default ports directory
.No ( Fx
and
.Ox ) .
.It Pa /usr/pkgsrc
The default ports directory
.Pq Nx .
.It Pa /usr/ports/Mk/bsd.port.mk
The big Kahuna.
.El
.Sh SEE ALSO
.Xr make 1 ,
.Xr pkg_add 1 ,
.Xr pkg_create 1 ,
.Xr pkg_delete 1 ,
.Xr pkg_info 1 ,
.Xr pkg_version 1
.Pp
The following are part of the ports collection:
.Pp
.Xr pib 1 ,
.Xr portcheckout 1 ,
.Xr portlint 1
.Rs
.%B "The FreeBSD Handbook"
.Re
.Pp
.Pa http://www.FreeBSD.org/ports
(searchable index of all ports)
.Sh AUTHORS
.An -nosplit
This man page was originated by
.An David O'Brien .
The ports collection is maintained by
.An Satoshi Asami
and the Awesome Ports Team.
.Sh HISTORY
The Ports Collection
appeared in
.Fx 1.0 .
It has since spread to
.Nx
and
.Ox .
.Sh BUGS
Ports documentation is split over four places \(em
.Pa /usr/ports/Mk/bsd.port.mk ,
.%B "The Porter's Handbook" ,
the
.Dq "Packages and Ports"
chapter of
.%B "The FreeBSD Handbook" ,
and
.Xr ports 7 .
.Pp
This man page is too long.
|