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