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