xref: /openbsd-src/share/man/man5/bsd.port.mk.5 (revision ed30dad480e71d1b8426e69090d8b579f7330c4a)
1.\" $OpenBSD: bsd.port.mk.5,v 1.545 2021/05/02 06:13:57 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: May 2 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=/tmp/obj
1774will affect only the mozilla 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_PROJECT
1929Name of the project on GitHub.
1930.It Ev GH_TAGNAME
1931Name of the tag to download.
1932Setting ${GH_TAGNAME} to master is invalid
1933and will throw an error.
1934${WRKDIST} is auto-generated based on the
1935${GH_TAGNAME} if specified, otherwise ${GH_COMMIT} will be used to generate
1936${WRKDIST}.
1937.It Ev GMAKE
1938Location of the GNU make binary, if needed.
1939Defaults to gmake.
1940.It Ev HOMEPAGE
1941URL to the homepage of the software, if applicable.
1942.It Ev IGNORE
1943For ignored ports, set to the reasons for which the port is ignored.
1944If non-empty, most common targets that do something (e.g.,
1945.Cm fetch ,
1946.Cm build ,
1947.Cm install No ... )
1948will be ignored.
1949See also
1950.Ev BATCH ,
1951.Ev BROKEN ,
1952.Ev FETCH_MANUALLY ,
1953.Ev IGNORE_IS_FATAL ,
1954.Ev IGNORE_SILENT ,
1955.Ev INTERACTIVE ,
1956.Ev IS_INTERACTIVE ,
1957.Ev NOT_FOR_ARCHS ,
1958.Ev NO_IGNORE ,
1959.Ev ONLY_FOR_ARCHS .
1960.It Ev IGNORE_IS_FATAL
1961User settings.
1962If set to
1963.Sq Yes ,
1964ignored ports will become fatal errors.
1965.It Ev IGNORE_SILENT
1966User settings.
1967If set to
1968.Sq Yes ,
1969do not print anything when ignoring a port.
1970.It Ev INSTALL_DEBUG_PACKAGES
1971User settings.
1972Defaults to
1973.Sq \&No .
1974If
1975.Sq Yes ,
1976install available debug packages during all install/update targets.
1977.It Ev INSTALL_{PROGRAM,SCRIPT,DATA,MAN}[_DIR]
1978Macros to use to install a program, a script, data, or a man page (or the
1979corresponding directory), respectively.
1980.It Ev INSTALL_TARGET
1981Target invoked to install the software, during fake installation.
1982Default is
1983.Sq install .
1984.It Ev INTERACTIVE
1985User settings.
1986Set to
1987.Sq Yes
1988to skip all non-interactive ports.
1989Used in conjunction with
1990.Ev BATCH
1991to simplify bulk-package builds.
1992.It Ev IS_INTERACTIVE
1993Set to
1994.Sq Yes
1995if port needs human interaction to build.
1996Porters should strive to minimize
1997.Ev IS_INTERACTIVE
1998ports, by using
1999.Ev FLAVORS
2000for multiple choice ports, and by postponing human intervention
2001to package installation time.
2002.It Ev LE_ARCHS
2003Set to the list of little-endian architectures.
2004Read-only.
2005Use with
2006.Ev NOT_FOR_ARCHS
2007and
2008.Ev ONLY_FOR_ARCHS .
2009.It Ev LIB_DEPENDS
2010List of packages used by a port for its library dependencies.
2011Each item has the form
2012.Sq [pkgspec:]pkgpath .
2013Similar to
2014.Ev BUILD_DEPENDS
2015and
2016.Ev RUN_DEPENDS ,
2017but with specific rules:
2018.Ev LIB_DEPENDS
2019always turn into
2020.Ev BUILD_DEPENDS
2021.Po
2022but see
2023.Sx FLAVORS AND MULTI PACKAGES
2024.Pc .
2025.Pp
2026.Ev LIB_DEPENDS
2027is also used as a run-time dependency, and recorded in the package as
2028such, if any of the libraries mentioned in
2029.Ev WANTLIB
2030is a shared library that originates within the dependent port.
2031.Pp
2032See
2033.Xr library-specs 7
2034for more details.
2035.It Ev lib_depends_args
2036Controls the behavior of
2037.Xr pkg_create 1
2038related targets, see
2039.Cm print-package-args
2040for details.
2041.It Ev LIBCXX
2042List of standard C++ libraries for the base compiler.
2043Read-only.
2044Use in
2045.Ev WANTLIB .
2046.It Ev LIBTOOL
2047Location of the libtool binary.
2048Default:
2049.Pa /usr/bin/libtool .
2050.It Ev LIBTOOL_FLAGS
2051Arguments to pass to libtool.
2052If USE_LIBTOOL is set, the environment variable LIBTOOL is set
2053to ${LIBTOOL} ${LIBTOOL_FLAGS}.
2054.It Ev LLD_EMUL
2055As
2056.Xr ld.lld 1
2057does not have a default emulation mode,
2058if it is the linker in-use,
2059.Ev LLD_EMUL
2060defaults to the correct option to set the emulation mode;
2061Otherwise, it stays empty.
2062Read-only.
2063Seldom used, as it is only needed to link binary data without using the
2064compiler.
2065.It Ev LLVM_ARCHS
2066Set to the list of architectures where LLVM/Clang could be used,
2067e.g., via lang/clang port module, see
2068.Xr port-modules 5 .
2069Read-only.
2070Use with
2071.Ev NOT_FOR_ARCHS
2072or
2073.Ev ONLY_FOR_ARCHS .
2074.It Ev LOCALBASE
2075where other ports have already been installed.
2076Default:
2077.Pa /usr/local .
2078.It Ev LOCALSTATEDIR
2079Location for this port's state directory, should always be derived
2080from
2081.Ev BASELOCALSTATEDIR ,
2082which defaults to
2083.Pa /var .
2084Passed to gnu configure scripts.
2085.It Ev LOCKDIR
2086User settings.
2087Defaults to
2088.Pa ${WRKOBJDIR}/locks .
2089If set, points to a local directory common for all instances of
2090concurrent ports builds.
2091.It Ev LOCK_CMD
2092Expands to a command that will acquire a lock, namely
2093.Xr portlock 1 .
2094See also
2095.Xr ports 7 .
2096.It Ev LOCK_VERBOSE
2097User settings.
2098Defaults to
2099.Sq \&No .
2100Set to
2101.Sq Yes
2102to show every acquire/release lock operation.
2103.It Ev LP64_ARCHS
2104Set to the list of 64-bit architectures.
2105Read-only.
2106Use with
2107.Ev NOT_FOR_ARCHS .
2108.It Ev MAINTAINER
2109Email address with full name of the port's maintainer.
2110Defaults to
2111.Mt ports@openbsd.org .
2112.It Ev MAKE_ENV
2113Environment variables passed to make invocations and tests.
2114Sets at least PATH, PREFIX, LOCALBASE, X11BASE, CFLAGS, TRUEPREFIX, DESTDIR,
2115and the BSD_INSTALL_* macros.
2116.It Ev MAKE_FLAGS
2117Flags used for all make invocations, except for the
2118.Cm fake
2119stage, which adds
2120.Ev FAKE_FLAGS
2121(see
2122.Ev ALL_FAKE_FLAGS )
2123and for the
2124.Cm test
2125stage, which adds
2126.Ev TEST_FLAGS
2127(see
2128.Ev ALL_TEST_FLAGS ) .
2129.It Ev MAKE_FILE
2130Name of the Makefile used for ports building.
2131Defaults to Makefile.
2132Used after changing directory to ${WRKBUILD}.
2133.It Ev MAKE_JOBS
2134Number of jobs to use when building the port, normally passed to
2135.Ev MAKE_PROGRAM
2136through
2137.Ev PARALLEL_MAKE_FLAGS .
2138Mostly set automatically when
2139.Ev DPB_PROPERTIES
2140contains
2141.Sq parallel .
2142.Pp
2143Note that
2144.Xr make 1
2145still has bugs that may prevent parallel build from working correctly!
2146.It Ev MAKE_PROGRAM
2147The make program that is used for building the port.
2148Set to ${MAKE} or ${GMAKE} depending on USE_GMAKE.
2149Read-only.
2150.It Ev MAKEFILE_LIST
2151Introspection variable, see
2152.Xr make 1 .
2153.It Ev MAKESUMFILES
2154List of all files that need to be retrieved by
2155.Cm fetch-all ,
2156with
2157.Ev DIST_SUBDIR
2158prepended and with master site selection extension removed.
2159Read-only.
2160See also
2161.Ev CHECKSUMFILES .
2162.It Ev MASTER_SITE_BACKUP
2163User settings.
2164List of sites to try after normal master sites.
2165Normally includes ${MASTER_SITE_OPENBSD} and ${MASTER_SITE_FREEBSD}.
2166.It Ev MASTER_SITE_*
2167Lists of standard sites to retrieve files from, refer to
2168.Pa ${PORTSDIR}/infrastructure/db/network.conf .
2169.It Ev MASTER_SITES
2170List of primary locations from which distribution files and patchfiles are
2171retrieved.
2172See the
2173.Cm fetch
2174target for details.
2175Defaults to ${MASTER_SITES_GITHUB} for GitHub-hosted projects,
2176see
2177.Ev GH_* .
2178See
2179.Xr ports 7
2180for user configuration.
2181.It Ev MASTER_SITES0 , ... , MASTER_SITES9
2182Supplementary locations from which distribution files and patchfiles are
2183retrieved.
2184.It Ev MESSAGE
2185File recorded in the package and displayed during installation.
2186Defaults to ${PKGDIR}/MESSAGE if this file exists.
2187Leave empty if no message is needed.
2188.It Ev MISSING_FILES
2189When
2190.Ev FETCH_MANUALLY
2191is set,
2192.Ev MISSING_FILES
2193will contain the list of missing distfiles or patchfiles that need to
2194be fetched manually.
2195Read-only.
2196.It Ev MTREE_FILE
2197.Xr mtree 8
2198specification used during
2199.Ar fake .
2200Replaced by direct use of
2201.Xr mkdir 1
2202now that
2203.Ar fake
2204no longer happens as root.
2205.It Ev MODGNU_CONFIG_GUESS_DIRS
2206If a port uses config.guess outside WRKSRC, the directories
2207containing the other copies must be set here.
2208.It Ev MODPERL_ADJ_FILES
2209If any files have a Perl shebang line, which needs to be replaced
2210with
2211.Dq #!/usr/bin/perl ,
2212list them in
2213.Ev MODPERL_ADJ_FILES .
2214File paths here should be relative to
2215.Ev WRKSRC .
2216These files are patched automatically at the end of
2217.Cm pre-configure .
2218.It Ev MODPERL_BIN_ADJ
2219Shell fragment to patch the Perl interpreter path in executable scripts.
2220Used by
2221.Ev MODPERL_ADJ_FILES .
2222.It Ev MODPERL_BUILD_TARGET
2223Normal content of
2224.Cm do-build
2225when
2226.Ev CONFIGURE_STYLE
2227uses perl.
2228Provided as a separate variable if a port wants to override
2229.Cm do-build
2230for its own reasons.
2231.It Ev MODPERL_INSTALL_TARGET
2232Likewise for
2233.Cm do-install .
2234.It Ev MODPERL_TEST_TARGET
2235Likewise for
2236.Cm do-test .
2237.It Ev MODULES
2238External modules mechanism, documented separately.
2239Modules such as
2240.Sq imake
2241and
2242.Sq gnu
2243are normally included automatically with the right
2244.Ev CONFIGURE_STYLE .
2245Note that it is possible to
2246.Li CONFIGURE_STYLE = simple ,
2247.Li MODULES += gnu
2248to just get the effects of
2249.Ev CONFIG_SITE
2250and
2251.Ev MODGNU_CONFIG_GUESS_DIRS
2252along with the default
2253.Ev TEST_TARGET ,
2254in case the normal GNU configure script was wrapped in a separate script that
2255takes different arguments.
2256See
2257.Xr port-modules 5 .
2258.It Ev MULTI_PACKAGES
2259Set to a list of subpackage extensions for ports that create multiple packages.
2260See
2261.Sx FLAVORS AND MULTI_PACKAGES
2262below.
2263Especially read the part about
2264.Ev ONLY_FOR_ARCHS
2265when some of the packages only exist for some architectures.
2266.It NO_ARCH
2267Location for arch-independent packages.
2268Defaults to
2269.Sq no-arch .
2270Normally, packages are generated under ${PACKAGE_REPOSITORY}/${MACHINE_ARCH},
2271except for packages where PKG_ARCH=*, which end up under
2272${PACKAGE_REPOSITORY}/${NO_ARCH}.
2273.It Ev NOT_FOR_ARCHS
2274List of architectures on which this port does not build.
2275See also
2276.Ev ONLY_FOR_ARCHS .
2277.It Ev NO_BUILD
2278Set to
2279.Sq Yes
2280if port does not need any build stage.
2281.It Ev NO_CCACHE
2282Set to
2283.Sq Yes
2284to prevent ccache from being used when building a certain port,
2285even when
2286.Ev USE_CCACHE
2287is set.
2288.It Ev NO_CHECKSUM
2289Set to
2290.Sq Yes
2291by
2292.Xr dpb 1
2293to avoid
2294.Cm checksum
2295entirely,
2296as
2297.Xr dpb 1
2298already deals with checksums internally.
2299.It Ev NO_DEPENDS
2300User settings.
2301Don't verify build of dependencies.
2302Do not use in any ports Makefile.
2303This is only meant as a user convenience when, e.g., you just want to browse
2304through a given port's source and do not wish to trigger the build of
2305dependencies.
2306.It Ev NO_IGNORE
2307User settings.
2308If set to
2309.Sq Yes ,
2310avoid ignoring a port for the usual reasons.
2311Use, for instance, for fetching all distribution files, or for fixing a
2312broken port.
2313See also
2314.Ev IGNORE
2315and
2316.Ev TRY_BROKEN .
2317.It Ev NO_TEST
2318Port does not have any regression tests.
2319Only set to
2320.Sq Yes
2321for ports with no regression test.
2322It should be left alone for ports with empty regression tests, and for
2323ports with failing tests.
2324That way, if a subsequent update of a port acquires actual regression tests,
2325they will be picked up automatically.
2326.It Ev ONLY_FOR_ARCHS
2327List of architectures on which this port builds.
2328Can hold both processor-specific information (e.g., powerpc), and more
2329specific model information (e.g., macppc).
2330This is subpackage dependent.
2331Read the corresponding part of
2332.Sx FLAVORS AND MULTI_PACKAGES
2333if some subpackages should only be built on some architectures.
2334.It Ev OSREV
2335Revision number of
2336.Ox .
2337Read-only.
2338.It Ev PACKAGE_REPOSITORY
2339User settings.
2340Location for built packages.
2341Defaults to
2342.Pa ${PORTSDIR}/packages .
2343See
2344.Cm package
2345for details.
2346.It Ev PARALLEL_MAKE_FLAGS
2347Used when
2348.Ev DPB_PROPERTIES
2349contains
2350.Sq parallel .
2351Flags to pass to
2352.Ev MAKE_PROGRAM
2353to yield a parallel build.
2354Defaults to
2355.Li -j${MAKE_JOBS} .
2356Mostly set to empty by ports that use other mechanisms for setting the number
2357of jobs.
2358.It Ev PARALLEL_MAKE_JOBS
2359User settings.
2360Value of
2361.Ev MAKE_JOBS
2362to use when building manually a port with
2363.Ev DPB_PROPERTIES
2364containing
2365.Sq parallel .
2366Defaults to the number of online cpus.
2367.It Ev PATCH
2368Command to use to apply all patches.
2369Defaults to
2370.Pa /usr/bin/patch .
2371.It Ev PATCHORIG
2372Suffix used by
2373.Cm patch
2374to rename original files, and
2375.Cm update-patches
2376to re-generate
2377.Pa ${PATCHDIR}/${PATCH_LIST}
2378by looking for files using this suffix.
2379Defaults to
2380.Pa .orig .
2381For a port that already contains
2382.Pa .orig
2383files in the ${DISTFILES},
2384set this to something else, such as
2385.Pa .pat.orig .
2386See also
2387.Cm distpatch ,
2388.Ev DISTORIG .
2389.It Ev PATCH_CASES
2390In the normal
2391.Cm distpatch
2392stage (when
2393.Ev PATCHFILES
2394is not empty), this is the contents of a case statement, used to apply
2395distribution patches.
2396Fragments are automatically appended to handle gzip'ed, bzip'ed and lzip'ed
2397patches, so that the default case is more or less equivalent to the following
2398shell fragment:
2399.Bd -literal
2400set -e
2401cd ${FULLDISTDIR}
2402for patchfile in ${_LIST_PATCHFILES}
2403do
2404    case $$patchfile in
2405	*.bz2)
2406	  bzip2 -dc $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
2407	*.lz)
2408	  lunzip -c $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
2409	*.Z|*.gz)
2410	  gzcat $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
2411	*)
2412	  ${PATCH} ${PATCH_DIST_ARGS} <$$patchfile;;
2413    esac
2414done
2415.Ed
2416.It Ev PATCHDIR
2417Location for patches applied by the
2418.Cm patch
2419target.
2420Default:
2421.Pa patches .
2422.It Ev PATCHFILES
2423Files to fetch from the master sites like
2424.Ev DISTFILES ,
2425but serving a different purpose, as they hold distribution patches that
2426will be applied at the
2427.Cm patch
2428stage.
2429See also
2430.Ev SUPDISTFILES .
2431.It Ev PATCH_ARGS
2432Full list of options used while applying port's patches.
2433.It Ev PATCH_CHECK_ONLY
2434Set to
2435.Sq Yes
2436by the
2437.Cm checkpatch
2438target.
2439Don't touch unless the default
2440.Cm checkpatch
2441target needs to be redefined.
2442Ideally, user-defined patch subtargets ought to test checkpatch.
2443In practice, they don't.
2444.It Ev PATCH_DEBUG
2445If set to
2446.Sq Yes ,
2447the
2448.Cm patch
2449stage will output extra debug information.
2450This is the default.
2451.It Ev PATCH_DIST_ARGS
2452Full list of options used while applying distribution patches.
2453.It Ev PATCH_DIST_STRIP
2454Patch option used to strip directory levels while applying distribution
2455patches.
2456Defaults to -p0.
2457.It Ev PATCH_LIST
2458Wildcard pattern of patches to select under ${PATCHDIR}.
2459Defaults to patch-*.
2460Note that filenames ending in .orig, or ~ are never applied.
2461Note that
2462.Ev PATCH_LIST
2463can hold absolute pathnames, for instance to share patches among similar
2464ports:
2465.Bd -literal
2466PATCH_LIST=${PORTSDIR}/x11/kde/libs2/patches/p-* patch-*
2467.Ed
2468.It Ev PATCH_STRIP
2469Patch option used to strip directory levels while applying port's patches.
2470Defaults to -p0.
2471.It Ev PERMIT_DISTFILES , PERMIT_PACKAGE
2472Set to
2473.Sq Yes
2474if the distribution files or the package can be allowed on FTP sites without
2475legal issues.
2476Set to reason not to otherwise.
2477PERMIT_* lines in the Makefile should be preceded with a comment explaining
2478details about licensing and patents issues the port may have.
2479Porters must be very thorough in their checks.
2480In case of doubt, ask.
2481.Pp
2482If
2483.Ev PERMIT_PACKAGE
2484is set to
2485.Sq Yes ,
2486.Ev PERMIT_DISTFILES
2487will default to
2488.Sq Yes .
2489.It Ev PKG_ADD
2490User settings.
2491Path to
2492.Xr pkg_add 1
2493command, with possible options.
2494.It Ev PKG_ARCH
2495Comma-separated list of architectures on which this package may install.
2496Defaults to ${MACHINE_ARCH},${ARCH}.
2497Use * for arch-independent packages.
2498.It Ev PKG_ARGS
2499Special arguments to pass to
2500.Xr pkg_create 1 ,
2501in addition to the default ones.
2502For mips64 and pic libraries, see
2503.Sx THE GENERATION OF PACKAGE INFORMATION .
2504.It Ev PKG_CREATE
2505User settings.
2506Path to
2507.Xr pkg_create 1
2508command, with possible options.
2509.It Ev PKG_CREATE_NO_CHECKS
2510Porters switch.
2511Set to
2512.Sq Yes
2513to avoid checking the ports tree when solving
2514.Ev WANTLIB
2515.Po
2516see
2517.Cm wantlib-args
2518.Pc .
2519May result in bogus packages that mix
2520.Cm @depends
2521lines obtained from
2522the ports tree with
2523.Cm @wantlib
2524lines that come from the installed system.
2525Set to
2526.Sq Warn
2527to have the differences printed as a warning instead of an error
2528.Po
2529the default
2530.Pc .
2531.It Ev PKG_DBDIR
2532User settings.
2533Path to package installation records.
2534Defaults to
2535.Pa /var/db/pkg .
2536.It Ev PKG_DELETE
2537User settings.
2538Path to
2539.Xr pkg_delete 1
2540command, with possible options.
2541.It Ev PKG_INFO
2542User settings.
2543Path to
2544.Xr pkg_info 1
2545command, with possible options.
2546.It Ev PKG_TMPDIR
2547See
2548.Xr pkg_add 1 .
2549Normally points to
2550.Pa /var/tmp ,
2551as per default.
2552.It Ev PORTHOME
2553Setting of env variable
2554.Ev HOME
2555for most shell invocations.
2556Default will trip ports that try to write into $HOME while building.
2557.It Ev PORTPATH
2558Path used by most shell invocations.
2559Don't override unless really needed.
2560.It Ev PORTSDIR
2561Root of the ports tree (default:
2562.Pa /usr/ports ) .
2563.It Ev PORTSDIR_PATH
2564Path used by dependencies and
2565.Pa bsd.port.subdir.mk
2566to look up package specifications.
2567Defaults to
2568.Pa ${PORTSDIR}:${PORTSDIR}/mystuff .
2569.It Ev PORTS_PRIVSEP
2570If set to
2571.Sq Yes ,
2572will build ports as
2573.Ev BUILD_USER
2574and fetch distfiles
2575as
2576.Ev FETCH_USER .
2577.Pp
2578To work fully, this does require the ports tree
2579to be world-readable, and
2580.Pa ${WRKDIR}
2581to be world-readable as well
2582.Po
2583.Cm update-patches
2584and friends won't work otherwise
2585.Pc .
2586.Pp
2587Meant to use in concert with
2588.Xr dpb 1 ,
2589which uses the same permissions
2590.Po
2591see
2592.Sq THE SECURITY MODEL OF DPB
2593in
2594.Xr dpb 1
2595.Pc .
2596.Pp
2597Basically,
2598.Ev BUILD_USER
2599must be able to write into
2600.Pa ${WRKOBJDIR} , ${PACKAGE_REPOSITORY} , ${PLIST_REPOSITORY}
2601and
2602.Ev FETCH_USER
2603must be able to write into
2604.Pa ${DISTDIR} .
2605The directories and permissions can be set correctly using
2606.Cm fix-permissions .
2607.Pp
2608The regular user must be allowed to execute commands as
2609.Ev BUILD_USER
2610and
2611.Ev FETCH_USER .
2612Running commands as another user can be achieved with
2613.Xr doas 1
2614by setting
2615.Ev SUDO=doas
2616in
2617.Xr mk.conf 5
2618and using the following minimal
2619.Xr doas.conf 5 :
2620.Bd -literal -offset indent
2621permit keepenv nopass solene as _pbuild
2622permit keepenv nopass solene as _pfetch
2623.Ed
2624.Pp
2625It is reasonably safe to allow your user id to run commands as the
2626.Ev BUILD_USER
2627or
2628.Ev FETCH_USER
2629and using
2630.Ic nopass
2631for these can save a lot of password entry, however it is inadvisable
2632to allow commands like
2633.Xr pkg_add 1
2634to run as root without a password.
2635.Pp
2636Note that this also means that
2637.Xr doas 1
2638must be configured to work within the chroot
2639created by
2640.Xr proot 1 .
2641.Pp
2642As
2643.Xr dpb 1
2644does its own privilege dropping when run as root,
2645it will automatically override
2646.Ev PORTS_PRIVSEP .
2647.Pp
2648User settings, defaults to
2649.Sq \&No .
2650.It Ev PKGDIR
2651Location for packaging information (packing list, port description, messages).
2652.Cm update-plist
2653may create it.
2654Must be a valid directory.
2655Default: pkg.
2656.It Ev PKGFILE
2657Full path to the created package for the given subpackage.
2658Read-only.
2659.It Ev PKGFILES
2660Full path to all created packages.
2661Read-only.
2662.It Ev PKGNAME
2663Name of the created package.
2664Default is ${DISTNAME}.
2665This does not take flavors into account.
2666See
2667.Ev FULLPKGNAME
2668for that.
2669Specific revisions and epoch changes should be
2670handled by
2671.Ev REVISION
2672and
2673.Ev EPOCH
2674instead.
2675.It Ev PKGNAMES
2676Read-only.
2677List of all package names generated by the port, with
2678.Ev FLAVORS
2679and
2680.Ev BUILD_PACKAGES
2681taken into account.
2682Mostly used as
2683.Ql make show=PKGNAMES
2684to verify that bumped package names are correct.
2685.It Ev PKGNAME-foo
2686Package name for sub-package foo, if the default value
2687of ${PKGNAME}${SUBPACKAGE} is not appropriate.
2688.It Ev PKGPATH
2689Path to the current port's directory, relative to ${PORTSDIR}.
2690Read-only.
2691.It Ev PKGPATHS
2692Read-only.
2693List of all package paths generated by the port, with
2694.Ev FLAVORS
2695and
2696.Ev MULTI_PACKAGES
2697taken into account.
2698Order matches
2699.Ev PKGNAMES
2700exactly.
2701.It Ev PKGSPEC
2702Default package spec for using this port as a dependency.
2703Defaults to
2704.Sq stem-* ,
2705derived from the
2706.Ev FULLPKGNAME .
2707Do not override without very good reasons,
2708namely software that coexist as different incompatible versions with the
2709same stem, e.g., already a mess.
2710.It Ev PKGSTEM
2711Base for the package name without any version number.
2712Used in
2713.Pa READMEs
2714file names and actual contents, can be overridden for ports
2715with branches, like php, e.g.,
2716.Li PKGSTEM-main = php-5.6
2717.It Ev PLIST_DB
2718Deprecated, see
2719.Ev PLIST_REPOSITORY .
2720.It Ev PLIST_REPOSITORY
2721User settings.
2722Base directory used to save generated packing-lists, as persistent information.
2723Packing-lists are processed by a script,
2724.Xr register-plist 1 ,
2725which complains when packing-lists change without a
2726.Ev REVISION
2727bump.
2728It also knows enough about package version numbers when something in the
2729package or its dependencies goes backward, thus catching
2730.Ev EPOCH
2731issues.
2732This directory is never cleaned during normal operation.
2733.Ql make clean=plist
2734should only ever be used during debugging by port maintainers.
2735Defaults to
2736.Pa ${PORTSDIR}/plist
2737.Po
2738plists actually get saved into
2739.Pa ${PLIST_REPOSITORY}/${MACHINE_ARCH}
2740.Pc .
2741If set to empty, will not register anything: very much unsafe.
2742.It Ev PORTS_BUILD_XENOCARA_TOO
2743EXPERIMENTAL.
2744Set to
2745.Sq Yes
2746to build xenocara through ports.
2747This is highly experimental and not recommended.
2748.It Ev PORTROACH
2749Controls the behavior of
2750.Pa misc/portroach
2751as documented in detail at
2752.Lk http://jasperla.github.io/portroach/docs/portroach-portconfig.txt .
2753.It Ev PREFIX
2754Base directory for the current port installation.
2755Usually ${LOCALBASE}, though some ports may elect a location under
2756.Pa ${VARBASE} ,
2757and some multi-package ports may install under several locations.
2758Additionally, firmware files generally install under
2759.Pa ${BASESYSCONFDIR} .
2760.It Ev PREPARE_CHECK_ONLY
2761Build settings.
2762Prevent the
2763.Cm prepare
2764stage from installing anything, let it just check dependencies, and
2765handle [:target] dependencies.
2766Mostly used by
2767.Xr dpb 1 ,
2768which already installs everything before running
2769.Cm prepare .
2770.It Ev PROGRESS_METER
2771User settings.
2772Defaults to
2773.Sq Yes .
2774Forces commands like
2775.Xr ftp 1
2776and
2777.Xr pkg_create 1
2778to use their progress-meter even in the absence of a terminal.
2779.It Ev PROPERTIES
2780List of properties specific to a given machine architecture.
2781Most often obtained through
2782.Xr bsd.port.arch.mk 5 .
2783These can be checked like this
2784.Bd -literal -offset indent
2785\&.include <bsd.port.arch.mk>
2786\&.if ${PROPERTIES:Mapm}
2787# then add build options specific to apm arches
2788\&...
2789\&.if !${PROPERTIES:Mlp64}
2790# build options specific to lp32 arches
2791\&...
2792.Ed
2793For
2794.Ev MULTI_PACKAGES
2795setup, use of
2796.Ev ONLY_FOR_ARCHS-sub
2797and
2798.Ev BUILD_PACKAGES
2799is generally preferred (and simpler).
2800Possible properties include
2801.Bl -tag -width mono
2802.It apm
2803architecture possesses suspend (apm) support.
2804.It be
2805architecture is big-endian.
2806.It gccN
2807gccN architecture.
2808.It le
2809architecture is little-endian.
2810.It lp64
2811lp64 architecture.
2812.It llvm
2813there is
2814.Pa lang/llvm
2815support on this architecture.
2816.It mono
2817there is
2818.Pa lang/mono
2819support on this architecture.
2820.El
2821.It Ev PSEUDO_FLAVOR
2822List of flavors in
2823.Ev FLAVOR
2824that are actually pseudo-flavors.
2825Only for introspection purposes.
2826Read-only.
2827.It Ev PSEUDO_FLAVORS
2828Extra list of flavors that do not register in package names, but are still
2829used to control build logic, and work directory names.
2830Its only use should be for disabling part of a multi-packages build,
2831for instance:
2832.Bd -literal
2833FLAVOR=no_gnome make package
2834.Ed
2835.Pp
2836Pseudo-flavors should be named as
2837.Sq no_something
2838to disable the build of subpackage
2839.Sq -something
2840.Po
2841and possibly some others, by restricting
2842.Ev BUILD_PACKAGES
2843.Pc .
2844Pseudo-flavors should always be handled through
2845.Xr bsd.port.arch.mk 5 .
2846A pseudo-flavor can remove several subpackages through the following
2847construct.
2848.Bd -literal -offset indent
2849# pseudo-flavor no_gui will also remove gtk and gtk3
2850MULTI_PACKAGES = -main -gtk -gtk3 -gui
2851# ...
2852\&.include <bsd.port.arch.mk>
2853
2854# remove extra build components
2855\&.if !${BUILD_PACKAGES:M-gui}
2856BUILD_PACKAGES := ${BUILD_PACKAGES:N-gtk:N-gtk3}
2857\&.endif
2858
2859# normal configure setup, e.g.,
2860\&.if ${BUILD_PACKAGES:M-gtk}
2861# ...
2862.Ed
2863.Pp
2864Caveat: creation of a separate working directory is mandatory for a
2865pseudo-flavor.
2866If, at a later time, a full build with all subpackages is required,
2867all the work will need to be done again.
2868.Pp
2869See also
2870.Ev BUILD_ONCE .
2871.It Ev RCDIR
2872Location for daemon startup scripts.
2873Defaults to
2874.Pa /etc/rc.d .
2875Do not change.
2876.It Ev REFETCH
2877User settings.
2878If set to true,
2879.Cm checksum
2880will analyze ${CHECKSUM_FILE}, and try retrieving files with the correct
2881checksum off
2882.Lk https://ftp.openbsd.org ,
2883in the directory
2884.Pa /pub/OpenBSD/distfiles/$cipher/$value/$file .
2885.It Ev REGISTER_PLIST_OPTS
2886User settings.
2887User options added to
2888.Xr register-plist 1 .
2889.It Ev REORDER_DEPENDENCIES
2890Points to a list of files that specify inter-dependencies for
2891.Xr make 1 .
2892If defined, each line of the file is either a comment (starting with #)
2893or a pair of two files: most_recent older.
2894At the end of
2895.Cm post-patch ,
2896.Xr touch 1
2897will be used to ensure those files are put in the proper order.
2898The files are assumed to be under
2899.Pa ${WRKSRC} .
2900The notation /file can be used to ask for a recursive search, e.g.,
2901to make sure that all Makefile.in are up to date.
2902See
2903.Pa ${PORTSDIR}/infrastructure/mk/automake.dep
2904for an example.
2905.It Ev REPORT_PROBLEM
2906See
2907.Xr ports 7 .
2908.It Ev REPORT_PROBLEM_LOGFILE
2909See
2910.Xr ports 7 .
2911.It Ev REVISION
2912Revision number of the current package.
2913Defaults to empty (very first package), then
2914numbering starts at 0.
2915Gets automatically incorporated into
2916.Ev FULLPKGNAME
2917as
2918.Sq p${REVISION}
2919to form a full package-name conforming to
2920.Xr packages-specs 7 .
2921.It Ev RUN_DEPENDS
2922Specification of ports this port needs installed to be functional.
2923Same format as
2924.Ev LIB_DEPENDS .
2925The corresponding packages will be built right before the
2926.Cm install
2927stage, and
2928.Xr pkg_add 1
2929will take care of installing them.
2930.It Ev SEPARATE_BUILD
2931Many GNU configure ports can be built in a directory distinct from the
2932place they were unpacked.
2933For some specific ports, this is even mandatory.
2934Set to
2935.Sq yes
2936if this is the case.
2937The ports infrastructure will generate a separate ${WRKBUILD} directory
2938in which the port will be configured and built.
2939Wipe ${WRKBUILD} to start anew, but skipping the extract/patch stage.
2940.It Ev SETENV
2941Normally set to
2942.Li /usr/bin/env -i .
2943Prepended to every command invocation that requires a clean environment.
2944Do not override.
2945.It Ev SHARED_LIBS
2946List of shared libraries that the port may build, as a list of the form
2947.Sq libname
2948.Sq libversion .
2949Used to set variables of the form
2950.Ev LIBlibname_VERSION
2951that are then used for substitution by
2952.Xr pkg_create 1 .
2953The porter is responsible for making sure the port uses those version numbers
2954when shared libraries are built.
2955.Pp
2956The intent is that the
2957.Ox
2958ports system must have control over shared library versions because of global
2959changes that may require bumping the major version of every shared library in
2960the system, or simply because the third party programmers do not understand
2961the rules for shared library versions, thus breaking the update mechanism.
2962For that reason it is advised to set libversion to 0.0 when first importing a
2963port.
2964.Pp
2965Porters of software using libtool should make sure
2966.Ev MAKE_FLAGS
2967get propagated to the libtool invocations.
2968This should be enough in most cases.
2969.It Ev SKIPDIR
2970See
2971.Xr ports 7 .
2972.It Ev STATIC_PLIST
2973Normally set to
2974.Sq yes .
2975Can be set to no for ports that do not have a static plist.
2976Do not change without a very good reason.
2977Note that the only good reason to not have a static plist is for ports such
2978as
2979.Pa databases/ports-readmes
2980which actually build a bunch of files depending on the current ports tree.
2981This breaks all introspection mechanisms within the ports tree, including
2982.Pa databases/pkglocatedb
2983which will not include that port.
2984.It Ev STARTAFTER
2985See
2986.Xr ports 7 .
2987.It Ev STARTDIR
2988See
2989.Xr ports 7 .
2990.It Ev SUBPACKAGE
2991Set to the subpackage suffix when building a package in a multi-package port.
2992Read-only.
2993Used to test for dependencies or to adjust the package name.
2994.It Ev SUBST_CMD
2995A command that can be used to perform
2996.Ev SUBST_VARS
2997substitution on arbitrary files.
2998In normal mode,
2999.Pp
3000.Dl ${SUBST_CMD} file1 file2 ...
3001.Pp
3002will substitute files in place, creating backup copies of them.
3003In copy mode,
3004.Pp
3005.Dl ${SUBST_CMD} -c src1 dest1 src2 dest2
3006.Pp
3007will copy files over while performing the substitution, as suitable for
3008copying template files over from
3009.Pa ${FILESDIR}
3010to
3011.Pa ${PREFIX} ,
3012for instance.
3013This uses
3014.Xr pkg_subst 1
3015with suitable parameters.
3016Read-only.
3017.Pp
3018${SUBST_CMD}
3019can be used like
3020.Xr install 1 :
3021.Dl ${SUBST_CMD} Oo Fl g Ar group Oc Oo Fl o Ar owner Oc Oo Fl m Ar mode Oc file...
3022to set file
3023.Ar owner ,
3024.Ar group
3025and/or
3026.Ar mode .
3027.Pp
3028Note that
3029.Ev SUBST_CMD
3030is not really appropriate when variables have subpackage variations, like
3031.Ev PREFIX
3032or
3033.Ev FULLPKGNAME .
3034Use the appropriate
3035.Ev SUBST_CMD-sub
3036instead.
3037.It Ev SUBST_CMD-sub
3038.Ev SUBST_CMD
3039with subpackage-dependent semantics, like packing-list substitution.
3040It will substitute the right variable depending on the desired subpackage,
3041e.g.,
3042.Ev SUBST_CMD-foo
3043will substitute the value of
3044.Ev FULLPKGNAME-foo
3045for
3046.Li ${FULLPKGNAME} .
3047.It Ev SUBST_DATA , SUBST_MAN , SUBST_PROGRAM
3048Specialized versions of
3049.Ev SUBST_CMD
3050that use
3051.Fl c
3052and appropriate owner/group/mode for data, manpages and programs respectively.
3053.It Ev SUBST_VARS
3054Make variables whose values get substituted to create the actual package
3055information.
3056Always holds
3057.Ev ARCH ,
3058.Ev BASE_PKGPATH ,
3059.Ev FLAVOR_EXT ,
3060.Ev FULLPKGNAME ,
3061.Ev HOMEPAGE ,
3062.Ev LOCALBASE ,
3063.Ev MACHINE_ARCH ,
3064.Ev MAINTAINER ,
3065.Ev PREFIX ,
3066.Ev PKGSTEM ,
3067.Ev RCDIR ,
3068.Ev SYSCONFDIR ,
3069.Ev TRUEPREFIX ,
3070and
3071.Ev X11BASE .
3072The special construct
3073.Sq ${FLAVORS}
3074can be used in the packing-list to specify the current list of dash
3075separated flavors the port is compiled with (useful for cross-dependencies
3076in
3077.Ev MULTI_PACKAGES ) .
3078Add other
3079variables as needed.
3080.Pp
3081.Ev TRUEPREFIX
3082is never passed to
3083.Xr pkg_create 1
3084as it is identical to
3085.Ev PREFIX .
3086.Pp
3087By default,
3088.Xr update-plist 1
3089is run with the following options:
3090.Bd -literal -offset indent
3091update-plist -i ARCH -i BASE_PKGPATH -i FULLPKGNAME
3092-i FULLPKGPATH -i LOCALSTATEDIR -i MACHINE_ARCH
3093-s BASE_PKGPATH -s LOCALBASE -s LOCALSTATEDIR -s PREFIX
3094-s RCDIR -s SYSCONFDIR -s X11BASE
3095.Ed
3096.It Ev SUDO
3097User settings.
3098If set to
3099.Xr doas 1
3100in
3101.Xr mk.conf 5 ,
3102the ports tree will only invoke root's privileges for the parts that
3103really require it.
3104.It Ev SUPDISTFILES
3105Supplementary files that need to be retrieved under some specific
3106circumstances.
3107For instance, a port might need architecture-specific files.
3108.Ev SUPDISTFILES
3109should hold a list of all distribution files and patchfiles that are not
3110always needed, so that a mirror will be able to grab all files, or that
3111.Cm makesum
3112will work.
3113Having an overlap between
3114.Ev SUPDISTFILES
3115and
3116.Ev DISTFILES ,
3117.Ev PATCHFILES
3118is admissible, and in fact, expected, as it is much simpler to build
3119an error-free list of files to retrieve in that way.
3120See the xanim port for an example.
3121.It Ev SYSCONFDIR
3122Location for this port's configuration files, should always be derived
3123from
3124.Ev BASESYSCONFDIR ,
3125which defaults to
3126.Pa /etc .
3127Passed to gnu configure scripts and substituted in PLISTs.
3128.It Ev TAR
3129Name of the tar binary.
3130.It Ev TARGETS
3131Read-only.
3132Set to the list of special targets for a port
3133.Po
3134.Cm {pre,do,post}-*
3135and module hooks
3136.Pc .
3137Used by introspection tools such as the sqlports package.
3138.It Ev TEMPLATES
3139Base location for the templates used in the
3140.Cm readmes
3141target.
3142User settings.
3143Defaults to
3144.Pa ${PORTSDIR}/infrastructure/templates .
3145.It Ev TEST_DEPENDS
3146See
3147.Ev BUILD_DEPENDS
3148for specification.
3149Test dependencies are only checked if the
3150.Cm test
3151stage is invoked.
3152.It Ev TEST_ENV
3153Additional environment variables passed to tests.
3154Empty by default.
3155.It Ev TEST_FLAGS
3156Extra flags passed to ${MAKE_PROGRAM} to run the regression tests.
3157Empty by default.
3158.It Ev TEST_IS_INTERACTIVE
3159Set to
3160.Sq Yes
3161if port needs human interaction to run its tests, or set to
3162.Sq X11
3163if the tests need an active X11 display to work.
3164.It Ev TEST_LOG
3165Command used to log the results of regression tests to TEST_LOGFILE.
3166Read-only.
3167.It Ev TEST_LOGFILE
3168Log file containing the results of regression tests.
3169.It Ev TEST_TARGET
3170Target to run regression tests.
3171Defaults to
3172.Sq regress ,
3173except for
3174.Sq perl
3175and
3176.Sq gnu
3177.Ev CONFIGURE_STYLE ,
3178which default to
3179.Sq test
3180and
3181.Sq check ,
3182respectively.
3183.It Ev TRUEPREFIX
3184Read-only.
3185Mostly the same as ${PREFIX}, except it never gets ${DESTDIR} prepended
3186during
3187.Cm fake .
3188Refer to
3189.Sx THE FAKE FRAMEWORK
3190section for details.
3191.It Ev TRY_BROKEN
3192User settings.
3193If set to
3194.Sq Yes ,
3195don't set
3196.Ev IGNORE
3197for
3198.Ev BROKEN
3199ports, so that we will attempt to build them.
3200.It Ev UNLOCK_CMD
3201User settings.
3202If set, expands to a command that will release a lock.
3203This lock will reside in
3204.Pa ${LOCKDIR} .
3205.It Ev UNMESSAGE
3206File recorded in the package and displayed during deinstallation.
3207Defaults to ${PKGDIR}/UNMESSAGE if this file exists.
3208Leave empty if no message is needed.
3209.It Ev UNZIP
3210Name of the unzip binary.
3211.It Ev UPDATE_COOKIES_DIR
3212User settings.
3213Used to store cookies for package updates and defaults to
3214.Pa ${PORTSDIR}/update/${MACHINE_ARCH} .
3215If set to empty, will revert to a file under
3216.Pa ${WRKDIR} .
3217.It Ev UPDATE_PLIST_ARGS
3218Tweaks to
3219.Xr update-plist 1
3220behavior for some specific ports, such as variable handling.
3221.It Ev UPDATE_PLIST_OPTS
3222User settings.
3223User options added to
3224.Xr update-plist 1 ,
3225mostly
3226.Fl v
3227for now.
3228.It Ev USE_CCACHE
3229User settings.
3230Set to
3231.Sq Yes
3232to use ccache when building ports.
3233Adds a build dependency on devel/ccache, and sets up the build
3234environment so that it is used.
3235.It Ev USE_GMAKE
3236Set to
3237.Sq Yes
3238if GNU make (${GMAKE}) is needed for correct behavior of this port.
3239.It Ev USE_GROFF
3240Set to
3241.Sq Yes
3242to use groff to build manpages.
3243This sets groff as a build dependency, and also tells
3244.Xr pkg_create 1
3245to format manpages behind the scene using groff while building packages.
3246.It Ev USE_LIBTOOL
3247Defaults to
3248.Sq Yes .
3249Set to
3250.Sq gnu
3251if the base
3252.Xr libtool 1
3253is insufficient and GNU libtool is required.
3254Set to
3255.Sq \&No
3256to disable the use of
3257.Xr libtool 1
3258entirely; this should not be set under normal circumstances.
3259Adds dependencies if necessary, and passes LIBTOOL environment variable to
3260scripts invocations.
3261.Pp
3262Many ports using GNU autoconf need an m4 file from the GNU libtool package
3263but otherwise work with base
3264.Xr libtool 1 .
3265In those cases do not set
3266.Ev USE_LIBTOOL ,
3267instead just set
3268.Li BUILD_DEPENDS = devel/libtool .
3269.It Ev USE_LLD
3270Set to
3271.Sq Yes
3272or
3273.Sq \&No
3274to force the use of
3275.Xr ld.lld 1
3276.Po
3277as opposed to
3278bfd's
3279.Xr ld 1
3280.Pc .
3281Defaults to the appropriate value for the current architecture
3282.Po
3283see
3284.Ev LLD_ARCHS
3285in
3286.Xr bsd.port.arch.mk 5
3287.Pc .
3288.It Ev USE_MFS
3289Set to
3290.Sq Yes
3291to build ports under an MFS filesystem
3292(see
3293.Xr mount_mfs 8 ) .
3294Mostly for use by
3295.Xr dpb 1
3296and not intended to be a user setting.
3297See
3298.Ev WRKOBJDIR_MFS
3299for configuration.
3300.It Ev USE_WXNEEDED
3301If set to
3302.Sq Yes ,
3303writes a wrapper script to ${WRKDIR}/bin/ld in
3304.Cm patch
3305to request that the linker adds an OPENBSD_WXNEEDED ELF section.
3306Use when a port requires memory mappings that are both executable
3307and writable and cannot be modified to avoid this.
3308.It Ev USE_X11
3309Normally, presence of ${X11BASE} is enforced by default for building ports.
3310But there is an experimental way to hook the xenocara build into
3311.Xr dpb 1 ,
3312which requires knowing whether a port requires X11 to already
3313be there.
3314.Pp
3315The infrastructure mostly sets
3316.Ev USE_X11
3317automatically based on
3318.Ev WANTLIB
3319values, there are a few ports (about 20) that require X11 components without
3320any library telltale.
3321.It Ev VARBASE
3322User settings.
3323Base location for ports that install stuff outside of
3324.Pa ${LOCALBASE} .
3325Defaults to
3326.Pa /var .
3327.It Ev WANTLIB
3328List of library specifications that a package will need.
3329May include system and X11 libraries.
3330See
3331.Xr library-specs 7
3332for more details.
3333.Pp
3334As a special extension,
3335.Ev WANTLIB
3336may include absolute paths, e.g.,
3337.Pa ${LOCALBASE}/lib/expat=4
3338to distinguish between base libraries and port libraries.
3339Use with caution, this is very seldom needed.
3340.It Ev wantlib_args
3341Controls the behavior of
3342.Xr pkg_create 1
3343related targets, see
3344.Cm print-package-args
3345for details.
3346.It Ev WARNINGS
3347User settings.
3348If set to
3349.Sq Yes ,
3350add
3351.Ev CDIAGFLAGS
3352to
3353.Ev CFLAGS
3354and
3355.Ev CXXDIAGFLAGS
3356to
3357.Ev CXXFLAGS .
3358.It Ev WRKBUILD
3359Subdirectory of ${WRKDIR} where the actual build occurs.
3360Defaults to ${WRKSRC}, unless
3361.Ev SEPARATE_BUILD
3362is involved, in which case it is set to an appropriate value.
3363.It Ev WRKCONF
3364Subdirectory of ${WRKDIR} where the actual configure set occurs.
3365Defaults to ${WRKBUILD}.
3366.It Ev WRKDIR
3367Location where all port activity occurs.
3368Apart from the actual port, may
3369hold all kinds of cookies that checkpoint the port's build.
3370Read-only.
3371Note that WRKDIR may be a symbolic link.
3372During ports building,
3373.Pa ${WRKDIR}/bin
3374is put at the front of the
3375.Ev PATH .
3376.It Ev WRKDIR_LINKNAME
3377Name of a symbolic link to create within the port directory which will
3378point to the port's ${WRKDIR}.
3379Deprecated.
3380.It Ev WRKDIST
3381Subdirectory of ${WRKDIR} in which the distribution files normally unpack.
3382Base for all patches.
3383Defaults to
3384.Pa ${WRKDIR}/${DISTNAME} .
3385Note that WRKDIST may be a symbolic link, if set to ${WRKDIR}.
3386.It Ev WRKSRC
3387Subdirectory of ${WRKDIR} where the actual source is.
3388Base for configuration (default: ${WRKDIST}).
3389Note that WRKSRC may be a symbolic link, if set to ${WRKDIR}.
3390.It Ev WRKINST
3391Subdirectory of ${WRKDIR} where port normally installs (see the
3392.Cm fake
3393target).
3394.It Ev WRKOBJDIR
3395Used as a base for the actual port working directory.
3396Defaults to
3397.Pa ${PORTSDIR}/pobj .
3398The real working directory ${WRKDIR} is created there.
3399Can be set on a per-${PKGPATH} basis.
3400For instance, setting WRKOBJDIR_www/mozilla=/tmp/obj
3401will affect only the mozilla port.
3402If explicitly unset (WRKOBJDIR=), the working directory is
3403created within the port directory.
3404.It Ev WRKOBJDIR_MFS
3405Alternate location for the port working directory.
3406The intent is to use an MFS based filesystem for small ports with
3407.Xr dpb 1 .
3408Active when
3409.Ev USE_MFS
3410is
3411.Sq Yes .
3412Defaults to
3413.Pa /tmp/pobj .
3414.It Ev X11BASE
3415Where X11 has been installed.
3416Default:
3417.Pa /usr/X11R6 .
3418.It Ev XAUTHORITY
3419Points to a suitable authority file for X11 interactive regression tests.
3420Defaults to
3421.Pa ${HOME}/.Xauthority .
3422.It Ev XMKMF
3423Invocation of xmkmf for a
3424.Li CONFIGURE_STYLE=imake
3425port.
3426Defaults to xmkmf -a -DPorts.
3427The -DPorts is specific to
3428.Ox
3429and is always appended.
3430.It Ev YACC
3431Name of yacc program to pass to GNU-configure, defaults to yacc.
3432GNU-configure would always try to use bison otherwise, which leads to
3433unreproducible builds.
3434Set to bison if needed.
3435.El
3436.Sh DIAGNOSTICS
3437Note that some of these messages are actually emitted by some other external
3438commands, but grouped here for convenience: easier to look for in
3439.Xr dpb 1 Ns 's
3440logs.
3441.Bl -diag
3442.It "/bin/sh: cd .../pkg - No such file or directory"
3443Emitted during
3444.Cm generate-readmes .
3445.Pa ${PKGDIR}
3446must point to an existing directory, so that
3447.Nm
3448can be certain there are no
3449.Pa MESSAGEs
3450or
3451other files pertinent to the package.
3452.It "Discovered old directory in ..."
3453This message comes from
3454.Xr update-plist 1 .
3455A directory was found in the PLIST that used to be needed but is no longer,
3456because it's now accounted for through dependencies.
3457Indicates the old directory has been removed.
3458.It "Error: change in plist between ..."
3459Error message comes from
3460.Xr register-plist 1 .
3461.It "Error: duplicate item in packing-list"
3462Error message comes from
3463.Xr pkg_create 1 ,
3464and will result from incorrect packing-lists, such as including several
3465fragments with the same file, or having incorrect
3466.Ev PKG_ARGS-sub .
3467.It "Error: Libraries in packing-lists...and libraries from installed packages don't match"
3468The ports tree and the installed packages are out-of-sync.
3469Mixing library information from both sources might produce packages that can't
3470be installed elsewhere.
3471Cleanest fix is to update the out-of-date source (e.g., update the ports tree,
3472or build and install new packages).
3473Developers may use
3474.Ev PKG_CREATE_NO_CHECKS
3475instead, assuming they understand the implications.
3476See
3477.Cm print-package-args Pq Cm wantlib-args
3478for details.
3479.It "Fatal: can't flavor a SUBDIR"
3480A dependency mentions top_subdir,flavor.
3481Flavor would then be ignored, as it is only applied to individual ports.
3482.It "Fatal: can't subpackage a SUBDIR"
3483A dependency mentions top_subdir,-sub.
3484Subpackage would then be ignored, as it is only applied to individual ports.
3485.It "Fatal: flavor should never start with a digit"
3486This would utterly confuse
3487.Xr pkg_add 1 .
3488See
3489.Xr packages-specs 7 .
3490.It "Fatal: inclusion of <file> from <file>"
3491.Pa bsd.port.mk
3492or
3493.Pa bsd.port.subdir.mk
3494has been included from a
3495.Ev MODULE
3496or from
3497.Pa Makefile.inc ,
3498resulting in a double inclusion.
3499This would lead to weird results, such as
3500.Ev PKG_ARGS
3501being defined twice.
3502.It "Fatal: SUBPACKAGES should always begin with -: <offending list>"
3503That is the only way to differentiate between
3504.Ev FLAVOR
3505and
3506.Ev SUBPACKAGE
3507in
3508.Xr pkgpath 7
3509specifications.
3510.It "Fatal: building ports requires correctly installed X11"
3511All file sets of the base OS, including xenocara, must be installed
3512before building ports.
3513.It "Fatal: /usr/local/lib/X11/app-defaults should exist and be a symlink"
3514/usr/local/lib/X11/app-defaults is distributed as a symlink in the
3515xshare*.tgz file set.
3516If xenocara was not fully installed before packages were added, it may
3517have been created as a directory instead.
3518.It "Fatal: the licensing info for <pkgname> is incomplete..."
3519Every port must have explicit defines of all
3520.Ev PERMIT_*
3521values.
3522.It "Fatal: Use 'env FLAVOR=flavor make' instead"
3523Arguments specified after
3524.Xr make 1
3525are hardcoded for all recursive sub-makes, and very difficult to override.
3526Thus,
3527.Ev FLAVOR
3528must be specified in the environment instead.
3529.It "Fatal: Use 'env SUBPACKAGE=-sub make' instead"
3530Arguments specified after
3531.Xr make 1
3532are hardcoded for all recursive sub-makes, and very difficult to override.
3533Thus,
3534.Ev SUBPACKAGE
3535must be specified in the environment instead.
3536.It "ldconfig: <dir>: No such file or directory"
3537Usually produced by
3538.Xr pkg_add 1
3539running
3540.Xr ldconfig 8 .
3541Some tools such as GNU libtool will add directories living under
3542.Pa ${WRKINST}
3543to the shared library path during the
3544.Cm fake
3545stage.
3546Of course,
3547.Xr ldconfig 8
3548will later complain after the directory no longer exists.
3549The bogus tool should be fixed to conform to
3550.Ox
3551usage.
3552.It LIB_DEPENDS <spec> not needed for <FULLPKGPATH>
3553There doesn't seem to be any WANTLIB to match the given LIB_DEPENDS.
3554Thus, the LIB_DEPENDS won't turn into a @depends line in the created package.
3555This is often because of confusion between LIB_DEPENDS and RUN_DEPENDS:
3556RUN_DEPENDS is needed for dlopen'd libraries.
3557.Pp
3558Might be intentional sometimes, if some compile flavors create static binaries,
3559for instance.
3560Also, will happen for multi-packages, where one sets LIB_DEPENDS to have
3561a given build dependency (and corresponding WANTLIB for a given SUBPACKAGE).
3562.Pp
3563See
3564.Cm print-package-args Pq Cm lib-depends-args
3565for details.
3566.It "Warning: FULLPKGNAME-sub defined but not FULLPKGPATH-sub"
3567.Ev FULLPKGNAME-sub
3568has been explicitly defined by the port, instead of relying on the default,
3569but no value of
3570.Ev FULLPKGPATH-sub
3571has been given.
3572This is often an error.
3573.It "Warning: no debug-info in ..."
3574Port uses
3575.Ev DEBUG_PACKAGES
3576so the
3577.Xr build-debug-info 1
3578script excepts debug information on all binaries and libraries.
3579Most probably, the build machinery for that specific port omitted -g
3580somewhere, or it runs strips during fake anyway.
3581It can also occur if
3582.Ev DEBUG_PACKAGES
3583includes subpackages with no files holding debug info.
3584.It "Warning: symlink(s) point to non existent file."
3585Warning message comes from
3586.Xr pkg_create 1 .
3587The symlink resides in the fake area, under
3588.Pa ${WRKINST} .
3589This is only a warning because the symlink may point to a run-time dependency,
3590which obviously won't exist under
3591.Pa ${WRKINST}
3592at the time
3593.Ql make package
3594is run.
3595.It "Warning: @option no-default-conflict with no @conflict"
3596Warning message comes from
3597.Xr pkg_create 1 .
3598Most packages that waive "default-conflict" will have explicit conflict markers
3599instead.
3600Otherwise, the package will only conflict with the exact same version, with
3601some possible
3602.Ev REVISION
3603bumps.
3604Any other version or
3605.Ev FLAVOR
3606won't conflict.
3607This is generally an error, apart from very few ports like
3608.Pa devel/autoconf/* .
3609.It "groff produced empty result for <manpage>..."
3610Warning message comes from
3611.Xr pkg_create 1 .
3612Manpages are automatically formatted with
3613.Xr groff 1
3614if
3615.Ev USE_GROFF
3616is set.
3617The above message denotes an actual problem while formatting the page,
3618which should be addressed.
3619In the meantime,
3620.Xr pkg_create 1
3621still produces a package, but leaves the manpage unformatted, in the hope
3622that something will be able to make sense of it.
3623.El
3624.Sh FILES
3625.Bl -tag -width Ds
3626.It Pa ../Makefile.inc
3627Common Makefile fragment for a set of ports, included automatically.
3628.It Pa /cdrom/distfiles
3629Default path to a CD-ROM (or other media) full of distribution files.
3630.It Pa ${PORTSDIR}/distfiles
3631Default setup of ${DISTDIR}.
3632.It Pa ${DISTDIR}
3633Cache of all distribution files.
3634.It Pa distinfo
3635Checksum file.
3636Holds the output of
3637.Xr cksum 1 ,
3638using
3639.Xr sha256 1
3640for the port's ${DISTFILES} and ${PATCHFILES},
3641as well as the sizes of these files.
3642.It Pa ${DISTDIR}/${CHECKSUMFILES}
3643Cache of normal distribution files for a given port.
3644.It Pa ${DISTDIR}/${MAKESUMFILES}
3645Cache of all distribution files for a given port.
3646.It Pa ${PKGDIR}/DESCR
3647Description for the port.
3648Variables such as ${HOMEPAGE} and ${MAINTAINER} will be expanded
3649(see SUBST_VARS).
3650Multi-package ports will use DESCR${SUBPACKAGE}.
3651.It Pa ${PKGDIR}/README
3652.Ox
3653specific documentation for a port, that will be installed as
3654.Pa ${LOCALBASE}/share/doc/pkg-readmes/${PKGSTEM}
3655at the end of
3656.Cm fake .
3657Variables from
3658.Ev SUBST_VARS
3659will be expanded.
3660Multi-package ports will use
3661.Pa README${SUBPACKAGE} .
3662.It Pa ${PKGDIR}/<foo>.rc
3663Startup script for <foo>.
3664Will be installed as
3665.Ar ${RCDIR}/<foo>
3666at the end of
3667.Cm fake .
3668Variables from
3669.Ev SUBST_VARS
3670will be expanded.
3671.It Pa ${PORTSDIR}/packages/${MACHINE_ARCH}
3672Default setup of ${PACKAGE_REPOSITORY}.
3673.It Pa ${PACKAGE_REPOSITORY}/no-arch
3674Location of arch-independent packages.
3675.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all
3676Location of all built packages.
3677.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cache
3678Location of packages retrieved through the network.
3679.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cksums
3680Location of checksums, see
3681.Ev CHECKSUM_PACKAGES .
3682.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cdrom
3683Location of packages suitable for the CD.
3684.It Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp
3685Location of packages suitable for FTP.
3686.It Pa ${PORTSDIR}/bulk/${MACHINE_ARCH}
3687Default setup of ${BULK_COOKIES_DIR}.
3688.It Pa ${PORTSDIR}/update/${MACHINE_ARCH}
3689Default setup of ${UPDATE_COOKIES_DIR}.
3690.It Pa ${PORTSDIR}/mystuff
3691Extra directory used to store local ports before committing them.
3692All depend targets will normally look there after the normal lookup fails.
3693See
3694.Ev PORTSDIR_PATH .
3695.El
3696.Sh THE FAKE FRAMEWORK
3697The
3698.Cm fake
3699target is used to install the port in a private directory first, ready for
3700packaging by the
3701.Cm package
3702target, so that the actual installation will use the package.
3703.Pp
3704Essentially,
3705.Cm fake
3706invokes a real install process after tweaking a few variables.
3707.Pp
3708.Cm fake
3709first creates a skeleton tree under ${WRKINST}, using
3710.Xr mkdir 1
3711.Fl p .
3712.Pp
3713A
3714.Cm pre-fake
3715target may be used to complete that skeleton tree.
3716For instance, a few ports may need supplementary stuff to be present (as
3717it would be installed if the port's dependencies were present).
3718.Pp
3719If
3720.Cm {pre,do,post}-install
3721overrides are present, they are used with some
3722important changes, listed in
3723.Ev FAKE_SETUP :
3724.Bd -literal -offset indent
3725TRUEPREFIX=${PREFIX}
3726PREFIX=${WRKINST}${PREFIX}
3727${DESTDIRNAME}=${WRKINST}
3728.Ed
3729.Pp
3730Essentially, old install targets work transparently, except for a need to
3731change
3732.Ev PREFIX
3733to
3734.Ev TRUEPREFIX
3735for symbolic links and similar path lookups.
3736Specific traditional post install work can be simply removed, as it will
3737be taken care of by the package itself (for instance, ldconfig, or
3738texinfo's install-info).
3739.Pp
3740If no
3741.Cm do-install
3742override is present, the port is installed using
3743.Bd -literal -offset 2n
3744env -i ${MAKE_ENV} ${FAKE_SETUP} ${MAKE_PROGRAM} ${ALL_FAKE_FLAGS} -f ${MAKE_FILE} ${FAKE_TARGET}
3745.Ed
3746.Pp
3747Note that this does set both PREFIX and ${DESTDIRNAME}.
3748If a port's Makefile both heeds ${DESTDIRNAME},
3749and references PREFIX explicitly,
3750FAKE_FLAGS may rectify the problem by setting PREFIX=${PREFIX}
3751(which will do the right thing, since ${PREFIX} is a
3752.Xr make 1
3753construct which will not be seen by the shell).
3754.Pp
3755${FAKE_FLAGS} is used to set variables on
3756.Xr make 1
3757command line, which will override the port Makefile contents.
3758Thus, a port that mentions DESTDIR= does not need any patch to work with fake.
3759.Pp
3760Files such as
3761.Pa ${PKGDIR}/README*
3762or
3763.Pa ${PKGDIR}/*.rc
3764get copied to
3765.Pa ${WRKINST}
3766right after the end of
3767.Cm fake ,
3768during
3769.Cm generate-readmes
3770(see the
3771.Sx FILES
3772section above for details).
3773.Sh THE DEBUG_PACKAGES INFRASTRUCTURE
3774If
3775.Ev DEBUG_PACKAGES
3776is not empty, debug packages will be built "on the side".
3777Since debug information is usually large, this is controlled on a per-arch
3778basis with
3779.Ev DEBUGINFO_ARCHS
3780controlling the behavior (set to amd64 by default).
3781.Pp
3782During the normal
3783.Cm package
3784target ,
3785.Xr build-debug-info 1
3786will be invoked to deduce debug packing-lists from the normal packing-lists,
3787and some extra makefile rules will be invoked to set aside the debug
3788information.
3789.Pp
3790Then each normal package will have a "shadow" debug-* package built alongside
3791it, with the exact same package signature, except it will also be tied closely
3792with the normal package.
3793.Pp
3794Figuring out what files contain debug information is entirely achieved through
3795.Cm @bin ,
3796.Cm @lib ,
3797.Cm @so
3798and
3799.Cm @static-lib
3800annotations in the base packing-lists.
3801.Pp
3802Debug packages will be produced for all subpackages in
3803.Ev DEBUG_PACKAGES .
3804Usually, the heuristics of trimming arch-independent packages
3805from
3806.Ev BUILD_PACKAGES
3807is enough.
3808In case this still produces empty debug packages, the
3809.Ev DEBUG_PACKAGES
3810list should be produced manually.
3811.Pp
3812The actual debug packages are not registered through
3813.Xr register-plist 1
3814since the information was automatically generated.
3815.Pp
3816debug package names and debug package filenames are added to
3817.Ev PKGNAMES
3818and
3819.Ev PKGFILES
3820respectively for introspection purpose.
3821.Pp
3822.Xr egdb 1
3823from ports can read debug information from a separate file, as long as
3824the original ELF file was annotated with a debuginfo link.
3825.Pp
3826That feature is used to set debug information on the side, in
3827.Pa .debug/
3828subdirectories alongside the normal binaries, shared objects and shared
3829libraries.
3830.Pp
3831For static libraries, the information can't be separated, instead the full
3832static library with debug information is provided in the
3833.Pa .debug/
3834subdirectory, while the normal static library gets stripped.
3835.Sh FLAVORS AND MULTI_PACKAGES
3836Starting with
3837.Ox 2.7 ,
3838each port can generate distinct packages through two orthogonal mechanisms:
3839.Ev FLAVORS
3840and
3841.Ev MULTI_PACKAGES .
3842.Pp
3843The current
3844.Ev MULTI_PACKAGES
3845mechanism was introduced after
3846.Ox 4.0 .
3847.Pp
3848The arch-dependent part was refined after
3849.Ox 5.0 .
3850.Pp
3851If a port can be compiled with several options, these options
3852should be turned into
3853.Ev FLAVORS .
3854The port maintainer will set
3855.Ev FLAVORS
3856to be the list of possible options in the Makefile.
3857When building the port, the package builder will set
3858.Li "FLAVOR='option1 option2...'"
3859to build a specific flavor of the port.
3860The Makefile should test the value of FLAVOR as follows:
3861.Bd -literal -offset indent
3862FLAVOR?=
3863\&.if ${FLAVOR:Moption1}
3864# what to do if option1
3865\&.endif
3866\&.if ${FLAVOR:Moption2}
3867# what to do if option2
3868\&.endif
3869.Ed
3870.Pp
3871.Nm
3872takes care of a few details, such as generating a distinct work directory for
3873each flavor, or creating a FULLPKGNAME by adding a dash separated list of
3874flavors to the base package name.
3875The order in which
3876.Ev FLAVOR
3877is specified does not matter: this dash separated list will be
3878reordered to match the ordering of
3879.Ev FLAVORS .
3880.Pp
3881It is an error to specify an option in
3882.Ev FLAVOR
3883that does not appear in
3884.Ev FLAVORS ,
3885to prevent misspellings.
3886.Pp
3887In bulk package building, flavors can be specified as a comma
3888separated list after the package directory, e.g., SUBDIR+=vim,no_x11
3889.Po
3890see
3891.Xr pkgpath 7
3892.Pc
3893.Pp
3894Finally, package information will use templates with the canonical package
3895extension if they are available: if FLAVOR='option1 option2' and both
3896COMMENT and COMMENT-option1-option2 are available, COMMENT-option1-option2 will
3897be used.
3898.Pp
3899If one build of a port can generate several distinct packages, set
3900.Ev MULTI_PACKAGES
3901accordingly.
3902Each extension of a
3903.Ev MULTI_PACKAGES
3904name should start with a dash, so that they cannot be confused with
3905.Ev FLAVORS .
3906In dependency checking and bulk builds, a subpackage can be
3907specified after a comma, e.g.,
3908.Li SUBDIR+=quake,-server .
3909.Ev MULTI_PACKAGES
3910only affects the actual package building step (and the
3911.Cm describe
3912step, since a
3913.Ev MULTI_PACKAGES
3914port will produce several descriptions).
3915.Pp
3916If
3917.Ev MULTI_PACKAGES
3918is set, the packaging stage happens once for every
3919subpackage, using subpackage-specific variables.
3920For instance, if
3921.Li MULTI_PACKAGES=-main -lib -server ,
3922.Ev PKG_ARCH-main ,
3923.Ev PKG_ARCH-lib
3924and
3925.Ev PKG_ARCH-server
3926will be used for the subpackages respectively called
3927.Ev FULLPKGNAME-main ,
3928.Ev FULLPKGNAME-lib
3929and
3930.Ev FULLPKGNAME-server .
3931.Pp
3932All package information is also derived from
3933templates with SUBPACKAGE appended.
3934In the preceding example, the packing-list template for FULLPKGNAME-lib
3935must be in PLIST-lib.
3936.Pp
3937The following variables are subpackage dependent:
3938.Ev COMMENT ,
3939.Ev PKG_ARCH ,
3940.Ev PERMIT_PACKAGE ,
3941.Ev PKGFILE ,
3942.Ev PKGNAME ,
3943.Ev PKGSTEM ,
3944.Ev FULLPKGNAME ,
3945.Ev REVISION ,
3946.Ev EPOCH ,
3947.Ev FULLPKGPATH ,
3948.Ev RUN_DEPENDS ,
3949.Ev WANTLIB ,
3950.Ev LIB_DEPENDS ,
3951.Ev IGNORE ,
3952.Ev ONLY_FOR_ARCHS ,
3953.Ev NOT_FOR_ARCHS ,
3954.Ev PKG_ARGS ,
3955.Ev PREFIX ,
3956.Ev CATEGORIES ,
3957.Ev MESSAGE ,
3958.Ev UNMESSAGE ,
3959.Ev DESCR ,
3960.Ev PLIST ,
3961.Ev STATIC_PLIST ,
3962.Ev PKGSPEC .
3963.Pp
3964The usual non-MULTI_PACKAGES variables are simply used as default values
3965for all subpackages.
3966So, if you set
3967.Li "PKG_ARCH=*"
3968.Li "PKG_ARCH-main=i386"
3969then
3970.Ev PKG_ARCH-lib
3971and
3972.Ev PKG_ARCH-server
3973will both be
3974.Sq * .
3975.Pp
3976.Ev WANTLIB
3977and
3978.Ev LIB_DEPENDS
3979are special.
3980At the beginning of the build, during
3981.Cm prepare ,
3982all build dependencies will be checked,
3983which includes
3984.Ev LIB_DEPENDS ,
3985.Ev WANTLIB
3986for every subpackage.
3987As an exception, any
3988.Ev LIB_DEPENDS-sub
3989that references the current port will be ignored as a build dependency,
3990in order to avoid recursion.
3991.Pp
3992.Ev FULLPKGPATH
3993and
3994.Ev FULLPKGNAME
3995are special as well.
3996You must set
3997.Ev PKGNAME-sub
3998or
3999.Ev FULLPKGNAME-sub
4000for each subpackage, but
4001.Ev FULLPKGPATH-sub
4002is set automatically to the right value.
4003In very rare cases, one may override
4004.Ev FULLPKGPATH-sub .
4005(for instance, if one specific subpackage is not affected by option
4006settings that affect other subpackages, e.g., for include files packs).
4007.Pp
4008In terms of using the port, quite a few targets will have a subpackage
4009specific subtarget:
4010invoking
4011.Cm package
4012is the same as invoking
4013.Cm subpackage
4014for all subpackages,
4015invoking
4016.Cm install-all
4017is the same as invoking
4018.Cm install
4019for all subpackages,
4020and invoking
4021.Cm update
4022is the same as invoking
4023.Cm subupdate
4024for all subpackages.
4025.Pp
4026.Ev ONLY_FOR_ARCHS
4027and
4028.Ev NOT_FOR_ARCHS
4029interact with
4030.Ev MULTI_PACKAGES
4031and
4032.Ev IGNORE .
4033The infrastructure will automatically filter subpackages
4034that are not suitable for the current architecture.
4035Thus,
4036.Ev MULTI_PACKAGES
4037should always list all subpackages,
4038even things not buildable on the current architecture,
4039for indexing purposes.
4040.Pp
4041Starting with
4042.Ox 5.1 ,
4043.Xr bsd.port.arch.mk 5
4044should be used to simplify the handling of
4045.Ev MULTI_PACKAGES
4046in arch-dependent setups:
4047.Pp
4048Make sure
4049.Ev MULTI_PACKAGES ,
4050.Ev ONLY_FOR_ARCHS* ,
4051and
4052.Ev PSEUDO_FLAVORS
4053are defined correctly, then
4054.Bd -literal -offset indent
4055\&.include <bsd.port.arch.mk>
4056.Ed
4057.Pp
4058This will compute
4059.Ev BUILD_PACKAGES ,
4060the list of actual subpackages to build with the current setup,
4061by taking arch constraints and pseudo-flavors into account.
4062Then test
4063.Ev BUILD_PACKAGES
4064to set up the right configuration, e.g., to check if
4065.Ev SUBPACKAGE
4066.Ar -mono
4067should be built:
4068.Bd -literal -offset indent
4069\&.if ${BUILD_PACKAGES:M-mono}
4070.Ed
4071.Pp
4072The
4073.Pa lang/gcc/8
4074or
4075.Pa print/poppler
4076ports should provide examples of proper use.
4077.Pp
4078Note that
4079.Xr dpb 1
4080will break if all subpackages are not properly listed.
4081.Sh THE GENERATION OF PACKAGE INFORMATION
4082Starting after
4083.Ox 4.1
4084all package information is processed directly by
4085.Xr pkg_create 1
4086from templates in ${PKG_DIR}.
4087.Pp
4088.Bl -bullet -compact
4089.It
4090If not overridden by the user, determine which set of templates to use,
4091depending on the current SUBPACKAGE and FLAVOR information.
4092Set PLIST${SUBPACKAGE}, DESCR${SUBPACKAGE}, COMMENT${SUBPACKAGE}, MESSAGE${SUBPACKAGE}, UNMESSAGE${SUBPACKAGE} accordingly.
4093.It
4094Generate the actual DESCR, and if needed, MESSAGE, UNMESSAGE,
4095from the templates in ${DESCR}, ${MESSAGE}, ${UNMESSAGE}, by
4096substituting the variables in ${SUBST_VARS}, and by substituting
4097${FLAVORS} with the canonical flavor extension for this port,
4098e.g., if
4099.Li FLAVORS=no_map gfx qt2 ,
4100if
4101.Li FLAVOR=gfx no_map ,
4102this is
4103.Sq -no_map-gfx .
4104.It
4105Generate the actual PLIST from the template ${PLIST},
4106by inserting fragments
4107and applying the same variable substitutions as other package information.
4108.El
4109.Pp
4110Note that ${COMMENT} is currently not substituted, to speed up
4111.Cm describe
4112generation.
4113.Pp
4114To avoid substitution, variables can be escaped as follows:
4115.Li "$\e{PREFIX}"
4116.Pp
4117If
4118.Ev FLAVORS
4119lists flv, then constructs such as the line
4120.Li "%%flv%%"
4121or
4122.Li "!%%flv%%"
4123in the packing-list template trigger the inclusion of
4124.Pa ${PKGDIR}/PFRAG.flv${SUBPACKAGE}
4125or
4126.Pa ${PKGDIR}/PFRAG.no-flv${SUBPACKAGE} .
4127Other fragments can be defined by simply adding
4128.Li "-Dfrag=1"
4129or
4130.Li "-Dfrag=0"
4131to
4132.Ev PKG_ARGS .
4133.Pp
4134If libraries are built using
4135.Pa bsd.lib.mk ,
4136special care should be taken for mips64* architectures,
4137which do not ever build
4138.Pa *pic.a
4139files (all mips code is pic already).
4140.Nm
4141automatically adds
4142.Li "-Dno_mips64=1"
4143or
4144.Li "-Dno_mips64=0"
4145to
4146.Ev PKG_ARGS ,
4147and the porter only needs to provide the appropriate fragment.
4148.Pp
4149.Xr pkg_add 1
4150now calls
4151.Xr ldconfig 8
4152directly, provided dynamic libraries have been annotated with
4153.Li "@lib libthingy.so.5.0" .
4154Adding new directories to the dynamic loader cache has been
4155deprecated.
4156It is often better to let libraries be visible as a link
4157under ${LOCALBASE}.
4158Having a separate directory is enough to trick
4159.Xr ld 1
4160into grabbing the right version.
4161Libraries used only for
4162.Xr dlopen 3
4163do not need to be visible.
4164Some programs will prefer to use rpath to find their own libraries.
4165.Pp
4166The special
4167.Cm update-plist
4168target does a fairly good job of automatically generating the PLIST.
4169.Pp
4170If
4171.Ev PLIST_REPOSITORY
4172points to a directory, all packing-lists from packages generated by
4173.Xr pkg_create 1
4174during the
4175.Cm package
4176stage are saved in
4177.Pa ${PLIST_REPOSITORY}/${MACHINE_ARCH}
4178by a script:
4179.Pa ${PORTSDIR}/infrastructure/bin/register-plist .
4180This script strips some irrelevant information and normalizes the
4181packing-list somehow, and compares it to existing information, looking
4182for relevant changes.
4183Since a package name must always be changed when the packing-list changes,
4184any attempt to replace a packing-list of a given name with a different
4185packing-list will be flagged as an error.
4186.Pp
4187In
4188.Ev MULTI_PACKAGES
4189mode, there must be separate COMMENT, DESCR, and PLIST
4190templates for each SUBPACKAGE (and optional distinct MESSAGE, UNMESSAGE
4191files in a similar way).
4192This contrasts with the
4193.Ev FLAVORS
4194situation, where all these files will automatically default to the
4195non-flavor version if there is no flavor-specific file around.
4196.Sh OBSOLETE TARGETS
4197.Bl -tag -width Ds
4198.It Cm addsum
4199Used for direct fiddling with
4200.Pa distinfo ,
4201made obsolete by the correct use of
4202.Ev SUPDISTFILES .
4203.It Cm cdrom-packages , ftp-packages
4204Links are now created during the
4205.Cm package
4206target.
4207.It Cm depends-list
4208Renamed into
4209.Cm full-build-depends .
4210.It Cm describe
4211Prints a one-line index entry of the port.
4212.Cm dump-vars
4213provides much more accurate information, and the indexing role
4214has been taken over by the
4215.Pa sqlports
4216and
4217.Pa portslist
4218packages.
4219.It Cm {build,run,lib}-depends
4220The dependency mechanism now meshes
4221.Ev BUILD_DEPENDS , LIB_DEPENDS , RUN_DEPENDS, WANTLIB
4222and
4223.Ev MULTI_PACKAGES .
4224Refer to
4225.Cm prepare , install-depends , test-depends .
4226.It Cm {pre,do}-extract
4227Don't override.
4228Set
4229.Ev EXTRACT_ONLY
4230to nothing and override
4231.Cm post-extract
4232instead.
4233.It Cm {pre,do,post}-fetch
4234These prevented bulk mechanisms from running properly.
4235.It Cm {pre,do,post}-package
4236There is no port that requires special treatment during packaging,
4237as
4238.Cm {pre,do,post}-install
4239should take care of every necessity.
4240.It Cm fetch-list , mirror-distfiles , fetch-makefile , mirror-maker , mirror-maker-fetch
4241Use
4242.Cm dpb Fl F
4243instead, see
4244.Xr mirroring-ports 7 .
4245.It Cm obj
4246Starting with
4247.Ox 3.3 ,
4248using
4249.Ev WRKOBJDIR
4250no longer creates a symlink between the current directory and
4251a subdirectory of ${WRKOBJDIR}, so
4252.Cm obj
4253is no longer applicable.
4254.It Cm print-depends
4255Use
4256.Cm print-build-depends
4257and
4258.Cm print-run-depends
4259instead.
4260.It Cm print-depends-list
4261Renamed into
4262.Cm print-build-depends .
4263.It Cm print-package-depends
4264Renamed into
4265.Cm print-run-depends .
4266.It Cm print-package-signature
4267Renamed into
4268.Cm print-update-signature .
4269.It Cm readme , readmes
4270replaced by the
4271.Pa databases/ports-readmes
4272port, using the Template Toolkit
4273.Po
4274.Pa textproc/p5-Template
4275.Pc
4276instead of hand-coded substitutions.
4277.El
4278.Sh OBSOLETE VARIABLES
4279.Bl -tag -width Ds
4280.It Ev BIN_PACKAGES
4281Old user settings.
4282The infrastructure always trusts the repository to contain correct packages.
4283So, if the package name did not change and if it exists in the repository,
4284it will not be rebuilt without manual user action.
4285.It Ev CATn
4286List of formatted manpages, per section.
4287.It Ev CATPREFIX
4288Location for storing formatted manpages.
4289Derived directly from
4290.Ev PREFIX .
4291.It Ev CDROM_PACKAGES
4292Old user settings.
4293Base location where packages suitable for a CD-ROM would be placed.
4294.It Ev COMMENT
4295Used to be the name of the comment file for a package.
4296It now holds the comment itself.
4297Some magic has been put in to allow for a seamless transition.
4298.It Ev CONFIGURE_SHARED
4299Used to default to --enable-shared or --disable-shared, depending on whether
4300the architecture supported shared libraries.
4301.It Ev DESCR_SRC
4302From
4303.Nx .
4304This is DESCR.
4305.Ox
4306does not give a specific name to the generated file.
4307It is not recommended to try to access it directly.
4308.It Ev EXTRACT_AFTER_ARGS
4309Was used to cobble together the normal extraction command, as
4310${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${EXTRACT_AFTER_ARGS}.
4311Use
4312.Ev EXTRACT_CASES
4313instead.
4314.It Ev EXTRACT_BEFORE_ARGS
4315Likewise, use
4316.Ev EXTRACT_CASES
4317instead.
4318.It Ev EXTRACT_CMD
4319Likewise, use
4320.Ev EXTRACT_CASES
4321instead.
4322.It Ev FETCH_BEFORE_ARGS , FETCH_AFTER_ARGS
4323Set
4324.Ev FETCH_CMD
4325to point to a script that does any required special treatment instead.
4326.It Ev FETCH_DEPENDS
4327Used to specify dependencies that were needed to fetch files.
4328It is much easier to mirror locally weird distribution files.
4329.It Ev FTP_PACKAGES
4330User settings.
4331Base location where packages suitable for FTP (see
4332PERMIT_PACKAGE) will be placed.
4333Now hardwired to
4334.Pa ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp .
4335.It Ev GNU_CONFIGURE
4336Use
4337.Ev CONFIGURE_STYLE
4338instead.
4339.It Ev HAS_CONFIGURE
4340Use
4341.Ev CONFIGURE_STYLE
4342instead.
4343.It Ev IGNOREFILES
4344Set to the list of files that can't be checksummed.
4345All uses of it have led to postponing the correct action: talking
4346to the software author and getting him to provide versioned archives.
4347.It Ev MANn
4348List of unformatted manpages, per section.
4349.It Ev MANPREFIX
4350Location for storing unformatted manpages.
4351Derived directly from
4352.Ev PREFIX .
4353.It Ev MASTERDIR
4354From
4355.Fx .
4356Used to organize a collection of ports that share most files.
4357.Ox
4358uses a single port with flavors or multi-packages to produce
4359package variations instead.
4360.It Ev MASTER_SITE_SUBDIR
4361Contents were used to replace
4362.Sq %SUBDIR%
4363in all
4364.Ev MASTER_SITES
4365variables.
4366Since
4367.Sq %SUBDIR%
4368almost always occur at the end of the directory,
4369the simpler
4370.Li ${VARIABLE:=subdir/}
4371construct is now used instead
4372.Po
4373taken from
4374.Nx
4375.Pc .
4376.It Ev MD5_FILE
4377Use
4378.Ev CHECKSUM_FILE
4379instead.
4380.It Ev MIRROR_DISTFILE
4381Use
4382.Ev PERMIT_DISTFILES
4383to determine which files can be mirrored instead.
4384See
4385.Xr mirroring-ports 7 .
4386.It Ev NEED_VERSION
4387Used to set a requirement on a specific revision of
4388.Nm
4389needed by a port.
4390No longer needed as
4391.Nm
4392should always be kept up to date.
4393.It Ev NO_CONFIGURE
4394If ${CONFIGURE_SCRIPT} does not exist, no automatic configuration will
4395be done anyway.
4396.It Ev NO_DESCRIBE
4397All ports should generate a description.
4398.It Ev NO_EXTRACT
4399Set EXTRACT_ONLY= instead.
4400.It Ev NO_INSTALL_MANPAGES
4401Use
4402.Ev CONFIGURE_STYLE
4403instead.
4404.It Ev NO_MTREE
4405Starting with
4406.Ox 2.7 ,
4407the operating system installation script runs the /usr/local specification
4408globally, instead of embedding it in each package.
4409So packages no longer record an
4410.Xr mtree 8
4411specification.
4412Use an explicit
4413.Sq @exec
4414command if needed.
4415.It Ev NO_PACKAGE
4416All ports should generate a package, preferably before install.
4417.It Ev NO_PATCH
4418The absence of a patches directory does the same.
4419Use PATCHDIR and PATCH_LIST if patches need to be changed dynamically.
4420.It Ev NO_SHARED_ARCHS
4421Used to be set to the list of platforms that did not support shared libraries.
4422No such architectures remain.
4423.It Ev NO_SHARED_LIBS
4424Used to be set to
4425.Sq Yes
4426if platform did not support shared libraries.
4427.It Ev NO_WRKDIR
4428All ports should have a working directory, as this is necessary to store
4429cookies and keep state.
4430.It Ev NO_WRKSUBDIR
4431The same functionality is obtained by setting WRKDIST=${WRKDIR}.
4432.It Ev NOCLEANDEPENDS
4433Use CLEANDEPENDS instead.
4434.It Ev NOMANCOMPRESS
4435.Fx
4436ships with compressed man pages, and uses this variable to control
4437that behavior.
4438.It Ev OBJMACHINE
4439Starting with
4440.Ox 3.3 ,
4441setting
4442.Ev WRKOBJDIR
4443creates the whole
4444.Ev WRKDIR
4445hierarchy under ${WRKOBJDIR}, so
4446.Ev OBJMACHINE
4447is no longer useful.
4448.It Ev OLD_WRKDIR_NAME
4449Used to be a base name for
4450.Ev WRKDIR
4451in the old scheme without
4452.Ev WRKOBJDIR .
4453.It Ev OPSYS
4454The operating system.
4455This ports tree is only used on
4456.Ox .
4457.It Ev OPSYS_VER
4458Use
4459.Ev OSREV
4460instead.
4461.It Ev PACKAGES
4462Base location for packages built, everything is based on
4463.Ev PACKAGE_REPOSITORY
4464now.
4465.It Ev PACKAGING
4466Used to be set during package creation, so that the port would test it
4467to tweak some settings at this point.
4468All its effects are now achieved through
4469.Ev MULTI_PACKAGES .
4470.It Ev PATCH_SITES
4471.Ev PATCHFILES
4472used to be retrieved from a separate site list.
4473For greater flexibility, all files are now retrieved from
4474.Ev MASTER_SITES ,
4475.Ev MASTER_SITES0 , ... ,
4476.Ev MASTER_SITES9 ,
4477using a
4478.Sq :0
4479to
4480.Sq :9
4481extension to the file name, e.g.,
4482.Bd -literal -offset indent
4483PATCHFILES=foo.diff.gz
4484PATCH_SITES=ftp://ftp.zoinx.org/pub/
4485.Ed
4486.Pp
4487becomes
4488.Bd -literal -offset indent
4489PATCHFILES=foo.diff.gz:0
4490MASTER_SITES0=ftp://ftp.zoinx.org/pub/
4491.Ed
4492.\" keep the long form so searching can find them
4493.It Ev PERMIT_DISTFILES_CDROM , PERMIT_DISTFILES_FTP , PERMIT_PACKAGE_CDROM , PERMIT_PACKAGE_FTP
4494The
4495.Ox
4496project no longer produces CD-ROMs, so the
4497.Ev PERMIT_*_CDROM
4498variables were dropped,
4499and
4500.Ev PERMIT_DISTFILES_FTP / PERMIT_PACKAGE_FTP
4501were shortened to
4502.Ev PERMIT_DISTFILES / PERMIT_PACKAGE .
4503.It Ev PKG_CMD
4504Replaced by
4505.Ev PKG_CREATE .
4506.It Ev PKGREPOSITORY
4507Old user settings.
4508See
4509.Ev PACKAGE_REPOSITORY .
4510.It Ev PKGREPOSITORYBASE
4511Old user settings.
4512See
4513.Ev PACKAGE_REPOSITORY .
4514.It Ev PLIST_SRC
4515From
4516.Nx .
4517This is PLIST.
4518.Ox
4519does not give a specific name to the generated file.
4520It is not recommended to try to access them directly.
4521.It Ev PKGNAME
4522Used to refer to the full package name, has been superseded by
4523.Ev FULLPKGNAME-foo ,
4524for
4525.Ev SUBPACKAGE
4526-foo.
4527.Ev PKGNAME
4528now holds the package name, not taking multi-packages or flavors
4529into account.
4530Most ports are not concerned by this change.
4531.It Ev PLIST_SUBST
4532From
4533.Nx
4534and
4535.Fx .
4536Use SUBST_VARS instead.
4537.Ox
4538does not allow general substitutions of the form VAR=value, but uses
4539only a list of variables instead.
4540Most package files gets transformed, instead of only the packing list.
4541.It Ev PREFERRED_CIPHERS
4542Allowing user change of cryptographic digest is dangerous.
4543.It Ev RECURSIVE_FETCH_LIST
4544No longer needed with modern
4545.Xr mirroring-ports 7 .
4546.It Ev RESTRICTED
4547Port has cryptographic issues.
4548.Ox
4549focuses on
4550.Ev PERMIT_PACKAGE
4551instead.
4552.It Ev SED_PLIST
4553Old pipeline for creating packing-lists at the ports level.
4554Necessary functionality has been integrated directly into
4555.Xr pkg_create 1 .
4556.It Ev SIGNING_PARAMETERS
4557Old user settings.
4558There is no longer any benefit to signing packages during creation.
4559.It Ev SCRIPTDIR
4560Old location for scripts related to the current port.
4561There is no reason for the semantic distinction, use
4562.Ev FILESDIR
4563for those.
4564.It Ev SCRIPTS_ENV
4565Used to contain the environment for invoking various scripts.
4566.Ev CONFIGURE_ENV
4567and
4568.Ev MAKE_ENV
4569are enough.
4570.It Ev SHARED_ONLY
4571Had to be set to
4572.Sq Yes
4573if port could only be built on architectures with shared libraries.
4574.It Ev USE_AUTOCONF
4575Use
4576.Ev CONFIGURE_STYLE
4577instead.
4578.It Ev USE_BZIP2
4579The framework will automatically detect the presence of
4580.Pa .tar.bz2
4581files to extract.
4582See also
4583.Ev BZIP2 , EXTRACT_CASES ,
4584and
4585.Ev EXTRACT_SUFX .
4586.It Ev USE_IMAKE
4587Use
4588.Ev CONFIGURE_STYLE
4589instead.
4590.It Ev USE_ZIP
4591The framework will automatically detect the presence of
4592.Pa .zip
4593files to extract.
4594See also
4595.Ev ZIP , EXTRACT_CASES ,
4596and
4597.Ev EXTRACT_SUFX .
4598.It Ev VARNAME
4599Use make show=name instead of make show VARNAME=name.
4600.It Ev WRKPKG
4601Directory used to build package information from the templates under
4602.Pa ${PKGDIR} .
4603This information is now built on the fly by
4604.Xr pkg_create 1 .
4605.El
4606.Sh OBSOLETE FILES
4607.Bl -tag -width Ds
4608.It Pa {files,patches,pkg}.${ARCH}
4609Offensive to introspection, makes it impossible to build a decent sqlports
4610on a given arch.
4611Hasn't been used for a long time, and there are lots of mechanisms such as
4612.Ev PKG_ARGS
4613and fragment substitution, or
4614.Ev PATCH_LIST
4615to achieve similar results.
4616.It Pa Makefile.${ARCH}
4617Likewise, offensive to introspection too.
4618.It Pa ${FILESDIR}/md5
4619Renamed to
4620.Pa distinfo
4621to match other
4622.Bx ,
4623and save directories.
4624.It Pa ${SCRIPTDIR}/{pre,do,post}-*
4625Identical functionality can be obtained through a
4626.Cm {pre,do,post}-*
4627target, invoking the script manually if necessary.
4628.It Pa ${SCRIPTDIR}/configure
4629No longer invoked automatically.
4630Just inline the instructions in
4631.Cm do-configure
4632in the Makefile, or put the script in ${FILESDIR} and
4633invoke it.
4634.It Pa ${PKGDIR}/COMMENT
4635Use COMMENT variable instead.
4636.It Pa ${PKGDIR}/DEINSTALL*
4637Use @unexec annotations in the packing-list instead.
4638.It Pa ${PKGDIR}/INSTALL*
4639Use @exec annotations in the packing-list instead.
4640.It Pa ${PKGDIR}/PLIST.{noshared,no-shared,shared}
4641Packaging list fragments to handle platforms that did not support
4642shared libraries.
4643.It Pa ${PKGDIR}/PLIST.sed
4644Use PLIST directly.
4645Until revision 1.295,
4646.Nm
4647did not substitute variables in the packing list unless this special form
4648was used.
4649.It Pa ${PKGDIR}/REQ*
4650Old requirement script.
4651Was mostly unused anyway.
4652.It Pa /usr/share/mk/bsd.port.mk
4653Original location of
4654.Nm .
4655The current file lives under
4656.Pa ${PORTSDIR}/infrastructure/mk/bsd.port.mk ,
4657whereas
4658.Pa /usr/share/mk/bsd.port.mk
4659is just a stub.
4660.It Pa {scripts,files,patches}.${OPSYS}
4661The
4662.Ox
4663ports tree focuses on robustness, not on being portable to other operating
4664systems.
4665In any case, portability should not need to depend on operating
4666system dependent patches.
4667.It Pa /usr/local/etc
4668Used by
4669.Fx
4670to marshall system configuration files.
4671All
4672.Ox
4673system configuration files are located in
4674.Pa /etc ,
4675or in a subdirectory of
4676.Pa /etc .
4677.El
4678.Sh SEE ALSO
4679.Xr clean-old-distfiles 1 ,
4680.Xr ftp 1 ,
4681.Xr pkg_add 1 ,
4682.Xr pkg_create 1 ,
4683.Xr OpenBSD::Intro 3p ,
4684.Xr bsd.port.arch.mk 5 ,
4685.Xr mk.conf 5 ,
4686.Xr port-modules 5 ,
4687.Xr library-specs 7 ,
4688.Xr mirroring-ports 7 ,
4689.Xr packages-specs 7 ,
4690.Xr pkgpath 7 ,
4691.Xr ports 7
4692.Sh HISTORY
4693The ports mechanism originally came from
4694.Fx .
4695A lot of additions were taken from
4696.Nx
4697over the seminal years.
4698.Pp
4699Since 1998, the framework has been systematically cleaned-up and reorganized
4700to remove bugs.
4701New features have been carefully introduced, trying hard to avoid
4702inconsistencies.
4703.Pp
4704.Ev FLAVORS ,
4705.Ev MULTI_PACKAGES ,
4706.Ev SEPARATE_BUILD
4707and FAKE are
4708.Ox
4709improvements.
4710Most recent additions do not come from another
4711.Bx .
4712.\" Voluntarily undocumented:
4713.\" AUTOCONF_ENV: probably not needed anyway, should be internal.
4714.Sh BUGS AND LIMITATIONS
4715.Ev LOCALBASE ,
4716.Ev X11BASE ,
4717.Ev BASESYSCONFDIR ,
4718.Ev VARBASE
4719and
4720.Ev PREFIX
4721are not heeded consistently.
4722Using anything but the default values has not been heavily tested.
4723Some ports may not build if you change them.
4724