{"id":44,"date":"2010-04-17T17:39:51","date_gmt":"2010-04-18T02:39:51","guid":{"rendered":"\/blog\/?p=44"},"modified":"2023-09-21T09:41:22","modified_gmt":"2023-09-21T00:41:22","slug":"openbsd-port-%ec%82%ac%ec%9a%a9%eb%b0%a9%eb%b2%95","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=44","title":{"rendered":"OpenBSD Port \uc0ac\uc6a9\ubc29\ubc95"},"content":{"rendered":"\nPORTS(7) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OpenBSD Reference Manual &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTS(7)<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"NAME\" target=\"_blank\" _cssquery_UID=\"72\" rel=\"noopener\"><B>NAME<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; <B>ports<\/B> - contributed applications<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"DESCRIPTION\" target=\"_blank\" rel=\"noopener\"><B>DESCRIPTION<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; The OpenBSD Ports Collection is the infrastructure used to create binary<br \/>&nbsp; &nbsp;&nbsp; packages for third party applications.<br \/><br \/>&nbsp; &nbsp;&nbsp; For normal usage refer to <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=packages&amp;sektion=7&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">packages(7)<\/A>, as most ports produce binary pack-<br \/>&nbsp; &nbsp;&nbsp; ages which are available from the official CD-ROM, or on a neighborly FTP<br \/>&nbsp; &nbsp;&nbsp; mirror.<br \/><br \/>&nbsp; &nbsp;&nbsp; Each port contains any patches necessary to make the original application<br \/>&nbsp; &nbsp;&nbsp; source code compile and run on OpenBSD.&nbsp; Compiling an application is as<br \/>&nbsp; &nbsp;&nbsp; simple as typing <B>make<\/B> in the port directory!&nbsp; The <I>Makefile<\/I> automatically<br \/>&nbsp; &nbsp;&nbsp; fetches the application source code, either from a local disk or via ftp,<br \/>&nbsp; &nbsp;&nbsp; unpacks it on the local system, applies the patches, and compiles it.&nbsp; If<br \/>&nbsp; &nbsp;&nbsp; all goes well, simply type <B>sudo make<\/B> install to install the application.<br \/><br \/>&nbsp; &nbsp;&nbsp; For more information about using ports, see The OpenBSD Ports Mechanism<br \/>&nbsp; &nbsp;&nbsp; (<I><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/ports.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.openbsd.org\/ports.html<\/A><\/I>) and the OpenBSD FAQ<br \/>&nbsp; &nbsp;&nbsp; (<I><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/faq\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.openbsd.org\/faq\/<\/A><\/I>).&nbsp; For information about creating new ports,<br \/>&nbsp; &nbsp;&nbsp; see the OpenBSD Porting Checklist <I><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/checklist.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.openbsd.org\/checklist.html<\/A><\/I>.<br \/><br \/>&nbsp; &nbsp;&nbsp; For a detailed description of the build process, see <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=bsd.port.mk&amp;sektion=5&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">bsd.port.mk(5)<\/A>.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"PORTS+MASTER\" target=\"_blank\" rel=\"noopener\"><B>PORTS MASTER<\/B><\/A> MAKEFILE<br \/>&nbsp; &nbsp;&nbsp; The ports master Makefile, normally located in <I>\/usr\/ports\/Makefile<\/I> (but<br \/>&nbsp; &nbsp;&nbsp; see PORTSDIR below) offers a few useful targets.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>index<\/I>&nbsp; &nbsp; &nbsp; rebuild the ports complete index, <I>\/usr\/ports\/INDEX<\/I><br \/><br \/>&nbsp; &nbsp;&nbsp; <I>mirror-maker<\/I><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; see <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=mirroring-ports&amp;sektion=7&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">mirroring-ports(7)<\/A>,<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>pkglocatedb<\/I><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; build a <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_mklocatedb&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_mklocatedb(1)<\/A> database file and place it in<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <I>${PORTSDIR}\/packages\/${MACHINE_ARCH}\/ftp<\/I>, for use by<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=locate&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">locate(1)<\/A>,<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>print-index<\/I><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display the contents of the index in a user-friendly way,<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>search<\/I>&nbsp; &nbsp;&nbsp; invoked with a key, e.g., <B>make search<\/B> key=foo, retrieve infor-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mation relevant to a given port (obsolescent).<br \/><br \/>&nbsp; &nbsp;&nbsp; Starting in OpenBSD 4.0, there is a port, <I>databases\/sqlports<\/I> that builds<br \/>&nbsp; &nbsp;&nbsp; an sqlite database containing most information relevant to every port in<br \/>&nbsp; &nbsp;&nbsp; the ports tree.&nbsp; This database can be searched using any tool able to ma-<br \/>&nbsp; &nbsp;&nbsp; nipulate such databases, for instance sqlitebrowser, or a script language<br \/>&nbsp; &nbsp;&nbsp; with an sqlite interface, e.g., perl, python, ocaml, lua, php5.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"SELECTING+A\" target=\"_blank\" rel=\"noopener\"><B>SELECTING A<\/B><\/A> <B>SET OF<\/B> PORTS<br \/>&nbsp; &nbsp;&nbsp; If <I>\/usr\/ports\/INDEX<\/I> is up to date, it is possible to select subsets by<br \/>&nbsp; &nbsp;&nbsp; setting the following variables on the command line:<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>key<\/I>&nbsp; &nbsp; &nbsp;&nbsp; package name matching the given key,<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>category<\/I>&nbsp; port belonging to category,<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>maintainer<\/I><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; port maintained by a given person.<br \/><br \/>&nbsp; &nbsp;&nbsp; For instance, to invoke clean on all ports in the x11 category, one can<br \/>&nbsp; &nbsp;&nbsp; say:<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ make category=x11 clean<br \/><br \/>&nbsp; &nbsp;&nbsp; The index search is done by a perl script, so all regular expressions<br \/>&nbsp; &nbsp;&nbsp; from <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=perlre&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">perlre(1)<\/A> apply.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"TARGETS\" target=\"_blank\" rel=\"noopener\"><B>TARGETS<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; Individual ports are controlled through a few documented targets.&nbsp; Some<br \/>&nbsp; &nbsp;&nbsp; of these targets work recursively through subdirectories, so that someone<br \/>&nbsp; &nbsp;&nbsp; can, for example, install all of the net ports.<br \/><br \/>&nbsp; &nbsp;&nbsp; The variable SKIPDIR can hold a set of package directories to avoid dur-<br \/>&nbsp; &nbsp;&nbsp; ing recursion.&nbsp; These are always specified relative to the root of the<br \/>&nbsp; &nbsp;&nbsp; ports tree, and can contain a flavor or subpackage part (see<br \/>&nbsp; &nbsp;&nbsp; <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=packages-specs&amp;sektion=7&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">packages-specs(7)<\/A>).&nbsp; SKIPDIR is handled by a case statement, and so can<br \/>&nbsp; &nbsp;&nbsp; contain simple wildcards, e.g., SKIPDIR='editors\/openoffice*' .<br \/><br \/>&nbsp; &nbsp;&nbsp; The variable STARTDIR can hold the path to a starting directory.&nbsp; The re-<br \/>&nbsp; &nbsp;&nbsp; cursion will skip all directories up to that package path.&nbsp; This can be<br \/>&nbsp; &nbsp;&nbsp; used to resume a full build at some specific point without having to go<br \/>&nbsp; &nbsp;&nbsp; through thousands of directories first.<br \/><br \/>&nbsp; &nbsp;&nbsp; In case of failure in a subdirectory, the shell fragment held in<br \/>&nbsp; &nbsp;&nbsp; REPORT_PROBLEM is executed.&nbsp; Default behavior is to call exit, but this<br \/>&nbsp; &nbsp;&nbsp; can be overridden on the command line, e.g., to avoid stopping after each<br \/>&nbsp; &nbsp;&nbsp; problem.<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ make REPORT_PROBLEM=true<br \/><br \/>&nbsp; &nbsp;&nbsp; If REPORT_PROBLEM_LOGFILE is non empty, then REPORT_PROBLEM will default<br \/>&nbsp; &nbsp;&nbsp; to:<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; echo $$d ($@) &gt;$${REPORT_PROBLEM_LOGFILE}<br \/><br \/>&nbsp; &nbsp;&nbsp; That is, any failure will append the faulty directory name together with<br \/>&nbsp; &nbsp;&nbsp; the target that failed to <I>${REPORT_PROBLEM_LOGFILE}<\/I> and proceed.<br \/><br \/>&nbsp; &nbsp;&nbsp; The targets that do this are <I>all<\/I>, <I>build<\/I>, <I>checksum<\/I>, <I>clean<\/I>, <I>configure<\/I>,<br \/>&nbsp; &nbsp;&nbsp; <I>extract<\/I>, <I>fake<\/I>, <I>fetch<\/I>, <I>install<\/I>, <I>distclean<\/I>, <I>deinstall<\/I>, <I>reinstall<\/I>, <I>package<\/I>,<br \/>&nbsp; &nbsp;&nbsp; <I>link-categories<\/I>, <I>unlink-categories<\/I>, <I>describe<\/I>, <I>show<\/I>, <I>regress<\/I>, <I>lib-depends-<\/I><br \/>&nbsp; &nbsp;&nbsp; <I>check<\/I>, <I>homepage-links<\/I>, <I>manpages-check<\/I>, <I>license-check<\/I>, <I>all-dir-depends<\/I>,<br \/>&nbsp; &nbsp;&nbsp; <I>build-dir-depends<\/I>, <I>run-dir-depends<\/I> and <I>readmes<\/I>.<br \/><br \/>&nbsp; &nbsp;&nbsp; Target names starting with _ are private to the ports infrastructure,<br \/>&nbsp; &nbsp;&nbsp; should not be invoked directly, and are liable to change without notice.<br \/><br \/>&nbsp; &nbsp;&nbsp; In the following list, each target will run the preceding targets in or-<br \/>&nbsp; &nbsp;&nbsp; der automatically.&nbsp; That is, <I>build<\/I> will be run (if necessary) by <I>install<\/I>,<br \/>&nbsp; &nbsp;&nbsp; and so on all the way to <I>fetch<\/I>.&nbsp; In typical use, one will only run<br \/>&nbsp; &nbsp;&nbsp; <I>install<\/I> explicitly (as normal user, with SUDO defined in <I>\/etc\/mk.conf<\/I>),<br \/>&nbsp; &nbsp;&nbsp; or <I>build<\/I> (as user), then <I>install<\/I> (as root).<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>fetch<\/I>&nbsp; &nbsp; &nbsp; Fetch all of the files needed to build this port from the<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; site(s) listed in MASTER_SITES.&nbsp; See FETCH_CMD and<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MASTER_SITE_OVERRIDE.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>checksum<\/I>&nbsp;&nbsp; Verify that the fetched distfile matches the one the port was<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tested against.&nbsp; Defining NO_CHECKSUM to Yes will skip this<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; step.&nbsp; Sometimes, distfiles change without warning.&nbsp; The main<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OpenBSD mirror should still hold a copy of old distfiles, in-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dexed by checksum.&nbsp; Using<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ make checksum REFETCH=true<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; will try to get a set of distfiles that match the recorded<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; checksum.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>depends<\/I>&nbsp; &nbsp; Install (or package if only compilation is necessary) any de-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pendencies of the current port.&nbsp; When called by the <I>extract<\/I>,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <I>install<\/I> or <I>fetch<\/I> targets, this is run in scattered pieces as<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <I>lib-depends<\/I>, <I>build-depends<\/I> and <I>run-depends<\/I>.&nbsp; Defining<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NO_DEPENDS to Yes will skip this step.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>extract<\/I>&nbsp; &nbsp; Expand the distfile into a work directory.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>patch<\/I>&nbsp; &nbsp; &nbsp; Apply any patches that are necessary for the port.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>configure<\/I>&nbsp; Configure the port.&nbsp; Some ports will ask questions during this<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stage.&nbsp; See INTERACTIVE and BATCH.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>build<\/I>&nbsp; &nbsp; &nbsp; Build the port.&nbsp; This is the same as calling the <I>all<\/I> target.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>fake<\/I>&nbsp; &nbsp; &nbsp;&nbsp; Pretend to install the port under a subdirectory of the work<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; directory.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>package<\/I>&nbsp; &nbsp; Create a binary package from the fake installation.&nbsp; The pack-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; age is a .tgz file that can be used to install the port on<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; several machines with <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_add&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_add(1)<\/A>.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>install<\/I>&nbsp; &nbsp; Install the resulting package.<br \/><br \/>&nbsp; &nbsp;&nbsp; The following targets are not run during the normal install process.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>print-build-depends<\/I> <I>print-run-depends<\/I><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Print an ordered list of all the compile and run dependen-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; cies.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>clean<\/I>&nbsp; &nbsp; &nbsp;&nbsp; Remove the expanded source code.&nbsp; This does not recurse to<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; dependencies unless CLEANDEPENDS is defined to Yes.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>distclean<\/I>&nbsp;&nbsp; Remove the port's distfile(s).&nbsp; This does not recurse to de-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pendencies.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>regress<\/I>&nbsp; &nbsp;&nbsp; Runs the ports regression tests.&nbsp; Usually needs a completed<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; build.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>reinstall<\/I>&nbsp;&nbsp; Use this to restore a port after using <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_delete&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_delete(1)<\/A>.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>update<\/I>&nbsp; &nbsp; &nbsp; Alternative target to <I>install<\/I>.&nbsp; Does not install new pack-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ages, but updates existing ones.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>link-categories<\/I><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Populate the ports tree with symbolic links for each category<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; the port belongs to.<br \/><br \/>&nbsp; &nbsp;&nbsp; <I>unlink-categories<\/I><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Remove the symbolic links created by <I>link-categories<\/I>.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"LOCK+INFRASTRUCTURE\" target=\"_blank\" rel=\"noopener\"><B>LOCK INFRASTRUCTURE<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; The ports tree can be used concurrently for building several ports at the<br \/>&nbsp; &nbsp;&nbsp; same time, thanks to a locking mechanism.&nbsp; By default, this mechanism is<br \/>&nbsp; &nbsp;&nbsp; disabled.&nbsp; Defining LOCKDIR to a proper value will activate it.<br \/><br \/>&nbsp; &nbsp;&nbsp; All locks will be stored in <I>${LOCKDIR}<\/I>.&nbsp; LOCK_CMD should be used to ac-<br \/>&nbsp; &nbsp;&nbsp; quire a lock, and UNLOCK_CMD should be used to release it.<br \/><br \/>&nbsp; &nbsp;&nbsp; Locks are named ${LOCKDIR}\/${FULLPKGNAME}.lock, or ${LOCKDIR}\/${DIST-<br \/>&nbsp; &nbsp;&nbsp; FILE}.lock for distfiles fetching.<br \/><br \/>&nbsp; &nbsp;&nbsp; The default values of LOCK_CMD and UNLOCK_CMD are appropriate for most<br \/>&nbsp; &nbsp;&nbsp; uses.<br \/><br \/>&nbsp; &nbsp;&nbsp; The locking protocol follows a big-lock model: each top-level target in a<br \/>&nbsp; &nbsp;&nbsp; port directory will acquire the corresponding lock, complete its job,<br \/>&nbsp; &nbsp;&nbsp; then release the lock, e.g., running<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ make build<br \/><br \/>&nbsp; &nbsp;&nbsp; will acquire the lock, run the port through <I>fetch<\/I>, <I>checksum<\/I>, <I>extract<\/I>,<br \/>&nbsp; &nbsp;&nbsp; <I>patch<\/I>, <I>configure<\/I>, <I>build<\/I>, then release the lock.&nbsp; If dependencies are in-<br \/>&nbsp; &nbsp;&nbsp; volved, they will invoke top-level targets in other directories, and thus<br \/>&nbsp; &nbsp;&nbsp; acquire some other locks as well.<br \/><br \/>&nbsp; &nbsp;&nbsp; The infrastructure contains some protection against acquiring the same<br \/>&nbsp; &nbsp;&nbsp; lock twice, thus recursive locking is not needed for LOCK_CMD.<br \/><br \/>&nbsp; &nbsp;&nbsp; Starting with OpenBSD 4.3, the infrastructure supports manual locking:<br \/>&nbsp; &nbsp;&nbsp; the targets <I>lock<\/I> and <I>unlock<\/I> can be used to acquire and release individual<br \/>&nbsp; &nbsp;&nbsp; locks.&nbsp; Both these targets output a shell command that must be used to<br \/>&nbsp; &nbsp;&nbsp; update environment variables.&nbsp; Manual locking can be used to protect a<br \/>&nbsp; &nbsp;&nbsp; directory against interference by an automated build job, while the user<br \/>&nbsp; &nbsp;&nbsp; is looking at or modifying a given port.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"UPDATING+PACKAGES\" target=\"_blank\" rel=\"noopener\"><B>UPDATING PACKAGES<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; Instead of deinstalling each package and rebuilding from scratch, the<br \/>&nbsp; &nbsp;&nbsp; ports tree can be used to update installed packages.&nbsp; The <I>update<\/I> target<br \/>&nbsp; &nbsp;&nbsp; will replace an installed package using <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_add&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_add(1)<\/A> in replacement mode.<br \/>&nbsp; &nbsp;&nbsp; If FORCE_UPDATE is set to `Yes', dependencies will also be updated first,<br \/>&nbsp; &nbsp;&nbsp; and packages will always be updated, even if there is no difference be-<br \/>&nbsp; &nbsp;&nbsp; tween the old and the new packages.<br \/><br \/>&nbsp; &nbsp;&nbsp; Updates use a mechanism similar to bulk cookies and deposit cookies in<br \/>&nbsp; &nbsp;&nbsp; the UPDATE_COOKIES_DIR.&nbsp; See the next section for more details, since<br \/>&nbsp; &nbsp;&nbsp; most of the fine points of bulk package building also apply to updates.<br \/><br \/>&nbsp; &nbsp;&nbsp; There are bugs in the ports tree, most related to libtool, which make<br \/>&nbsp; &nbsp;&nbsp; some updates prefer the already installed libraries instead of the newly<br \/>&nbsp; &nbsp;&nbsp; built ones.&nbsp; This shows up as undefined references in libraries, in which<br \/>&nbsp; &nbsp;&nbsp; case there is no choice but to proceed the old way: deinstall the offend-<br \/>&nbsp; &nbsp;&nbsp; ing package and everything built on top of it, build and install new<br \/>&nbsp; &nbsp;&nbsp; packages.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"BULK+PACKAGE\" target=\"_blank\" rel=\"noopener\"><B>BULK PACKAGE<\/B><\/A> BUILDING<br \/>&nbsp; &nbsp;&nbsp; The ports tree contains some mechanisms to save space when building large<br \/>&nbsp; &nbsp;&nbsp; collections of packages.&nbsp; If TRUST_PACKAGES and BULK are set to `Yes' for<br \/>&nbsp; &nbsp;&nbsp; a package build, some shortcuts are taken to allow cleaning up working<br \/>&nbsp; &nbsp;&nbsp; directories on the fly.<br \/><br \/>&nbsp; &nbsp;&nbsp; Some important caveats apply: the packages already built in the package<br \/>&nbsp; &nbsp;&nbsp; repository are assumed to be up-to-date, the database of installed pack-<br \/>&nbsp; &nbsp;&nbsp; ages is assumed to be accurate (TRUST_PACKAGES), and the bulk cookies are<br \/>&nbsp; &nbsp;&nbsp; assumed to be up-to-date (BULK).<br \/><br \/>&nbsp; &nbsp;&nbsp; This means that newer iterations of package buildings should make sure<br \/>&nbsp; &nbsp;&nbsp; those conditions are met, which entails erasing old package repository,<br \/>&nbsp; &nbsp;&nbsp; removing packages that need to be rebuilt from the base of installed<br \/>&nbsp; &nbsp;&nbsp; packages, and cleaning up old bulk cookies.<br \/><br \/>&nbsp; &nbsp;&nbsp; If any of these conditions is not met, the package build may run into<br \/>&nbsp; &nbsp;&nbsp; weird problems.<br \/><br \/>&nbsp; &nbsp;&nbsp; Some experimental framework allows for building a new set of packages<br \/>&nbsp; &nbsp;&nbsp; without first uninstalling the old ones: move the old packages away, re-<br \/>&nbsp; &nbsp;&nbsp; move all bulk cookies and update cookies, and use the <I>update<\/I> target with<br \/>&nbsp; &nbsp;&nbsp; FORCE_UPDATE set to `Yes' for the build.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"NETWORK+CONFIGURATION\" target=\"_blank\" rel=\"noopener\"><B>NETWORK CONFIGURATION<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; The variables pertaining to network access have been marshalled into<br \/>&nbsp; &nbsp;&nbsp; <I>${PORTSDIR}\/infrastructure\/templates\/network.conf.template<\/I>.<br \/><br \/>&nbsp; &nbsp;&nbsp; To customize that setup, copy that file into<br \/>&nbsp; &nbsp;&nbsp; <I>${PORTSDIR}\/infrastructure\/db\/network.conf<\/I> and edit it.<br \/><br \/>&nbsp; &nbsp;&nbsp; MASTER_SITE_OPENBSD<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; If set to Yes, include the master OpenBSD site when fetch-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ing files.<br \/><br \/>&nbsp; &nbsp;&nbsp; MASTER_SITE_FREEBSD<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; If set to Yes, include the master FreeBSD site when fetch-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ing files.<br \/><br \/>&nbsp; &nbsp;&nbsp; MASTER_SITE_OVERRIDE<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Go to this site first for all files.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"FLAVORS\" target=\"_blank\" rel=\"noopener\"><B>FLAVORS<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; The OpenBSD ports tree comes with a mechanism called <B>FLAVORS<\/B>.&nbsp; Thanks to<br \/>&nbsp; &nbsp;&nbsp; this mechanism, users can select specific options provided by a given<br \/>&nbsp; &nbsp;&nbsp; port.<br \/><br \/>&nbsp; &nbsp;&nbsp; If a port is \"flavored\", there should be a terse description of available<br \/>&nbsp; &nbsp;&nbsp; flavors in the <I>pkg\/DESCR<\/I> file.<br \/><br \/>&nbsp; &nbsp;&nbsp; For example, the misc\/screen port comes with a flavor called <B>static<\/B>.<br \/>&nbsp; &nbsp;&nbsp; This changes the building process so a statically compiled version of the<br \/>&nbsp; &nbsp;&nbsp; program will be built.&nbsp; To avoid confusion with other packages or fla-<br \/>&nbsp; &nbsp;&nbsp; vors, the package name will be extended with a dash-separated list of the<br \/>&nbsp; &nbsp;&nbsp; selected flavors.<br \/><br \/>&nbsp; &nbsp;&nbsp; In this instance, the corresponding package will be called<br \/>&nbsp; &nbsp;&nbsp; <B>screen-4.0.2-static<\/B>.<br \/><br \/>&nbsp; &nbsp;&nbsp; To build a port with a specific flavor, just pass FLAVOR in the environ-<br \/>&nbsp; &nbsp;&nbsp; ment of the <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=make&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">make(1)<\/A> command:<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ env FLAVOR=\"static\" make package<br \/><br \/>&nbsp; &nbsp;&nbsp; and of course, use the same settings for the subsequent invocations of<br \/>&nbsp; &nbsp;&nbsp; make:<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ env FLAVOR=\"static\" make install<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ env FLAVOR=\"static\" make clean<br \/><br \/>&nbsp; &nbsp;&nbsp; More than one flavor may be specified:<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ cd \/usr\/ports\/mail\/exim<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ env FLAVOR=\"mysql ldap\" make package<br \/><br \/>&nbsp; &nbsp;&nbsp; Specifying a flavor that does not exist is an error.&nbsp; Additionally, some<br \/>&nbsp; &nbsp;&nbsp; ports impose some further restrictions on flavor combinations, when such<br \/>&nbsp; &nbsp;&nbsp; combinations do not make sense.<br \/><br \/>&nbsp; &nbsp;&nbsp; Lots of ports can be built without X11 requirement and accordingly have a<br \/>&nbsp; &nbsp;&nbsp; <B>no<\/B><I>_<\/I><B>x11<\/B> flavor.<br \/><br \/>&nbsp; &nbsp;&nbsp; Flavor settings are not propagated to dependencies.&nbsp; If a specific combi-<br \/>&nbsp; &nbsp;&nbsp; nation is needed, careful hand-building of the required set of packages<br \/>&nbsp; &nbsp;&nbsp; is still necessary.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"MULTI\" target=\"_blank\" rel=\"noopener\"><B>MULTI<\/B><\/A><I>_<\/I><B>PACKAGES<\/B><br \/>&nbsp; &nbsp;&nbsp; The OpenBSD ports tree comes with a mechanism called <B>MULTI<\/B><I>_<\/I><B>PACKAGES<\/B>.<br \/>&nbsp; &nbsp;&nbsp; This mechanism is used when a larger package is broken down into several<br \/>&nbsp; &nbsp;&nbsp; smaller components referred to as subpackages.<br \/><br \/>&nbsp; &nbsp;&nbsp; If a port is \"subpackaged\", each subpackage will have a corresponding de-<br \/>&nbsp; &nbsp;&nbsp; scription in the <I>pkg\/DESCR-subpackage<\/I> file.<br \/><br \/>&nbsp; &nbsp;&nbsp; For example, the database\/mysql port comes with subpackages called <B>-main<\/B>,<br \/>&nbsp; &nbsp;&nbsp; <B>-tests<\/B> and <B>-server<\/B>.<br \/><br \/>&nbsp; &nbsp;&nbsp; In this instance, the build will yield multiple packages, one correspond-<br \/>&nbsp; &nbsp;&nbsp; ing to each subpackage.&nbsp; In the case of our mysql example, the packages<br \/>&nbsp; &nbsp;&nbsp; will be called <B>mysql-client-<\/B>&lt;<B>version<\/B>&gt;, <B>mysql-tests-<\/B>&lt;<B>version<\/B>&gt;, and <B>mysql-<\/B><br \/>&nbsp; &nbsp;&nbsp; <B>server-<\/B>&lt;<B>version<\/B>&gt;.<br \/><br \/>&nbsp; &nbsp;&nbsp; To install\/deinstall a specific subpackage of a port, you may <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_add&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_add(1)<\/A><br \/>&nbsp; &nbsp;&nbsp; them manually, or alternatively, you may set SUBPACKAGE in the environ-<br \/>&nbsp; &nbsp;&nbsp; ment of the <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=make&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">make(1)<\/A> command during the install\/deinstall phase:<br \/><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ env SUBPACKAGE=\"-server\" make install<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $ env SUBPACKAGE=\"-server\" make deinstall<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"PORT+VARIABLES\" target=\"_blank\" rel=\"noopener\"><B>PORT VARIABLES<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; These can be changed in the environment, or in <I>\/etc\/mk.conf<\/I> for persis-<br \/>&nbsp; &nbsp;&nbsp; tence.&nbsp; They can also be set on make's command line, e.g., <B>make<\/B><br \/>&nbsp; &nbsp;&nbsp; <B>VAR<\/B><I>_<\/I><B>FOO=foo<\/B><br \/><br \/>&nbsp; &nbsp;&nbsp; Boolean variables should be set to Yes instead of simply being defined,<br \/>&nbsp; &nbsp;&nbsp; for uniformity and future compatibility.<br \/><br \/>&nbsp; &nbsp;&nbsp; Variable names starting with _ are private to the ports infrastructure,<br \/>&nbsp; &nbsp;&nbsp; should not be changed by the user, and are liable to change without no-<br \/>&nbsp; &nbsp;&nbsp; tice.<br \/><br \/>&nbsp; &nbsp;&nbsp; PORTSDIR &nbsp; &nbsp;&nbsp; Location of the ports tree (usually <I>\/usr\/ports<\/I>).<br \/><br \/>&nbsp; &nbsp;&nbsp; DISTDIR &nbsp; &nbsp; &nbsp; Where to find\/put distfiles, normally <I>distfiles\/<\/I> in<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTSDIR.<br \/><br \/>&nbsp; &nbsp;&nbsp; PACKAGE_REPOSITORY<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Used only for the <I>package<\/I> target; the base directory for<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; the packages tree, normally <I>packages<\/I> in PORTSDIR.&nbsp; If this<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; directory exists, the package tree will be (partially) con-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; structed.<br \/><br \/>&nbsp; &nbsp;&nbsp; BULK_COOKIES_DIR<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; During bulk package building, used to store cookies for al-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ready built packages to avoid rebuilding them, since the<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; actual working directory will already have been cleaned<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; out.&nbsp; Defaults to bulk\/${MACHINE_ARCH} under PORTSDIR.<br \/><br \/>&nbsp; &nbsp;&nbsp; UPDATE_COOKIES_DIR<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Used to store cookies for package updates, defaults to up-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; date\/${MACHINE_ARCH} under PORTSDIR.&nbsp; If set to empty, it<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; will revert to a file under ${WRKDIR}.<br \/><br \/>&nbsp; &nbsp;&nbsp; LOCALBASE &nbsp; &nbsp; Where to install things in general (usually <I>\/usr\/local<\/I>).<br \/><br \/>&nbsp; &nbsp;&nbsp; MASTER_SITES&nbsp; Primary sites for distribution files if not found locally.<br \/><br \/>&nbsp; &nbsp;&nbsp; CLEANDEPENDS&nbsp; If set to Yes, let `clean' recurse to dependencies.<br \/><br \/>&nbsp; &nbsp;&nbsp; FETCH_CMD &nbsp; &nbsp; Command to use to fetch files.&nbsp; Normally <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ftp&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">ftp(1)<\/A>.<br \/><br \/>&nbsp; &nbsp;&nbsp; FETCH_PACKAGES<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; If set to ``Yes'', try to use <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_add&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_add(1)<\/A> to install the<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; missing packages from PKG_PATH.<br \/><br \/>&nbsp; &nbsp;&nbsp; PATCH_DEBUG &nbsp; If defined, display verbose output when applying each<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; patch.<br \/><br \/>&nbsp; &nbsp;&nbsp; INTERACTIVE &nbsp; If defined, only operate on a port if it requires interac-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; tion.<br \/><br \/>&nbsp; &nbsp;&nbsp; BATCH &nbsp; &nbsp; &nbsp; &nbsp; If defined, only operate on a port if it can be installed<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 100% automatically.<br \/><br \/>&nbsp; &nbsp;&nbsp; USE_SYSTRACE&nbsp; Set to `Yes' to protect the <I>configure<\/I>, <I>build<\/I>, and <I>fake<\/I> tar-<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; gets with <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=systrace&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">systrace(1)<\/A>.&nbsp; This way it is ensured that ports<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; do not make any network connections during build or write<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; outside some well defined directories.&nbsp; The filter list is<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; stored in <I>${PORTSDIR}\/infrastructure\/db\/systrace.filter<\/I>.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"USING+A\" target=\"_blank\" rel=\"noopener\"><B>USING A<\/B><\/A> <B>READ-ONLY PORTS<\/B> TREE<br \/>&nbsp; &nbsp;&nbsp; Select read-write partition(s) that can accommodate working directories,<br \/>&nbsp; &nbsp;&nbsp; the distfiles repository, and the built packages.&nbsp; Set WRKOBJDIR,<br \/>&nbsp; &nbsp;&nbsp; PACKAGE_REPOSITORY, BULK_COOKIES_DIR, UPDATE_COOKIES_DIR and DISTDIR in<br \/>&nbsp; &nbsp;&nbsp; <I>\/etc\/mk.conf<\/I> accordingly.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"FILES\" target=\"_blank\" rel=\"noopener\"><B>FILES<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The default ports directory.<br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports\/Makefile&nbsp; Ports master Makefile.<br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports\/INDEX &nbsp; &nbsp; Ports index.<br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports\/infrastructure\/mk\/bsd.port.mk<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The ports main engine.<br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports\/infrastructure\/templates\/network.conf.template<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Network configuration defaults.<br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports\/infrastructure\/db\/network.conf<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Local network configuration.<br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports\/infrastructure\/db\/systrace.filter<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Filter list for systrace.<br \/>&nbsp; &nbsp;&nbsp; \/usr\/ports\/infrastructure\/db\/user.list<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List of users and groups created by ports.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"SEE+ALSO\" target=\"_blank\" rel=\"noopener\"><B>SEE ALSO<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=make&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">make(1)<\/A>, <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_add&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_add(1)<\/A>, <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_create&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_create(1)<\/A>, <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_delete&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_delete(1)<\/A>, <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=pkg_info&amp;sektion=1&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">pkg_info(1)<\/A>,<br \/>&nbsp; &nbsp;&nbsp; <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=bsd.port.mk&amp;sektion=5&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">bsd.port.mk(5)<\/A>, <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=packages&amp;sektion=7&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">packages(7)<\/A><br \/><br \/>&nbsp; &nbsp;&nbsp; The OpenBSD Ports Mechanism: <I><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/ports.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.openbsd.org\/ports.html<\/A><\/I><br \/><br \/>&nbsp; &nbsp;&nbsp; The OpenBSD Porting Checklist: <I><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/checklist.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.openbsd.org\/checklist.html<\/A><\/I><br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"HISTORY\" target=\"_blank\" rel=\"noopener\"><B>HISTORY<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; <B>The Ports<\/B> Collection appeared in FreeBSD 1.0.&nbsp; It was introduced in<br \/>&nbsp; &nbsp;&nbsp; OpenBSD by Ejovi Nuwere, with much initial effort by Angelos D.<br \/>&nbsp; &nbsp;&nbsp; Keromytis.&nbsp; Maintenance passed then to Marco S. Hyman, and then to<br \/>&nbsp; &nbsp;&nbsp; Christopher Turan.&nbsp; It is currently managed by Marc Espie, Brad Smith,<br \/>&nbsp; &nbsp;&nbsp; and Christian Weisgerber, along with a host of others found at<br \/>&nbsp; &nbsp;&nbsp; <a class=\"con_link\" href=\"mailto:ports@openbsd.org\" target=\"_blank\" rel=\"noopener\">ports@openbsd.org<\/A>.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"AUTHORS\" target=\"_blank\" rel=\"noopener\"><B>AUTHORS<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; This man page was originated by David O'Brien, from the FreeBSD project.<br \/><br \/><a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=ports&amp;sektion=7&amp;format=html#end\" name=\"BUGS\" target=\"_blank\" rel=\"noopener\"><B>BUGS<\/B><\/A><br \/>&nbsp; &nbsp;&nbsp; Ports documentation is split over several places --- <a class=\"con_link\" href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi?query=bsd.port.mk&amp;sektion=5&amp;arch=&amp;apropos=0&amp;manpath=OpenBSD+Current\" target=\"_blank\" rel=\"noopener\">bsd.port.mk(5)<\/A>, the<br \/>&nbsp; &nbsp;&nbsp; ``Ports Collection'' section of the FreeBSD handbook, the ``Porting<br \/>&nbsp; &nbsp;&nbsp; Existing Software'' section of the FreeBSD handbook, and some man pages.<br \/>&nbsp; &nbsp;&nbsp; OpenBSD adds a few web pages to further confuse the issue.<br \/><br \/>&nbsp; &nbsp;&nbsp; Use of the MANPS and MANZ variables is not supported.<br \/>\n","protected":false},"excerpt":{"rendered":"<p>PORTS(7) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OpenBSD Reference Manual &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PORTS(7) NAME&nbsp; &nbsp;&nbsp; ports &#8211; contributed applications DESCRIPTION&nbsp; &nbsp;&nbsp; The OpenBSD Ports Collection is the infrastructure used to create binary&nbsp; &nbsp;&nbsp; packages for third party applications. &nbsp; &nbsp;&nbsp; For normal usage refer to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[39],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-os_linux_unix_macos"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/44\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}