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