xref: /openbsd-src/share/man/man5/bsd.port.mk.5 (revision 4b70baf6e17fc8b27fc1f7fa7929335753fa94c3)
1.\" $OpenBSD: bsd.port.mk.5,v 1.508 2019/04/04 02:28:23 naddy Exp $
2.\"
3.\" Copyright (c) 2000-2008 Marc Espie
4.\"
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd $Mdocdate: April 4 2019 $
28.Dt BSD.PORT.MK 5
29.Os
30.Sh NAME
31.Nm bsd.port.mk
32.Nd ports tree master Makefile fragment
33.Sh SYNOPSIS
34.Fd .include <bsd.port.mk>
35.Sh DESCRIPTION
36.Nm
37contains the
38.Xr ports 7
39tree
40.Xr make 1
41framework, in the form of documented public targets,
42variables and paths.
43.Pp
44Identifiers beginning with an underscore
45are internal-use only and likely to change without
46notice.
47.Pp
48This documentation contains sections covering targets, variables,
49diagnostics, and filenames, ordered in alphabetic order, followed
50by a section covering the fake framework, a section
51explaining flavors and multi-packages, and a section covering
52the generation of package information.
53.Pp
54It ends with sections covering obsolete targets, variables and files,
55outlining conversion
56methods from older incarnations of the ports tree or from other
57.Bx
58variants.
59.Pp
60.Nm
61also uses quite a few helper scripts which live under
62.Pa ${PORTSDIR}/infrastructure/bin .
63.Pp
64Binary package details are mostly covered in
65.Xr pkg_create 1
66for the packing-list details,
67and in
68.Xr pkg_add 1
69for the installation semantics.
70.Pp
71Common usage such as building every package in
72the system is covered by
73.Xr ports 7
74and
75.Xr bulk 8
76instead, with
77.Xr packages 7
78providing an overview of the result.
79.Sh TARGETS
80.Bl -tag -width Ds
81.It Cm {build,run,all,test}-dir-depends
82Print all dependencies for a port in order to build it, run it, build and
83run it, or to run regression tests.
84The output is formatted as package specification pairs, in a form suitable
85for
86.Xr tsort 1 .
87.It Cm full-{build,run,all,test}-depends
88Print all dependencies a package depends upon for building, running,
89or both, as a list of package names, sorted by dependency order with
90.Xr tsort 1 ,
91most dependent port first.
92.It Cm {build,lib,test,run}-depends-list
93Print a list of first level package specifications a port depends as
94build dependencies, library dependencies, test dependencies or
95run dependencies.
96.It Cm print-{build,run}-depends
97User convenience target that displays the result of
98.Cm full-{build,run}-depends
99in a more readable way.
100.It Cm {pre,do,post}-*
101Most standard targets can be specialized according to a given port's needs.
102If defined,
103the
104.Cm pre-*
105hook will be invoked before running the normal action;
106the
107.Cm do-*
108hook will be invoked instead of the normal action;
109the
110.Cm post-*
111hook will be invoked after the normal action.
112Specialization hooks exist for
113.Cm build ,
114.Cm configure ,
115.Cm distpatch ,
116.Cm extract ,
117.Cm fake ,
118.Cm gen ,
119.Cm install ,
120.Cm patch ,
121.Cm test .
122See individual targets for exceptions.
123.It Cm all-lib-depends-args
124Process the full
125.Ev LIB_DEPENDS
126list into a form suitable for
127.Xr pkg_create 1 ,
128see
129.Cm print-package-args .
130.It Cm build , Cm all
131Default target.
132Build the port.
133Essentially invoke
134.Bd -literal
135env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \e
136	-f ${MAKE_FILE} ${ALL_TARGET}
137.Ed
138.It Cm check-register
139Introspection target.
140Verify from the ports tree, without building anything, that the current
141subpackage will register okay
142.Po
143see
144.Ev PLIST_REPOSITORY
145.Pc .
146.It Cm check-register-all
147Apply
148.Cm check-register
149to all subpackages of the current port.
150.It Cm checkpatch
151Check that patches would apply cleanly, but do not modify anything.
152.It Cm checksum
153Compute a
154.Xr sha256 1
155digest
156of ${CHECKSUM_FILES} (files listed in DISTFILES and PATCHFILES) and
157check it against ${CHECKSUM_FILE}, normally
158.Pa distinfo .
159In case of a mismatch, running
160.Cm checksum
161with
162.Ev REFETCH Ns = Ns Cm true
163will fetch alternative versions of files keyed on their checksum
164fron the
165.Ox
166main archive site.
167.It Cm clean
168Clean ports contents.
169By default, it will clean the work directory.
170It can be invoked as
171make clean='[depends build bulk work fake flavors dist install sub package
172packages plist]'.
173.Bl -tag -width packages
174.It Va work
175Clean work directory.
176.It Va bulk
177Clean bulk cookie.
178.It Va build
179Clean the
180.Ev WRKBUILD
181directory (only useful if
182.Ev SEPARATE_BUILD
183is set).
184.It Va depends
185Recurse into dependencies.
186.It Va dist
187Clean distribution files.
188.It Va fake
189Clean fake installation directory.
190.It Va flavors
191Clean all work directories.
192.It Va install
193Uninstall package.
194.It Va package
195Remove all copies of package file.
196.It Va plist
197Remove registered packing lists of all subpackages.
198.It Va sub
199With
200.Va install
201or
202.Va package ,
203clean subpackages as well.
204.It Va packages
205Shorthand for
206.Sq sub package .
207.It Va all
208Shorthand for
209.Sq work flavors packages plist .
210.El
211.It Cm clean-depends
212Shorthand for
213.Ql make clean=depends .
214.It Cm configure
215Configure the port.
216By default,
217.Cm configure
218creates the ${WRKBUILD} directory (see
219.Ev SEPARATE_BUILD ) ,
220and runs whatever configuration methods are recorded in
221.Ev CONFIGURE_STYLE .
222.It Cm distclean
223Shorthand for
224.Ql make clean=dist .
225.It Cm distpatch
226Apply distribution patches only.
227See
228.Cm patch
229and
230.Ev PATCH_CASES
231for details.
232.It Cm dump-vars
233Dump the values of all relevant variables in a port, prepended with the
234port's FULLPKGPATH.
235.It Cm extract
236Extract the distribution files under
237.Pa ${WRKDIR}
238(but see
239.Ev EXTRACT_ONLY ,
240.Ev FIX_EXTRACT_PERMISSIONS
241and
242.Ev NO_DEPENDS ) .
243Refer to
244.Ev EXTRACT_CASES
245for a complete description.
246Do not use
247.Cm pre-extract
248and
249.Cm do-extract
250hooks.
251.It Cm fake
252Do a fake port installation, that is, simulate the port installation under
253${WRKINST}.
254There is no
255.Cm do-fake
256and
257.Cm post-fake
258hooks.
259.Cm fake
260actually uses
261.Cm pre-fake ,
262.Cm pre-install ,
263.Cm do-install
264and
265.Cm post-install .
266Override
267.Cm pre-install ,
268.Cm do-install ,
269or
270.Cm post-install
271to change behavior.
272Do not touch
273.Cm pre-fake
274unless you really know what you are doing.
275See
276.Sx THE FAKE FRAMEWORK
277section below.
278.It Cm fake-wantlib-args
279Check
280.Ev WANTLIB
281against the list of installed packages and libraries in the ports tree.
282See
283.Cm print-package-args .
284.It Cm fetch
285Fetch the list of files in
286.Ev DISTFILES
287and
288.Ev PATCHFILES
289using ${FETCH_CMD}.
290Files are normally retrieved from the list of sites in
291.Ev MASTER_SITES .
292.Pp
293Appending
294.Sq :0
295to
296.Sq :9
297to an entry will let
298${FETCH_CMD} retrieve from
299.Ev MASTER_SITES0
300to
301.Ev MASTER_SITES9
302instead.
303If the rest of the entry parses as
304.Sq Ar filename Ns { Ns Ar url Ns } Ns Ar sufx
305${FETCH_CMD} will fetch
306.Ar url Ns Ar sufx
307instead, but store the result as
308.Ar filename Ns Ar sufx .
309.Pp
310Transfers in progress are stored as
311.Ar filenamesufx.part
312and moved after completion.
313.Pp
314The ports framework uses
315.Pa ${DISTDIR}/${DIST_SUBDIR}
316(aliased to
317.Pa ${FULLDISTDIR} )
318to save the ports distribution files and patch files.
319.Pp
320If you want to fetch a significant number of distfiles quickly, say
321all files relevant to a port,
322.Cm dpb Fl F
323is more efficient.
324.Pp
325Use of
326.Cm {pre,do,post}-fetch
327hooks is forbidden, as this would make mirroring of distfiles very complicated.
328.Pp
329See
330.Ev CHECKSUMFILES ,
331.Ev DISTDIR ,
332.Ev DISTFILES ,
333.Ev DIST_SUBDIR ,
334.Ev FETCH_CMD ,
335.Ev FETCH_MANUALLY ,
336.Ev FETCH_SYMLINK_DISTFILES ,
337.Ev FULLDISTDIR ,
338.Ev MAKESUMFILES ,
339.Ev MASTER_SITES ,
340.Ev MASTER_SITES0 , ... ,
341.Ev MASTER_SITES9 ,
342.Ev PATCHFILES ,
343.Ev SUPDISTFILES ,
344.Ev REFETCH .
345.It Cm fetch-all
346Like
347.Cm fetch ,
348but also fetches
349.Ev SUPDISTFILES ,
350for use with e.g.,
351.Cm makesum .
352.It Cm fix-permissions
353Ensure permissions are correct when using
354.Ev PORTS_PRIVSEP
355and/or
356.Xr dpb 1 .
357.Pp
358If necessary, creates directory
359.Ev DISTDIR
360owned by
361.Ev FETCH_USER ,
362and creates directories
363.Ev LOCKDIR ,
364.Ev PACKAGES_REPOSITORY ,
365.Ev PLIST_REPOSITORY
366and
367.Ev WRKOBJDIR
368owned by
369.Ev BUILD_USER .
370.Pp
371If these directories already exist,
372ownership of their contents is modified to conform to
373.Ev PORTS_PRIVSEP
374and
375.Xr dpb 1
376requirements.
377.It Cm gen
378Generate configure script when needed, either after patching
379input files, or from scratch for some ports,
380generally using automake, autoconf, autogen and similar gnu tools.
381This target only has modules
382.Po Ev MODxxx_gen Pc
383and a
384.Ar do-gen
385hooks.
386Then adjust timestamps to avoid regeneration during build
387.Po
388see
389.Ev REORDER_DEPENDENCIES
390.Pc .
391.It Cm generate-readmes
392Generate READMEs and rc scripts from
393.Pa ${PKGDIR}
394into
395.Pa ${WRKINST} .
396Run after
397.Cm fake
398and before
399.Cm package
400or
401.Cm update-plist .
402Always rerun, as it is cheap enough.
403.It Cm index
404Top-level target, see
405.Xr ports 7 .
406.It Cm install-depends
407Before package installation, install and verify dependencies constructed from
408.Ev RUN_DEPENDS , LIB_DEPENDS ,
409and
410.Ev WANTLIB .
411.It Cm install
412Install the package after building.
413See the description of
414.Sx THE FAKE FRAMEWORK
415for the non-intuitive details of the way
416.Cm {pre,do,post}-install
417hooks are actually used by the ports tree.
418.It Cm install-all
419Install all packages in a multi-packages port.
420.It Cm lib-depends-args
421Filter
422.Ev LIB_DEPENDS
423to keep only entries required by
424.Ev WANTLIB ,
425and output a list of dependencies suitable for
426.Xr pkg_create 1 ,
427see
428.Cm print-package-args .
429.It Cm lib-depends-check
430Verify that the
431.Ev LIB_DEPENDS
432and
433.Ev WANTLIB
434are accurate for the port.
435See
436.Cm port-lib-depends-check ,
437which is quicker.
438.It Cm license-check
439Check that
440.Ev PERMIT_PACKAGE_*
441settings match:
442if any dependency has a more restrictive setting, warn about it.
443This warning is advisory, because the automated license checking cannot
444figure out which ports were used only for building and did not taint
445the current port.
446.It Cm lock
447Manually obtain a lock on a given directory.
448Output must be used to update environment variables.
449The lock can be released with
450.Cm unlock .
451Seldom used, see
452.Xr ports 7
453for details.
454.It Cm makesum
455Run
456.Xr sha256 1
457on ${MAKESUMFILES}
458that is, files listed in ${DISTFILES}, ${SUPDISTFILES} and ${PATCHFILES},
459and store the result in ${CHECKSUM_FILE}, normally
460.Pa distinfo .
461Also store the lengths of all files for a quick check during
462.Cm fetch .
463.It Cm no-lib-depends-args
464Degenerate form of
465.Cm lib-depends-args
466that does not do anything.
467See
468.Cm print-package-args .
469.It Cm no-wantlib-args
470Degenerate form of
471.Cm wantlib-args
472that does not do anything.
473See
474.Cm print-package-args .
475.It Cm package
476Build a port package (or packages in a
477.Ev MULTI_PACKAGES
478case) from the fake installation.
479Involves creating packaging information from templates
480(see
481.Ev COMMENT ,
482.Ev SUBST_VARS
483among others) and invoking
484.Xr pkg_create 1
485for each package in the
486.Ev MULTI_PACKAGES
487list.
488If the repository already contains up-to-date packages, they are not rebuilt.
489If PLIST_REPOSITORY is set, the resulting packaging information is compared
490with existing stuff, and saved if new, with loud complaints if it changed
491without a REVISION bump.
492Arch-independent packages are created in ${PACKAGE_REPOSITORY}/no-arch,
493and copied into ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all as needed.
494If ${PERMIT_PACKAGE_FTP} is set to
495.Sq Yes ,
496copies built packages into ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp, using
497hard links if possible.
498If ${PERMIT_PACKAGE_CDROM} is set to
499.Sq Yes ,
500copies built packages into ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cdrom, using
501hard links if possible.
502.It Cm patch
503Apply distribution and
504.Ox
505specific patches.
506Because of historical accident,
507.Cm patch
508does not follow the exact same scheme other standard targets do.
509Namely,
510.Cm patch
511invokes
512.Cm pre-patch
513(if defined),
514.Cm do-patch ,
515and
516.Cm post-patch ,
517but the default
518.Cm do-patch
519target invokes
520.Cm distpatch
521directly.
522So, if the
523.Cm do-patch
524target is overridden, it should still begin by calling
525.Ql make distpatch ,
526before applying
527.Ox
528specific patches.
529Accordingly, the exact sequence of hooks is:
530.Cm pre-patch ,
531.Cm do-distpatch ,
532.Cm post-distpatch ,
533.Cm do-patch ,
534.Cm post-patch .
535If
536.Pa ${PATCHDIR}
537exists, the files described under
538.Ev PATCH_LIST
539will be applied under
540.Ev WRKDIST .
541.It Cm peek-ftp
542Connect to the first site in
543.Ev MASTER_SITES ,
544in the right directory, and leaves user at
545.Xr ftp 1 Ns 's
546prompt.
547.It Cm pkglocatedb
548Top-level target, see
549.Xr ports 7 .
550.It Cm port-lib-depends-check
551Verify that the
552.Ev LIB_DEPENDS
553and
554.Ev WANTLIB
555hold all shared libraries used for every package in the port.
556See
557.Xr library-specs 7 .
558This makes use of
559.Cm print-plist-with-depends
560to avoid actually building the packages, it only needs the
561completion of the
562.Cm fake
563stage, and thus is quicker than
564.Cm lib-depends-check ,
565unless you already have all binary packages.
566.It Cm port-wantlib-args
567Resolve
568.Ev WANTLIB
569against the ports tree itself and system libraries, without looking at built
570or installed packages, and writes a list of options suitable for
571.Xr pkg_create 1 .
572See
573.Cm print-package-args .
574.It Cm prepare
575Before port building, install and verify dependencies constructed from
576.Ev BUILD_DEPENDS ,
577.Ev LIB_DEPENDS
578and
579.Ev WANTLIB .
580In
581.Ev MULTI_PACKAGES
582setups,
583see
584.Sx FLAVORS AND MULTI_PACKAGES .
585.It Cm print-package-args
586Print all dependency-related information that will be passed as parameters
587to
588.Xr pkg_create 1 ,
589e.g.,
590.Fl W Ar wantlib
591and
592.Fl P Ar depends
593lines.
594.Pp
595Those parameters are generated by
596.Cm run-depends-args
597for
598.Ev RUN_DEPENDENCIES
599handling, a form of
600.Cm lib-depends-args
601for
602.Ev LIB_DEPENDS
603and
604.Ev WANTLIB
605interaction,
606and a form of
607.Cm wantlib-args
608for
609.Ev WANTLIB
610resolution.
611.Pp
612Variables
613.Ev lib_depends_args
614and
615.Ev wantlib_args
616control the exact behavior:
617.Ev lib_depends_args
618is normally set to
619.Cm lib-depends-args ,
620but will be set to
621.Cm all-lib-depends-args
622by
623.Cm port-lib-depends-check ,
624in order to have access to the full list of LIB_DEPENDS for figuring
625out missing WANTLIB.
626.Ev wantlib_args
627is normally set to
628.Cm wantlib-args
629but it may be set to
630.Cm port-wantlib-args
631for introspection purposes,
632to
633.Cm fake-wantlib-args
634to avoid some checks, or to
635.Cm no-wantlib-args
636to avoid expensive WANTLIB checks entirely.
637.It Cm print-update-signature
638Print the update signature, as computed using information from the ports tree,
639in the same format used for
640.Xr pkg_info 1
641.Fl S .
642.It Cm print-plist
643Generate and print a package packing-list from the static information
644present in the port.
645.It Cm print-plist-all
646Iterate over
647.Cm print-plist
648for all subpackages in a given port.
649.It Cm print-plist-all-with-depends
650Iterate over
651.Cm print-plist-with-depends
652for all subpackages in a given port.
653.It Cm print-plist-contents
654Generate and print package contents from the static information
655present in the port.
656In contrast with
657.Cm print-plist ,
658the package contents only consists of files, all tagged with category
659markers such as @file.
660See
661.Xr pkg_create 1 .
662.It Cm print-plist-libs
663Generate and print the list of static and dynamic libraries present in the port.
664See
665.Xr pkg_create 1 .
666.It Cm print-plist-libs-with-depends
667Like
668.Cm print-plist-libs ,
669but slower.
670It also handles
671.Ev LIB_DEPENDS ,
672.Ev RUN_DEPENDS ,
673and
674.Ev WANTLIB ,
675so that the packing-list has complete dependency information.
676.It Cm print-plist-with-depends
677Like
678.Cm print-plist ,
679but slower.
680It also handles
681.Ev LIB_DEPENDS ,
682.Ev RUN_DEPENDS ,
683and
684.Ev WANTLIB ,
685so that the packing-list is complete.
686.It Cm rebuild
687Force rebuild of the port.
688.It Cm regen
689Force rebuilding configure scripts using
690.Ar gen
691steps.
692.It Cm reinstall
693Force reinstallation of a port, by first cleaning the old installation.
694Seldom needed, as
695.Cm update
696will often do the right thing.
697.It Cm repackage
698Rebuild the packages of a port after removing existing packages.
699.It Cm run-depends-args
700Process
701.Ev RUN_DEPENDS
702and outputs a list of dependencies suitable for
703.Xr pkg_create 1 ,
704see
705.Cm print-package-args .
706.It Cm reprepare
707Force running the
708.Ar prepare
709target
710again.
711.It Cm show
712Invoked as make show=name, show the contents of ${name}.
713Invoked as make show="name1 name2 ...",
714show the contents of ${name1} ${name2} ...,
715one variable value per line.
716Mostly used from recursive makes, or to know the contents of another
717port's variables without guessing wrongly.
718.It Cm show-fake-size
719Print the size of ${WRKINST}.
720Used by some options of
721.Xr dpb 1 ,
722suitable for
723.Ev BULK_TARGETS .
724.It Cm show-indexed
725Similar to
726.Cm show .
727Invoked as make show-indexed=name, show the contents of ${name${SUBPACKAGE}},
728or ${name} if the variable
729.Ev name
730is not
731.Ev SUBPACKAGE
732dependent.
733.It Cm show-prepare-results
734Print the list of actual installed packages found out by
735.Cm prepare .
736.It Cm show-prepare-test-results
737Print the list of actual installed packages found out by
738.Cm prepare
739and
740.Cm test-depends .
741.It Cm show-required-by
742Print the list of
743.Xr pkgpath 7
744for all ports that will be affected by the
745current port changing.
746Works by walking the list of dependencies, in reverse.
747.It Cm show-run-depends
748Print all running dependencies for a port, one per-line, without duplicates.
749.It Cm subpackage
750Build a port package.
751Exactly like
752.Cm package ,
753but affects only one single subpackage in multi-packages ports.
754.It Cm show-size
755Prints the size of the work directory.
756Used by some options of
757.Xr dpb 1 ,
758suitable for
759.Ev BULK_TARGETS .
760.It Cm subupdate
761Update an existing installation to a newer package, exactly
762like
763.Cm update ,
764but affects only one single subpackage in multi-packages ports.
765.It Cm test
766Run regression tests for the port.
767Essentially depend on a correct build and invoke
768.Bd -literal
769env -i ${ALL_TEST_ENV} ${MAKE_PROGRAM} ${ALL_TEST_FLAGS} \e
770	-f ${MAKE_FILE} ${TEST_TARGET} ${TEST_LOG}
771.Ed
772.Pp
773If a port needs some other ports installed to run regression tests,
774use
775.Ev TEST_DEPENDS .
776If a port needs special configuration or build options to enable regression
777testing, define a
778.Sq test
779.Ev FLAVOR .
780.It Cm test-depends
781Before running regression tests, Install and verify dependencies
782constructed from
783.Ev TEST_DEPENDS .
784.It Cm unlock
785Manually release a lock on a given directory.
786See
787.Cm lock .
788.It Cm update-patches
789Create or update patches for a port, using
790.Xr update-patches 1 .
791See
792.Ev EDIT_PATCHES .
793.It Cm update
794Update an existing installation to a newer package:
795scan the installation for a package with the same
796.Ev FULLPKGPATH ,
797and update it using
798.Sq pkg_add -r
799if a newer package is available.
800In multi-packages ports, all relevant packages are updated.
801See
802.Ev UPDATE_COOKIES_DIR
803and
804.Ev FORCE_UPDATE
805as well.
806.It Cm update-or-install
807Update an installed package or perform a fresh installation,
808by using
809.Sq pkg_add -r .
810Handles one single package in multi-packages ports.
811See
812.Ev UPDATE_COOKIES_DIR
813and
814.Ev FORCE_UPDATE
815as well.
816.It Cm update-or-install-all
817Update installed packages or perform a fresh installation,
818by using
819.Sq pkg_add -r .
820Handles all packages in multi-packages ports.
821See
822.Ev UPDATE_COOKIES_DIR
823and
824.Ev FORCE_UPDATE
825as well.
826.It Cm update-plist
827Update the packing lists for a port, using the fake installation and the
828existing packing lists.
829.Cm update-plist
830should produce a mostly correct
831.Pa PLIST
832file, handling GNU
833.Xr info 1
834files, setuid files, and empty directories.
835It moves an existing file to
836.Pa PLIST.orig .
837If the generated list includes files and directories that shouldn't be
838included, comment these like this:
839.Bd -literal
840@comment unwanted-file
841@comment unwanted-dir/
842.Ed
843.Pp
844Subsequent calls to
845.Cm update-plist
846will automatically recognize and handle such lines correctly.
847.Pp
848.Cm update-plist
849may not handle flavor and multi-packages situations correctly yet, so beware.
850.It Cm verbose-show
851Similar to
852.Cm show ,
853except that it prefixes each value with the variable name, e.g.,
854.Li VAR=value .
855Also note that it does not show undefined variables, contrary to
856.Cm show
857which outputs blank lines for these.
858.It Cm wantlib-args
859Call
860.Cm port-wantlib-args
861and
862.Cm fake-wantlib-args
863and compare the results, errors out in case of discrepancies.
864See
865.Cm print-package-args .
866.El
867.Sh VARIABLES
868Note that some variables are marked as
869.Sq User settings ,
870which means that individual ports should not modify them,
871and that some variables are marked as
872.Sq read-only ,
873which means that they shouldn't ever be changed.
874In a
875.Ev MULTI_PACKAGES
876setup, some variables have settings specific to a given subpackage.
877See
878.Sx FLAVORS AND MULTI_PACKAGES .
879.Bl -tag -width Ds
880.It Ev show
881Invoked as make show=name, show the contents of ${name}.
882Invoked as make show="name1 name2 ...", show the contents of
883${name1} ${name2} ...,
884one variable value per line.
885.It Ev ALL_FAKE_FLAGS
886Flags passed to ${MAKE} invocations during the fake process.
887Equals
888.Li ${MAKE_FLAGS} ${DESTDIRNAME}=${WRKINST} ${FAKE_FLAGS} .
889Read-only.
890.It Ev ALL_TEST_ENV
891Environment passed to test.
892Equals
893.Li ${MAKE_ENV} ${TEST_ENV} .
894Read-only.
895.It Ev ALL_TEST_FLAGS
896Flags passed to ${MAKE} invocations during test.
897Equals
898.Li ${MAKE_FLAGS} ${TEST_FLAGS} .
899Read-only.
900.It Ev ALL_TARGET
901Target used to build software.
902Default is
903.Sq all .
904Can be set to empty, to yield a package's default target.
905.It Ev APM_ARCHS
906Set to the list of
907.Xr apm 4
908architectures.
909Read-only.
910Use with
911.Ev ONLY_FOR_ARCHS .
912.It Ev ARCH
913Current machine architecture.
914Read-only.
915.It Ev AUTOCONF
916Location of the autoconf binary if needed.
917Defaults to autoconf (though autoreconf might be more appropriate).
918.It Ev AUTOCONF_DIR
919Where to invoke autoconf if ${CONFIGURE_STYLE} includes autoconf.
920Defaults to ${WRKSRC}.
921.\" AUTOCONF_DIR should probably be a list, and be renamed to AUTOCONF_DIRS ?
922.It Ev AUTOCONF_ENV
923Environment values that should be passed to all runs of autoconf, automake
924and related tools.
925Specifically, version numbers and PATH.
926Automatically set as soon as
927.Ev CONFIGURE_STYLE
928is gnu or higher.
929.It Ev AUTOCONF_VERSION
930Starting with
931.Ox 3.3 ,
932several versions of autoconf may coexist peacefully.
933The main autoconf script is a shell wrapper in the
934.Pa devel/metaauto
935package, and similarly for automake.
936Setting
937.Ev AUTOCONF_VERSION
938along with
939.Ev CONFIGURE_STYLE
940set to autoconf is the correct way to specify which one to use.
941.Ev AUTOCONF_VERSION
942defaults to 2.13.
943If autoconf must be run manually,
944.Ev MODGNU_AUTOCONF_DEPENDS
945can be used to specify what packages to depend upon.
946.It Ev AUTOHEADER
947Location of the autoheader binary.
948Defaults to autoheader.
949.It Ev AUTOMAKE_VERSION
950Several versions of automake may coexist peacefully.
951.Ev AUTOMAKE_VERSION
952must be set before trying to run automake.
953Defaults to 1.4.
954.It Ev BASE_PKGPATH
955Full
956.Xr pkgpath 7
957to the current port, taking flavors into account.
958See also
959.Ev BUILD_PKGPATH ,
960which also includes pseudo-flavors.
961Read-only.
962.It Ev BASELOCALSTATEDIR
963User settings.
964Base location for system-wide state directory.
965Defaults to
966.Pa ${VARBASE} .
967See
968.Ev LOCALSTATEDIR .
969.It Ev BASESYSCONFDIR
970User settings.
971Base location for system-wide configuration files.
972Defaults to
973.Pa /etc .
974See
975.Ev SYSCONFDIR .
976.It Ev BATCH
977User settings.
978Set to
979.Sq Yes
980to avoid ports that require user-interaction.
981Use in conjunction with
982.Ev INTERACTIVE
983to simplify bulk-package builds.
984.Pq See IGNORE .
985.It Ev BE_ARCHS
986Set to the list of big-endian architectures.
987Read-only.
988Use with
989.Ev NOT_FOR_ARCHS
990and
991.Ev ONLY_FOR_ARCHS .
992.It Ev BUILD_DEPENDS
993List of other ports the current port needs to build correctly.
994Each item has the form
995.Sq [pkgspec:]pkgpath[:target] .
996.Sq target
997defaults to
998.Sq install .
999The package installed must conform to the
1000.Sq pkgspec ,
1001which is by default obtained from the dependent
1002.Sq pkgpath
1003.Po
1004see
1005.Ev PKGSPEC
1006.Pc .
1007If no installation is involved, the infrastructure will still check
1008that the directory would provide a package conforming to the
1009.Sq pkgspec .
1010.Sq pkgpath
1011is set relative to ${PORTSDIR},
1012see
1013.Xr pkgpath 7
1014for details.
1015Build dependencies are checked before the
1016.Cm extract
1017stage during
1018.Cm prepare .
1019.Pp
1020Build dependencies with a
1021.Cm patch ,
1022.Cm configure
1023or
1024.Cm build
1025target will be processed in a subdirectory of the working directory,
1026specifically, in ${WRKDIR}/some/directory,
1027with
1028.Pa some/directory
1029the directory part of the
1030.Sq pkgpath .
1031.It Ev BUILD_ONCE
1032User settings.
1033Defaults to
1034.Sq \&No .
1035Set to
1036.Sq Yes
1037during bulk builds.
1038.Pp
1039When
1040.Ev BUILD_ONCE
1041is set to
1042.Sq Yes ,
1043all
1044.Ev PSEUDO_FLAVORS
1045matching
1046.Sq no_*
1047will be disabled, unless the special pseudo-flavor
1048.Sq bootstrap
1049is also set.
1050.Pp
1051This is a bulk build optimisation, automatically set by
1052.Xr dpb 1 :
1053to avoid rebuilding the same package several times, a full bulk build will
1054strip most ports of pseudo-packages variations that remove subpackages.
1055.Pp
1056For instance, an individual package may depend on
1057.Pa databases/db/v4,no_java,no_tcl ,
1058to avoid bringing a jdk in during a quick build.
1059Nevertheless, during a full bulk build,
1060.Pa databases/db/v4
1061will only be built once, as the pseudo-flavor will be automatically removed.
1062.Pp
1063However, the extra
1064.Sq bootstrap
1065rule is needed to take build cycles into account.
1066For instance, the
1067.Pa x11/gnome/gvfs,-goa
1068subpackage depends on gnome-online-accounts, which in turn requires
1069.Pa x11/gnome/gvfs,-main
1070to build (through its dependencies).
1071So
1072.Pa x11/gnome/gvfs
1073has
1074.Li PSEUDO_FLAVORS = no_smb no_goa bootstrap
1075and the GNOME build first builds
1076.Pa x11/gnome/gvfs,no_smb,no_goa,bootstrap,-main
1077which is later used to rebuild
1078.Pa x11/gnome/gvfs .
1079.It Ev BUILD_PKGPATH
1080Full
1081.Xr pkgpath 7
1082to the current port, taking flavors and pseudo-flavors
1083into account.
1084See also
1085.Ev BASE_PKGPATH ,
1086which doesn't include pseudo-flavors.
1087Mostly useful to write dependencies for subpackages like this:
1088.Li "LIB_DEPENDS-foo=${BUILD_PKGPATH}"
1089and avoid starting to build a package with some other flavor combination.
1090See
1091.Xr pkgpath 7
1092on the subject of
1093.Sq pkgpath normalisation .
1094Read-only.
1095.It Ev BUILD_PACKAGES
1096The actual list of packages that will be built, once architecture problems
1097and pseudo-flavors have been taken into account.
1098See
1099.Sx FLAVORS AND MULTI_PACKAGES .
1100.It Ev BROKEN
1101Define only for broken ports, set to reason the port is broken.
1102See also
1103.Ev NO_IGNORE ,
1104.Ev TRY_BROKEN .
1105.It Ev BUILD_USER
1106User to switch to when using
1107.Ev PORTS_PRIVSEP ,
1108defaults to
1109.Sq _pbuild .
1110.It Ev BROKEN-<arch>
1111Define only for ports broken on a given architecture.
1112Distinct from
1113.Ev ONLY_FOR_ARCHS
1114and
1115.Ev NOT_FOR_ARCHS ,
1116which are used to mark ports for which support for some architectures
1117does not exist at all, or is completely obsolete.
1118.It Ev BSD_INSTALL_{PROGRAM,SCRIPT,DATA,MAN}[_DIR]
1119Macros passed to make and configure invocations.
1120Set based on corresponding INSTALL_* variables.
1121.It Ev BULK
1122User settings.
1123If set to
1124.Sq Yes ,
1125all successful package builds and installations will clean
1126their working directories, after invoking
1127any targets mentioned in BULK_TARGETS,
1128and commands mentioned in BULK_DO.
1129Can be set on a per-${PKGPATH} basis.
1130For instance, setting BULK_misc/screen=No
1131will override any BULK=Yes passed on the command line.
1132If set to
1133.Sq Auto ,
1134it will apply to dependencies, but not to the current port itself.
1135See
1136.Ev BULK_COOKIES_DIR .
1137Defaults to
1138.Sq Auto .
1139.It Ev BULK_COOKIES_DIR
1140User settings.
1141Used to store cookies for successful bulk-package builds, defaults to
1142.Pa ${PORTSDIR}/bulk/${MACHINE_ARCH} .
1143.It Ev BULK_DO
1144Commands to run after each bulk package build before cleaning up the
1145working directory.
1146Empty defaults.
1147Can be set on a per-${PKGPATH} basis, e.g.,
1148BULK_DO_${PKGPATH}=...
1149.It Ev BULK_FLAGS
1150Flags to pass to build each target in
1151.Ev BULK_TARGETS .
1152.It Ev BULK_TARGETS
1153Targets to run after each bulk package build before cleaning up the
1154working directory.
1155Empty defaults.
1156Can be set on a per-${PKGPATH} basis, e.g.,
1157BULK_TARGETS_${PKGPATH}=...
1158.It Ev BZIP2
1159Name of the bzip2 binary.
1160.It Ev CATEGORIES
1161List of descriptive categories into which this port falls.
1162Mandatory.
1163One entry must match the current pkgpath:
1164.Pa devel/gmake
1165must belong to the
1166.Sq devel
1167category.
1168See
1169.Cm link-categories ,
1170.Cm unlink-categories .
1171.It Ev CCACHE_DIR
1172Sets the cache directory used when
1173.Ev USE_CCACHE
1174is set to yes.
1175Defaults to ${WRKOBJDIR}/.ccache.
1176.It Ev CCACHE_ENV
1177Sets additional environment variables when
1178.Ev USE_CCACHE
1179is set to yes.
1180For instance, to enable verbose logging, set
1181CCACHE_ENV="CCACHE_LOGFILE=/tmp/ccache.log"
1182.It Ev CDIAGFLAGS
1183Flags appended to
1184.Ev CFLAGS
1185if
1186.Ev WARNINGS
1187is set.
1188.It Ev CFLAGS
1189Default flags passed to the compiler for building.
1190Many ports ignore it.
1191See also
1192.Ev COPTS ,
1193.Ev CDIAGFLAGS .
1194.It Ev CHECK_LIB_DEPENDS
1195User settings.
1196If set to
1197.Sq Yes ,
1198every package build will verify that shared libraries are correctly
1199registered.
1200This is essentially the same as running
1201.Ql make lib-depends-check
1202after each package build.
1203Defaults to
1204.Sq \&No ,
1205as this can be a big performance hit.
1206.It Ev CHECKSUMFILES
1207List of all files that need to be retrieved by
1208.Cm fetch ,
1209with
1210.Ev DIST_SUBDIR
1211prepended and with the master site selection extension removed.
1212Read-only.
1213See also
1214.Ev MAKESUMFILES .
1215.It Ev CHECKSUM_FILE
1216Location for this port's checksums, used by
1217.Cm checksum ,
1218and
1219.Cm makesum .
1220Defaults to
1221.Pa distinfo .
1222.It Ev CHECKSUM_PACKAGES
1223User settings.
1224Choose whether or not to checksum packages while building.
1225Deposits result in
1226.Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cksums/${FULLPKGNAME}.sha256 .
1227Can be set to
1228.Sq Yes
1229to compute a checksum for all packages,
1230.Sq cdrom
1231to compute it only for
1232.Ev PERMIT_PACKAGE_CDROM
1233packages
1234or to
1235.Sq ftp
1236to compute it only for
1237.Ev PERMIT_PACKAGE_FTP
1238packages.
1239Defaults to
1240.Sq no ,
1241which does not compute a checksum at all.
1242.It Ev CHOSEN_COMPILER
1243Read-only.
1244Compiler suite chosen by the
1245.Ev COMPILER
1246mechanism.
1247Set to
1248.Sq irrelevant
1249to disable
1250.Ev COMPILER .
1251.It Ev CLEANDEPENDS
1252If set to
1253.Sq Yes ,
1254the
1255.Cm clean
1256target will also clean dependencies.
1257Can be overridden on a per-${PKGPATH} basis,
1258by setting CLEANDEPENDS_${PKGPATH}.
1259.It Ev COMMENT
1260Short (no more than 60 characters) description of the port, used for
1261the package and the INDEX.
1262It should not start with an uppercase letter unless semantically
1263significant.
1264.It Ev COMMENT-foo
1265Same as COMMENT but used for sub package -foo in a multi-package setup.
1266.It Ev COMMENT-vanilla
1267Same as COMMENT but used for a flavored package, if the non-flavored comment
1268is inappropriate.
1269.It Ev COMMENT-foo-vanilla
1270Same as COMMENT but used for a sub-, flavored package.
1271.It Ev COMES_WITH
1272The first release where the port was made part of the standard
1273distribution.
1274If the current
1275.Ox
1276version is >= this version then a notice
1277will be displayed instead of the port being built.
1278.It Ev COMPILER
1279Select preferred compiler.
1280First element in the list that matches will be chosen.
1281.Bl -tag -width ports-gccxx
1282.It base-gcc
1283gcc 4.2 compiler from base
1284.It base-clang
1285clang compiler from base
1286.It gcc3
1287gcc 3 compiler from base
1288.It ports-gcc
1289gcc 4.9 compiler from ports
1290(heeds
1291.Ev MODGCC4_ARCHS
1292from the module)
1293.It ports-clang
1294clang compiler from ports
1295(heeds
1296.Ev MODCLANG_ARCHS
1297from the module)
1298.El
1299.Pp
1300The first compiler that matches criteria will be chosen.
1301On clang-based architectures, even though gcc is still compiled in base,
1302.Sq base-gcc
1303never matches.
1304.Pp
1305Defaults to base compilers, e.g.,
1306.Sq base-clang base-gcc gcc3 .
1307.Pp
1308Common reasons for explicitly setting
1309.Ev COMPILER
1310will most often be C++11 support, thread-local-storage support (emulated),
1311atomic operations on some arches, sometimes assembler support, ABI
1312compatibility with dependent/depending ports, or plain old internal compiler
1313errors.
1314.Pp
1315With
1316.Ev COMPILER
1317in effect,
1318.Ev MODGCC4_ARCHS
1319and
1320.Ev MODCLANG_ARCHS
1321default to
1322.Sq ${GCC49_ARCHS}
1323and
1324.Sq ${LLVM_ARCHS}
1325respectively.
1326.Pp
1327.Ev ONLY_FOR_ARCHS
1328will also be set if applicable.
1329.It Ev COMPILER_LANGS
1330The value of
1331.Ev COMPILER_LANGS
1332will be added to the respective module's supported langs.
1333Defaults to
1334.Sq c c++ .
1335Only
1336.Sq c
1337and
1338.Sq c++
1339are supported by this mechanism.
1340.Sq fortran
1341or
1342.Sq java
1343still need old modules annotations, so that it's possible
1344to select, e.g.,
1345.Sq gfortran
1346from gcc 4.9 while having clang from base.
1347See also
1348.Ev CHOSEN_COMPILER .
1349.It Ev COMPILER_LINKS
1350Used by
1351.Nm
1352and compiler
1353.Ev MODULES
1354to build scripts in
1355.Pa ${WRKDIR}/bin
1356to force setting compiler flags
1357.Po
1358.Fl B
1359is required for clang to find
1360.Pa ${WRKDIR}/bin/ld
1361as used by
1362.Ev USE_WXNEEDED
1363.Pc
1364and call
1365.Ev COMPILER_WRAPPER
1366if used.
1367.It Ev COMPILER_WRAPPER
1368External program used to "wrap" compilers.
1369Populated automatically by
1370.Ev USE_CCACHE
1371or can be set explicitly for other purposes (e.g. distcc).
1372.It Ev CONFIG_SITE_LIST
1373Used when
1374.Li CONFIGURE_STYLE=gnu ,
1375or with
1376.Li MODULES += gnu .
1377List of
1378.Pa config.site
1379fragments that will speed up gnu-configure, and prevent it from
1380preferring various gnu programs, unless
1381.Ev BUILD_DEPENDS
1382explicitly ask for them.
1383Read-only, available for debugging purposes.
1384.It Ev CLANG_ARCHS, GCC3_ARCHS , GCC4_ARCHS
1385List of architectures using Clang, GCC 3.3.6 or GCC 4.2.1 as the base compiler.
1386Read-only.
1387Use with
1388.Ev NOT_FOR_ARCHS
1389or
1390.Ev ONLY_FOR_ARCHS
1391to limit ports to architectures where they compile.
1392.It Ev CONFIGURE_ARGS
1393Arguments to pass to configure script.
1394Defaults are empty, except for
1395GNU-style configure, where prefix and sysconfdir are set.
1396.It Ev CONFIGURE_ENV
1397Basic environment passed to configure script (path and libtool setup).
1398GNU-style configure adds a lot more variables.
1399.It Ev CONFIGURE_SCRIPT
1400Set to name of script invoked by the
1401.Cm configure
1402target, if appropriate.
1403Should be either an absolute path, or relative to ${WRKSRC}.
1404.It Ev CONFIGURE_STYLE
1405Set to style of configuration that needs to happen.
1406.Pp
1407If
1408.Sq perl ,
1409assume
1410.Xr perl 1 Ns 's
1411.Xr ExtUtils::MakeMaker 3p
1412style.
1413Add
1414.Sq modbuild
1415to enable
1416.Xr Module::Build 3p ,
1417.Sq modbuild tiny
1418to enable
1419.Xr Module::Build::Tiny 3p ,
1420or
1421.Sq modinst
1422for
1423.Xr Module::Install 3p
1424style.
1425.Pp
1426If
1427.Sq gnu ,
1428assume
1429GNU configure style.
1430Add
1431.Sq dest
1432if port does not handle DESTDIR correctly, and needs to be configured to
1433add DESTDIR to prefixes
1434.Po
1435see also
1436.Ev DESTDIRNAME
1437.Pc .
1438Add
1439.Sq old
1440if port is an older autoconf port that does not recognize --sysconfdir.
1441Add
1442.Sq autoconf
1443if autoconf needs to be rerun first,
1444but set
1445.Sq no-autoheader
1446to prevent autoheader from running.
1447.Pp
1448If
1449.Sq imake ,
1450assume port configures using X11 ports Imakefile framework.
1451Add
1452.Sq noman
1453if port has no man pages the Imakefile should try installing.
1454.Pp
1455If
1456.Sq simple ,
1457there is a configure script, but it does not fit the normal GNU configure
1458conventions.
1459.Pp
1460Extensions may be defined by specific MODULES.
1461See
1462.Xr port-modules 5
1463for details.
1464.It Ev COPTS
1465User settings.
1466Supplementary options appended to ${CFLAGS} for building.
1467Since most ports ignore the COPTS convention, they are actually told to use
1468${CFLAGS} ${COPTS} as CFLAGS.
1469.It Ev CXXDIAGFLAGS
1470Flags appended to
1471.Ev CXXFLAGS
1472if
1473.Ev WARNINGS
1474is set.
1475.It Ev CXXFLAGS
1476Default flags passed to the C++ compiler for building.
1477Many ports ignore it.
1478.It Ev CXXOPTS
1479User settings.
1480Supplementary options appended to ${CXXFLAGS} for building.
1481.It Ev DESTDIR
1482See
1483.Ev DESTDIRNAME .
1484.It Ev DESTDIRNAME
1485Name of variable to set to ${WRKINST} while faking.
1486Usually DESTDIR.
1487To be used in the rare cases where a port heeds DESTDIR in a few
1488directories and needs to be configured with
1489.Sq gnu dest ,
1490so that those few directories do not get in the way.
1491.It Ev DISTDIR
1492User settings.
1493Directory where all ports distribution files and patchfiles are stashed.
1494Defaults to
1495.Pa ${PORTSDIR}/distfiles .
1496Override if distribution files are stored elsewhere.
1497Always use
1498.Ev FULLDISTDIR
1499to refer to ports' distribution files location, as it takes an eventual
1500.Ev DIST_SUBDIR
1501into account.
1502.It Ev DISTFILES
1503The main port's distribution files (the actual software source, except
1504for binary-only ports).
1505Will be retrieved from the MASTER_SITES (see
1506.Cm fetch ) ,
1507checksummed and extracted (see
1508.Cm checksum ,
1509.Cm extract ) .
1510.Ev DISTFILES
1511normally holds a list of files, possibly with
1512.Sq :0
1513to
1514.Sq :9
1515appended to select a different
1516.Ev MASTER_SITES .
1517.Pp
1518Each entry may optionally be of the form
1519.Sq Ar filename Ns { Ns Ar url Ns } Ns Ar sufx
1520to deal with sites that only offer archives as weird urls, doing the transfer
1521of
1522.Ar url Ns Ar sufx
1523into result file
1524.Ar filename Ns Ar sufx .
1525For instance, if
1526.Bd -literal
1527DISTFILES = minetest-{minetest/archive/}${V}${EXTRACT_SUFX}
1528.Ed
1529.Pp
1530then
1531.Cm fetch
1532will retrieve from url
1533.Sq minetest/archive/${V}${EXTRACT_SUFX}
1534into
1535.Sq minetest-${V}${EXTRACT_SUFX} .
1536.Pp
1537If ${DISTFILES} varies depending on
1538.Ev FLAVORS
1539or architecture, use
1540.Ev SUPDISTFILES
1541to ensure distfiles mirroring and
1542.Cm makesum
1543proper operation.
1544.It Ev DISTNAME
1545Name used to identify the port.
1546See
1547.Ev DISTFILES
1548and
1549.Ev PKGNAME .
1550.It Ev DISTORIG
1551Suffix used by
1552.Cm distpatch
1553to rename original files.
1554Defaults to
1555.Pa .bak.orig .
1556Distinct from
1557.Pa .orig
1558to avoid confusing
1559.Cm update-patches .
1560.It Ev DIST_SUBDIR
1561Optional subdirectory of ${DISTDIR} where the current port's distribution
1562files and patchfiles will be located.
1563See target
1564.Cm fetch .
1565.It Ev DPB
1566Set by the Distributed Ports Builder to only get the information it needs
1567from
1568.Cm dump-vars .
1569.It Ev DPB_PROPERTIES
1570Annotations for the Distributed Ports Builder.
1571See
1572.Xr dpb 1
1573for semantics.
1574.It Ev DUMMY_PACKAGE
1575If defined,
1576.Nm
1577will provide dummy values for variables mandatory for a minimally functional
1578port.
1579Used by various pieces of the ports tree to perform introspection and get to
1580.Nm Ns 's
1581variables.
1582.It Ev ECHO_MSG
1583User settings.
1584Used to display
1585.Sq ===> Configuring for foo
1586and similar informative messages.
1587Override to turn off, for instance.
1588.It Ev ECHO_REORDER
1589User settings.
1590Set it to
1591.Sq echo
1592to see
1593.Ev REORDER_DEPENDENCIES
1594actions.
1595Silent by default.
1596.It Ev EDIT_PATCHES
1597User settings.
1598If set to
1599.Sq \&No ,
1600.Cm update-patches
1601will not open changed files in an editor.
1602.It Ev EPOCH
1603Epoch number of the current package.
1604Defaults to empty (no need for numbering changes), then
1605numbering starts at 0.
1606Gets automatically incorporated into
1607.Ev FULLPKGNAME
1608as
1609.Sq v${EPOCH}
1610to form a full package-name conforming to
1611.Xr packages-specs 7 .
1612.It Ev ERRORS
1613List of errors found while parsing the port's Makefile.
1614Display the errors before making any target, and if any error starts with
1615.Qq Fatal: ,
1616do not make anything.
1617For instance:
1618.Bd -literal -offset indent
1619\&.if !defined(COMMENT)
1620ERRORS+="Fatal: Missing comment"
1621\&.endif
1622.Ed
1623Porter can add to
1624.Ev ERRORS ,
1625for instance to flag erroneous combinations of
1626.Ev FLAVORS
1627(but see
1628.Ev ONLY_FOR_ARCHS
1629.Ev NOT_FOR_ARCHS
1630and
1631.Ev BROKEN
1632for other common issues).
1633.It Ev EXTRACT_CASES
1634In the normal extraction stage (when
1635.Ev EXTRACT_ONLY
1636is not empty), this is the contents of a case statement, used to extract files.
1637Fragments are automatically appended to extract tar, xz and zip
1638archives, so that the default case is more or less equivalent to the
1639following shell fragment:
1640.Bd -literal
1641set -e
1642cd ${WRKDIR}
1643for archive in ${EXTRACT_ONLY}
1644do
1645    case $$archive in
1646	*.tar.xz|*.tar.lzma)
1647	  xzcat ${FULLDISTDIR}/$$archive| tar xf -;;
1648	*.tar.lz)
1649	  lunzip -c ${FULLDISTDIR}/$$archive| tar xf -;;
1650	*.zip)
1651	  unzip -q ${FULLDISTDIR}/$$archive -d ${WRKDIR};;
1652	*.tar.bz2|*.tbz2|*.tbz)
1653	  bzip2 -dc ${FULLDISTDIR}/$$archive| tar xf -;;
1654	*.shar.gz|*.shar.Z|*.sh.Z|*.sh.gz)
1655	  gzcat ${FULLDISTDIR}/$$archive | /bin/sh;;
1656	*.shar|*.sh)
1657	  /bin/sh ${FULLDISTDIR}/$$archive;;
1658	*.tar)
1659	  tar xf ${FULLDISTDIR}/$$archive;;
1660	*)
1661	  gzip -dc ${FULLDISTDIR}/$$archive | tar xf -;;
1662    esac
1663done
1664.Ed
1665.It Ev EXTRACT_ONLY
1666Set to the list of distfiles to actually extract if some distfiles
1667should not be extracted during the
1668.Cm do-extract
1669stage.
1670Defaults to all distfiles, can even be set to empty.
1671.It Ev EXTRACT_SUFX
1672Used to set DISTFILES default value to ${DISTNAME}${EXTRACT_SUFX}.
1673The decompression tool needed will be automatically added as
1674.Ev BUILD_DEPENDS .
1675Default value is .tar.gz.
1676.It Ev FAKE_FLAGS
1677Extra flags passed to ${MAKE_PROGRAM} during the
1678fake invocation.
1679Empty by default.
1680Also see
1681.Ev ALL_FAKE_FLAGS .
1682.It Ev FAKE_SETUP
1683List of environment values normally set during fake invocations.
1684Exposed so that modules may provide their own
1685.Cm do-install .
1686Read-only,
1687see
1688.Sx THE FAKE FRAMEWORK
1689section for details.
1690.It Ev FAKE_TARGET
1691Target built by ${MAKE_PROGRAM} on fake invocation.
1692Defaults to ${INSTALL_TARGET}.
1693.It Ev FAKEOBJDIR
1694User settings.
1695If non empty, used as a base for the fake area.
1696The real fake directory ${WRKINST} is created there.
1697Can be set on a per-${PKGPATH} basis.
1698For instance, setting FAKEOBJDIR_www/mozilla=/tmp/obj
1699will affect only the mozilla port.
1700.It Ev FETCH_CMD
1701User settings.
1702Command used to fetch distribution files for this port.
1703Defaults to
1704.Xr ftp 1 .
1705Can be used to go through excessively paranoid firewalls.
1706Note that
1707.Ev FETCH_CMD
1708should support
1709.Fl C
1710and
1711.Fl o Ar dest .
1712.It Ev FETCH_MANUALLY
1713Some ports' distfiles cannot be fetched automatically for licensing reasons.
1714In this case, set
1715.Ev FETCH_MANUALLY
1716to a list of strings that will be displayed, one per line, e.g.,
1717.Bd -literal
1718FETCH_MANUALLY= "You must fetch foo-1.0.tgz"
1719FETCH_MANUALLY+="from http://www.fubar.com/ manually,"
1720FETCH_MANUALLY+="after reading and agreeing to the license."
1721.Ed
1722Behaves like
1723.Ev IS_INTERACTIVE
1724if some distribution files are missing.
1725.It Ev FETCH_PACKAGES
1726User settings, defaults to
1727.Sq \&No .
1728Set to
1729.Xr pkg_add 1
1730options.
1731Instruct the
1732.Cm package
1733target to download packages missing from the repository from locations in
1734${PKG_PATH} and place them into
1735.Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cache/ ,
1736only building them if no suitable packages are found.
1737For instance,
1738.Bd -literal -offset indent
1739make FETCH_PACKAGES=
1740.Ed
1741.Pp
1742to use without any options, or
1743.Bd -literal -offset indent
1744make FETCH_PACKAGES=-Dsnap
1745.Ed
1746.Pp
1747to use close to release.
1748.It Ev FILESDIR
1749Location of other files related to the current port.
1750Default: files.
1751.It Ev FETCH_USER
1752User to use to fetch distfiles when using
1753.Ev PORTS_PRIVSEP ,
1754defaults to
1755.Sq _pfetch .
1756.It Ev FIX_EXTRACT_PERMISSIONS
1757If
1758.Sq Yes ,
1759restore contents of
1760.Pa ${WRKDIR}
1761to world-readable at the end of
1762.Cm extract .
1763Used for some distfile contents which have paranoid permissions for no reason.
1764Defaults to
1765.Sq \&No .
1766.It Ev FLAVOR
1767The port's current options.
1768Set by the user, and tested by the port to activate wanted functionalities.
1769.It Ev FLAVORS
1770List of all flavors keywords a port may match.
1771Used to sort
1772.Ev FLAVOR
1773into a canonical order to build the package name,
1774or to select the packing-list, and as a quick validity check.
1775See also
1776.Ev PSEUDO_FLAVORS .
1777.It Ev FLAVOR_EXT
1778Canonical list of flavors being set for the current build, dash-separated.
1779See
1780.Ev FULLPKGNAME .
1781.It Ev FORCE_UPDATE
1782User settings.
1783If set to
1784.Sq Yes ,
1785the
1786.Cm update
1787target will always update an installed package,
1788as soon as its signature differs,
1789and all dependencies that install packages will
1790also force an update.
1791If set to
1792.Sq hard ,
1793the
1794.Cm update
1795target will also update installed packages even when the signature
1796did not change.
1797.It Ev FULLDISTDIR
1798Complete path to directory where ${DISTFILES} and ${PATCHFILES} will be
1799located, to be used in hand-crafted extraction targets.
1800Read-only.
1801.It Ev FULLPKGNAME
1802Full name of the created package, taking flavors into account.
1803Defaults to ${PKGNAME}${FLAVOR_EXT}.
1804See also
1805.Ev EPOCH
1806and
1807.Ev REVISION .
1808.It Ev FULLPKGPATH
1809Path to the current port's directory, relative to ${PORTSDIR},
1810including flavors and subpackages.
1811See
1812.Xr pkgpath 7 .
1813.It Ev GH_*
1814Support for GitHub-hosted projects.
1815Leave empty for non hosted projects.
1816Yields a suitable default for
1817.Ev MASTER_SITES_GITHUB
1818and
1819.Ev DISTNAME .
1820.It Ev GH_ACCOUNT
1821Account name of the GitHub user hosting the project.
1822.It Ev GH_COMMIT
1823SHA1 commit id to fetch.
1824It is an error to specify ${GH_COMMIT} when ${GH_TAGNAME} is specified.
1825.It Ev GH_PROJECT
1826Name of the project on GitHub.
1827.It Ev GH_TAGNAME
1828Name of the tag to download.
1829Setting ${GH_TAGNAME} to master is invalid
1830and will throw an error.
1831${WRKDIST} is auto-generated based on the
1832${GH_TAGNAME} if specified, otherwise ${GH_COMMIT} will be used to generate
1833${WRKDIST}.
1834.It Ev GMAKE
1835Location of the GNU make binary, if needed.
1836Defaults to gmake.
1837.It Ev HOMEPAGE
1838URL to the homepage of the software, if applicable.
1839.It Ev IGNORE
1840For ignored ports, set to the reasons for which the port is ignored.
1841If non-empty, most common targets that do something (e.g.,
1842.Cm fetch ,
1843.Cm build ,
1844.Cm install No ... )
1845will be ignored.
1846See also
1847.Ev BATCH ,
1848.Ev BROKEN ,
1849.Ev FETCH_MANUALLY ,
1850.Ev IGNORE_IS_FATAL ,
1851.Ev IGNORE_SILENT ,
1852.Ev INTERACTIVE ,
1853.Ev IS_INTERACTIVE ,
1854.Ev NOT_FOR_ARCHS ,
1855.Ev NO_IGNORE ,
1856.Ev ONLY_FOR_ARCHS .
1857.It Ev IGNORE_IS_FATAL
1858User settings.
1859If set to
1860.Sq Yes ,
1861ignored ports will become fatal errors.
1862.It Ev IGNORE_SILENT
1863User settings.
1864If set to
1865.Sq Yes ,
1866do not print anything when ignoring a port.
1867.It Ev INSTALL_{PROGRAM,SCRIPT,DATA,MAN}[_DIR]
1868Macros to use to install a program, a script, data, or a man page (or the
1869corresponding directory), respectively.
1870.It Ev INSTALL_TARGET
1871Target invoked to install the software, during fake installation.
1872Default is
1873.Sq install .
1874.It Ev INTERACTIVE
1875User settings.
1876Set to
1877.Sq Yes
1878to skip all non-interactive ports.
1879Used in conjunction with
1880.Ev BATCH
1881to simplify bulk-package builds.
1882.It Ev IS_INTERACTIVE
1883Set to
1884.Sq Yes
1885if port needs human interaction to build.
1886Porters should strive to minimize
1887.Ev IS_INTERACTIVE
1888ports, by using
1889.Ev FLAVORS
1890for multiple choice ports, and by postponing human intervention
1891to package installation time.
1892.It Ev LE_ARCHS
1893Set to the list of little-endian architectures.
1894Read-only.
1895Use with
1896.Ev NOT_FOR_ARCHS
1897and
1898.Ev ONLY_FOR_ARCHS .
1899.It Ev LIB_DEPENDS
1900List of packages used by a port for its library dependencies.
1901Each item has the form
1902.Sq [pkgspec:]pkgpath .
1903Similar to
1904.Ev BUILD_DEPENDS
1905and
1906.Ev RUN_DEPENDS ,
1907but with specific rules:
1908.Ev LIB_DEPENDS
1909always turn into
1910.Ev BUILD_DEPENDS
1911.Po
1912but see
1913.Sx FLAVORS AND MULTI PACKAGES
1914.Pc .
1915.Pp
1916.Ev LIB_DEPENDS
1917is also used as a run-time dependency, and recorded in the package as
1918such, if any of the libraries mentioned in
1919.Ev WANTLIB
1920is a shared library that originates within the dependent port.
1921.Pp
1922See
1923.Xr library-specs 7
1924for more details.
1925.It Ev lib_depends_args
1926Controls the behavior of
1927.Xr pkg_create 1
1928related targets, see
1929.Cm print-package-args
1930for details.
1931.It Ev LIBCXX
1932List of standard C++ libraries for the base compiler.
1933Read-only.
1934Use in
1935.Ev WANTLIB .
1936.It Ev LIBTOOL
1937Location of the libtool binary.
1938Default:
1939.Pa /usr/bin/libtool .
1940.It Ev LIBTOOL_FLAGS
1941Arguments to pass to libtool.
1942If USE_LIBTOOL is set, the environment variable LIBTOOL is set
1943to ${LIBTOOL} ${LIBTOOL_FLAGS}.
1944.It Ev LLVM_ARCHS
1945Set to the list of architectures where LLVM/Clang could be used,
1946e.g., via lang/clang port module, see
1947.Xr port-modules 5 .
1948Read-only.
1949Use with
1950.Ev NOT_FOR_ARCHS
1951or
1952.Ev ONLY_FOR_ARCHS .
1953.It Ev LOCALBASE
1954where other ports have already been installed.
1955Default:
1956.Pa /usr/local .
1957.It Ev LOCALSTATEDIR
1958Location for this port's state directory, should always be derived
1959from
1960.Ev BASELOCALSTATEDIR ,
1961which defaults to
1962.Pa /var .
1963Passed to gnu configure scripts.
1964.It Ev LOCKDIR
1965User settings.
1966Defaults to
1967.Pa ${WRKOBJDIR}/locks .
1968If set, points to a local directory common for all instances of
1969concurrent ports builds.
1970.It Ev LOCK_CMD
1971Expands to a command that will acquire a lock, namely
1972.Xr portlock 1 .
1973See also
1974.Xr ports 7 .
1975.It Ev LOCK_VERBOSE
1976User settings.
1977Defaults to
1978.Sq \&No .
1979Set to
1980.Sq Yes
1981to show every acquire/release lock operation.
1982.It Ev LP64_ARCHS
1983Set to the list of 64-bit architectures.
1984Read-only.
1985Use with
1986.Ev NOT_FOR_ARCHS .
1987.It Ev MAINTAINER
1988Email address with full name of the port's maintainer.
1989Defaults to
1990.Mt ports@openbsd.org .
1991.It Ev MAKE_ENV
1992Environment variables passed to make invocations and tests.
1993Sets at least PATH, PREFIX, LOCALBASE, X11BASE, CFLAGS, TRUEPREFIX, DESTDIR,
1994and the BSD_INSTALL_* macros.
1995.It Ev MAKE_FLAGS
1996Flags used for all make invocations, except for the
1997.Cm fake
1998stage, which adds
1999.Ev FAKE_FLAGS
2000(see
2001.Ev ALL_FAKE_FLAGS )
2002and for the
2003.Cm test
2004stage, which adds
2005.Ev TEST_FLAGS
2006(see
2007.Ev ALL_TEST_FLAGS ) .
2008.It Ev MAKE_FILE
2009Name of the Makefile used for ports building.
2010Defaults to Makefile.
2011Used after changing directory to ${WRKBUILD}.
2012.It Ev MAKE_PROGRAM
2013The make program that is used for building the port.
2014Set to ${MAKE} or ${GMAKE} depending on USE_GMAKE.
2015Read-only.
2016.It Ev MAKEFILE_LIST
2017Introspection variable, see
2018.Xr make 1 .
2019.It Ev MAKESUMFILES
2020List of all files that need to be retrieved by
2021.Cm fetch-all ,
2022with
2023.Ev DIST_SUBDIR
2024prepended and with master site selection extension removed.
2025Read-only.
2026See also
2027.Ev CHECKSUMFILES .
2028.It Ev MASTER_SITE_BACKUP
2029User settings.
2030List of sites to try after normal master sites.
2031Normally includes ${MASTER_SITE_OPENBSD} and ${MASTER_SITE_FREEBSD}.
2032.It Ev MASTER_SITE_*
2033Lists of standard sites to retrieve files from, refer to
2034.Pa ${PORTSDIR}/infrastructure/db/network.conf .
2035.It Ev MASTER_SITES
2036List of primary locations from which distribution files and patchfiles are
2037retrieved.
2038See the
2039.Cm fetch
2040target for details.
2041Defaults to ${MASTER_SITES_GITHUB} for GitHub-hosted projects,
2042see
2043.Ev GH_* .
2044See
2045.Xr ports 7
2046for user configuration.
2047.It Ev MASTER_SITES0 , ... , MASTER_SITES9
2048Supplementary locations from which distribution files and patchfiles are
2049retrieved.
2050.It Ev MESSAGE
2051File recorded in the package and displayed during installation.
2052Defaults to ${PKGDIR}/MESSAGE if this file exists.
2053Leave empty if no message is needed.
2054.It Ev MISSING_FILES
2055When
2056.Ev FETCH_MANUALLY
2057is set,
2058.Ev MISSING_FILES
2059will contain the list of missing distfiles or patchfiles that need to
2060be fetched manually.
2061Read-only.
2062.It Ev MTREE_FILE
2063.Xr mtree 8
2064specification used during
2065.Ar fake .
2066Replaced by direct use of
2067.Xr mkdir 1
2068now that
2069.Ar fake
2070no longer happens as root.
2071.It Ev MODGNU_CONFIG_GUESS_DIRS
2072If a port uses config.guess outside WRKSRC, the directories
2073containing the other copies must be set here.
2074.It Ev MODPERL_ADJ_FILES
2075If any files have a Perl shebang line, which needs to be replaced
2076with
2077.Dq #!/usr/bin/perl ,
2078list them in
2079.Ev MODPERL_ADJ_FILES .
2080File paths here should be relative to
2081.Ev WRKSRC .
2082These files are patched automatically at the end of
2083.Cm pre-configure .
2084.It Ev MODPERL_BIN_ADJ
2085Shell fragment to patch the Perl interpreter path in executable scripts.
2086Used by
2087.Ev MODPERL_ADJ_FILES .
2088.It Ev MODPERL_BUILD_TARGET
2089Normal content of
2090.Cm do-build
2091when
2092.Ev CONFIGURE_STYLE
2093uses perl.
2094Provided as a separate variable if a port wants to override
2095.Cm do-build
2096for its own reasons.
2097.It Ev MODPERL_INSTALL_TARGET
2098Likewise for
2099.Cm do-install .
2100.It Ev MODPERL_TEST_TARGET
2101Likewise for
2102.Cm do-test .
2103.It Ev MODULES
2104External modules mechanism, documented separately.
2105Modules such as
2106.Sq imake
2107and
2108.Sq gnu
2109are normally included automatically with the right
2110.Ev CONFIGURE_STYLE .
2111Note that it is possible to
2112.Li CONFIGURE_STYLE = simple ,
2113.Li MODULES += gnu
2114to just get the effects of
2115.Ev CONFIG_SITE
2116and
2117.Ev MODGNU_CONFIG_GUESS_DIRS
2118along with the default
2119.Ev TEST_TARGET ,
2120in case the normal GNU configure script was wrapped in a separate script that
2121takes different arguments.
2122See
2123.Xr port-modules 5 .
2124.It Ev MULTI_PACKAGES
2125Set to a list of subpackage extensions for ports that create multiple packages.
2126See
2127.Sx FLAVORS AND MULTI_PACKAGES
2128below.
2129Especially read the part about
2130.Ev ONLY_FOR_ARCHS
2131when some of the packages only exist for some architectures.
2132.It NO_ARCH
2133Location for arch-independent packages.
2134Defaults to
2135.Sq no-arch .
2136Normally, packages are generated under ${PACKAGE_REPOSITORY}/${MACHINE_ARCH},
2137except for packages where PKG_ARCH=*, which end up under
2138${PACKAGE_REPOSITORY}/${NO_ARCH}.
2139.It Ev NOT_FOR_ARCHS
2140List of architectures on which this port does not build.
2141See also
2142.Ev ONLY_FOR_ARCHS .
2143.It Ev NO_BUILD
2144Set to
2145.Sq Yes
2146if port does not need any build stage.
2147.It Ev NO_CCACHE
2148Set to
2149.Sq Yes
2150to prevent ccache from being used when building a certain port,
2151even when
2152.Ev USE_CCACHE
2153is set.
2154.It Ev NO_CHECKSUM
2155Set to
2156.Sq Yes
2157by
2158.Xr dpb 1
2159to avoid
2160.Cm checksum
2161entirely,
2162as
2163.Xr dpb 1
2164already deals with checksums internally.
2165.It Ev NO_DEPENDS
2166User settings.
2167Don't verify build of dependencies.
2168Do not use in any ports Makefile.
2169This is only meant as a user convenience when, e.g., you just want to browse
2170through a given port's source and do not wish to trigger the build of
2171dependencies.
2172.It Ev NO_IGNORE
2173User settings.
2174If set to
2175.Sq Yes ,
2176avoid ignoring a port for the usual reasons.
2177Use, for instance, for fetching all distribution files, or for fixing a
2178broken port.
2179See also
2180.Ev IGNORE
2181and
2182.Ev TRY_BROKEN .
2183.It Ev NO_TEST
2184Port does not have any regression tests.
2185Only set to
2186.Sq Yes
2187for ports with no regression test.
2188It should be left alone for ports with empty regression tests, and for
2189ports with failing tests.
2190That way, if a subsequent update of a port acquires actual regression tests,
2191they will be picked up automatically.
2192.It Ev ONLY_FOR_ARCHS
2193List of architectures on which this port builds.
2194Can hold both processor-specific information (e.g., powerpc), and more
2195specific model information (e.g., macppc).
2196This is subpackage dependent.
2197Read the corresponding part of
2198.Sx FLAVORS AND MULTI_PACKAGES
2199if some subpackages should only be built on some architectures.
2200.It Ev OSREV
2201Revision number of
2202.Ox .
2203Read-only.
2204.It Ev PACKAGE_REPOSITORY
2205User settings.
2206Location for built packages.
2207Defaults to
2208.Pa ${PORTSDIR}/packages .
2209See
2210.Cm package
2211for details.
2212.It Ev PATCH
2213Command to use to apply all patches.
2214Defaults to
2215.Pa /usr/bin/patch .
2216.It Ev PATCHORIG
2217Suffix used by
2218.Cm patch
2219to rename original files, and
2220.Cm update-patches
2221to re-generate
2222.Pa ${PATCHDIR}/${PATCH_LIST}
2223by looking for files using this suffix.
2224Defaults to
2225.Pa .orig .
2226For a port that already contains
2227.Pa .orig
2228files in the ${DISTFILES},
2229set this to something else, such as
2230.Pa .pat.orig .
2231See also
2232.Cm distpatch ,
2233.Ev DISTORIG .
2234.It Ev PATCH_CASES
2235In the normal
2236.Cm distpatch
2237stage (when
2238.Ev PATCHFILES
2239is not empty), this is the contents of a case statement, used to apply
2240distribution patches.
2241Fragments are automatically appended to handle gzip'ed, bzip'ed and lzip'ed
2242patches, so that the default case is more or less equivalent to the following
2243shell fragment:
2244.Bd -literal
2245set -e
2246cd ${FULLDISTDIR}
2247for patchfile in ${_LIST_PATCHFILES}
2248do
2249    case $$patchfile in
2250	*.bz2)
2251	  bzip2 -dc $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
2252	*.lz)
2253	  lunzip -c $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
2254	*.Z|*.gz)
2255	  gzcat $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
2256	*)
2257	  ${PATCH} ${PATCH_DIST_ARGS} <$$patchfile;;
2258    esac
2259done
2260.Ed
2261.It Ev PATCHDIR
2262Location for patches applied by the
2263.Cm patch
2264target.
2265Default:
2266.Pa patches .
2267.It Ev PATCHFILES
2268Files to fetch from the master sites like
2269.Ev DISTFILES ,
2270but serving a different purpose, as they hold distribution patches that
2271will be applied at the
2272.Cm patch
2273stage.
2274See also
2275.Ev SUPDISTFILES .
2276.It Ev PATCH_ARGS
2277Full list of options used while applying port's patches.
2278.It Ev PATCH_CHECK_ONLY
2279Set to
2280.Sq Yes
2281by the
2282.Cm checkpatch
2283target.
2284Don't touch unless the default
2285.Cm checkpatch
2286target needs to be redefined.
2287Ideally, user-defined patch subtargets ought to test checkpatch.
2288In practice, they don't.
2289.It Ev PATCH_DEBUG
2290If set to
2291.Sq Yes ,
2292the
2293.Cm patch
2294stage will output extra debug information.
2295This is the default.
2296.It Ev PATCH_DIST_ARGS
2297Full list of options used while applying distribution patches.
2298.It Ev PATCH_DIST_STRIP
2299Patch option used to strip directory levels while applying distribution
2300patches.
2301Defaults to -p0.
2302.It Ev PATCH_LIST
2303Wildcard pattern of patches to select under ${PATCHDIR}.
2304Defaults to patch-*.
2305Note that filenames ending in .orig, or ~ are never applied.
2306Note that
2307.Ev PATCH_LIST
2308can hold absolute pathnames, for instance to share patches among similar
2309ports:
2310.Bd -literal
2311PATCH_LIST=${PORTSDIR}/x11/kde/libs2/patches/p-* patch-*
2312.Ed
2313.It Ev PATCH_STRIP
2314Patch option used to strip directory levels while applying port's patches.
2315Defaults to -p0.
2316.It Ev PERMIT_DISTFILES_FTP , PERMIT_PACKAGE_CDROM , PERMIT_PACKAGE_FTP
2317Set to
2318.Sq Yes
2319if package or distribution files can be allowed on FTP sites or CD-ROM without
2320legal issues.
2321Set to reason not to otherwise.
2322PERMIT_* lines in the Makefile should be preceded with a comment explaining
2323details about licensing and patents issues the port may have.
2324Porters must be very thorough in their checks.
2325In case of doubt, ask.
2326.Pp
2327If
2328.Ev PERMIT_PACKAGE_CDROM
2329is set to
2330.Sq Yes ,
2331.Ev PERMIT_PACKAGE_FTP
2332and
2333.Ev PERMIT_DISTFILES_FTP
2334will default to
2335.Sq Yes .
2336.Pp
2337If
2338.Ev PERMIT_PACKAGE_FTP
2339is set to
2340.Sq Yes ,
2341.Ev PERMIT_DISTFILES_FTP
2342will default to
2343.Sq Yes .
2344.It Ev PKG_ADD
2345User settings.
2346Path to
2347.Xr pkg_add 1
2348command, with possible options.
2349.It Ev PKG_ARCH
2350Comma-separated list of architectures on which this package may install.
2351Defaults to ${MACHINE_ARCH},${ARCH}.
2352Use * for arch-independent packages.
2353.It Ev PKG_ARGS
2354Special arguments to pass to
2355.Xr pkg_create 1 ,
2356in addition to the default ones.
2357For mips64 and pic libraries, see
2358.Sx THE GENERATION OF PACKAGE INFORMATION .
2359.It Ev PKG_CREATE
2360User settings.
2361Path to
2362.Xr pkg_create 1
2363command, with possible options.
2364.It Ev PKG_CREATE_NO_CHECKS
2365Porters switch.
2366Set to
2367.Sq Yes
2368to avoid checking the ports tree when solving
2369.Ev WANTLIB
2370.Po
2371see
2372.Cm wantlib-args
2373.Pc .
2374May result in bogus packages that mix
2375.Cm @depends
2376lines obtained from
2377the ports tree with
2378.Cm @wantlib
2379lines that come from the installed system.
2380Set to
2381.Sq Warn
2382to have the differences printed as a warning instead of an error
2383.Po
2384the default
2385.Pc .
2386.It Ev PKG_DBDIR
2387User settings.
2388Path to package installation records.
2389Defaults to
2390.Pa /var/db/pkg .
2391.It Ev PKG_DELETE
2392User settings.
2393Path to
2394.Xr pkg_delete 1
2395command, with possible options.
2396.It Ev PKG_INFO
2397User settings.
2398Path to
2399.Xr pkg_info 1
2400command, with possible options.
2401.It Ev PKG_TMPDIR
2402See
2403.Xr pkg_add 1 .
2404Normally points to
2405.Pa /var/tmp ,
2406as per default.
2407.It Ev PORTHOME
2408Setting of env variable
2409.Ev HOME
2410for most shell invocations.
2411Default will trip ports that try to write into $HOME while building.
2412.It Ev PORTPATH
2413Path used by most shell invocations.
2414Don't override unless really needed.
2415.It Ev PORTSDIR
2416Root of the ports tree (default:
2417.Pa /usr/ports ) .
2418.It Ev PORTSDIR_PATH
2419Path used by dependencies and
2420.Pa bsd.port.subdir.mk
2421to look up package specifications.
2422Defaults to
2423.Pa ${PORTSDIR}:${PORTSDIR}/mystuff .
2424.It Ev PORTS_PRIVSEP
2425If set to
2426.Sq Yes ,
2427will build ports as
2428.Ev BUILD_USER
2429and fetch distfiles
2430as
2431.Ev FETCH_USER .
2432.Pp
2433To work fully, this does require the ports tree
2434to be world-readable, and
2435.Pa ${WRKDIR}
2436to be world-readable as well
2437.Po
2438.Cm update-patches
2439and friends won't work otherwise
2440.Pc .
2441.Pp
2442Meant to use in concert with
2443.Xr dpb 1 ,
2444which uses the same permissions
2445.Po
2446see
2447.Sq THE SECURITY MODEL OF DPB
2448in
2449.Xr dpb 1
2450.Pc .
2451.Pp
2452Basically,
2453.Ev BUILD_USER
2454must be able to write into
2455.Pa ${WRKOBJDIR} , ${PACKAGE_REPOSITORY} , ${PLIST_REPOSITORY}
2456and
2457.Ev FETCH_USER
2458must be able to write into
2459.Pa ${DISTDIR} .
2460The directories and permissions can be set correctly using
2461.Cm fix-permissions .
2462.Pp
2463The regular user must be allowed to execute commands as
2464.Ev BUILD_USER
2465and
2466.Ev FETCH_USER .
2467Running commands as another user can be achieved with
2468.Xr doas 1
2469by setting
2470.Ev SUDO=doas
2471in
2472.Xr mk.conf 5
2473and using the following minimal
2474.Xr doas.conf 5 :
2475.Bd -literal -offset indent
2476permit keepenv nopass solene as _pbuild
2477permit keepenv nopass solene as _pfetch
2478.Ed
2479.Pp
2480Note that this also means that
2481.Xr doas 1
2482must be configured to work within the chroot
2483created by
2484.Xr proot 1 .
2485.Pp
2486As
2487.Xr dpb 1
2488does its own privilege dropping when run as root,
2489it will automatically override
2490.Ev PORTS_PRIVSEP .
2491.Pp
2492User settings, defaults to
2493.Sq \&No .
2494.It Ev PKGDIR
2495Location for packaging information (packing list, port description, messages).
2496.Cm update-plist
2497may create it.
2498Must be a valid directory.
2499Default: pkg.
2500.It Ev PKGFILE
2501Full path to the created package for the given subpackage.
2502Read-only.
2503.It Ev PKGFILES
2504Full path to all created packages.
2505Read-only.
2506.It Ev PKGNAME
2507Name of the created package.
2508Default is ${DISTNAME}.
2509This does not take flavors into account.
2510See
2511.Ev FULLPKGNAME
2512for that.
2513Specific revisions and epoch changes should be
2514handled by
2515.Ev REVISION
2516and
2517.Ev EPOCH
2518instead.
2519.It Ev PKGNAMES
2520Read-only.
2521List of all package names generated by the port, with
2522.Ev FLAVORS
2523and
2524.Ev BUILD_PACKAGES
2525taken into account.
2526Mostly used as
2527.Ql make show=PKGNAMES
2528to verify that bumped package names are correct.
2529.It Ev PKGNAME-foo
2530Package name for sub-package foo, if the default value
2531of ${PKGNAME}${SUBPACKAGE} is not appropriate.
2532.It Ev PKGPATH
2533Path to the current port's directory, relative to ${PORTSDIR}.
2534Read-only.
2535.It Ev PKGPATHS
2536Read-only.
2537List of all package paths generated by the port, with
2538.Ev FLAVORS
2539and
2540.Ev MULTI_PACKAGES
2541taken into account.
2542Order matches
2543.Ev PKGNAMES
2544exactly.
2545.It Ev PKGSPEC
2546Default package spec for using this port as a dependency.
2547Defaults to
2548.Sq stem-* ,
2549derived from the
2550.Ev FULLPKGNAME .
2551Do not override without very good reasons,
2552namely software that coexist as different incompatible versions with the
2553same stem, e.g., already a mess.
2554.It Ev PKGSTEM
2555Base for the package name without any version number.
2556Used in
2557.Pa READMEs
2558file names and actual contents, can be overridden for ports
2559with branches, like php, e.g.,
2560.Li PKGSTEM-main = php-5.6
2561.It Ev PLIST_DB
2562Deprecated, see
2563.Ev PLIST_REPOSITORY .
2564.It Ev PLIST_REPOSITORY
2565User settings.
2566Base directory used to save generated packing-lists, as persistent information.
2567Packing-lists are processed by a script,
2568.Xr register-plist 1 ,
2569which complains when packing-lists change without a
2570.Ev REVISION
2571bump.
2572It also knows enough about package version numbers when something in the
2573package or its dependencies goes backward, thus catching
2574.Ev EPOCH
2575issues.
2576This directory is never cleaned during normal operation.
2577.Ql make clean=plist
2578should only ever be used during debugging by port maintainers.
2579Defaults to
2580.Pa ${PORTSDIR}/plist
2581.Po
2582plists actually get saved into
2583.Pa ${PLIST_REPOSITORY}/${MACHINE_ARCH}
2584.Pc .
2585If set to empty, will not register anything: very much unsafe.
2586.It Ev PORTS_BUILD_XENOCARA_TOO
2587EXPERIMENTAL.
2588Set to
2589.Sq Yes
2590to build xenocara through ports.
2591This is highly experimental and not recommended.
2592.It Ev PORTROACH
2593Controls the behavior of
2594.Pa misc/portroach
2595as documented in detail at
2596.Lk http://jasperla.github.io/portroach/docs/portroach-portconfig.txt .
2597.It Ev PREFIX
2598Base directory for the current port installation.
2599Usually ${LOCALBASE}, though some ports may elect a location under
2600.Pa ${VARBASE} ,
2601and some multi-package ports may install under several locations.
2602Additionally, firmware files generally install under
2603.Pa ${BASESYSCONFDIR} .
2604.It Ev PREPARE_CHECK_ONLY
2605Build settings.
2606Prevent the
2607.Cm prepare
2608stage from installing anything, let it just check dependencies, and
2609handle [:target] dependencies.
2610Mostly used by
2611.Xr dpb 1 ,
2612which already installs everything before running
2613.Cm prepare .
2614.It Ev PROGRESS_METER
2615User settings.
2616Defaults to
2617.Sq Yes .
2618Forces commands like
2619.Xr ftp 1
2620and
2621.Xr pkg_create 1
2622to use their progress-meter even in the absence of a terminal.
2623.It Ev PROPERTIES
2624List of properties specific to a given machine architecture.
2625Most often obtained through
2626.Xr bsd.port.arch.mk 5 .
2627These can be checked like this
2628.Bd -literal -offset indent
2629\&.include <bsd.port.arch.mk>
2630\&.if ${PROPERTIES:Mapm}
2631# then add build options specific to apm arches
2632\&...
2633\&.if !${PROPERTIES:Mlp64}
2634# build options specific to lp32 arches
2635\&...
2636.Ed
2637For
2638.Ev MULTI_PACKAGES
2639setup, use of
2640.Ev ONLY_FOR_ARCHS-sub
2641and
2642.Ev BUILD_PACKAGES
2643is generally preferred (and simpler).
2644Possible properties include
2645.Bl -tag -width mono
2646.It apm
2647architecture possesses suspend (apm) support.
2648.It be
2649architecture is big-endian.
2650.It gccN
2651gccN architecture.
2652.It le
2653architecture is little-endian.
2654.It lp64
2655lp64 architecture.
2656.It llvm
2657there is
2658.Pa lang/llvm
2659support on this architecture.
2660.It mono
2661there is
2662.Pa lang/mono
2663support on this architecture.
2664.El
2665.It Ev PSEUDO_FLAVOR
2666List of flavors in
2667.Ev FLAVOR
2668that are actually pseudo-flavors.
2669Only for introspection purposes.
2670Read-only.
2671.It Ev PSEUDO_FLAVORS
2672Extra list of flavors that do not register in package names, but are still
2673used to control build logic, and work directory names.
2674Its only use should be for disabling part of a multi-packages build,
2675for instance:
2676.Bd -literal
2677FLAVOR=no_gnome make package
2678.Ed
2679.Pp
2680Pseudo-flavors should be named as
2681.Sq no_something
2682to disable the build of subpackage
2683.Sq -something
2684.Po
2685and possibly some others, by restricting
2686.Ev BUILD_PACKAGES
2687.Pc .
2688Pseudo-flavors should always be handled through
2689.Xr bsd.port.arch.mk 5 .
2690A pseudo-flavor can remove several subpackages through the following
2691construct.
2692.Bd -literal -offset indent
2693# pseudo-flavor no_gui will also remove gtk and gtk3
2694MULTI_PACKAGES = -main -gtk -gtk3 -gui
2695# ...
2696\&.include <bsd.port.arch.mk>
2697
2698# remove extra build components
2699\&.if !${BUILD_PACKAGES:M-gui}
2700BUILD_PACKAGES := ${BUILD_PACKAGES:N-gtk:N-gtk3}
2701\&.endif
2702
2703# normal configure setup, e.g.,
2704\&.if ${BUILD_PACKAGES:M-gtk}
2705# ...
2706.Ed
2707.Pp
2708Caveat: creation of a separate working directory is mandatory for a
2709pseudo-flavor.
2710If, at a later time, a full build with all subpackages is required,
2711all the work will need to be done again.
2712.Pp
2713See also
2714.Ev BUILD_ONCE .
2715.It Ev RCDIR
2716Location for daemon startup scripts.
2717Defaults to
2718.Pa /etc/rc.d .
2719Do not change.
2720.It Ev REFETCH
2721User settings.
2722If set to true,
2723.Cm checksum
2724will analyze ${CHECKSUM_FILE}, and try retrieving files with the correct
2725checksum off
2726.Lk https://ftp.openbsd.org ,
2727in the directory
2728.Pa /pub/OpenBSD/distfiles/$cipher/$value/$file .
2729.It Ev REORDER_DEPENDENCIES
2730Points to a list of files that specify inter-dependencies for
2731.Xr make 1 .
2732If defined, each line of the file is either a comment (starting with #)
2733or a pair of two files: most_recent older.
2734At the end of
2735.Cm post-patch ,
2736.Xr touch 1
2737will be used to ensure those files are put in the proper order.
2738The files are assumed to be under
2739.Pa ${WRKSRC} .
2740The notation /file can be used to ask for a recursive search, e.g.,
2741to make sure that all Makefile.in are up to date.
2742See
2743.Pa ${PORTSDIR}/infrastructure/mk/automake.dep
2744for an example.
2745.It Ev REPORT_PROBLEM
2746See
2747.Xr ports 7 .
2748.It Ev REPORT_PROBLEM_LOGFILE
2749See
2750.Xr ports 7 .
2751.It Ev REVISION
2752Revision number of the current package.
2753Defaults to empty (very first package), then
2754numbering starts at 0.
2755Gets automatically incorporated into
2756.Ev FULLPKGNAME
2757as
2758.Sq p${REVISION}
2759to form a full package-name conforming to
2760.Xr packages-specs 7 .
2761.It Ev RUN_DEPENDS
2762Specification of ports this port needs installed to be functional.
2763Same format as
2764.Ev LIB_DEPENDS .
2765The corresponding packages will be built right before the
2766.Cm install
2767stage, and
2768.Xr pkg_add 1
2769will take care of installing them.
2770.It Ev SEPARATE_BUILD
2771Many GNU configure ports can be built in a directory distinct from the
2772place they were unpacked.
2773For some specific ports, this is even mandatory.
2774Set to
2775.Sq yes
2776or
2777.Sq simple
2778if this is the case.
2779The ports infrastructure will generate a separate ${WRKBUILD} directory
2780in which the port will be configured and built.
2781Wipe ${WRKBUILD} to start anew, but skipping the extract/patch stage.
2782.It Ev SETENV
2783Normally set to
2784.Li /usr/bin/env -i .
2785Prepended to every command invocation that requires a clean environment.
2786Do not override.
2787.It Ev SHARED_LIBS
2788List of shared libraries that the port may build, as a list of the form
2789.Sq libname
2790.Sq libversion .
2791Used to set variables of the form
2792.Ev LIBlibname_VERSION
2793that are then used for substitution by
2794.Xr pkg_create 1 .
2795The porter is responsible for making sure the port uses those version numbers
2796when shared libraries are built.
2797.Pp
2798The intent is that the
2799.Ox
2800ports system must have control over shared library versions because of global
2801changes that may require bumping the major version of every shared library in
2802the system, or simply because the third party programmers do not understand
2803the rules for shared library versions, thus breaking the update mechanism.
2804For that reason it is advised to set libversion to 0.0 when first importing a
2805port.
2806.Pp
2807Porters of software using libtool should make sure
2808.Ev MAKE_FLAGS
2809get propagated to the libtool invocations.
2810This should be enough in most cases.
2811.It Ev SKIPDIR
2812See
2813.Xr ports 7 .
2814.It Ev STATIC_PLIST
2815Normally set to
2816.Sq yes .
2817Can be set to no for ports that do not have a static plist.
2818Do not change without a very good reason.
2819Note that the only good reason to not have a static plist is for ports such
2820as
2821.Pa databases/ports-readmes
2822which actually build a bunch of files depending on the current ports tree.
2823This breaks all introspection mechanisms within the ports tree, including
2824.Pa databases/pkglocatedb
2825which will not include that port.
2826.It Ev STARTAFTER
2827See
2828.Xr ports 7 .
2829.It Ev STARTDIR
2830See
2831.Xr ports 7 .
2832.It Ev SUBPACKAGE
2833Set to the subpackage suffix when building a package in a multi-package port.
2834Read-only.
2835Used to test for dependencies or to adjust the package name.
2836.It Ev SUBST_CMD
2837A command that can be used to perform
2838.Ev SUBST_VARS
2839substitution on arbitrary files.
2840In normal mode,
2841.Pp
2842.Dl ${SUBST_CMD} file1 file2 ...
2843.Pp
2844will substitute files in place, creating backup copies of them.
2845In copy mode,
2846.Pp
2847.Dl ${SUBST_CMD} -c src1 dest1 src2 dest2
2848.Pp
2849will copy files over while performing the substitution, as suitable for
2850copying template files over from
2851.Pa ${FILESDIR}
2852to
2853.Pa ${PREFIX} ,
2854for instance.
2855This uses
2856.Xr pkg_subst 1
2857with suitable parameters.
2858Read-only.
2859.Pp
2860${SUBST_CMD}
2861can be used like
2862.Xr install 1 :
2863.Dl ${SUBST_CMD} Oo Fl g Ar group Oc Oo Fl o Ar owner Oc Oo Fl m Ar mode Oc file...
2864to set file
2865.Ar owner ,
2866.Ar group
2867and/or
2868.Ar mode .
2869.Pp
2870Note that
2871.Ev SUBST_CMD
2872is not really appropriate when variables have subpackage variations, like
2873.Ev PREFIX
2874or
2875.Ev FULLPKGNAME .
2876Use the appropriate
2877.Ev SUBST_CMD-sub
2878instead.
2879.It Ev SUBST_CMD-sub
2880.Ev SUBST_CMD
2881with subpackage-dependent semantics, like packing-list substitution.
2882It will substitute the right variable depending on the desired subpackage,
2883e.g.,
2884.Ev SUBST_CMD-foo
2885will substitute the value of
2886.Ev FULLPKGNAME-foo
2887for
2888.Li ${FULLPKGNAME} .
2889.It Ev SUBST_DATA , SUBST_MAN , SUBST_PROGRAM
2890Specialized versions of
2891.Ev SUBST_CMD
2892that use
2893.Fl c
2894and appropriate owner/group/mode for data, manpages and programs respectively.
2895.It Ev SUBST_VARS
2896Make variables whose values get substituted to create the actual package
2897information.
2898Always holds
2899.Ev ARCH ,
2900.Ev BASE_PKGPATH ,
2901.Ev FLAVOR_EXT ,
2902.Ev FULLPKGNAME ,
2903.Ev HOMEPAGE ,
2904.Ev LOCALBASE ,
2905.Ev MACHINE_ARCH ,
2906.Ev MAINTAINER ,
2907.Ev PREFIX ,
2908.Ev PKGSTEM ,
2909.Ev RCDIR ,
2910.Ev SYSCONFDIR ,
2911.Ev TRUEPREFIX ,
2912and
2913.Ev X11BASE .
2914The special construct
2915.Sq ${FLAVORS}
2916can be used in the packing-list to specify the current list of dash
2917separated flavors the port is compiled with (useful for cross-dependencies
2918in
2919.Ev MULTI_PACKAGES ) .
2920Add other
2921variables as needed.
2922.Pp
2923.Ev TRUEPREFIX
2924is never passed to
2925.Xr pkg_create 1
2926as it is identical to
2927.Ev PREFIX .
2928.Pp
2929By default,
2930.Xr update-plist 1
2931is run with the following options:
2932.Bd -literal -offset indent
2933update-plist -i ARCH -i BASE_PKGPATH -i FULLPKGNAME
2934-i FULLPKGPATH -i LOCALSTATEDIR -i MACHINE_ARCH
2935-s BASE_PKGPATH -s LOCALBASE -s LOCALSTATEDIR -s PREFIX
2936-s RCDIR -s SYSCONFDIR -s X11BASE
2937.Ed
2938.It Ev SUDO
2939User settings.
2940If set to
2941.Xr doas 1
2942in
2943.Xr mk.conf 5 ,
2944the ports tree will only invoke root's privileges for the parts that
2945really require it.
2946.It Ev SUPDISTFILES
2947Supplementary files that need to be retrieved under some specific
2948circumstances.
2949For instance, a port might need architecture-specific files.
2950.Ev SUPDISTFILES
2951should hold a list of all distribution files and patchfiles that are not
2952always needed, so that a mirror will be able to grab all files, or that
2953.Cm makesum
2954will work.
2955Having an overlap between
2956.Ev SUPDISTFILES
2957and
2958.Ev DISTFILES ,
2959.Ev PATCHFILES
2960is admissible, and in fact, expected, as it is much simpler to build
2961an error-free list of files to retrieve in that way.
2962See the xanim port for an example.
2963.It Ev SYSCONFDIR
2964Location for this port's configuration files, should always be derived
2965from
2966.Ev BASESYSCONFDIR ,
2967which defaults to
2968.Pa /etc .
2969Passed to gnu configure scripts and substituted in PLISTs.
2970.It Ev TAR
2971Name of the tar binary.
2972.It Ev TARGETS
2973Read-only.
2974Set to the list of special targets for a port
2975.Po
2976.Cm {pre,do,post}-*
2977and module hooks
2978.Pc .
2979Used by introspection tools such as the sqlports package.
2980.It Ev TEMPLATES
2981Base location for the templates used in the
2982.Cm readmes
2983target.
2984User settings.
2985Defaults to
2986.Pa ${PORTSDIR}/infrastructure/templates .
2987.It Ev TEST_DEPENDS
2988See
2989.Ev BUILD_DEPENDS
2990for specification.
2991Test dependencies are only checked if the
2992.Cm test
2993stage is invoked.
2994.It Ev TEST_ENV
2995Additional environment variables passed to tests.
2996Empty by default.
2997.It Ev TEST_FLAGS
2998Extra flags passed to ${MAKE_PROGRAM} to run the regression tests.
2999Empty by default.
3000.It Ev TEST_IS_INTERACTIVE
3001Set to
3002.Sq Yes
3003if port needs human interaction to run its tests, or set to
3004.Sq X11
3005if the tests need an active X11 display to work.
3006.It Ev TEST_LOG
3007Command used to log the results of regression tests to TEST_LOGFILE.
3008Read-only.
3009.It Ev TEST_LOGFILE
3010Log file containing the results of regression tests.
3011.It Ev TEST_TARGET
3012Target to run regression tests.
3013Defaults to
3014.Sq regress ,
3015except for
3016.Sq perl
3017and
3018.Sq gnu
3019.Ev CONFIGURE_STYLE ,
3020which default to
3021.Sq test
3022and
3023.Sq check ,
3024respectively.
3025.It Ev TRUEPREFIX
3026Read-only.
3027Mostly the same as ${PREFIX}, except it never gets ${DESTDIR} prepended
3028during
3029.Cm fake .
3030Refer to
3031.Sx THE FAKE FRAMEWORK
3032section for details.
3033.It Ev TRY_BROKEN
3034User settings.
3035If set to
3036.Sq Yes ,
3037don't set
3038.Ev IGNORE
3039for
3040.Ev BROKEN
3041ports, so that we will attempt to build them.
3042.It Ev UNLOCK_CMD
3043User settings.
3044If set, expands to a command that will release a lock.
3045This lock will reside in
3046.Pa ${LOCKDIR} .
3047.It Ev UNMESSAGE
3048File recorded in the package and displayed during deinstallation.
3049Defaults to ${PKGDIR}/UNMESSAGE if this file exists.
3050Leave empty if no message is needed.
3051.It Ev UNZIP
3052Name of the unzip binary.
3053.It Ev UPDATE_COOKIES_DIR
3054User settings.
3055Used to store cookies for package updates and defaults to
3056.Pa ${PORTSDIR}/update/${MACHINE_ARCH} .
3057If set to empty, will revert to a file under
3058.Pa ${WRKDIR} .
3059.It Ev UPDATE_PLIST_ARGS
3060Tweaks to
3061.Xr update-plist 1
3062behavior for some specific ports, such as variable handling.
3063.It Ev UPDATE_PLIST_OPTS
3064User settings.
3065User options added to
3066.Xr update-plist 1 ,
3067mostly
3068.Fl v
3069for now.
3070.It Ev USE_CCACHE
3071User settings.
3072Set to
3073.Sq Yes
3074to use ccache when building ports.
3075Adds a build dependency on devel/ccache, and sets up the build
3076environment so that it is used.
3077.It Ev USE_GMAKE
3078Set to
3079.Sq Yes
3080if GNU make (${GMAKE}) is needed for correct behavior of this port.
3081.It Ev USE_GROFF
3082Set to
3083.Sq Yes
3084to use groff to build manpages.
3085This sets groff as a build dependency, and also tells
3086.Xr pkg_create 1
3087to format manpages behind the scene using groff while building packages.
3088.It Ev USE_LIBTOOL
3089Defaults to
3090.Sq Yes .
3091Set to
3092.Sq gnu
3093if the base
3094.Xr libtool 1
3095is insufficient and GNU libtool is required.
3096Set to
3097.Sq \&No
3098to disable the use of
3099.Xr libtool 1
3100entirely; this should not be set under normal circumstances.
3101Adds dependencies if necessary, and passes LIBTOOL environment variable to
3102scripts invocations.
3103.Pp
3104Many ports using GNU autoconf need an m4 file from the GNU libtool package
3105but otherwise work with base
3106.Xr libtool 1 .
3107In those cases do not set
3108.Ev USE_LIBTOOL ,
3109instead just set
3110.Li BUILD_DEPENDS = devel/libtool .
3111.It Ev USE_MFS
3112Set to
3113.Sq Yes
3114to build ports under an MFS filesystem
3115(see
3116.Xr mount_mfs 8 ) .
3117Mostly for use by
3118.Xr dpb 1
3119and not intended to be a user setting.
3120See
3121.Ev WRKOBJDIR_MFS
3122for configuration.
3123.It Ev USE_WXNEEDED
3124If set to
3125.Sq Yes ,
3126writes a wrapper script to ${WRKDIR}/bin/ld in
3127.Cm patch
3128to request that the linker adds an OPENBSD_WXNEEDED ELF section.
3129Use when a port requires memory mappings that are both executable
3130and writable and cannot be modified to avoid this.
3131.It Ev USE_X11
3132Normally, presence of ${X11BASE} is enforced by default for building ports.
3133But there is an experimental way to hook the xenocara build into
3134.Xr dpb 1 ,
3135which requires knowing whether a port requires X11 to already
3136be there.
3137.Pp
3138The infrastructure mostly sets
3139.Ev USE_X11
3140automatically based on
3141.Ev WANTLIB
3142values, there are a few ports (about 20) that require X11 components without
3143any library telltale.
3144.It Ev VARBASE
3145User settings.
3146Base location for ports that install stuff outside of
3147.Pa ${LOCALBASE} .
3148Defaults to
3149.Pa /var .
3150.It Ev WANTLIB
3151List of library specifications that a package will need.
3152May include system and X11 libraries.
3153See
3154.Xr library-specs 7
3155for more details.
3156.Pp
3157As a special extension,
3158.Ev WANTLIB
3159may include absolute paths, e.g.,
3160.Pa ${LOCALBASE}/lib/expat=4
3161to distinguish between base libraries and port libraries.
3162Use with caution, this is very seldom needed.
3163.It Ev wantlib_args
3164Controls the behavior of
3165.Xr pkg_create 1
3166related targets, see
3167.Cm print-package-args
3168for details.
3169.It Ev WARNINGS
3170User settings.
3171If set to
3172.Sq Yes ,
3173add
3174.Ev CDIAGFLAGS
3175to
3176.Ev CFLAGS
3177and
3178.Ev CXXDIAGFLAGS
3179to
3180.Ev CXXFLAGS .
3181.It Ev WRKBUILD
3182Subdirectory of ${WRKDIR} where the actual build occurs.
3183Defaults to ${WRKSRC}, unless
3184.Ev SEPARATE_BUILD
3185is involved, in which case it is set to an appropriate value.
3186.It Ev WRKCONF
3187Subdirectory of ${WRKDIR} where the actual configure set occurs.
3188Defaults to ${WRKBUILD}.
3189.It Ev WRKDIR
3190Location where all port activity occurs.
3191Apart from the actual port, may
3192hold all kinds of cookies that checkpoint the port's build.
3193Read-only.
3194Note that WRKDIR may be a symbolic link.
3195During ports building,
3196.Pa ${WRKDIR}/bin
3197is put at the front of the
3198.Ev PATH .
3199.It Ev WRKDIR_LINKNAME
3200Name of a symbolic link to create within the port directory which will
3201point to the port's ${WRKDIR}.
3202Deprecated.
3203.It Ev WRKDIST
3204Subdirectory of ${WRKDIR} in which the distribution files normally unpack.
3205Base for all patches.
3206Defaults to
3207.Pa ${WRKDIR}/${DISTNAME} .
3208Note that WRKDIST may be a symbolic link, if set to ${WRKDIR}.
3209.It Ev WRKSRC
3210Subdirectory of ${WRKDIR} where the actual source is.
3211Base for configuration (default: ${WRKDIST}).
3212Note that WRKSRC may be a symbolic link, if set to ${WRKDIR}.
3213.It Ev WRKINST
3214Subdirectory of ${WRKDIR} where port normally installs (see the
3215.Cm fake
3216target).
3217.It Ev WRKOBJDIR
3218Used as a base for the actual port working directory.
3219Defaults to
3220.Pa ${PORTSDIR}/pobj .
3221The real working directory ${WRKDIR} is created there.
3222Can be set on a per-${PKGPATH} basis.
3223For instance, setting WRKOBJDIR_www/mozilla=/tmp/obj
3224will affect only the mozilla port.
3225If explicitly unset (WRKOBJDIR=), the working directory is
3226created within the port directory.
3227.It Ev WRKOBJDIR_MFS
3228Alternate location for the port working directory.
3229The intent is to use an MFS based filesystem for small ports with
3230.Xr dpb 1 .
3231Active when
3232.Ev USE_MFS
3233is
3234.Sq Yes .
3235Defaults to
3236.Pa /tmp/pobj .
3237.It Ev X11BASE
3238Where X11 has been installed.
3239Default:
3240.Pa /usr/X11R6 .
3241.It Ev XAUTHORITY
3242Points to a suitable authority file for X11 interactive regression tests.
3243Defaults to
3244.Pa ${HOME}/.xauthority .
3245.It Ev XMKMF
3246Invocation of xmkmf for a
3247.Li CONFIGURE_STYLE=imake
3248port.
3249Defaults to xmkmf -a -DPorts.
3250The -DPorts is specific to
3251.Ox
3252and is always appended.
3253.It Ev YACC
3254Name of yacc program to pass to GNU-configure, defaults to yacc.
3255GNU-configure would always try to use bison otherwise, which leads to
3256unreproducible builds.
3257Set to bison if needed.
3258.El
3259.Sh DIAGNOSTICS
3260Note that some of these messages are actually emitted by some other external
3261commands, but grouped here for convenience: easier to look for in
3262.Xr dpb 1 Ns 's
3263logs.
3264.Bl -diag
3265.It "/bin/sh: cd .../pkg - No such file or directory"
3266Emitted during
3267.Cm generate-readmes .
3268.Pa ${PKGDIR}
3269must point to an existing directory, so that
3270.Nm
3271can be certain there are no
3272.Pa MESSAGEs
3273or
3274other files pertinent to the package.
3275.It "Discovered old directory in ..."
3276This message comes from
3277.Xr update-plist 1 .
3278A directory was found in the PLIST that used to be needed but is no longer,
3279because it's now accounted for through dependencies.
3280Indicates the old directory has been removed.
3281.It "Error: change in plist between ..."
3282Error message comes from
3283.Xr register-plist 1 .
3284.It "Error: duplicate item in packing-list"
3285Error message comes from
3286.Xr pkg_create 1 ,
3287and will result from incorrect packing-lists, such as including several
3288fragments with the same file, or having incorrect
3289.Ev PKG_ARGS-sub .
3290.It "Error: Libraries in packing-lists...and libraries from installed packages don't match"
3291The ports tree and the installed packages are out-of-sync.
3292Mixing library information from both sources might produce packages that can't
3293be installed elsewhere.
3294Cleanest fix is to update the out-of-date source (e.g., update the ports tree,
3295or build and install new packages).
3296Developers may use
3297.Ev PKG_CREATE_NO_CHECKS
3298instead, assuming they understand the implications.
3299See
3300.Cm print-package-args Pq Cm wantlib-args
3301for details.
3302.It "Fatal: can't flavor a SUBDIR"
3303A dependency mentions top_subdir,flavor.
3304Flavor would then be ignored, as it is only applied to individual ports.
3305.It "Fatal: can't subpackage a SUBDIR"
3306A dependency mentions top_subdir,-sub.
3307Subpackage would then be ignored, as it is only applied to individual ports.
3308.It "Fatal: flavor should never start with a digit"
3309This would utterly confuse
3310.Xr pkg_add 1 .
3311See
3312.Xr packages-specs 7 .
3313.It "Fatal: inclusion of <file> from <file>"
3314.Pa bsd.port.mk
3315or
3316.Pa bsd.port.subdir.mk
3317has been included from a
3318.Ev MODULE
3319or from
3320.Pa Makefile.inc ,
3321resulting in a double inclusion.
3322This would lead to weird results, such as
3323.Ev PKG_ARGS
3324being defined twice.
3325.It "Fatal: SUBPACKAGES should always begin with -: <offending list>"
3326That is the only way to differentiate between
3327.Ev FLAVOR
3328and
3329.Ev SUBPACKAGE
3330in
3331.Xr pkgpath 7
3332specifications.
3333.It "Fatal: building ports requires correctly installed X11"
3334All file sets of the base OS, including xenocara, must be installed
3335before building ports.
3336.It "Fatal: /usr/local/lib/X11/app-defaults should exist and be a symlink"
3337/usr/local/lib/X11/app-defaults is distributed as a symlink in the
3338xshare*.tgz file set.
3339If xenocara was not fully installed before packages were added, it may
3340have been created as a directory instead.
3341.It "Fatal: the licensing info for <pkgname> is incomplete..."
3342Every port must have explicit defines of all
3343.Ev PERMIT_*
3344values.
3345.It "Fatal: Use 'env FLAVOR=flavor make' instead"
3346Arguments specified after
3347.Xr make 1
3348are hardcoded for all recursive sub-makes, and very difficult to override.
3349Thus,
3350.Ev FLAVOR
3351must be specified in the environment instead.
3352.It "Fatal: Use 'env SUBPACKAGE=-sub make' instead"
3353Arguments specified after
3354.Xr make 1
3355are hardcoded for all recursive sub-makes, and very difficult to override.
3356Thus,
3357.Ev SUBPACKAGE
3358must be specified in the environment instead.
3359.It "ldconfig: <dir>: No such file or directory"
3360Usually produced by
3361.Xr pkg_add 1
3362running
3363.Xr ldconfig 8 .
3364Some tools such as GNU libtool will add directories living under
3365.Pa ${WRKINST}
3366to the shared library path during the
3367.Cm fake
3368stage.
3369Of course,
3370.Xr ldconfig 8
3371will later complain after the directory no longer exists.
3372The bogus tool should be fixed to conform to
3373.Ox
3374usage.
3375.It LIB_DEPENDS <spec> not needed for <FULLPKGPATH>
3376There doesn't seem to be any WANTLIB to match the given LIB_DEPENDS.
3377Thus, the LIB_DEPENDS won't turn into a @depends line in the created package.
3378This is often because of confusion between LIB_DEPENDS and RUN_DEPENDS:
3379RUN_DEPENDS is needed for dlopen'd libraries.
3380.Pp
3381Might be intentional sometimes, if some compile flavors create static binaries,
3382for instance.
3383Also, will happen for multi-packages, where one sets LIB_DEPENDS to have
3384a given build dependency (and corresponding WANTLIB for a given SUBPACKAGE).
3385.Pp
3386See
3387.Cm print-package-args Pq Cm lib-depends-args
3388for details.
3389.It "Warning: FULLPKGNAME-sub defined but not FULLPKGPATH-sub"
3390.Ev FULLPKGNAME-sub
3391has been explicitly defined by the port, instead of relying on the default,
3392but no value of
3393.Ev FULLPKGPATH-sub
3394has been given.
3395This is often an error.
3396.It "Warning: symlink(s) point to non existent file."
3397Warning message comes from
3398.Xr pkg_create 1 .
3399The symlink resides in the fake area, under
3400.Pa ${WRKINST} .
3401This is only a warning because the symlink may point to a run-time dependency,
3402which obviously won't exist under
3403.Pa ${WRKINST}
3404at the time
3405.Ql make package
3406is run.
3407.It "Warning: @option no-default-conflict with no @conflict"
3408Warning message comes from
3409.Xr pkg_create 1 .
3410Most packages that waive "default-conflict" will have explicit conflict markers
3411instead.
3412Otherwise, the package will only conflict with the exact same version, with
3413some possible
3414.Ev REVISION
3415bumps.
3416Any other version or
3417.Ev FLAVOR
3418won't conflict.
3419This is generally an error, apart from very few ports like
3420.Pa devel/autoconf/* .
3421.It "groff produced empty result for <manpage>..."
3422Warning message comes from
3423.Xr pkg_create 1 .
3424Manpages are automatically formatted with
3425.Xr groff 1
3426if
3427.Ev USE_GROFF
3428is set.
3429The above message denotes an actual problem while formatting the page,
3430which should be addressed.
3431In the meantime,
3432.Xr pkg_create 1
3433still produces a package, but leaves the manpage unformatted, in the hope
3434that something will be able to make sense of it.
3435.El
3436.Sh FILES
3437.Bl -tag -width Ds
3438.It Pa ../Makefile.inc
3439Common Makefile fragment for a set of ports, included automatically.
3440.It Pa /cdrom/distfiles
3441Default path to a CD-ROM (or other media) full of distribution files.
3442.It Pa ${PORTSDIR}/distfiles
3443Default setup of ${DISTDIR}.
3444.It Pa ${DISTDIR}
3445Cache of all distribution files.
3446.It Pa distinfo
3447Checksum file.
3448Holds the output of
3449.Xr cksum 1 ,
3450using
3451.Xr sha256 1
3452for the port's ${DISTFILES} and ${PATCHFILES},
3453as well as the sizes of these files.
3454.It Pa ${DISTDIR}/${CHECKSUMFILES}
3455Cache of normal distribution files for a given port.
3456.It Pa ${DISTDIR}/${MAKESUMFILES}
3457Cache of all distribution files for a given port.
3458.It Pa ${PKGDIR}/DESCR
3459Description for the port.
3460Variables such as ${HOMEPAGE} and ${MAINTAINER} will be expanded
3461(see SUBST_VARS).
3462Multi-package ports will use DESCR${SUBPACKAGE}.
3463.It Pa ${PKGDIR}/README
3464.Ox
3465specific documentation for a port, that will be installed as
3466.Pa ${LOCALBASE}/share/doc/pkg-readmes/${PKGSTEM}
3467at the end of
3468.Cm fake .
3469Variables from
3470.Ev SUBST_VARS
3471will be expanded.
3472Multi-package ports will use
3473.Pa README${SUBPACKAGE} .
3474.It Pa ${PKGDIR}/<foo>.rc
3475Startup script for <foo>.
3476Will be installed as
3477.Ar ${RCDIR}/<foo>
3478at the end of
3479.Cm fake .
3480Variables from
3481.Ev SUBST_VARS
3482will be expanded.
3483.It Pa ${PORTSDIR}/packages/${MACHINE_ARCH}
3484Default setup of ${PACKAGE_REPOSITORY}.
3485.It Pa ${PACKAGE_REPOSITORY}/no-arch
3486Location of arch-independent packages.
3487.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all
3488Location of all built packages.
3489.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cache
3490Location of packages retrieved through the network.
3491.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cksums
3492Location of checksums, see
3493.Ev CHECKSUM_PACKAGES .
3494.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cdrom
3495Location of packages suitable for the CD.
3496.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp
3497Location of packages suitable for FTP.
3498.It Pa ${PORTSDIR}/bulk/${MACHINE_ARCH}
3499Default setup of ${BULK_COOKIES_DIR}.
3500.It Pa ${PORTSDIR}/update/${MACHINE_ARCH}
3501Default setup of ${UPDATE_COOKIES_DIR}.
3502.It Pa ${PORTSDIR}/mystuff
3503Extra directory used to store local ports before committing them.
3504All depend targets will normally look there after the normal lookup fails.
3505See
3506.Ev PORTSDIR_PATH .
3507.El
3508.Sh THE FAKE FRAMEWORK
3509The
3510.Cm fake
3511target is used to install the port in a private directory first, ready for
3512packaging by the
3513.Cm package
3514target, so that the actual installation will use the package.
3515.Pp
3516Essentially,
3517.Cm fake
3518invokes a real install process after tweaking a few variables.
3519.Pp
3520.Cm fake
3521first creates a skeleton tree under ${WRKINST}, using
3522.Xr mkdir 1
3523.Fl p .
3524.Pp
3525A
3526.Cm pre-fake
3527target may be used to complete that skeleton tree.
3528For instance, a few ports may need supplementary stuff to be present (as
3529it would be installed if the port's dependencies were present).
3530.Pp
3531If
3532.Cm {pre,do,post}-install
3533overrides are present, they are used with some
3534important changes, listed in
3535.Ev FAKE_SETUP :
3536.Bd -literal -offset indent
3537TRUEPREFIX=${PREFIX}
3538PREFIX=${WRKINST}${PREFIX}
3539${DESTDIRNAME}=${WRKINST}
3540.Ed
3541.Pp
3542Essentially, old install targets work transparently, except for a need to
3543change
3544.Ev PREFIX
3545to
3546.Ev TRUEPREFIX
3547for symbolic links and similar path lookups.
3548Specific traditional post install work can be simply removed, as it will
3549be taken care of by the package itself (for instance, ldconfig, or
3550texinfo's install-info).
3551.Pp
3552If no
3553.Cm do-install
3554override is present, the port is installed using
3555.Bd -literal -offset 2n
3556env -i ${MAKE_ENV} ${FAKE_SETUP} ${MAKE_PROGRAM} ${ALL_FAKE_FLAGS} -f ${MAKE_FILE} ${FAKE_TARGET}
3557.Ed
3558.Pp
3559Note that this does set both PREFIX and ${DESTDIRNAME}.
3560If a port's Makefile both heeds ${DESTDIRNAME},
3561and references PREFIX explicitly,
3562FAKE_FLAGS may rectify the problem by setting PREFIX=${PREFIX}
3563(which will do the right thing, since ${PREFIX} is a
3564.Xr make 1
3565construct which will not be seen by the shell).
3566.Pp
3567${FAKE_FLAGS} is used to set variables on
3568.Xr make 1
3569command line, which will override the port Makefile contents.
3570Thus, a port that mentions DESTDIR= does not need any patch to work with fake.
3571.Pp
3572Files such as
3573.Pa ${PKGDIR}/README*
3574or
3575.Pa ${PKGDIR}/*.rc
3576get copied to
3577.Pa ${WRKINST}
3578right after the end of
3579.Cm fake ,
3580during
3581.Cm generate-readmes
3582(see the
3583.Sx FILES
3584section above for details).
3585.Sh FLAVORS AND MULTI_PACKAGES
3586Starting with
3587.Ox 2.7 ,
3588each port can generate distinct packages through two orthogonal mechanisms:
3589.Ev FLAVORS
3590and
3591.Ev MULTI_PACKAGES .
3592.Pp
3593The current
3594.Ev MULTI_PACKAGES
3595mechanism was introduced after
3596.Ox 4.0 .
3597.Pp
3598The arch-dependent part was refined after
3599.Ox 5.0 .
3600.Pp
3601If a port can be compiled with several options, these options
3602should be turned into
3603.Ev FLAVORS .
3604The port maintainer will set
3605.Ev FLAVORS
3606to be the list of possible options in the Makefile.
3607When building the port, the package builder will set
3608.Li "FLAVOR='option1 option2...'"
3609to build a specific flavor of the port.
3610The Makefile should test the value of FLAVOR as follows:
3611.Bd -literal -offset indent
3612FLAVOR?=
3613\&.if ${FLAVOR:Moption1}
3614# what to do if option1
3615\&.endif
3616\&.if ${FLAVOR:Moption2}
3617# what to do if option2
3618\&.endif
3619.Ed
3620.Pp
3621.Nm
3622takes care of a few details, such as generating a distinct work directory for
3623each flavor, or creating a FULLPKGNAME by adding a dash separated list of
3624flavors to the base package name.
3625The order in which
3626.Ev FLAVOR
3627is specified does not matter: this dash separated list will be
3628reordered to match the ordering of
3629.Ev FLAVORS .
3630.Pp
3631It is an error to specify an option in
3632.Ev FLAVOR
3633that does not appear in
3634.Ev FLAVORS ,
3635to prevent misspellings.
3636.Pp
3637In bulk package building, flavors can be specified as a comma
3638separated list after the package directory, e.g., SUBDIR+=vim,no_x11
3639.Po
3640see
3641.Xr pkgpath 7
3642.Pc
3643.Pp
3644Finally, package information will use templates with the canonical package
3645extension if they are available: if FLAVOR='option1 option2' and both
3646COMMENT and COMMENT-option1-option2 are available, COMMENT-option1-option2 will
3647be used.
3648.Pp
3649If one build of a port can generate several distinct packages, set
3650.Ev MULTI_PACKAGES
3651accordingly.
3652Each extension of a
3653.Ev MULTI_PACKAGES
3654name should start with a dash, so that they cannot be confused with
3655.Ev FLAVORS .
3656In dependency checking and bulk builds, a subpackage can be
3657specified after a comma, e.g.,
3658.Li SUBDIR+=quake,-server .
3659.Ev MULTI_PACKAGES
3660only affects the actual package building step (and the
3661.Cm describe
3662step, since a
3663.Ev MULTI_PACKAGES
3664port will produce several descriptions).
3665.Pp
3666If
3667.Ev MULTI_PACKAGES
3668is set, the packaging stage happens once for every
3669subpackage, using subpackage-specific variables.
3670For instance, if
3671.Li MULTI_PACKAGES=-main -lib -server ,
3672.Ev PKG_ARCH-main ,
3673.Ev PKG_ARCH-lib
3674and
3675.Ev PKG_ARCH-server
3676will be used for the subpackages respectively called
3677.Ev FULLPKGNAME-main ,
3678.Ev FULLPKGNAME-lib
3679and
3680.Ev FULLPKGNAME-server .
3681.Pp
3682All package information is also derived from
3683templates with SUBPACKAGE appended.
3684In the preceding example, the packing-list template for FULLPKGNAME-lib
3685must be in PLIST-lib.
3686.Pp
3687The following variables are subpackage dependent:
3688.Ev COMMENT ,
3689.Ev PKG_ARCH ,
3690.Ev PERMIT_PACKAGE_FTP ,
3691.Ev PERMIT_PACKAGE_CDROM ,
3692.Ev PKGFILE ,
3693.Ev PKGNAME ,
3694.Ev PKGSTEM ,
3695.Ev FULLPKGNAME ,
3696.Ev REVISION ,
3697.Ev EPOCH ,
3698.Ev FULLPKGPATH ,
3699.Ev RUN_DEPENDS ,
3700.Ev WANTLIB ,
3701.Ev LIB_DEPENDS ,
3702.Ev IGNORE ,
3703.Ev ONLY_FOR_ARCHS ,
3704.Ev NOT_FOR_ARCHS ,
3705.Ev PKG_ARGS ,
3706.Ev PREFIX ,
3707.Ev CATEGORIES ,
3708.Ev MESSAGE ,
3709.Ev UNMESSAGE ,
3710.Ev DESCR ,
3711.Ev PLIST ,
3712.Ev STATIC_PLIST ,
3713.Ev PKGSPEC .
3714.Pp
3715The usual non-MULTI_PACKAGES variables are simply used as default values
3716for all subpackages.
3717So, if you set
3718.Li "PKG_ARCH=*"
3719.Li "PKG_ARCH-main=i386"
3720then
3721.Ev PKG_ARCH-lib
3722and
3723.Ev PKG_ARCH-server
3724will both be
3725.Sq * .
3726.Pp
3727.Ev WANTLIB
3728and
3729.Ev LIB_DEPENDS
3730are special.
3731At the beginning of the build, during
3732.Cm prepare ,
3733all build dependencies will be checked,
3734which includes
3735.Ev LIB_DEPENDS ,
3736.Ev WANTLIB
3737for every subpackage.
3738As an exception, any
3739.Ev LIB_DEPENDS-sub
3740that references the current port will be ignored as a build dependency,
3741in order to avoid recursion.
3742.Pp
3743.Ev FULLPKGPATH
3744and
3745.Ev FULLPKGNAME
3746are special as well.
3747You must set
3748.Ev PKGNAME-sub
3749or
3750.Ev FULLPKGNAME-sub
3751for each subpackage, but
3752.Ev FULLPKGPATH-sub
3753is set automatically to the right value.
3754In very rare cases, one may override
3755.Ev FULLPKGPATH-sub .
3756(for instance, if one specific subpackage is not affected by option
3757settings that affect other subpackages, e.g., for include files packs).
3758.Pp
3759In terms of using the port, quite a few targets will have a subpackage
3760specific subtarget:
3761invoking
3762.Cm package
3763is the same as invoking
3764.Cm subpackage
3765for all subpackages,
3766invoking
3767.Cm install-all
3768is the same as invoking
3769.Cm install
3770for all subpackages,
3771and invoking
3772.Cm update
3773is the same as invoking
3774.Cm subupdate
3775for all subpackages.
3776.Pp
3777.Ev ONLY_FOR_ARCHS
3778and
3779.Ev NOT_FOR_ARCHS
3780interact with
3781.Ev MULTI_PACKAGES
3782and
3783.Ev IGNORE .
3784The infrastructure will automatically filter subpackages
3785that are not suitable for the current architecture.
3786Thus,
3787.Ev MULTI_PACKAGES
3788should always list all subpackages,
3789even things not buildable on the current architecture,
3790for indexing purposes.
3791.Pp
3792Starting with
3793.Ox 5.1 ,
3794.Xr bsd.port.arch.mk 5
3795should be used to simplify the handling of
3796.Ev MULTI_PACKAGES
3797in arch-dependent setups:
3798.Pp
3799Make sure
3800.Ev MULTI_PACKAGES ,
3801.Ev ONLY_FOR_ARCHS* ,
3802and
3803.Ev PSEUDO_FLAVORS
3804are defined correctly, then
3805.Bd -literal -offset indent
3806\&.include <bsd.port.arch.mk>
3807.Ed
3808.Pp
3809This will compute
3810.Ev BUILD_PACKAGES ,
3811the list of actual subpackages to build with the current setup,
3812by taking arch constraints and pseudo-flavors into account.
3813Then test
3814.Ev BUILD_PACKAGES
3815to set up the right configuration, e.g., to check if
3816.Ev SUBPACKAGE
3817.Ar -mono
3818should be built:
3819.Bd -literal -offset indent
3820\&.if ${BUILD_PACKAGES:M-mono}
3821.Ed
3822.Pp
3823The
3824.Pa lang/gcc/4.9
3825or
3826.Pa print/poppler
3827ports should provide examples of proper use.
3828.Pp
3829Note that
3830.Xr dpb 1
3831will break if all subpackages are not properly listed.
3832.Sh THE GENERATION OF PACKAGE INFORMATION
3833Starting after
3834.Ox 4.1
3835all package information is processed directly by
3836.Xr pkg_create 1
3837from templates in ${PKG_DIR}.
3838.Pp
3839.Bl -bullet -compact
3840.It
3841If not overridden by the user, determine which set of templates to use,
3842depending on the current SUBPACKAGE and FLAVOR information.
3843Set PLIST${SUBPACKAGE}, DESCR${SUBPACKAGE}, COMMENT${SUBPACKAGE}, MESSAGE${SUBPACKAGE}, UNMESSAGE${SUBPACKAGE} accordingly.
3844.It
3845Generate the actual DESCR, and if needed, MESSAGE, UNMESSAGE,
3846from the templates in ${DESCR}, ${MESSAGE}, ${UNMESSAGE}, by
3847substituting the variables in ${SUBST_VARS}, and by substituting
3848${FLAVORS} with the canonical flavor extension for this port,
3849e.g., if
3850.Li FLAVORS=no_map gfx qt2 ,
3851if
3852.Li FLAVOR=gfx no_map ,
3853this is
3854.Sq -no_map-gfx .
3855.It
3856Generate the actual PLIST from the template ${PLIST},
3857by inserting fragments
3858and applying the same variable substitutions as other package information.
3859.El
3860.Pp
3861Note that ${COMMENT} is currently not substituted, to speed up
3862.Cm describe
3863generation.
3864.Pp
3865To avoid substitution, variables can be escaped as follows:
3866.Li "$\e{PREFIX}"
3867.Pp
3868If
3869.Ev FLAVORS
3870lists flv, then constructs such as the line
3871.Li "%%flv%%"
3872or
3873.Li "!%%flv%%"
3874in the packing-list template trigger the inclusion of
3875.Pa ${PKGDIR}/PFRAG.flv${SUBPACKAGE}
3876or
3877.Pa ${PKGDIR}/PFRAG.no-flv${SUBPACKAGE} .
3878Other fragments can be defined by simply adding
3879.Li "-Dfrag=1"
3880or
3881.Li "-Dfrag=0"
3882to
3883.Ev PKG_ARGS .
3884.Pp
3885If libraries are built using
3886.Pa bsd.lib.mk ,
3887special care should be taken for mips64* architectures,
3888which do not ever build
3889.Pa *pic.a
3890files (all mips code is pic already).
3891.Nm
3892automatically adds
3893.Li "-Dno_mips64=1"
3894or
3895.Li "-Dno_mips64=0"
3896to
3897.Ev PKG_ARGS ,
3898and the porter only needs to provide the appropriate fragment.
3899.Pp
3900.Xr pkg_add 1
3901now calls
3902.Xr ldconfig 8
3903directly, provided dynamic libraries have been annotated with
3904.Li "@lib libthingy.so.5.0" .
3905Adding new directories to the dynamic loader cache has been
3906deprecated.
3907It is often better to let libraries be visible as a link
3908under ${LOCALBASE}.
3909Having a separate directory is enough to trick
3910.Xr ld 1
3911into grabbing the right version.
3912Libraries used only for
3913.Xr dlopen 3
3914do not need to be visible.
3915Some programs will prefer to use rpath to find their own libraries.
3916.Pp
3917The special
3918.Cm update-plist
3919target does a fairly good job of automatically generating the PLIST.
3920.Pp
3921If
3922.Ev PLIST_REPOSITORY
3923points to a directory, all packing-lists from packages generated by
3924.Xr pkg_create 1
3925during the
3926.Cm package
3927stage are saved in
3928.Pa ${PLIST_REPOSITORY}/${MACHINE_ARCH}
3929by a script:
3930.Pa ${PORTSDIR}/infrastructure/bin/register-plist .
3931This script strips some irrelevant information and normalizes the
3932packing-list somehow, and compares it to existing information, looking
3933for relevant changes.
3934Since a package name must always be changed when the packing-list changes,
3935any attempt to replace a packing-list of a given name with a different
3936packing-list will be flagged as an error.
3937.Pp
3938In
3939.Ev MULTI_PACKAGES
3940mode, there must be separate COMMENT, DESCR, and PLIST
3941templates for each SUBPACKAGE (and optional distinct MESSAGE, UNMESSAGE
3942files in a similar way).
3943This contrasts with the
3944.Ev FLAVORS
3945situation, where all these files will automatically default to the
3946non-flavor version if there is no flavor-specific file around.
3947.Sh OBSOLETE TARGETS
3948.Bl -tag -width Ds
3949.It Cm addsum
3950Used for direct fiddling with
3951.Pa distinfo ,
3952made obsolete by the correct use of
3953.Ev SUPDISTFILES .
3954.It Cm cdrom-packages , ftp-packages
3955Links are now created during the
3956.Cm package
3957target.
3958.It Cm depends-list
3959Renamed into
3960.Cm full-build-depends .
3961.It Cm describe
3962Prints a one-line index entry of the port.
3963.Cm dump-vars
3964provides much more accurate information, and the indexing role
3965has been taken over by the
3966.Pa sqlports
3967and
3968.Pa portslist
3969packages.
3970.It Cm {build,run,lib}-depends
3971The dependency mechanism now meshes
3972.Ev BUILD_DEPENDS , LIB_DEPENDS , RUN_DEPENDS, WANTLIB
3973and
3974.Ev MULTI_PACKAGES .
3975Refer to
3976.Cm prepare , install-depends , test-depends .
3977.It Cm {pre,do}-extract
3978Don't override.
3979Set
3980.Ev EXTRACT_ONLY
3981to nothing and override
3982.Cm post-extract
3983instead.
3984.It Cm {pre,do,post}-fetch
3985These prevented bulk mechanisms from running properly.
3986.It Cm {pre,do,post}-package
3987There is no port that requires special treatment during packaging,
3988as
3989.Cm {pre,do,post}-install
3990should take care of every necessity.
3991.It Cm fetch-list , mirror-distfiles , fetch-makefile , mirror-maker , mirror-maker-fetch
3992Use
3993.Cm dpb Fl F
3994instead, see
3995.Xr mirroring-ports 7 .
3996.It Cm obj
3997Starting with
3998.Ox 3.3 ,
3999using
4000.Ev WRKOBJDIR
4001no longer creates a symlink between the current directory and
4002a subdirectory of ${WRKOBJDIR}, so
4003.Cm obj
4004is no longer applicable.
4005.It Cm print-depends
4006Use
4007.Cm print-build-depends
4008and
4009.Cm print-run-depends
4010instead.
4011.It Cm print-depends-list
4012Renamed into
4013.Cm print-build-depends .
4014.It Cm print-package-depends
4015Renamed into
4016.Cm print-run-depends .
4017.It Cm print-package-signature
4018Renamed into
4019.Cm print-update-signature .
4020.It Cm readme , readmes
4021replaced by the
4022.Pa databases/ports-readmes
4023port, using the Template Toolkit
4024.Po
4025.Pa textproc/p5-Template
4026.Pc
4027instead of hand-coded substitutions.
4028.El
4029.Sh OBSOLETE VARIABLES
4030.Bl -tag -width Ds
4031.It Ev BIN_PACKAGES
4032Old user settings.
4033The infrastructure always trusts the repository to contain correct packages.
4034So, if the package name did not change and if it exists in the repository,
4035it will not be rebuilt without manual user action.
4036.It Ev CATn
4037List of formatted manpages, per section.
4038.It Ev CATPREFIX
4039Location for storing formatted manpages.
4040Derived directly from
4041.Ev PREFIX .
4042.It Ev CDROM_PACKAGES
4043Old user settings.
4044Base location where packages suitable for a CD-ROM (see
4045PERMIT_PACKAGE_CDROM) will be placed.
4046Now hardwired to
4047.Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cdrom .
4048.It Ev COMMENT
4049Used to be the name of the comment file for a package.
4050It now holds the comment itself.
4051Some magic has been put in to allow for a seamless transition.
4052.It Ev CONFIGURE_SHARED
4053Used to default to --enable-shared or --disable-shared, depending on whether
4054the architecture supported shared libraries.
4055.It Ev DESCR_SRC
4056From
4057.Nx .
4058This is DESCR.
4059.Ox
4060does not give a specific name to the generated file.
4061It is not recommended to try to access it directly.
4062.It Ev EXTRACT_AFTER_ARGS
4063Was used to cobble together the normal extraction command, as
4064${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${EXTRACT_AFTER_ARGS}.
4065Use
4066.Ev EXTRACT_CASES
4067instead.
4068.It Ev EXTRACT_BEFORE_ARGS
4069Likewise, use
4070.Ev EXTRACT_CASES
4071instead.
4072.It Ev EXTRACT_CMD
4073Likewise, use
4074.Ev EXTRACT_CASES
4075instead.
4076.It Ev FETCH_BEFORE_ARGS , FETCH_AFTER_ARGS
4077Set
4078.Ev FETCH_CMD
4079to point to a script that does any required special treatment instead.
4080.It Ev FETCH_DEPENDS
4081Used to specify dependencies that were needed to fetch files.
4082It is much easier to mirror locally weird distribution files.
4083.It Ev FTP_PACKAGES
4084User settings.
4085Base location where packages suitable for FTP (see
4086PERMIT_PACKAGE_FTP) will be placed.
4087Now hardwired to
4088.Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp .
4089.It Ev GNU_CONFIGURE
4090Use
4091.Ev CONFIGURE_STYLE
4092instead.
4093.It Ev HAS_CONFIGURE
4094Use
4095.Ev CONFIGURE_STYLE
4096instead.
4097.It Ev IGNOREFILES
4098Set to the list of files that can't be checksummed.
4099All uses of it have led to postponing the correct action: talking
4100to the software author and getting him to provide versioned archives.
4101.It Ev MANn
4102List of unformatted manpages, per section.
4103.It Ev MANPREFIX
4104Location for storing unformatted manpages.
4105Derived directly from
4106.Ev PREFIX .
4107.It Ev MASTERDIR
4108From
4109.Fx .
4110Used to organize a collection of ports that share most files.
4111.Ox
4112uses a single port with flavors or multi-packages to produce
4113package variations instead.
4114.It Ev MASTER_SITE_SUBDIR
4115Contents were used to replace
4116.Sq %SUBDIR%
4117in all
4118.Ev MASTER_SITES
4119variables.
4120Since
4121.Sq %SUBDIR%
4122almost always occur at the end of the directory,
4123the simpler
4124.Li ${VARIABLE:=subdir/}
4125construct is now used instead
4126.Po
4127taken from
4128.Nx
4129.Pc .
4130.It Ev MD5_FILE
4131Use
4132.Ev CHECKSUM_FILE
4133instead.
4134.It Ev MIRROR_DISTFILE
4135Use
4136.Ev PERMIT_DISTFILES_FTP
4137to determine which files can be mirrored instead.
4138See
4139.Xr mirroring-ports 7 .
4140.It Ev NEED_VERSION
4141Used to set a requirement on a specific revision of
4142.Nm
4143needed by a port.
4144No longer needed as
4145.Nm
4146should always be kept up to date.
4147.It Ev NO_CONFIGURE
4148If ${CONFIGURE_SCRIPT} does not exist, no automatic configuration will
4149be done anyway.
4150.It Ev NO_DESCRIBE
4151All ports should generate a description.
4152.It Ev NO_EXTRACT
4153Set EXTRACT_ONLY= instead.
4154.It Ev NO_INSTALL_MANPAGES
4155Use
4156.Ev CONFIGURE_STYLE
4157instead.
4158.It Ev NO_MTREE
4159Starting with
4160.Ox 2.7 ,
4161the operating system installation script runs the /usr/local specification
4162globally, instead of embedding it in each package.
4163So packages no longer record an
4164.Xr mtree 8
4165specification.
4166Use an explicit
4167.Sq @exec
4168command if needed.
4169.It Ev NO_PACKAGE
4170All ports should generate a package, preferably before install.
4171.It Ev NO_PATCH
4172The absence of a patches directory does the same.
4173Use PATCHDIR and PATCH_LIST if patches need to be changed dynamically.
4174.It Ev NO_SHARED_ARCHS
4175Used to be set to the list of platforms that did not support shared libraries.
4176No such architectures remain.
4177.It Ev NO_SHARED_LIBS
4178Used to be set to
4179.Sq Yes
4180if platform did not support shared libraries.
4181.It Ev NO_WRKDIR
4182All ports should have a working directory, as this is necessary to store
4183cookies and keep state.
4184.It Ev NO_WRKSUBDIR
4185The same functionality is obtained by setting WRKDIST=${WRKDIR}.
4186.It Ev NOCLEANDEPENDS
4187Use CLEANDEPENDS instead.
4188.It Ev NOMANCOMPRESS
4189.Fx
4190ships with compressed man pages, and uses this variable to control
4191that behavior.
4192.It Ev OBJMACHINE
4193Starting with
4194.Ox 3.3 ,
4195setting
4196.Ev WRKOBJDIR
4197creates the whole
4198.Ev WRKDIR
4199hierarchy under ${WRKOBJDIR}, so
4200.Ev OBJMACHINE
4201is no longer useful.
4202.It Ev OLD_WRKDIR_NAME
4203Used to be a base name for
4204.Ev WRKDIR
4205in the old scheme without
4206.Ev WRKOBJDIR .
4207.It Ev OPSYS
4208The operating system.
4209This ports tree is only used on
4210.Ox .
4211.It Ev OPSYS_VER
4212Use
4213.Ev OSREV
4214instead.
4215.It Ev PACKAGES
4216Base location for packages built, everything is based on
4217.Ev PACKAGE_REPOSITORY
4218now.
4219.It Ev PACKAGING
4220Used to be set during package creation, so that the port would test it
4221to tweak some settings at this point.
4222All its effects are now achieved through
4223.Ev MULTI_PACKAGES .
4224.It Ev PATCH_SITES
4225.Ev PATCHFILES
4226used to be retrieved from a separate site list.
4227For greater flexibility, all files are now retrieved from
4228.Ev MASTER_SITES ,
4229.Ev MASTER_SITES0 , ... ,
4230.Ev MASTER_SITES9 ,
4231using a
4232.Sq :0
4233to
4234.Sq :9
4235extension to the file name, e.g.,
4236.Bd -literal -offset indent
4237PATCHFILES=foo.diff.gz
4238PATCH_SITES=ftp://ftp.zoinx.org/pub/
4239.Ed
4240.Pp
4241becomes
4242.Bd -literal -offset indent
4243PATCHFILES=foo.diff.gz:0
4244MASTER_SITES0=ftp://ftp.zoinx.org/pub/
4245.Ed
4246.It Ev PERMIT_DISTFILES_CDROM
4247The
4248.Ox
4249project does not ship distfiles on cdrom.
4250Concentrate on real questions instead, make sure
4251.Ev PERMIT_PACKAGE_CDROM
4252is set correctly.
4253.It Ev PKG_CMD
4254Replaced by
4255.Ev PKG_CREATE .
4256.It Ev PKGREPOSITORY
4257Old user settings.
4258See
4259.Ev PACKAGE_REPOSITORY .
4260.It Ev PKGREPOSITORYBASE
4261Old user settings.
4262See
4263.Ev PACKAGE_REPOSITORY .
4264.It Ev PLIST_SRC
4265From
4266.Nx .
4267This is PLIST.
4268.Ox
4269does not give a specific name to the generated file.
4270It is not recommended to try to access them directly.
4271.It Ev PKGNAME
4272Used to refer to the full package name, has been superseded by
4273.Ev FULLPKGNAME-foo ,
4274for
4275.Ev SUBPACKAGE
4276-foo.
4277.Ev PKGNAME
4278now holds the package name, not taking multi-packages or flavors
4279into account.
4280Most ports are not concerned by this change.
4281.It Ev PLIST_SUBST
4282From
4283.Nx
4284and
4285.Fx .
4286Use SUBST_VARS instead.
4287.Ox
4288does not allow general substitutions of the form VAR=value, but uses
4289only a list of variables instead.
4290Most package files gets transformed, instead of only the packing list.
4291.It Ev PREFERRED_CIPHERS
4292Allowing user change of cryptographic digest is dangerous.
4293.It Ev RECURSIVE_FETCH_LIST
4294No longer needed with modern
4295.Xr mirroring-ports 7 .
4296.It Ev RESTRICTED
4297Port has cryptographic issues.
4298.Ox
4299focuses on
4300.Ev PERMIT_PACKAGE_{FTP,CDROM}
4301instead.
4302.It Ev SED_PLIST
4303Old pipeline for creating packing-lists at the ports level.
4304Necessary functionality has been integrated directly into
4305.Xr pkg_create 1 .
4306.It Ev SIGNING_PARAMETERS
4307Old user settings.
4308There is no longer any benefit to signing packages during creation.
4309.It Ev SCRIPTDIR
4310Old location for scripts related to the current port.
4311There is no reason for the semantic distinction, use
4312.Ev FILESDIR
4313for those.
4314.It Ev SCRIPTS_ENV
4315Used to contain the environment for invoking various scripts.
4316.Ev CONFIGURE_ENV
4317and
4318.Ev MAKE_ENV
4319are enough.
4320.It Ev SHARED_ONLY
4321Had to be set to
4322.Sq Yes
4323if port could only be built on architectures with shared libraries.
4324.It Ev USE_AUTOCONF
4325Use
4326.Ev CONFIGURE_STYLE
4327instead.
4328.It Ev USE_BZIP2
4329The framework will automatically detect the presence of
4330.Pa .tar.bz2
4331files to extract.
4332See also
4333.Ev BZIP2 , EXTRACT_CASES ,
4334and
4335.Ev EXTRACT_SUFX .
4336.It Ev USE_IMAKE
4337Use
4338.Ev CONFIGURE_STYLE
4339instead.
4340.It Ev USE_ZIP
4341The framework will automatically detect the presence of
4342.Pa .zip
4343files to extract.
4344See also
4345.Ev ZIP , EXTRACT_CASES ,
4346and
4347.Ev EXTRACT_SUFX .
4348.It Ev VARNAME
4349Use make show=name instead of make show VARNAME=name.
4350.It Ev WRKPKG
4351Directory used to build package information from the templates under
4352.Pa ${PKGDIR} .
4353This information is now built on the fly by
4354.Xr pkg_create 1 .
4355.El
4356.Sh OBSOLETE FILES
4357.Bl -tag -width Ds
4358.It Pa {files,patches,pkg}.${ARCH}
4359Offensive to introspection, makes it impossible to build a decent sqlports
4360on a given arch.
4361Hasn't been used for a long time, and there are lots of mechanisms such as
4362.Ev PKG_ARGS
4363and fragment substitution, or
4364.Ev PATCH_LIST
4365to achieve similar results.
4366.It Pa Makefile.${ARCH}
4367Likewise, offensive to introspection too.
4368.It Pa ${FILESDIR}/md5
4369Renamed to
4370.Pa distinfo
4371to match other
4372.Bx ,
4373and save directories.
4374.It Pa ${SCRIPTDIR}/{pre,do,post}-*
4375Identical functionality can be obtained through a
4376.Cm {pre,do,post}-*
4377target, invoking the script manually if necessary.
4378.It Pa ${SCRIPTDIR}/configure
4379No longer invoked automatically.
4380Just inline the instructions in
4381.Cm do-configure
4382in the Makefile, or put the script in ${FILESDIR} and
4383invoke it.
4384.It Pa ${PKGDIR}/COMMENT
4385Use COMMENT variable instead.
4386.It Pa ${PKGDIR}/DEINSTALL*
4387Use @unexec annotations in the packing-list instead.
4388.It Pa ${PKGDIR}/INSTALL*
4389Use @exec annotations in the packing-list instead.
4390.It Pa ${PKGDIR}/PLIST.{noshared,no-shared,shared}
4391Packaging list fragments to handle platforms that did not support
4392shared libraries.
4393.It Pa ${PKGDIR}/PLIST.sed
4394Use PLIST directly.
4395Until revision 1.295,
4396.Nm
4397did not substitute variables in the packing list unless this special form
4398was used.
4399.It Pa ${PKGDIR}/REQ*
4400Old requirement script.
4401Was mostly unused anyway.
4402.It Pa /usr/share/mk/bsd.port.mk
4403Original location of
4404.Nm .
4405The current file lives under
4406.Pa ${PORTSDIR}/infrastructure/mk/bsd.port.mk ,
4407whereas
4408.Pa /usr/share/mk/bsd.port.mk
4409is just a stub.
4410.It Pa {scripts,files,patches}.${OPSYS}
4411The
4412.Ox
4413ports tree focuses on robustness, not on being portable to other operating
4414systems.
4415In any case, portability should not need to depend on operating
4416system dependent patches.
4417.It Pa /usr/local/etc
4418Used by
4419.Fx
4420to marshall system configuration files.
4421All
4422.Ox
4423system configuration files are located in
4424.Pa /etc ,
4425or in a subdirectory of
4426.Pa /etc .
4427.El
4428.Sh SEE ALSO
4429.Xr ftp 1 ,
4430.Xr pkg_add 1 ,
4431.Xr pkg_create 1 ,
4432.Xr OpenBSD::Intro 3p ,
4433.Xr bsd.port.arch.mk 5 ,
4434.Xr mk.conf 5 ,
4435.Xr port-modules 5 ,
4436.Xr library-specs 7 ,
4437.Xr mirroring-ports 7 ,
4438.Xr packages-specs 7 ,
4439.Xr pkgpath 7 ,
4440.Xr ports 7
4441.Sh HISTORY
4442The ports mechanism originally came from
4443.Fx .
4444A lot of additions were taken from
4445.Nx
4446over the seminal years.
4447.Pp
4448Since 1998, the framework has been systematically cleaned-up and reorganized
4449to remove bugs.
4450New features have been carefully introduced, trying hard to avoid
4451inconsistencies.
4452.Pp
4453.Ev FLAVORS ,
4454.Ev MULTI_PACKAGES ,
4455.Ev SEPARATE_BUILD
4456and FAKE are
4457.Ox
4458improvements.
4459Most recent additions do not come from another
4460.Bx .
4461.\" Voluntarily undocumented:
4462.\" AUTOCONF_ENV: probably not needed anyway, should be internal.
4463.Sh BUGS AND LIMITATIONS
4464.Ev LOCALBASE ,
4465.Ev X11BASE ,
4466.Ev BASESYSCONFDIR ,
4467.Ev VARBASE
4468and
4469.Ev PREFIX
4470are not heeded consistently.
4471Using anything but the default values has not been heavily tested.
4472Some ports may not build if you change them.
4473