]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - share/man/man7/ports.7
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / share / man / man7 / ports.7
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 21, 2009
29 .Dt PORTS 7
30 .Os
31 .Sh NAME
32 .Nm ports
33 .Nd contributed applications
34 .Sh DESCRIPTION
35 The
36 .Fx
37 Ports Collection
38 offers a simple way for users and
39 administrators to install applications.
40 Each
41 .Em port
42 contains any patches necessary to make the original
43 application source code compile and run on
44 .Bx .
45 Compiling an
46 application is as simple as typing
47 .Nm make Cm build
48 in the port directory!
49 The
50 .Pa Makefile
51 automatically fetches the
52 application source code, either from a local disk or via FTP, unpacks it
53 on your system, applies the patches, and compiles it.
54 If all goes well,
55 simply type
56 .Nm make Cm install
57 to install the application.
58 .Pp
59 It is possible to download and use ports from the
60 .Fx
61 repository
62 that are newer than the installed system; however it is important to
63 install the appropriate
64 .Dq "Upgrade Kit"
65 from
66 .Pa http://www.FreeBSD.org/ports/
67 first!
68 The
69 .Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout
70 script (also a port, of course!) will help to download new ports.
71 .Pp
72 For more information about using ports, see
73 .Dq "Packages and Ports"
74 in
75 .%B "The FreeBSD Handbook" ,
76 .Pa ( file:/usr/share/doc/en_US.ISO8859-1/books/handbook/ports.html
77 or
78 .Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ports.html ) .
79 For information about creating new ports, see
80 .%B "The Porter's Handbook"
81 .Pa ( file:/usr/share/doc/en_US.ISO8859-1/books/porters-handbook/index.html
82 or
83 .Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/ ) .
84 .Sh TARGETS
85 Some of the targets work recursively through subdirectories.
86 This lets you, for example, install all of the
87 .Dq Li biology
88 ports.
89 The targets that do this are
90 .Cm build , checksum , clean , configure ,
91 .Cm depends , extract , fetch , install ,
92 and
93 .Cm package .
94 .Pp
95 The following targets will be run automatically by each proceeding
96 target in order.
97 That is,
98 .Cm build
99 will be run
100 (if necessary)
101 by
102 .Cm install ,
103 and so on all the way to
104 .Cm fetch .
105 Usually, you will only use the
106 .Cm install
107 target.
108 .Bl -tag -width ".Cm configure"
109 .It Cm config
110 Configure
111 .Va OPTIONS
112 for this port using
113 .Xr dialog 1 .
114 .It Cm fetch
115 Fetch all of the files needed to build this port from the sites
116 listed in
117 .Va MASTER_SITES
118 and
119 .Va PATCH_SITES .
120 See
121 .Va FETCH_CMD , MASTER_SITE_OVERRIDE
122 and
123 .Va MASTER_SITE_BACKUP .
124 .It Cm checksum
125 Verify that the fetched distfile's checksum matches the one the port was
126 tested against.
127 Defining
128 .Va NO_CHECKSUM
129 will skip this step.
130 .It Cm depends
131 Install
132 (or compile if only compilation is necessary)
133 any dependencies of the current port.
134 When called by the
135 .Cm extract
136 or
137 .Cm fetch
138 targets, this is run in piecemeal as
139 .Cm fetch-depends , build-depends ,
140 etc.
141 Defining
142 .Va NO_DEPENDS
143 will skip this step.
144 .It Cm extract
145 Expand the distfile into a work directory.
146 .It Cm patch
147 Apply any patches that are necessary for the port.
148 .It Cm configure
149 Configure the port.
150 Some ports will ask you questions during this stage.
151 See
152 .Va INTERACTIVE
153 and
154 .Va BATCH .
155 .It Cm build
156 Build the port.
157 This is the same as calling the
158 .Cm all
159 target.
160 .It Cm install
161 Install the port and register it with the package system.
162 This is all you really need to do.
163 .El
164 .Pp
165 The following targets are not run during the normal install process.
166 .Bl -tag -width ".Cm fetch-recursive"
167 .It Cm showconfig
168 Display
169 .Va OPTIONS
170 config for this port.
171 .It Cm showconfig-recursive
172 Display
173 .Va OPTIONS
174 config for this port and all its dependencies.
175 .It Cm rmconfig
176 Remove
177 .Va OPTIONS
178 config for this port.
179 .It Cm rmconfig-recursive
180 Remove
181 .Va OPTIONS
182 config for this port and all its dependencies.
183 .It Cm config-conditional
184 Skip the ports which have already had their
185 .Va OPTIONS
186 configured.
187 .It Cm config-recursive
188 Configure
189 .Va OPTIONS
190 for this port and all its dependencies using
191 .Xr dialog 1 .
192 .It Cm fetch-list
193 Show list of files to be fetched in order to build the port.
194 .It Cm fetch-recursive
195 Fetch the distfiles of the port and all its dependencies.
196 .It Cm fetch-recursive-list
197 Show list of files that would be retrieved by
198 .Cm fetch-recursive .
199 .It Cm run-depends-list , build-depends-list
200 Print a list of all the compile and run dependencies, and dependencies
201 of those dependencies, by port directory.
202 .It Cm all-depends-list
203 Print a list of all dependencies for the port.
204 .It Cm pretty-print-run-depends-list , pretty-print-build-depends-list
205 Print a list of all the compile and run dependencies, and dependencies
206 of those dependencies, by port name and version.
207 .It Cm missing
208 Print a list of missing dependencies to be installed for the port.
209 .It Cm clean
210 Remove the expanded source code.
211 This recurses to dependencies unless
212 .Va NOCLEANDEPENDS
213 is defined.
214 .It Cm distclean
215 Remove the port's distfiles and perform the
216 .Cm clean
217 target.
218 The
219 .Cm clean
220 portion recurses to dependencies unless
221 .Va NOCLEANDEPENDS
222 is defined, but the
223 .Cm distclean
224 portion never recurses
225 (this is perhaps a bug).
226 .It Cm reinstall
227 Use this to restore a port after using
228 .Xr pkg_delete 1
229 when you should have used
230 .Cm deinstall .
231 .It Cm deinstall
232 Remove an installed port from the system, similar to
233 .Xr pkg_delete 1 .
234 .It Cm deinstall-all
235 Remove all installed ports with the same
236 .Va PKGORIGIN
237 from the system.
238 .It Cm package
239 Make a binary package for the port.
240 The port will be installed if it has not already been.
241 The package is a
242 .Pa .tbz
243 file that you can use to
244 install the port on other machines with
245 .Xr pkg_add 1 .
246 If the directory specified by
247 .Va PACKAGES
248 does not exist, the package will be put into the current directory.
249 See
250 .Va PKGREPOSITORY
251 and
252 .Va PKGFILE .
253 .It Cm package-recursive
254 Like
255 .Cm package ,
256 but makes a package for each depending port as well.
257 .It Cm package-name
258 Prints the name with version of the port.
259 .It Cm readmes
260 Create a port's
261 .Pa README.html .
262 This can be used from
263 .Pa /usr/ports
264 to create a browsable web of all ports on your system!
265 .It Cm search
266 Search the
267 .Pa INDEX
268 file for the pattern specified by the
269 .Va key
270 (searches the port name, comment, and dependencies),
271 .Va name
272 (searches the port name only),
273 .Va path
274 (searches the port path),
275 .Va info
276 (searches the port info),
277 .Va maint
278 (searches the port maintainer),
279 .Va cat
280 (searches the port category),
281 .Va bdeps
282 (searches the port build-time dependency),
283 .Va rdeps
284 (searches the port run-time dependency),
285 .Va www
286 (searches the port web site)
287 .Xr make 1
288 variables, and their exclusion counterparts:
289 .Va xname , xkey
290 etc.
291 For example, one would type:
292 .Pp
293 .Dl "cd /usr/ports && make search name=query"
294 .Pp
295 to find all ports whose
296 name matches
297 .Dq Li query .
298 Results include the matching ports' path, comment, maintainer,
299 build dependencies, and run dependencies.
300 .Bd -literal -offset indent
301 cd /usr/ports && make search name=pear- \e
302     xbdeps=apache
303 .Ed
304 .Pp
305 To find all ports whose
306 names contain
307 .Dq Li pear-
308 and which do not have apache
309 listed in build-time dependencies.
310 .Bd -literal -offset indent
311 cd /usr/ports && make search name=pear- \e
312     xname='ht(tp|ml)'
313 .Ed
314 .Pp
315 To find all ports whose names contain
316 .Dq Li pear- ,
317 but not
318 .Dq Li html
319 or
320 .Dq Li http .
321 .Bd -literal -offset indent
322 make search key=apache display=name,path,info keylim=1
323 .Ed
324 .Pp
325 To find ports that contain
326 .Dq Li apache
327 in either of the name, path, info
328 fields, ignore the rest of the record.
329 .Pp
330 By default the search is not case-sensitive.
331 In order to make it case-sensitive you can use the
332 .Va icase
333 variable:
334 .Bd -literal -offset indent
335 make search name=p5-R icase=0
336 .Ed
337 .It Cm quicksearch
338 Reduced
339 .Cm search
340 output.
341 Only display name, path and info.
342 .It Cm describe
343 Generate a one-line description of each port for use in the
344 .Pa INDEX
345 file.
346 .It Cm maintainer
347 Display the port maintainer's email address.
348 .It Cm index
349 Create
350 .Pa /usr/ports/INDEX ,
351 which is used by the
352 .Cm pretty-print-*
353 and
354 .Cm search
355 targets.
356 Running the
357 .Cm index
358 target will ensure your
359 .Pa INDEX
360 file is up to date with your ports tree.
361 .It Cm fetchindex
362 Fetch the
363 .Pa INDEX
364 file from the
365 .Fx
366 cluster.
367 .El
368 .Sh ENVIRONMENT
369 You can change all of these.
370 .Bl -tag -width ".Va MASTER_SITES"
371 .It Va PORTSDIR
372 Location of the ports tree.
373 This is
374 .Pa /usr/ports
375 on
376 .Fx
377 and
378 .Ox ,
379 and
380 .Pa /usr/pkgsrc
381 on
382 .Nx .
383 .It Va WRKDIRPREFIX
384 Where to create any temporary files.
385 Useful if
386 .Va PORTSDIR
387 is read-only (perhaps mounted from a CD-ROM).
388 .It Va DISTDIR
389 Where to find/put distfiles, normally
390 .Pa distfiles/
391 in
392 .Va PORTSDIR .
393 .It Va PACKAGES
394 Used only for the
395 .Cm package
396 target; the base directory for the packages tree, normally
397 .Pa packages/
398 in
399 .Va PORTSDIR .
400 If this directory exists, the package tree will be (partially) constructed.
401 This directory does not have to exist; if it does not, packages will be
402 placed into the current directory, or you can define one of
403 .Bl -tag -width ".Va PKGREPOSITORY"
404 .It Va PKGREPOSITORY
405 Directory to put the package in.
406 .It Va PKGFILE
407 The full path to the package.
408 .El
409 .It Va PREFIX
410 Where to install things in general
411 (usually
412 .Pa /usr/local ) .
413 .It Va MASTER_SITES
414 Primary sites for distribution files if not found locally.
415 .It Va PATCH_SITES
416 Primary locations for distribution patch files if not found
417 locally.
418 .It Va MASTER_SITE_FREEBSD
419 If set, go to the master
420 .Fx
421 site for all files.
422 .It Va MASTER_SITE_OVERRIDE
423 Try going to these sites for all files and patches, first.
424 .It Va MASTER_SITE_BACKUP
425 Try going to these sites for all files and patches, last.
426 .It Va RANDOMIZE_MASTER_SITES
427 Try the download locations in a random order.
428 .It Va MASTER_SORT
429 Sort the download locations according to user supplied pattern.
430 Example:
431 .Dl .dk .sunet.se .se dk.php.net .no .de heanet.dl.sourceforge.net
432 .It Va MASTER_SITE_INDEX
433 Where to get
434 .Pa INDEX
435 source built on
436 .Fx
437 cluster (for
438 .Cm fetchindex
439 target).
440 Defaults to
441 .Pa http://www.FreeBSD.org/ports/ .
442 .It Va FETCHINDEX
443 Command to get
444 .Pa INDEX
445 (for
446 .Cm fetchindex
447 target).
448 Defaults to
449 .Dq Nm fetch Fl am .
450 .It Va NOCLEANDEPENDS
451 If defined, do not let
452 .Cm clean
453 recurse to dependencies.
454 .It Va FETCH_CMD
455 Command to use to fetch files.
456 Normally
457 .Xr fetch 1 .
458 .It Va FORCE_PKG_REGISTER
459 If set, overwrite any existing package registration on the system.
460 .It Va MOTIFLIB
461 Location of
462 .Pa libXm. Ns Brq Pa a , Ns Pa so .
463 .It Va INTERACTIVE
464 If defined, only operate on a port if it requires interaction.
465 .It Va BATCH
466 If defined, only operate on a port if it can be installed 100% automatically.
467 .It Va DISABLE_VULNERABILITIES
468 If defined, disable check for security vulnerabilities using
469 .Xr portaudit 1 Pq Pa ports/ports-mgmt/portaudit
470 when installing new ports.
471 .It Va NO_IGNORE
472 If defined, allow installation of ports marked as
473 .Aq Va FORBIDDEN .
474 The default behavior of the Ports framework is to abort when the
475 installation of a forbidden port is attempted.
476 Of course, these ports may not work as expected, but if you really know
477 what you are doing and are sure about installing a forbidden port, then
478 .Va NO_IGNORE
479 lets you do it.
480 .It Va PORT_DBDIR
481 Directory where the results of configuring
482 .Va OPTIONS
483 are stored.
484 Defaults to
485 .Pa /var/db/ports .
486 Each port where
487 .Va OPTIONS
488 have been configured will have a uniquely named sub-directory, containing a
489 single file
490 .Pa options .
491 .El
492 .Sh FILES
493 .Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact
494 .It Pa /usr/ports
495 The default ports directory
496 .No ( Fx
497 and
498 .Ox ) .
499 .It Pa /usr/pkgsrc
500 The default ports directory
501 .Pq Nx .
502 .It Pa /usr/ports/Mk/bsd.port.mk
503 The big Kahuna.
504 .El
505 .Sh SEE ALSO
506 .Xr make 1 ,
507 .Xr pkg_add 1 ,
508 .Xr pkg_create 1 ,
509 .Xr pkg_delete 1 ,
510 .Xr pkg_info 1 ,
511 .Xr pkg_version 1
512 .Pp
513 The following are part of the ports collection:
514 .Pp
515 .Xr portaudit 1 ,
516 .Xr portcheckout 1 ,
517 .Xr portlint 1
518 .Rs
519 .%B "The FreeBSD Handbook"
520 .Re
521 .Pp
522 .Pa http://www.FreeBSD.org/ports
523 (searchable index of all ports)
524 .Sh HISTORY
525 The Ports Collection
526 appeared in
527 .Fx 1.0 .
528 It has since spread to
529 .Nx
530 and
531 .Ox .
532 .Sh AUTHORS
533 .An -nosplit
534 This manual page was originated by
535 .An David O'Brien .
536 .Sh BUGS
537 Ports documentation is split over four places \(em
538 .Pa /usr/ports/Mk/bsd.port.mk ,
539 .%B "The Porter's Handbook" ,
540 the
541 .Dq "Packages and Ports"
542 chapter of
543 .%B "The FreeBSD Handbook" ,
544 and
545 this manual page.