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