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