xref: /freebsd/share/man/man7/ports.7 (revision af1f5e647a261263c631c19b629c64ee2fc0b95b)
14000f72fSDavid E. O'Brien.\"
24000f72fSDavid E. O'Brien.\" Copyright (c) 1997 David E. O'Brien
34000f72fSDavid E. O'Brien.\"
44000f72fSDavid E. O'Brien.\" All rights reserved.
54000f72fSDavid E. O'Brien.\"
64000f72fSDavid E. O'Brien.\" Redistribution and use in source and binary forms, with or without
74000f72fSDavid E. O'Brien.\" modification, are permitted provided that the following conditions
84000f72fSDavid E. O'Brien.\" are met:
94000f72fSDavid E. O'Brien.\" 1. Redistributions of source code must retain the above copyright
104000f72fSDavid E. O'Brien.\"    notice, this list of conditions and the following disclaimer.
114000f72fSDavid E. O'Brien.\" 2. Redistributions in binary form must reproduce the above copyright
124000f72fSDavid E. O'Brien.\"    notice, this list of conditions and the following disclaimer in the
134000f72fSDavid E. O'Brien.\"    documentation and/or other materials provided with the distribution.
144000f72fSDavid E. O'Brien.\"
154000f72fSDavid E. O'Brien.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
164000f72fSDavid E. O'Brien.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
174000f72fSDavid E. O'Brien.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
184000f72fSDavid E. O'Brien.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
194000f72fSDavid E. O'Brien.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
204000f72fSDavid E. O'Brien.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
214000f72fSDavid E. O'Brien.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
224000f72fSDavid E. O'Brien.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
234000f72fSDavid E. O'Brien.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
244000f72fSDavid E. O'Brien.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
254000f72fSDavid E. O'Brien.\"
267f3dea24SPeter Wemm.\" $FreeBSD$
274000f72fSDavid E. O'Brien.\"
28*af1f5e64SMateusz Piotrowski.Dd January 8, 2019
294000f72fSDavid E. O'Brien.Dt PORTS 7
303d45e180SRuslan Ermilov.Os
314000f72fSDavid E. O'Brien.Sh NAME
324000f72fSDavid E. O'Brien.Nm ports
334000f72fSDavid E. O'Brien.Nd contributed applications
344000f72fSDavid E. O'Brien.Sh DESCRIPTION
354000f72fSDavid E. O'BrienThe
36b5c508fbSRuslan Ermilov.Fx
370412d17cSRuslan ErmilovPorts Collection
38f1dd4984SEdward Tomasz Napieralaoffers a simple way to compile and install third party applications.
39f1dd4984SEdward Tomasz NapieralaIt is also used to build packages, to be installed using
4086b83608SEdward Tomasz Napierala.Xr pkg 8 .
41f1dd4984SEdward Tomasz NapieralaIt can be installed and updated using
42f1dd4984SEdward Tomasz Napierala.Xr portsnap 8 .
43f1dd4984SEdward Tomasz Napierala.Pp
44f1dd4984SEdward Tomasz NapieralaThe ports tree, typically located at
45f1dd4984SEdward Tomasz Napierala.Pa /usr/ports ,
46f1dd4984SEdward Tomasz Napieralaconsists of subdirectories, one for each category; those in turn contain
47f1dd4984SEdward Tomasz Napieralaindividual ports.
48f1dd4984SEdward Tomasz NapieralaEach port is a directory with metadata and patches necessary to make
49f1dd4984SEdward Tomasz Napieralathe original application source code compile and run on
50481974c2SEitan Adler.Fx .
513d04377bSMateusz PiotrowskiCompiling an application is as simple as typing
523d04377bSMateusz Piotrowski.Dq Li "make build"
53f1dd4984SEdward Tomasz Napieralain the port directory.
540412d17cSRuslan ErmilovThe
550412d17cSRuslan Ermilov.Pa Makefile
56e4b22b63SDavid E. O'Brienautomatically fetches the
57f1dd4984SEdward Tomasz Napieralaapplication source code, either from a local disk or the network, unpacks it,
58f1dd4984SEdward Tomasz Napieralaapplies the patches, and compiles it.
59f1dd4984SEdward Tomasz NapieralaIt also recursively handles dependencies \(em other pieces of software
60f1dd4984SEdward Tomasz Napieralathe port depends on in order to build and work.
61f1dd4984SEdward Tomasz NapieralaAfterwards,
623d04377bSMateusz Piotrowski.Dq Li "make install"
63f1dd4984SEdward Tomasz Napieralainstalls the application.
644000f72fSDavid E. O'Brien.Pp
658f9c7371SEdward Tomasz NapieralaFor more information about using ports, see the
668f9c7371SEdward Tomasz Napierala.Dq "Packages and Ports" section
675d3d0230SMurray Stokelyin
683d04377bSMateusz Piotrowski.Sm off
693d04377bSMateusz Piotrowski.%B "The FreeBSD Handbook"
703d04377bSMateusz Piotrowski.No \&:
713d04377bSMateusz Piotrowski.Sm on
728f9c7371SEdward Tomasz Napierala.Pp
738f9c7371SEdward Tomasz Napierala.Lk https://www.FreeBSD.org/doc/en/books/handbook/ports.html
748f9c7371SEdward Tomasz Napierala.Pp
75f1dd4984SEdward Tomasz NapieralaFor information about creating new ports, see
763d04377bSMateusz Piotrowski.Sm off
773d04377bSMateusz Piotrowski.%B "The Porter's Handbook"
783d04377bSMateusz Piotrowski.No \&:
793d04377bSMateusz Piotrowski.Sm on
808f9c7371SEdward Tomasz Napierala.Pp
818f9c7371SEdward Tomasz Napierala.Lk https://www.FreeBSD.org/doc/en/books/porters-handbook/
82e4b22b63SDavid E. O'Brien.Sh TARGETS
83f1dd4984SEdward Tomasz NapieralaSome of the
84f1dd4984SEdward Tomasz Napierala.Xr make 1
85f1dd4984SEdward Tomasz Napieralatargets work recursively through subdirectories.
860412d17cSRuslan ErmilovThis lets you, for example, install all of the
870412d17cSRuslan Ermilov.Dq Li biology
883d04377bSMateusz Piotrowskiports with one command.
890412d17cSRuslan ErmilovThe targets that do this are
900412d17cSRuslan Ermilov.Cm build , checksum , clean , configure ,
910412d17cSRuslan Ermilov.Cm depends , extract , fetch , install ,
9265dfa7aaSTim Vanderhoekand
930412d17cSRuslan Ermilov.Cm package .
9465dfa7aaSTim Vanderhoek.Pp
9565dfa7aaSTim VanderhoekThe following targets will be run automatically by each proceeding
960412d17cSRuslan Ermilovtarget in order.
970412d17cSRuslan ErmilovThat is,
980412d17cSRuslan Ermilov.Cm build
993d04377bSMateusz Piotrowskiwill be run (if necessary) by
1000412d17cSRuslan Ermilov.Cm install ,
10165dfa7aaSTim Vanderhoekand so on all the way to
1020412d17cSRuslan Ermilov.Cm fetch .
103019de50bSDima DorfmanUsually, you will only use the
1040412d17cSRuslan Ermilov.Cm install
105019de50bSDima Dorfmantarget.
1060412d17cSRuslan Ermilov.Bl -tag -width ".Cm configure"
10703687bafSKirill Ponomarev.It Cm config
10803687bafSKirill PonomarevConfigure
10903687bafSKirill Ponomarev.Va OPTIONS
11003687bafSKirill Ponomarevfor this port using
111ae41fe61SEitan Adler.Xr dialog4ports 1 .
1120412d17cSRuslan Ermilov.It Cm fetch
1130412d17cSRuslan ErmilovFetch all of the files needed to build this port from the sites
1140412d17cSRuslan Ermilovlisted in
1150412d17cSRuslan Ermilov.Va MASTER_SITES
11665dfa7aaSTim Vanderhoekand
1170412d17cSRuslan Ermilov.Va PATCH_SITES .
1180412d17cSRuslan ErmilovSee
119e57fe046SKirill Ponomarev.Va FETCH_CMD , MASTER_SITE_OVERRIDE
1200412d17cSRuslan Ermilovand
121e57fe046SKirill Ponomarev.Va MASTER_SITE_BACKUP .
1220412d17cSRuslan Ermilov.It Cm checksum
123019de50bSDima DorfmanVerify that the fetched distfile's checksum matches the one the port was
124019de50bSDima Dorfmantested against.
12567900914SBenedict ReuschlingIf the distfile's checksum does not match, it also fetches the distfiles
12667900914SBenedict Reuschlingwhich are missing or failed the checksum calculation.
12765dfa7aaSTim VanderhoekDefining
1280412d17cSRuslan Ermilov.Va NO_CHECKSUM
12965dfa7aaSTim Vanderhoekwill skip this step.
1300412d17cSRuslan Ermilov.It Cm depends
13165dfa7aaSTim VanderhoekInstall
132c4d9468eSRuslan Ermilov(or compile if only compilation is necessary)
1330412d17cSRuslan Ermilovany dependencies of the current port.
1340412d17cSRuslan ErmilovWhen called by the
1350412d17cSRuslan Ermilov.Cm extract
13665dfa7aaSTim Vanderhoekor
1370412d17cSRuslan Ermilov.Cm fetch
13865dfa7aaSTim Vanderhoektargets, this is run in piecemeal as
1390412d17cSRuslan Ermilov.Cm fetch-depends , build-depends ,
1400412d17cSRuslan Ermilovetc.
1410412d17cSRuslan ErmilovDefining
1420412d17cSRuslan Ermilov.Va NO_DEPENDS
14365dfa7aaSTim Vanderhoekwill skip this step.
1440412d17cSRuslan Ermilov.It Cm extract
14565dfa7aaSTim VanderhoekExpand the distfile into a work directory.
1460412d17cSRuslan Ermilov.It Cm patch
14765dfa7aaSTim VanderhoekApply any patches that are necessary for the port.
1480412d17cSRuslan Ermilov.It Cm configure
1490412d17cSRuslan ErmilovConfigure the port.
1500412d17cSRuslan ErmilovSome ports will ask you questions during this stage.
1510412d17cSRuslan ErmilovSee
1520412d17cSRuslan Ermilov.Va INTERACTIVE
15365dfa7aaSTim Vanderhoekand
1540412d17cSRuslan Ermilov.Va BATCH .
1550412d17cSRuslan Ermilov.It Cm build
1560412d17cSRuslan ErmilovBuild the port.
1570412d17cSRuslan ErmilovThis is the same as calling the
1580412d17cSRuslan Ermilov.Cm all
15965dfa7aaSTim Vanderhoektarget.
1600412d17cSRuslan Ermilov.It Cm install
1610412d17cSRuslan ErmilovInstall the port and register it with the package system.
1620412d17cSRuslan ErmilovThis is all you really need to do.
16365dfa7aaSTim Vanderhoek.El
16465dfa7aaSTim Vanderhoek.Pp
16565dfa7aaSTim VanderhoekThe following targets are not run during the normal install process.
16656e37108SGiorgos Keramidas.Bl -tag -width ".Cm fetch-recursive"
16703687bafSKirill Ponomarev.It Cm showconfig
16803687bafSKirill PonomarevDisplay
16903687bafSKirill Ponomarev.Va OPTIONS
17003687bafSKirill Ponomarevconfig for this port.
171a571610dSKirill Ponomarev.It Cm showconfig-recursive
172a571610dSKirill PonomarevDisplay
173a571610dSKirill Ponomarev.Va OPTIONS
174a571610dSKirill Ponomarevconfig for this port and all its dependencies.
17503687bafSKirill Ponomarev.It Cm rmconfig
17603687bafSKirill PonomarevRemove
17703687bafSKirill Ponomarev.Va OPTIONS
17803687bafSKirill Ponomarevconfig for this port.
179a571610dSKirill Ponomarev.It Cm rmconfig-recursive
180a571610dSKirill PonomarevRemove
181a571610dSKirill Ponomarev.Va OPTIONS
182a571610dSKirill Ponomarevconfig for this port and all its dependencies.
183a571610dSKirill Ponomarev.It Cm config-conditional
184a571610dSKirill PonomarevSkip the ports which have already had their
185a571610dSKirill Ponomarev.Va OPTIONS
186a571610dSKirill Ponomarevconfigured.
187039b8701STom Rhodes.It Cm config-recursive
188039b8701STom RhodesConfigure
189039b8701STom Rhodes.Va OPTIONS
190039b8701STom Rhodesfor this port and all its dependencies using
191ae41fe61SEitan Adler.Xr dialog4ports 1 .
1920412d17cSRuslan Ermilov.It Cm fetch-list
19303687bafSKirill PonomarevShow list of files to be fetched in order to build the port.
19456e37108SGiorgos Keramidas.It Cm fetch-recursive
19556e37108SGiorgos KeramidasFetch the distfiles of the port and all its dependencies.
196515ba752SChristian Brueffer.It Cm fetch-recursive-list
197515ba752SChristian BruefferShow list of files that would be retrieved by
198515ba752SChristian Brueffer.Cm fetch-recursive .
199d40caf29SThomas Abthorpe.It Cm run-depends-list , build-depends-list
200d40caf29SThomas AbthorpePrint a list of all the compile and run dependencies, and dependencies
201d40caf29SThomas Abthorpeof those dependencies, by port directory.
202039b8701STom Rhodes.It Cm all-depends-list
203039b8701STom RhodesPrint a list of all dependencies for the port.
2040412d17cSRuslan Ermilov.It Cm pretty-print-run-depends-list , pretty-print-build-depends-list
20565dfa7aaSTim VanderhoekPrint a list of all the compile and run dependencies, and dependencies
206d40caf29SThomas Abthorpeof those dependencies, by port name and version.
207c8ff7e9eSPav Lucistnik.It Cm missing
208c8ff7e9eSPav LucistnikPrint a list of missing dependencies to be installed for the port.
2090412d17cSRuslan Ermilov.It Cm clean
2100412d17cSRuslan ErmilovRemove the expanded source code.
2110412d17cSRuslan ErmilovThis recurses to dependencies unless
2120412d17cSRuslan Ermilov.Va NOCLEANDEPENDS
21365dfa7aaSTim Vanderhoekis defined.
2140412d17cSRuslan Ermilov.It Cm distclean
2150412d17cSRuslan ErmilovRemove the port's distfiles and perform the
2160412d17cSRuslan Ermilov.Cm clean
217019de50bSDima Dorfmantarget.
218019de50bSDima DorfmanThe
2190412d17cSRuslan Ermilov.Cm clean
22065dfa7aaSTim Vanderhoekportion recurses to dependencies unless
2210412d17cSRuslan Ermilov.Va NOCLEANDEPENDS
22265dfa7aaSTim Vanderhoekis defined, but the
2230412d17cSRuslan Ermilov.Cm distclean
22465dfa7aaSTim Vanderhoekportion never recurses
225c4d9468eSRuslan Ermilov(this is perhaps a bug).
2260412d17cSRuslan Ermilov.It Cm reinstall
22765dfa7aaSTim VanderhoekUse this to restore a port after using
228225636dcSEdward Tomasz Napierala.Xr pkg-delete 8
22965dfa7aaSTim Vanderhoekwhen you should have used
2300412d17cSRuslan Ermilov.Cm deinstall .
2310412d17cSRuslan Ermilov.It Cm deinstall
23265dfa7aaSTim VanderhoekRemove an installed port from the system, similar to
233225636dcSEdward Tomasz Napierala.Xr pkg-delete 8 .
234515ba752SChristian Brueffer.It Cm deinstall-all
235515ba752SChristian BruefferRemove all installed ports with the same
236515ba752SChristian Brueffer.Va PKGORIGIN
237515ba752SChristian Bruefferfrom the system.
2380412d17cSRuslan Ermilov.It Cm package
2390412d17cSRuslan ErmilovMake a binary package for the port.
2400412d17cSRuslan ErmilovThe port will be installed if it has not already been.
2410412d17cSRuslan ErmilovThe package is a
24281c4ddbfSChristian Brueffer.Pa .tbz
2430412d17cSRuslan Ermilovfile that you can use to
24465dfa7aaSTim Vanderhoekinstall the port on other machines with
245225636dcSEdward Tomasz Napierala.Xr pkg-add 8 .
24665dfa7aaSTim VanderhoekIf the directory specified by
2470412d17cSRuslan Ermilov.Va PACKAGES
2480412d17cSRuslan Ermilovdoes not exist, the package will be put into the current directory.
24983d04c76STim VanderhoekSee
2500412d17cSRuslan Ermilov.Va PKGREPOSITORY
25183d04c76STim Vanderhoekand
2520412d17cSRuslan Ermilov.Va PKGFILE .
2538c3bfd69SChristian Brueffer.It Cm package-recursive
2548c3bfd69SChristian BruefferLike
2558c3bfd69SChristian Brueffer.Cm package ,
2568c3bfd69SChristian Bruefferbut makes a package for each depending port as well.
257d40caf29SThomas Abthorpe.It Cm package-name
258d40caf29SThomas AbthorpePrints the name with version of the port.
2590412d17cSRuslan Ermilov.It Cm readmes
26083d04c76STim VanderhoekCreate a port's
26183d04c76STim Vanderhoek.Pa README.html .
2626b4c0736STim VanderhoekThis can be used from
2636b4c0736STim Vanderhoek.Pa /usr/ports
2646b4c0736STim Vanderhoekto create a browsable web of all ports on your system!
2650412d17cSRuslan Ermilov.It Cm search
266019de50bSDima DorfmanSearch the
267019de50bSDima Dorfman.Pa INDEX
26865d476e0SKirill Ponomarevfile for the pattern specified by the
2690412d17cSRuslan Ermilov.Va key
27065d476e0SKirill Ponomarev(searches the port name, comment, and dependencies),
2710412d17cSRuslan Ermilov.Va name
27265d476e0SKirill Ponomarev(searches the port name only),
27365d476e0SKirill Ponomarev.Va path
27465d476e0SKirill Ponomarev(searches the port path),
27565d476e0SKirill Ponomarev.Va info
27665d476e0SKirill Ponomarev(searches the port info),
27765d476e0SKirill Ponomarev.Va maint
27865d476e0SKirill Ponomarev(searches the port maintainer),
27965d476e0SKirill Ponomarev.Va cat
28065d476e0SKirill Ponomarev(searches the port category),
28165d476e0SKirill Ponomarev.Va bdeps
28265d476e0SKirill Ponomarev(searches the port build-time dependency),
28365d476e0SKirill Ponomarev.Va rdeps
2841ea65ec7SGabor Kovesdan(searches the port run-time dependency),
2851ea65ec7SGabor Kovesdan.Va www
2861ea65ec7SGabor Kovesdan(searches the port web site)
2870412d17cSRuslan Ermilov.Xr make 1
28865d476e0SKirill Ponomarevvariables, and their exclusion counterparts:
28965d476e0SKirill Ponomarev.Va xname , xkey
29065d476e0SKirill Ponomarevetc.
291019de50bSDima DorfmanFor example, one would type:
292019de50bSDima Dorfman.Pp
2930412d17cSRuslan Ermilov.Dl "cd /usr/ports && make search name=query"
294019de50bSDima Dorfman.Pp
295019de50bSDima Dorfmanto find all ports whose
296019de50bSDima Dorfmanname matches
2970412d17cSRuslan Ermilov.Dq Li query .
298019de50bSDima DorfmanResults include the matching ports' path, comment, maintainer,
299019de50bSDima Dorfmanbuild dependencies, and run dependencies.
30065d476e0SKirill Ponomarev.Bd -literal -offset indent
30165d476e0SKirill Ponomarevcd /usr/ports && make search name=pear- \e
30265d476e0SKirill Ponomarev    xbdeps=apache
30365d476e0SKirill Ponomarev.Ed
30465d476e0SKirill Ponomarev.Pp
30565d476e0SKirill PonomarevTo find all ports whose
30665d476e0SKirill Ponomarevnames contain
30765d476e0SKirill Ponomarev.Dq Li pear-
30865d476e0SKirill Ponomarevand which do not have apache
30965d476e0SKirill Ponomarevlisted in build-time dependencies.
31065d476e0SKirill Ponomarev.Bd -literal -offset indent
31165d476e0SKirill Ponomarevcd /usr/ports && make search name=pear- \e
31265d476e0SKirill Ponomarev    xname='ht(tp|ml)'
31365d476e0SKirill Ponomarev.Ed
31465d476e0SKirill Ponomarev.Pp
31565d476e0SKirill PonomarevTo find all ports whose names contain
31665d476e0SKirill Ponomarev.Dq Li pear- ,
31765d476e0SKirill Ponomarevbut not
31865d476e0SKirill Ponomarev.Dq Li html
31965d476e0SKirill Ponomarevor
32065d476e0SKirill Ponomarev.Dq Li http .
32165d476e0SKirill Ponomarev.Bd -literal -offset indent
32265d476e0SKirill Ponomarevmake search key=apache display=name,path,info keylim=1
32365d476e0SKirill Ponomarev.Ed
32465d476e0SKirill Ponomarev.Pp
32565d476e0SKirill PonomarevTo find ports that contain
32665d476e0SKirill Ponomarev.Dq Li apache
32765d476e0SKirill Ponomarevin either of the name, path, info
32865d476e0SKirill Ponomarevfields, ignore the rest of the record.
3291ea65ec7SGabor Kovesdan.Pp
330f283c8f8SJens SchweikhardtBy default the search is not case-sensitive.
3311ea65ec7SGabor KovesdanIn order to make it case-sensitive you can use the
3321ea65ec7SGabor Kovesdan.Va icase
3331ea65ec7SGabor Kovesdanvariable:
3341ea65ec7SGabor Kovesdan.Bd -literal -offset indent
3351ea65ec7SGabor Kovesdanmake search name=p5-R icase=0
3361ea65ec7SGabor Kovesdan.Ed
337be3253caSMaxim Konovalov.It Cm quicksearch
338be3253caSMaxim KonovalovReduced
339be3253caSMaxim Konovalov.Cm search
340be3253caSMaxim Konovalovoutput.
341be3253caSMaxim KonovalovOnly display name, path and info.
34203687bafSKirill Ponomarev.It Cm describe
34303687bafSKirill PonomarevGenerate a one-line description of each port for use in the
34403687bafSKirill Ponomarev.Pa INDEX
34503687bafSKirill Ponomarevfile.
346724c0a23SChristian Brueffer.It Cm maintainer
347724c0a23SChristian BruefferDisplay the port maintainer's email address.
3480412d17cSRuslan Ermilov.It Cm index
349019de50bSDima DorfmanCreate
350019de50bSDima Dorfman.Pa /usr/ports/INDEX ,
351019de50bSDima Dorfmanwhich is used by the
3520412d17cSRuslan Ermilov.Cm pretty-print-*
353019de50bSDima Dorfmanand
3540412d17cSRuslan Ermilov.Cm search
355019de50bSDima Dorfmantargets.
3567585929eSKirill PonomarevRunning the
3570412d17cSRuslan Ermilov.Cm index
3580412d17cSRuslan Ermilovtarget will ensure your
3590412d17cSRuslan Ermilov.Pa INDEX
3600412d17cSRuslan Ermilovfile is up to date with your ports tree.
3617585929eSKirill Ponomarev.It Cm fetchindex
3627585929eSKirill PonomarevFetch the
3637585929eSKirill Ponomarev.Pa INDEX
3647585929eSKirill Ponomarevfile from the
3657585929eSKirill Ponomarev.Fx
3667585929eSKirill Ponomarevcluster.
3673136363fSRuslan Ermilov.El
368def37e7cSMike Pritchard.Sh ENVIRONMENT
36965dfa7aaSTim VanderhoekYou can change all of these.
3700412d17cSRuslan Ermilov.Bl -tag -width ".Va MASTER_SITES"
3710412d17cSRuslan Ermilov.It Va PORTSDIR
3720412d17cSRuslan ErmilovLocation of the ports tree.
3730412d17cSRuslan ErmilovThis is
37465dfa7aaSTim Vanderhoek.Pa /usr/ports
37565dfa7aaSTim Vanderhoekon
376b5c508fbSRuslan Ermilov.Fx
377e4b22b63SDavid E. O'Brienand
3780412d17cSRuslan Ermilov.Ox ,
37965dfa7aaSTim Vanderhoekand
38065dfa7aaSTim Vanderhoek.Pa /usr/pkgsrc
38165dfa7aaSTim Vanderhoekon
38265dfa7aaSTim Vanderhoek.Nx .
3830412d17cSRuslan Ermilov.It Va WRKDIRPREFIX
3840412d17cSRuslan ErmilovWhere to create any temporary files.
3850412d17cSRuslan ErmilovUseful if
3860412d17cSRuslan Ermilov.Va PORTSDIR
3870412d17cSRuslan Ermilovis read-only (perhaps mounted from a CD-ROM).
3880412d17cSRuslan Ermilov.It Va DISTDIR
38965dfa7aaSTim VanderhoekWhere to find/put distfiles, normally
39065dfa7aaSTim Vanderhoek.Pa distfiles/
39165dfa7aaSTim Vanderhoekin
3920412d17cSRuslan Ermilov.Va PORTSDIR .
3930412d17cSRuslan Ermilov.It Va PACKAGES
39465dfa7aaSTim VanderhoekUsed only for the
3950412d17cSRuslan Ermilov.Cm package
39665dfa7aaSTim Vanderhoektarget; the base directory for the packages tree, normally
39765dfa7aaSTim Vanderhoek.Pa packages/
39865dfa7aaSTim Vanderhoekin
3990412d17cSRuslan Ermilov.Va PORTSDIR .
40065dfa7aaSTim VanderhoekIf this directory exists, the package tree will be (partially) constructed.
4010412d17cSRuslan ErmilovThis directory does not have to exist; if it does not, packages will be
40283d04c76STim Vanderhoekplaced into the current directory, or you can define one of
4030412d17cSRuslan Ermilov.Bl -tag -width ".Va PKGREPOSITORY"
4040412d17cSRuslan Ermilov.It Va PKGREPOSITORY
40583d04c76STim VanderhoekDirectory to put the package in.
4060412d17cSRuslan Ermilov.It Va PKGFILE
40765dfa7aaSTim VanderhoekThe full path to the package.
40865dfa7aaSTim Vanderhoek.El
409eed1dcabSEitan Adler.It Va LOCALBASE
410eed1dcabSEitan AdlerWhere existing things are installed and where to search for files when
411eed1dcabSEitan Adlerresolving dependencies (usually
4129a0e6be2SXin LI.Pa /usr/local ) .
413eed1dcabSEitan Adler.It Va PREFIX
414eed1dcabSEitan AdlerWhere to install this port (usually set to the same as
415eed1dcabSEitan Adler.Va LOCALBASE ) .
4160412d17cSRuslan Ermilov.It Va MASTER_SITES
417e4b22b63SDavid E. O'BrienPrimary sites for distribution files if not found locally.
4180412d17cSRuslan Ermilov.It Va PATCH_SITES
4190412d17cSRuslan ErmilovPrimary locations for distribution patch files if not found
420e4b22b63SDavid E. O'Brienlocally.
4210412d17cSRuslan Ermilov.It Va MASTER_SITE_FREEBSD
422b5c508fbSRuslan ErmilovIf set, go to the master
423b5c508fbSRuslan Ermilov.Fx
424b5c508fbSRuslan Ermilovsite for all files.
4250412d17cSRuslan Ermilov.It Va MASTER_SITE_OVERRIDE
426b81d803eSRuslan ErmilovTry going to these sites for all files and patches, first.
427e57fe046SKirill Ponomarev.It Va MASTER_SITE_BACKUP
428e57fe046SKirill PonomarevTry going to these sites for all files and patches, last.
4291f568fb2SPav Lucistnik.It Va RANDOMIZE_MASTER_SITES
4301f568fb2SPav LucistnikTry the download locations in a random order.
4311f568fb2SPav Lucistnik.It Va MASTER_SORT
4321f568fb2SPav LucistnikSort the download locations according to user supplied pattern.
4331f568fb2SPav LucistnikExample:
4341f568fb2SPav Lucistnik.Dl .dk .sunet.se .se dk.php.net .no .de heanet.dl.sourceforge.net
435e57fe046SKirill Ponomarev.It Va MASTER_SITE_INDEX
436e57fe046SKirill PonomarevWhere to get
437e57fe046SKirill Ponomarev.Pa INDEX
438e57fe046SKirill Ponomarevsource built on
439e57fe046SKirill Ponomarev.Fx
440e57fe046SKirill Ponomarevcluster (for
441e57fe046SKirill Ponomarev.Cm fetchindex
442e57fe046SKirill Ponomarevtarget).
443e57fe046SKirill PonomarevDefaults to
444a2aef24aSEitan Adler.Pa https://www.FreeBSD.org/ports/ .
445e57fe046SKirill Ponomarev.It Va FETCHINDEX
446e57fe046SKirill PonomarevCommand to get
447e57fe046SKirill Ponomarev.Pa INDEX
448e57fe046SKirill Ponomarev(for
449e57fe046SKirill Ponomarev.Cm fetchindex
450e57fe046SKirill Ponomarevtarget).
451e57fe046SKirill PonomarevDefaults to
4523d04377bSMateusz Piotrowski.Dq Li "fetch -am" .
4530412d17cSRuslan Ermilov.It Va NOCLEANDEPENDS
4540412d17cSRuslan ErmilovIf defined, do not let
4550412d17cSRuslan Ermilov.Cm clean
45665dfa7aaSTim Vanderhoekrecurse to dependencies.
4570412d17cSRuslan Ermilov.It Va FETCH_CMD
4580412d17cSRuslan ErmilovCommand to use to fetch files.
4590412d17cSRuslan ErmilovNormally
46065dfa7aaSTim Vanderhoek.Xr fetch 1 .
4610412d17cSRuslan Ermilov.It Va FORCE_PKG_REGISTER
46265dfa7aaSTim VanderhoekIf set, overwrite any existing package registration on the system.
4630412d17cSRuslan Ermilov.It Va MOTIFLIB
4640412d17cSRuslan ErmilovLocation of
4653d04377bSMateusz Piotrowski.Pa "libXm\&." Ns Brq Pa a , Ns Pa so .
4660412d17cSRuslan Ermilov.It Va INTERACTIVE
46765dfa7aaSTim VanderhoekIf defined, only operate on a port if it requires interaction.
4680412d17cSRuslan Ermilov.It Va BATCH
46965dfa7aaSTim VanderhoekIf defined, only operate on a port if it can be installed 100% automatically.
470949f900dSSimon L. B. Nielsen.It Va DISABLE_VULNERABILITIES
471949f900dSSimon L. B. NielsenIf defined, disable check for security vulnerabilities using
4729ef6fea6SGlen Barber.Xr pkg-audit 8
473949f900dSSimon L. B. Nielsenwhen installing new ports.
474068abd55SGiorgos Keramidas.It Va NO_IGNORE
475068abd55SGiorgos KeramidasIf defined, allow installation of ports marked as
476068abd55SGiorgos Keramidas.Aq Va FORBIDDEN .
477068abd55SGiorgos KeramidasThe default behavior of the Ports framework is to abort when the
478068abd55SGiorgos Keramidasinstallation of a forbidden port is attempted.
479068abd55SGiorgos KeramidasOf course, these ports may not work as expected, but if you really know
480068abd55SGiorgos Keramidaswhat you are doing and are sure about installing a forbidden port, then
481068abd55SGiorgos Keramidas.Va NO_IGNORE
482068abd55SGiorgos Keramidaslets you do it.
483b7642c92SBenedict Reuschling.It Va NO_CHECKSUM
484b7642c92SBenedict ReuschlingIf defined, skip verifying the port's checksum.
4851583221bSGiorgos Keramidas.It Va TRYBROKEN
4861583221bSGiorgos KeramidasIf defined, attempt to build a port even if it is marked as
4871583221bSGiorgos Keramidas.Aq Va BROKEN .
488520a4bfdSGabor Kovesdan.It Va PORT_DBDIR
489520a4bfdSGabor KovesdanDirectory where the results of configuring
490520a4bfdSGabor Kovesdan.Va OPTIONS
491520a4bfdSGabor Kovesdanare stored.
492520a4bfdSGabor KovesdanDefaults to
493520a4bfdSGabor Kovesdan.Pa /var/db/ports .
494520a4bfdSGabor KovesdanEach port where
495520a4bfdSGabor Kovesdan.Va OPTIONS
496520a4bfdSGabor Kovesdanhave been configured will have a uniquely named sub-directory, containing a
497520a4bfdSGabor Kovesdansingle file
498520a4bfdSGabor Kovesdan.Pa options .
49965dfa7aaSTim Vanderhoek.El
50059be36b0SBenjamin Kaduk.Sh MAKE VARIABLES
50159be36b0SBenjamin KadukThe following list provides a name and short description for many of the
50259be36b0SBenjamin Kadukvariables that are used when building ports.
50359be36b0SBenjamin KadukMore information on these and other related variables may be found in
50459be36b0SBenjamin Kaduk.Pa ${PORTSDIR}/Mk/*
50559be36b0SBenjamin Kadukand the
50659be36b0SBenjamin Kaduk.Fx
50759be36b0SBenjamin KadukPorter's Handbook.
508*af1f5e64SMateusz Piotrowski.Bl -tag -width "WITH_CCACHE_BUILD"
50959be36b0SBenjamin Kaduk.It Va WITH_DEBUG
51059be36b0SBenjamin Kaduk.Pq Vt bool
51159be36b0SBenjamin KadukIf set, debugging symbols are installed for ports binaries.
51259be36b0SBenjamin Kaduk.It Va WITH_DEBUG_PORTS
51359be36b0SBenjamin KadukA list of origins for which to set
51459be36b0SBenjamin Kaduk.Va WITH_DEBUG_PORTS .
51559be36b0SBenjamin Kaduk.It Va WITH_CCACHE_BUILD
51659be36b0SBenjamin Kaduk.Pq Vt bool
51759be36b0SBenjamin KadukIf set, enables the use of
51859be36b0SBenjamin Kaduk.Xr ccache 1
51959be36b0SBenjamin Kadukfor building ports.
52059be36b0SBenjamin Kaduk.It Va CCACHE_DIR
5213d04377bSMateusz PiotrowskiWhich directory to use for the
5223d04377bSMateusz Piotrowski.Xr ccache 1
5233d04377bSMateusz Piotrowskidata.
52459be36b0SBenjamin Kaduk.El
5254000f72fSDavid E. O'Brien.Sh FILES
5260412d17cSRuslan Ermilov.Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact
5274000f72fSDavid E. O'Brien.It Pa /usr/ports
5283d04377bSMateusz PiotrowskiThe default ports directory.
529652627f0STim Vanderhoek.It Pa /usr/ports/Mk/bsd.port.mk
53065dfa7aaSTim VanderhoekThe big Kahuna.
5313136363fSRuslan Ermilov.El
5321b3fba16SEdward Tomasz Napierala.Sh EXAMPLES
533154b4d39SMateusz Piotrowski.Bl -tag -width 0n
534154b4d39SMateusz Piotrowski.It Sy Example 1\&: No Building and Installing a Port
535154b4d39SMateusz Piotrowski.Pp
536154b4d39SMateusz PiotrowskiThe following command builds and installs Emacs.
537154b4d39SMateusz Piotrowski.Bd -literal -offset 2n
538154b4d39SMateusz Piotrowski.Li # Ic cd /usr/ports/editors/emacs
539154b4d39SMateusz Piotrowski.Li # Ic make install
5401b3fba16SEdward Tomasz Napierala.Ed
541154b4d39SMateusz Piotrowski.It Sy Example 2\&: No Installing Dependencies with Xr pkg 8
542154b4d39SMateusz Piotrowski.Pp
543154b4d39SMateusz PiotrowskiThe following examples shows how to build and install a port without having to
544154b4d39SMateusz Piotrowskibuild its dependencies.
545154b4d39SMateusz PiotrowskiInstead, the dependencies are downloaded via
546154b4d39SMateusz Piotrowski.Xr pkg 8 .
547154b4d39SMateusz Piotrowski.Bd -literal -offset 2n
548154b4d39SMateusz Piotrowski.Li # Ic make missing | xargs pkg install --automatic --yes
549154b4d39SMateusz Piotrowski.Li # Ic make install
550154b4d39SMateusz Piotrowski.Ed
551154b4d39SMateusz Piotrowski.Pp
552154b4d39SMateusz PiotrowskiIt is especially useful, when the dependencies are costly
553154b4d39SMateusz Piotrowskiin time and resources to build
554154b4d39SMateusz Piotrowski.Pq like Pa lang/rust .
555154b4d39SMateusz PiotrowskiThe drawback is that
556154b4d39SMateusz Piotrowski.Xr pkg 8
557154b4d39SMateusz Piotrowskioffers only packages built with the default set of
558154b4d39SMateusz Piotrowski.Va OPTIONS .
559154b4d39SMateusz Piotrowski.El
5604000f72fSDavid E. O'Brien.Sh SEE ALSO
5614000f72fSDavid E. O'Brien.Xr make 1 ,
56259be36b0SBenjamin Kaduk.Xr make.conf 5 ,
5633d04377bSMateusz Piotrowski.Xr pkg 7 ,
5647a36e6d2SEitan Adler.Xr portsnap 8
565def37e7cSMike Pritchard.Pp
5663d04377bSMateusz PiotrowskiAdditional developer documentation:
5673d04377bSMateusz Piotrowski.Bl -dash -width "" -offset indent
5683d04377bSMateusz Piotrowski.It
569ac8011f8SDavid E. O'Brien.Xr portlint 1
5703d04377bSMateusz Piotrowski.It
5713d04377bSMateusz Piotrowski.Pa /usr/ports/Mk/bsd.port.mk
5723d04377bSMateusz Piotrowski.El
57365dfa7aaSTim Vanderhoek.Pp
5743d04377bSMateusz PiotrowskiAdditional user documentation:
5753d04377bSMateusz Piotrowski.Bl -dash -width "" -offset indent
5763d04377bSMateusz Piotrowski.It
5773d04377bSMateusz Piotrowski.Xr pkg 8
5783d04377bSMateusz Piotrowski.It
5793d04377bSMateusz Piotrowski.Lk "https://www.FreeBSD.org/ports" "Searchable index of all ports"
5803d04377bSMateusz Piotrowski.El
5814000f72fSDavid E. O'Brien.Sh HISTORY
5820412d17cSRuslan ErmilovThe Ports Collection
5834000f72fSDavid E. O'Brienappeared in
5844000f72fSDavid E. O'Brien.Fx 1.0 .
5856b4c0736STim VanderhoekIt has since spread to
5866b4c0736STim Vanderhoek.Nx
5876b4c0736STim Vanderhoekand
5886b4c0736STim Vanderhoek.Ox .
5899cbda590SRuslan Ermilov.Sh AUTHORS
5909cbda590SRuslan Ermilov.An -nosplit
5919cbda590SRuslan ErmilovThis manual page was originated by
5929cbda590SRuslan Ermilov.An David O'Brien .
59365dfa7aaSTim Vanderhoek.Sh BUGS
5940412d17cSRuslan ErmilovPorts documentation is split over four places \(em
5952693c8b9STim Vanderhoek.Pa /usr/ports/Mk/bsd.port.mk ,
5960412d17cSRuslan Ermilov.%B "The Porter's Handbook" ,
59765dfa7aaSTim Vanderhoekthe
5980412d17cSRuslan Ermilov.Dq "Packages and Ports"
5995d3d0230SMurray Stokelychapter of
6000412d17cSRuslan Ermilov.%B "The FreeBSD Handbook" ,
6015d3d0230SMurray Stokelyand
602949f900dSSimon L. B. Nielsenthis manual page.
603