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