Annotation of htdocs/docs/pkgsrc/pkgsrc.html, revision 1.178
1.1 dsieger 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2: <html>
3: <head>
4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5: <title>The pkgsrc guide</title>
1.25 spz 6: <link rel="stylesheet" type="text/css" href="/global.css">
1.1 dsieger 7: <meta name="generator" content="DocBook XSL Stylesheets VX.X.X">
8: <meta name="description" content="pkgsrc is a centralized package management system for Unix-like operating systems. This guide provides information for users and developers of pkgsrc. It covers installation of binary and source packages, creation of binary and source packages and a high-level overview about the infrastructure.">
9: </head>
1.41 asau 10: <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book">
1.1 dsieger 11: <div class="titlepage">
12: <div>
13: <div><h1 class="title">
14: <a name="the-pkgsrc-guide"></a>The pkgsrc guide</h1></div>
15: <div><h2 class="subtitle">Documentation on the NetBSD packages system</h2></div>
16: <div><div class="authorgroup">
17: <div class="author">
18: <h3 class="author">
19: <span class="firstname">Alistair</span> <span class="surname">Crooks</span>
20: </h3>
1.10 hubertf 21: <div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:agc@NetBSD.org">agc@NetBSD.org</a>></code></p></div></div>
1.1 dsieger 22: </div>
23: <div class="author">
24: <h3 class="author">
25: <span class="firstname">Hubert</span> <span class="surname">Feyrer</span>
26: </h3>
1.10 hubertf 27: <div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:hubertf@NetBSD.org">hubertf@NetBSD.org</a>></code></p></div></div>
1.1 dsieger 28: </div>
29: <h3 class="corpauthor">
30: The pkgsrc Developers
31: </h3>
32: </div></div>
1.166 leot 33: <div><p class="copyright">Copyright © 1994-2020 The NetBSD Foundation, Inc</p></div>
34: <div><p class="pubdate">$NetBSD: pkgsrc.xml,v 1.36 2020/01/03 15:55:24 leot Exp $</p></div>
1.41 asau 35: <div><div class="abstract">
1.1 dsieger 36: <p class="title"><b>Abstract</b></p>
37: <p>pkgsrc is a centralized package management system for
38: Unix-like operating systems. This guide provides information for
39: users and developers of pkgsrc. It covers installation of binary
40: and source packages, creation of binary and source packages and
41: a high-level overview about the infrastructure.</p>
42: </div></div>
43: </div>
44: <hr>
45: </div>
46: <div class="toc">
47: <p><b>Table of Contents</b></p>
1.100 leot 48: <dl class="toc">
1.1 dsieger 49: <dt><span class="chapter"><a href="#introduction">1. What is pkgsrc?</a></span></dt>
50: <dd><dl>
51: <dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt>
52: <dd><dl>
53: <dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt>
54: <dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt>
55: </dl></dd>
56: <dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt>
57: <dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt>
58: <dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd>
59: <dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt>
60: </dl></dd>
61: <dt><span class="part"><a href="#users-guide">I. The pkgsrc user's guide</a></span></dt>
62: <dd><dl>
1.154 rillig 63: <dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt>
64: <dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt>
1.1 dsieger 65: <dd><dl>
1.154 rillig 66: <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt>
1.1 dsieger 67: <dd><dl>
1.154 rillig 68: <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt>
69: <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt>
1.1 dsieger 70: </dl></dd>
1.154 rillig 71: <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt>
1.1 dsieger 72: <dd><dl>
1.154 rillig 73: <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt>
74: <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt>
1.1 dsieger 75: </dl></dd>
76: </dl></dd>
1.154 rillig 77: <dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt>
1.1 dsieger 78: <dd><dl>
1.154 rillig 79: <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt>
80: <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt>
1.1 dsieger 81: </dl></dd>
1.154 rillig 82: <dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt>
1.1 dsieger 83: <dd><dl>
1.154 rillig 84: <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt>
1.1 dsieger 85: <dd><dl>
1.154 rillig 86: <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt>
87: <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt>
88: <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt>
89: <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt>
90: <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt>
91: <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt>
92: <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt>
1.1 dsieger 93: </dl></dd>
1.154 rillig 94: <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt>
1.1 dsieger 95: <dd><dl>
1.154 rillig 96: <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt>
97: <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt>
98: <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt>
1.1 dsieger 99: </dl></dd>
100: </dl></dd>
1.154 rillig 101: <dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt>
1.1 dsieger 102: <dd><dl>
1.154 rillig 103: <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt>
104: <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt>
105: <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt>
106: <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt>
1.1 dsieger 107: <dd><dl>
1.154 rillig 108: <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt>
109: <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt>
110: <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt>
1.1 dsieger 111: </dl></dd>
1.154 rillig 112: <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt>
113: <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt>
1.1 dsieger 114: </dl></dd>
1.154 rillig 115: <dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt>
1.1 dsieger 116: <dd><dl>
1.154 rillig 117: <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt>
118: <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt>
1.6 rillig 119: </dl></dd>
1.154 rillig 120: <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk
1.6 rillig 121: builds)</a></span></dt>
1.1 dsieger 122: <dd><dl>
1.154 rillig 123: <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt>
124: <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt>
125: <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd>
126: <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt>
1.178 ! rillig 127: <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt>
! 128: <dd><dl>
! 129: <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt>
! 130: <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt>
! 131: <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt>
! 132: <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt>
! 133: <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt>
! 134: <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt>
! 135: <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt>
! 136: <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt>
! 137: <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt>
! 138: <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt>
! 139: <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt>
! 140: <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt>
! 141: </dl></dd>
! 142: <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
! 143: <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
1.154 rillig 144: </dl></dd>
145: <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt>
146: <dd><dl>
147: <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
148: <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt>
149: </dl></dd>
150: <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt>
151: <dd><dl>
152: <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
153: <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
154: <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
155: <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
156: <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt>
157: <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
158: <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
159: <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt>
160: <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
161: <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make
1.23 wiz 162: /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
1.154 rillig 163: <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt>
164: <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt>
165: <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
166: <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
167: <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
168: <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
169: <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt>
1.1 dsieger 170: </dl></dd>
171: </dl></dd>
172: <dt><span class="part"><a href="#developers-guide">II. The pkgsrc developer's guide</a></span></dt>
173: <dd><dl>
1.154 rillig 174: <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt>
175: <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt>
1.1 dsieger 176: <dd><dl>
1.154 rillig 177: <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt>
1.1 dsieger 178: <dd><dl>
1.154 rillig 179: <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt>
180: <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt>
1.160 brook 181: <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt>
182: <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt>
1.1 dsieger 183: </dl></dd>
1.154 rillig 184: <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt>
185: <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd>
1.6 rillig 186: </dl></dd>
1.154 rillig 187: <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt>
1.6 rillig 188: <dd><dl>
1.154 rillig 189: <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt>
190: <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt>
191: <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt>
1.6 rillig 192: <dd><dl>
1.154 rillig 193: <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt>
194: <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt>
195: <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt>
196: <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt>
197: <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt>
1.6 rillig 198: </dl></dd>
1.154 rillig 199: <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt>
200: <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt>
1.6 rillig 201: <dd><dl>
1.154 rillig 202: <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt>
203: <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt>
204: <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt>
1.6 rillig 205: </dl></dd>
1.154 rillig 206: <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt>
207: <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt>
1.6 rillig 208: </dl></dd>
1.154 rillig 209: <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt>
1.6 rillig 210: <dd><dl>
1.154 rillig 211: <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt>
212: <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt>
213: <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd>
214: <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt>
1.6 rillig 215: <dd><dl>
1.154 rillig 216: <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt>
217: <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt>
218: <dt><span class="sect2"><a href="#cflags-gnu-configure">14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt>
219: <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt>
1.6 rillig 220: </dl></dd>
221: </dl></dd>
1.154 rillig 222: <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt>
1.6 rillig 223: <dd><dl>
1.154 rillig 224: <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt>
225: <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
226: <dt><span class="sect1"><a href="#print-PLIST">15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt>
227: <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt>
228: <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt>
229: <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
230: <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt>
231: <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt>
232: <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt>
1.6 rillig 233: </dl></dd>
1.154 rillig 234: <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt>
1.6 rillig 235: <dd><dl>
1.154 rillig 236: <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt>
237: <dt><span class="sect1"><a href="#creating-buildlink3.mk">16.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.6 rillig 238: <dd><dl>
1.154 rillig 239: <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt>
240: <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating
1.26 wiz 241: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
242: and
243: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
244: in <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.6 rillig 245: </dl></dd>
1.154 rillig 246: <dt><span class="sect1"><a href="#writing-builtin.mk">16.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt>
1.6 rillig 247: <dd><dl>
1.154 rillig 248: <dt><span class="sect2"><a href="#anatomy-of-builtin.mk">16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt>
249: <dt><span class="sect2"><a href="#native-or-pkgsrc-preference">16.3.2. Global preferences for native or pkgsrc software</a></span></dt>
1.6 rillig 250: </dl></dd>
251: </dl></dd>
1.154 rillig 252: <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt>
1.6 rillig 253: <dd><dl>
1.154 rillig 254: <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt>
255: <dd><dl>
256: <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt>
257: <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt>
258: </dl></dd>
259: <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt>
260: <dd><dl>
261: <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt>
262: <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt>
263: <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt>
264: <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt>
265: </dl></dd>
266: <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt>
267: <dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">17.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd>
268: <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt>
269: <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt>
270: <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd>
271: <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt>
272: <dd><dl><dt><span class="sect2"><a href="#fonts-disable">17.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd>
273: </dl></dd>
274: <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt>
275: <dd><dl>
276: <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt>
277: <dt><span class="sect1"><a href="#converting-to-options">18.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt>
278: <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt>
279: <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt>
280: </dl></dd>
281: <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt>
282: <dd><dl>
283: <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt>
284: <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt>
285: <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt>
286: <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt>
287: <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
288: <dd><dl>
289: <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt>
290: <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt>
291: </dl></dd>
292: <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt>
293: <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt>
294: <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt>
295: <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt>
296: <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt>
297: <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
298: <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
299: <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt>
300: <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
301: <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt>
302: <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt>
303: <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt>
304: </dl></dd>
305: <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt>
306: <dd><dl>
307: <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt>
308: <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt>
309: <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt>
310: </dl></dd>
311: <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt>
312: <dd><dl>
313: <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt>
314: <dd><dl>
315: <dt><span class="sect2"><a href="#pulling-vars-from-etc-mk.conf">21.1.1. How to pull in user-settable variables from <code class="filename">mk.conf</code></a></span></dt>
316: <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt>
317: <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt>
318: <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt>
319: <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt>
320: <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt>
321: <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt>
322: <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt>
323: <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt>
324: <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt>
325: <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt>
326: </dl></dd>
327: <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
328: <dd><dl>
329: <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt>
330: <dt><span class="sect2"><a href="#modified-distfiles-same-name">21.2.2. How to handle modified distfiles with the 'old' name</a></span></dt>
331: <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt>
332: </dl></dd>
333: <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
334: <dd><dl>
335: <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt>
336: <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt>
337: <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt>
338: </dl></dd>
339: <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt>
340: <dd><dl>
341: <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt>
342: <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt>
343: <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt>
344: <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt>
345: <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt>
346: </dl></dd>
347: <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
348: <dd><dl>
349: <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt>
350: <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt>
1.172 rillig 351: <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt>
352: <dt><span class="sect2"><a href="#undefined-reference">21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span></a></span></dt>
353: <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt>
1.154 rillig 354: </dl></dd>
355: <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
356: <dd><dl>
357: <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt>
358: <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt>
359: <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt>
360: <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt>
361: <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt>
362: <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt>
363: <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt>
364: <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt>
365: <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt>
366: <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt>
367: <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt>
368: <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt>
369: <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt>
370: <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt>
371: <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt>
372: <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt>
373: <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt>
374: <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in
1.1 dsieger 375: emulation</a></span></dt>
1.154 rillig 376: <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt>
377: <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt>
1.1 dsieger 378: </dl></dd>
1.154 rillig 379: <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt>
1.1 dsieger 380: </dl></dd>
1.154 rillig 381: <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt>
382: <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt>
1.1 dsieger 383: <dd><dl>
1.154 rillig 384: <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt>
385: <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt>
386: <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt>
387: <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt>
388: <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt>
389: <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt>
390: <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt>
391: <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt>
392: </dl></dd>
393: <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt>
394: <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt>
395: <dd><dl>
396: <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt>
397: <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt>
398: <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt>
399: <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt>
1.1 dsieger 400: </dl></dd>
401: </dl></dd>
402: <dt><span class="part"><a href="#infrastructure">III. The pkgsrc infrastructure internals</a></span></dt>
403: <dd><dl>
1.154 rillig 404: <dt><span class="chapter"><a href="#infr.design">26. Design of the pkgsrc infrastructure</a></span></dt>
1.1 dsieger 405: <dd><dl>
1.154 rillig 406: <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt>
407: <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt>
408: <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt>
1.1 dsieger 409: <dd><dl>
1.154 rillig 410: <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt>
411: <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt>
1.1 dsieger 412: </dl></dd>
1.154 rillig 413: <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt>
414: <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt>
1.1 dsieger 415: <dd><dl>
1.154 rillig 416: <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt>
417: <dt><span class="sect2"><a href="#infr.design.intf.action">26.5.2. Actions taken on behalf of parameters</a></span></dt>
1.1 dsieger 418: </dl></dd>
1.154 rillig 419: <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt>
1.1 dsieger 420: <dd><dl>
1.154 rillig 421: <dt><span class="sect2"><a href="#infr.order.prefs">26.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt>
422: <dt><span class="sect2"><a href="#infr.order.pkg">26.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt>
1.1 dsieger 423: </dl></dd>
424: </dl></dd>
1.154 rillig 425: <dt><span class="chapter"><a href="#regression">27. Regression tests</a></span></dt>
1.1 dsieger 426: <dd><dl>
1.154 rillig 427: <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt>
428: <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt>
1.1 dsieger 429: <dd><dl>
1.154 rillig 430: <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt>
431: <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt>
1.1 dsieger 432: </dl></dd>
433: </dl></dd>
1.154 rillig 434: <dt><span class="chapter"><a href="#porting">28. Porting pkgsrc</a></span></dt>
435: <dd><dl><dt><span class="sect1"><a href="#porting.opsys">28.1. Porting pkgsrc to a new operating system</a></span></dt></dl></dd>
1.1 dsieger 436: </dl></dd>
437: <dt><span class="appendix"><a href="#examples">A. A simple example package: bison</a></span></dt>
438: <dd><dl>
439: <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt>
440: <dd><dl>
441: <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt>
442: <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt>
443: <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt>
1.172 rillig 444: <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with pkglint</a></span></dt>
1.1 dsieger 445: </dl></dd>
446: <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt>
447: </dl></dd>
448: <dt><span class="appendix"><a href="#logs">B. Build logs</a></span></dt>
449: <dd><dl>
450: <dt><span class="sect1"><a href="#logs.building">B.1. Building figlet</a></span></dt>
451: <dt><span class="sect1"><a href="#logs.package">B.2. Packaging figlet</a></span></dt>
452: </dl></dd>
453: <dt><span class="appendix"><a href="#ftp-layout">C. Directory layout of the pkgsrc FTP server</a></span></dt>
454: <dd><dl>
1.23 wiz 455: <dt><span class="sect1"><a href="#ftp-distfiles">C.1. <code class="filename">distfiles</code>: The distributed source files</a></span></dt>
456: <dt><span class="sect1"><a href="#ftp-misc">C.2. <code class="filename">misc</code>: Miscellaneous things</a></span></dt>
457: <dt><span class="sect1"><a href="#ftp-packages">C.3. <code class="filename">packages</code>: Binary packages</a></span></dt>
458: <dt><span class="sect1"><a href="#ftp-reports">C.4. <code class="filename">reports</code>: Bulk build reports</a></span></dt>
459: <dt><span class="sect1"><a href="#ftp-source">C.5. <code class="filename">current</code>,
1.148 leot 460: <code class="filename">stable</code>,
1.23 wiz 461: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>:
1.1 dsieger 462: source packages</a></span></dt>
463: </dl></dd>
1.154 rillig 464: <dt><span class="appendix"><a href="#help-topics">D. Help topics</a></span></dt>
465: <dt><span class="appendix"><a href="#editing">E. Editing guidelines for the pkgsrc guide</a></span></dt>
1.1 dsieger 466: <dd><dl>
1.154 rillig 467: <dt><span class="sect1"><a href="#targets">E.1. Make targets</a></span></dt>
468: <dt><span class="sect1"><a href="#procedure">E.2. Procedure</a></span></dt>
1.1 dsieger 469: </dl></dd>
470: </dl>
471: </div>
472: <div class="list-of-tables">
473: <p><b>List of Tables</b></p>
474: <dl>
475: <dt>1.1. <a href="#supported-platforms">Platforms supported by pkgsrc</a>
476: </dt>
1.154 rillig 477: <dt>13.1. <a href="#patch-examples">Patching examples</a>
1.1 dsieger 478: </dt>
1.154 rillig 479: <dt>25.1. <a href="#plist-handling">PLIST handling for GNOME packages</a>
1.1 dsieger 480: </dt>
481: </dl>
482: </div>
1.41 asau 483: <div class="chapter">
484: <div class="titlepage"><div><div><h1 class="title">
485: <a name="introduction"></a>Chapter 1. What is pkgsrc?</h1></div></div></div>
1.1 dsieger 486: <div class="toc">
487: <p><b>Table of Contents</b></p>
1.100 leot 488: <dl class="toc">
1.1 dsieger 489: <dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt>
490: <dd><dl>
491: <dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt>
492: <dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt>
493: </dl></dd>
494: <dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt>
495: <dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt>
496: <dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd>
497: <dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt>
498: </dl>
499: </div>
1.41 asau 500: <div class="sect1">
1.1 dsieger 501: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
502: <a name="introduction-section"></a>1.1. Introduction</h2></div></div></div>
503: <p>There is a lot of software freely available for Unix-based
504: systems, which is usually available in form of the source code. Before
505: such software can be used, it needs to be configured to the local
506: system, compiled and installed, and this is exactly what The NetBSD
507: Packages Collection (pkgsrc) does. pkgsrc also has some basic commands
508: to handle binary packages, so that not every user has to build the
509: packages for himself, which is a time-costly task.</p>
510: <p>pkgsrc currently contains several thousand packages,
511: including:</p>
1.41 asau 512: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 513: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/apache24/README.html" target="_top"><code class="filename">www/apache24</code></a> - The Apache
1.1 dsieger 514: web server</p></li>
1.137 leot 515: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a> - The Firefox
1.1 dsieger 516: web browser</p></li>
1.137 leot 517: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome/README.html" target="_top"><code class="filename">meta-pkgs/gnome</code></a> - The GNOME
1.1 dsieger 518: Desktop Environment</p></li>
1.137 leot 519: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a> - The K
1.1 dsieger 520: Desktop Environment</p></li>
521: </ul></div>
1.108 rillig 522: <p>… just to name a few.</p>
1.1 dsieger 523: <p>pkgsrc has built-in support for handling varying dependencies,
524: such as pthreads and X11, and extended features such as IPv6 support on
525: a range of platforms.</p>
1.41 asau 526: <div class="sect2">
1.1 dsieger 527: <div class="titlepage"><div><div><h3 class="title">
528: <a name="why-pkgsrc"></a>1.1.1. Why pkgsrc?</h3></div></div></div>
529: <p>
530: pkgsrc provides the following key features:
531: </p>
1.41 asau 532: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 533: <li class="listitem"><p>Easy building of software from source as well as the creation
1.1 dsieger 534: and installation of binary packages. The source and latest
535: patches are retrieved from a master or mirror download site, checksum
536: verified, then built on your system. Support for binary-only
537: distributions is available for both native platforms and NetBSD
538: emulated platforms.</p></li>
1.23 wiz 539: <li class="listitem"><p>All packages are installed in a consistent directory tree,
1.1 dsieger 540: including binaries, libraries, man pages and other
541: documentation.</p></li>
1.104 sevan 542: <li class="listitem"><p>Tracking of package dependencies automatically, including when
543: performing updates, to ensure required packages are installed. The
544: configuration files of various packages are handled automatically during
545: updates, so local changes are preserved.</p></li>
1.23 wiz 546: <li class="listitem"><p>Like NetBSD, pkgsrc is designed with portability in mind and
1.1 dsieger 547: consists of highly portable code. This allows the greatest speed of
1.25 spz 548: development when porting to a new platform. This portability also
1.1 dsieger 549: ensures that pkgsrc is <span class="emphasis"><em>consistent across all
550: platforms</em></span>.</p></li>
1.23 wiz 551: <li class="listitem"><p>The installation prefix, acceptable software licenses,
1.1 dsieger 552: international encryption requirements and build-time options for a
553: large number of packages are all set in a simple, central
554: configuration file.</p></li>
1.23 wiz 555: <li class="listitem"><p>The entire source (not including the distribution files) is
1.1 dsieger 556: freely available under a BSD license, so you may extend and adapt
557: pkgsrc to your needs. Support for local packages and patches is
558: available right out of the box, so you can configure it specifically
559: for your environment.</p></li>
560: </ul></div>
561: <p>The following principles are basic to pkgsrc:</p>
1.41 asau 562: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 563: <li class="listitem"><p><span class="quote">“<span class="quote">It should only work if it's right.</span>”</span>
1.14 jmcneill 564: — That means, if a package contains bugs, it's better to find
1.1 dsieger 565: them and to complain about them rather than to just install the package
566: and hope that it works. There are numerous checks in pkgsrc that try to
1.175 gutterid 567: find such bugs: static analysis tools (<a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>), build-time checks (portability
1.1 dsieger 568: of shell scripts), and post-installation checks (installed files,
569: references to shared libraries, script interpreters).</p></li>
1.23 wiz 570: <li class="listitem"><p><span class="quote">“<span class="quote">If it works, it should work everywhere</span>”</span>
1.14 jmcneill 571: — Like NetBSD has been ported to many hardware architectures,
1.1 dsieger 572: pkgsrc has been ported to many operating systems. Care is taken that
573: packages behave the same on all platforms.</p></li>
574: </ul></div>
575: </div>
1.41 asau 576: <div class="sect2">
1.1 dsieger 577: <div class="titlepage"><div><div><h3 class="title">
578: <a name="intro.platforms"></a>1.1.2. Supported platforms</h3></div></div></div>
579: <p>pkgsrc consists of both a source distribution and a binary
580: distribution for these operating systems. After retrieving the required
581: source or binaries, you can be up and running with pkgsrc in just
582: minutes!</p>
583: <p>pkgsrc was derived from FreeBSD's ports system, and
584: initially developed for NetBSD only. Since then, pkgsrc has
585: grown a lot, and now supports the following platforms:</p>
586: <div class="table">
587: <a name="supported-platforms"></a><p class="title"><b>Table 1.1. Platforms supported by pkgsrc</b></p>
1.106 tnn 588: <div class="table-contents"><table class="table" summary="Platforms supported by pkgsrc" border="1">
1.1 dsieger 589: <colgroup>
590: <col>
591: <col>
1.92 sevan 592: <col>
1.1 dsieger 593: </colgroup>
594: <thead><tr>
595: <th>Platform</th>
596: <th>Date Support Added</th>
1.92 sevan 597: <th>Notes</th>
1.1 dsieger 598: </tr></thead>
599: <tbody>
600: <tr>
1.174 leot 601: <td><a class="ulink" href="https://www.NetBSD.org/" target="_top">NetBSD</a></td>
1.1 dsieger 602: <td align="center">Aug 1997</td>
1.92 sevan 603: <td class="auto-generated"> </td>
1.1 dsieger 604: </tr>
605: <tr>
1.10 hubertf 606: <td><a class="ulink" href="http://wwws.sun.com/software/solaris/" target="_top">Solaris</a></td>
1.1 dsieger 607: <td align="center">Mar 1999</td>
1.151 sevan 608: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Solaris" target="_top">README.Solaris</a></td>
1.1 dsieger 609: </tr>
610: <tr>
1.174 leot 611: <td><a class="ulink" href="https://www.kernel.org/" target="_top">Linux</a></td>
1.1 dsieger 612: <td align="center">Jun 1999</td>
1.151 sevan 613: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Linux" target="_top">README.Linux</a></td>
1.1 dsieger 614: </tr>
615: <tr>
616: <td>
1.118 sevan 617: <a class="ulink" href="https://developer.apple.com/macos/" target="_top">Darwin / Mac OS X / OS X / macOS</a>
1.1 dsieger 618: </td>
619: <td align="center">Oct 2001</td>
1.151 sevan 620: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.MacOSX" target="_top">README.MacOSX</a></td>
1.1 dsieger 621: </tr>
622: <tr>
1.174 leot 623: <td><a class="ulink" href="https://www.freebsd.org/" target="_top">FreeBSD</a></td>
1.1 dsieger 624: <td align="center">Nov 2002</td>
1.151 sevan 625: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.FreeBSD" target="_top">README.FreeBSD</a></td>
1.1 dsieger 626: </tr>
627: <tr>
1.174 leot 628: <td><a class="ulink" href="https://www.openbsd.org/" target="_top">OpenBSD</a></td>
1.1 dsieger 629: <td align="center">Nov 2002</td>
1.151 sevan 630: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OpenBSD" target="_top">README.OpenBSD</a></td>
1.1 dsieger 631: </tr>
632: <tr>
1.174 leot 633: <td><a class="ulink" href="https://www.sgi.com/software/irix/" target="_top">IRIX</a></td>
1.1 dsieger 634: <td align="center">Dec 2002</td>
1.92 sevan 635: <td>
1.151 sevan 636: <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX" target="_top">README.IRIX</a>
637: <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX5.3" target="_top">README.IRIX5.3</a>
1.92 sevan 638: </td>
1.1 dsieger 639: </tr>
640: <tr>
641: <td>BSD/OS</td>
642: <td align="center">Dec 2003</td>
1.92 sevan 643: <td class="auto-generated"> </td>
1.1 dsieger 644: </tr>
645: <tr>
1.174 leot 646: <td><a class="ulink" href="https://www-1.ibm.com/servers/aix/" target="_top">AIX</a></td>
1.1 dsieger 647: <td align="center">Dec 2003</td>
1.151 sevan 648: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.AIX" target="_top">README.AIX</a></td>
1.1 dsieger 649: </tr>
650: <tr>
651: <td>
1.174 leot 652: <a class="ulink" href="https://www.microsoft.com/windows/sfu/" target="_top">Interix</a>
1.1 dsieger 653: (Microsoft Windows Services for Unix)
654: </td>
655: <td align="center">Mar 2004</td>
1.151 sevan 656: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Interix" target="_top">README.Interix</a></td>
1.1 dsieger 657: </tr>
658: <tr>
1.174 leot 659: <td><a class="ulink" href="https://www.dragonflybsd.org/" target="_top">DragonFlyBSD</a></td>
1.1 dsieger 660: <td align="center">Oct 2004</td>
1.92 sevan 661: <td class="auto-generated"> </td>
1.1 dsieger 662: </tr>
663: <tr>
1.10 hubertf 664: <td><a class="ulink" href="http://www.tru64.org/" target="_top">OSF/1</a></td>
1.1 dsieger 665: <td align="center">Nov 2004</td>
1.151 sevan 666: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OSF1" target="_top">README.OSF1</a></td>
1.1 dsieger 667: </tr>
668: <tr>
1.174 leot 669: <td><a class="ulink" href="https://www.hp.com/products1/unix/" target="_top">HP-UX</a></td>
1.1 dsieger 670: <td align="center">Apr 2007</td>
1.151 sevan 671: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.HPUX" target="_top">README.HPUX</a></td>
1.1 dsieger 672: </tr>
1.23 wiz 673: <tr>
1.174 leot 674: <td><a class="ulink" href="https://www.haiku-os.org/" target="_top">Haiku</a></td>
1.23 wiz 675: <td align="center">Sep 2010</td>
1.151 sevan 676: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Haiku" target="_top">README.Haiku</a></td>
1.23 wiz 677: </tr>
1.45 obache 678: <tr>
1.174 leot 679: <td><a class="ulink" href="https://www.mirbsd.org/" target="_top">MirBSD</a></td>
1.57 bsiegert 680: <td align="center">Jan 2011</td>
1.92 sevan 681: <td class="auto-generated"> </td>
1.45 obache 682: </tr>
683: <tr>
1.174 leot 684: <td><a class="ulink" href="https://www.minix3.org/" target="_top">Minix3</a></td>
1.45 obache 685: <td align="center">Nov 2011</td>
1.151 sevan 686: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Minix3" target="_top">README.Minix3</a></td>
1.45 obache 687: </tr>
688: <tr>
1.174 leot 689: <td><a class="ulink" href="https://cygwin.com/" target="_top">Cygwin</a></td>
1.45 obache 690: <td align="center">Mar 2013</td>
1.151 sevan 691: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Cygwin" target="_top">README.Cygwin</a></td>
1.45 obache 692: </tr>
1.58 ryoon 693: <tr>
1.174 leot 694: <td><a class="ulink" href="https://www.debian.org/ports/kfreebsd-gnu/" target="_top">GNU/kFreeBSD</a></td>
1.58 ryoon 695: <td align="center">Jul 2013</td>
1.151 sevan 696: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.GNUkFreeBSD" target="_top">README.GNUkFreeBSD</a></td>
1.58 ryoon 697: </tr>
1.104 sevan 698: <tr>
1.174 leot 699: <td><a class="ulink" href="https://www.bitrig.org/" target="_top">Bitrig</a></td>
1.104 sevan 700: <td align="center">Jun 2014</td>
1.151 sevan 701: <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Bitrig" target="_top">README.Bitrig</a></td>
1.104 sevan 702: </tr>
1.1 dsieger 703: </tbody>
704: </table></div>
705: </div>
706: <br class="table-break">
707: </div>
708: </div>
1.41 asau 709: <div class="sect1">
1.1 dsieger 710: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
711: <a name="overview"></a>1.2. Overview</h2></div></div></div>
712: <p>This document is divided into three parts. The first,
1.10 hubertf 713: <a class="link" href="#users-guide" title="Part I. The pkgsrc user's guide">The pkgsrc user's guide</a>,
1.1 dsieger 714: describes how one can use one of the packages in the Package
715: Collection, either by installing a precompiled binary package,
716: or by building one's own copy using the NetBSD package system.
1.10 hubertf 717: The second part, <a class="link" href="#developers-guide" title="Part II. The pkgsrc developer's guide">The pkgsrc developer's guide</a>, explains how to prepare a
1.1 dsieger 718: package so it can be easily built by other NetBSD users without
719: knowing about the package's building details. The third part,
1.10 hubertf 720: <a class="link" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">The pkgsrc infrastructure internals</a>
1.1 dsieger 721: is intended for those who want to understand how pkgsrc is
722: implemented.</p>
723: <p>This document is available in various formats:
1.10 hubertf 724: <span class="simplelist"><a class="ulink" href="index.html" target="_top">HTML</a>, <a class="ulink" href="pkgsrc.pdf" target="_top">PDF</a>, <a class="ulink" href="pkgsrc.ps" target="_top">PS</a>, <a class="ulink" href="pkgsrc.txt" target="_top">TXT</a></span>.</p>
1.1 dsieger 725: </div>
1.41 asau 726: <div class="sect1">
1.1 dsieger 727: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
728: <a name="terminology"></a>1.3. Terminology</h2></div></div></div>
1.23 wiz 729: <p>There has been a lot of talk about <span class="quote">“<span class="quote">ports</span>”</span>,
730: <span class="quote">“<span class="quote">packages</span>”</span>, etc. so far. Here is a description of all the
1.1 dsieger 731: terminology used within this document.</p>
1.41 asau 732: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 733: <dt><span class="term">Package</span></dt>
734: <dd><p>A set of files and building instructions
735: that describe what's necessary
736: to build a certain piece of software using
737: pkgsrc. Packages are traditionally stored under
1.123 wiz 738: <code class="filename">/usr/pkgsrc</code>,
739: but may be stored in any location,
740: referred to as <code class="varname">PKGSRCDIR</code>.</p></dd>
1.1 dsieger 741: <dt><span class="term">The NetBSD package system</span></dt>
1.23 wiz 742: <dd><p>This is the former name of <span class="quote">“<span class="quote">pkgsrc</span>”</span>. It
1.1 dsieger 743: is part of the NetBSD operating system and can be bootstrapped
744: to run on non-NetBSD operating systems as well. It handles
745: building (compiling), installing, and removing of
746: packages.</p></dd>
747: <dt><span class="term">Distfile</span></dt>
748: <dd><p>This term describes the file or files that are
749: provided by the author of the piece of software to
750: distribute his work. All the changes necessary to build on
751: NetBSD are reflected in the corresponding package. Usually
752: the distfile is in the form of a compressed tar-archive,
753: but other types are possible, too. Distfiles are usually
754: stored below
755: <code class="filename">/usr/pkgsrc/distfiles</code>.</p></dd>
756: <dt><span class="term">Port</span></dt>
757: <dd><p>This is the term used by FreeBSD and OpenBSD people
758: for what we call a package.
1.23 wiz 759: In NetBSD terminology, <span class="quote">“<span class="quote">port</span>”</span> refers to a different
1.1 dsieger 760: architecture.</p></dd>
761: <dt><span class="term">Precompiled/binary package</span></dt>
762: <dd>
763: <p>A set of binaries built with pkgsrc from a distfile
764: and stuffed together in a single <code class="filename">.tgz</code>
765: file so it can be installed on machines of the same
766: machine architecture without the need to
767: recompile. Packages are usually generated in
768: <code class="filename">/usr/pkgsrc/packages</code>; there is also
1.25 spz 769: an archive on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/" target="_top">ftp.NetBSD.org</a>.</p>
1.23 wiz 770: <p>Sometimes, this is referred to by the term <span class="quote">“<span class="quote">package</span>”</span> too,
1.1 dsieger 771: especially in the context of precompiled packages.</p>
772: </dd>
773: <dt><span class="term">Program</span></dt>
774: <dd><p>The piece of software to be installed which will be
775: constructed from all the files in the distfile by the
776: actions defined in the corresponding package.</p></dd>
777: </dl></div>
1.41 asau 778: <div class="sect2">
1.1 dsieger 779: <div class="titlepage"><div><div><h3 class="title">
780: <a name="term.roles"></a>1.3.1. Roles involved in pkgsrc</h3></div></div></div>
1.41 asau 781: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 782: <dt><span class="term">pkgsrc users</span></dt>
783: <dd>
784: <p>The
785: pkgsrc users are people who use the packages provided by pkgsrc.
786: Typically they are system administrators. The people using the
1.23 wiz 787: software that is inside the packages (maybe called <span class="quote">“<span class="quote">end
788: users</span>”</span>) are not covered by the pkgsrc guide.</p>
1.1 dsieger 789: <p>There are two kinds of pkgsrc users: Some only want to
790: install pre-built binary packages. Others build the pkgsrc
791: packages from source, either for installing them directly or for
1.10 hubertf 792: building binary packages themselves. For pkgsrc users <a class="xref" href="#users-guide" title="Part I. The pkgsrc user's guide">Part I, “The pkgsrc user's guide”</a> should provide all necessary
1.1 dsieger 793: documentation.</p>
794: </dd>
795: <dt><span class="term">package maintainers</span></dt>
796: <dd><p>A
1.10 hubertf 797: package maintainer creates packages as described in <a class="xref" href="#developers-guide" title="Part II. The pkgsrc developer's guide">Part II, “The pkgsrc developer's guide”</a>.</p></dd>
1.1 dsieger 798: <dt><span class="term">infrastructure developers</span></dt>
799: <dd><p>These people are involved in all those files
800: that live in the <code class="filename">mk/</code> directory and below.
1.10 hubertf 801: Only these people should need to read through <a class="xref" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">Part III, “The pkgsrc infrastructure internals”</a>, though others might be curious,
1.1 dsieger 802: too.</p></dd>
803: </dl></div>
804: </div>
805: </div>
1.41 asau 806: <div class="sect1">
1.1 dsieger 807: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
808: <a name="typography"></a>1.4. Typography</h2></div></div></div>
809: <p>When giving examples for commands, shell prompts are used to
810: show if the command should/can be issued as root, or if
1.23 wiz 811: <span class="quote">“<span class="quote">normal</span>”</span> user privileges are sufficient. We use a
1.115 sevan 812: <code class="prompt">#</code> for root's shell prompt, a <code class="prompt">%</code> for users'
813: shell prompt, assuming they use the C-shell or tcsh and a <code class="prompt">$</code> for
814: bourne shell and derivatives.</p>
1.1 dsieger 815: </div>
816: </div>
1.41 asau 817: <div class="part">
1.1 dsieger 818: <div class="titlepage"><div><div><h1 class="title">
819: <a name="users-guide"></a>Part I. The pkgsrc user's guide</h1></div></div></div>
820: <div class="toc">
821: <p><b>Table of Contents</b></p>
1.100 leot 822: <dl class="toc">
1.154 rillig 823: <dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt>
824: <dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt>
1.1 dsieger 825: <dd><dl>
1.154 rillig 826: <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt>
1.1 dsieger 827: <dd><dl>
1.154 rillig 828: <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt>
829: <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt>
1.1 dsieger 830: </dl></dd>
1.154 rillig 831: <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt>
1.1 dsieger 832: <dd><dl>
1.154 rillig 833: <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt>
834: <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt>
1.1 dsieger 835: </dl></dd>
836: </dl></dd>
1.154 rillig 837: <dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt>
1.1 dsieger 838: <dd><dl>
1.154 rillig 839: <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt>
840: <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt>
1.1 dsieger 841: </dl></dd>
1.154 rillig 842: <dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt>
1.1 dsieger 843: <dd><dl>
1.154 rillig 844: <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt>
1.1 dsieger 845: <dd><dl>
1.154 rillig 846: <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt>
847: <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt>
848: <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt>
849: <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt>
850: <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt>
851: <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt>
852: <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt>
1.1 dsieger 853: </dl></dd>
1.154 rillig 854: <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt>
1.1 dsieger 855: <dd><dl>
1.154 rillig 856: <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt>
857: <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt>
858: <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt>
1.1 dsieger 859: </dl></dd>
860: </dl></dd>
1.154 rillig 861: <dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt>
1.1 dsieger 862: <dd><dl>
1.154 rillig 863: <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt>
864: <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt>
865: <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt>
866: <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt>
1.1 dsieger 867: <dd><dl>
1.154 rillig 868: <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt>
869: <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt>
870: <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt>
1.1 dsieger 871: </dl></dd>
1.154 rillig 872: <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt>
873: <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt>
1.1 dsieger 874: </dl></dd>
1.154 rillig 875: <dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt>
1.1 dsieger 876: <dd><dl>
1.154 rillig 877: <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt>
878: <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt>
1.6 rillig 879: </dl></dd>
1.154 rillig 880: <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk
1.6 rillig 881: builds)</a></span></dt>
1.1 dsieger 882: <dd><dl>
1.154 rillig 883: <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt>
884: <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt>
885: <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd>
886: <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt>
1.178 ! rillig 887: <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt>
! 888: <dd><dl>
! 889: <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt>
! 890: <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt>
! 891: <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt>
! 892: <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt>
! 893: <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt>
! 894: <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt>
! 895: <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt>
! 896: <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt>
! 897: <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt>
! 898: <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt>
! 899: <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt>
! 900: <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt>
! 901: </dl></dd>
! 902: <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
! 903: <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
1.154 rillig 904: </dl></dd>
905: <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt>
906: <dd><dl>
907: <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
908: <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt>
909: </dl></dd>
910: <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt>
911: <dd><dl>
912: <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
913: <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
914: <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
915: <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
916: <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt>
917: <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
918: <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
919: <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt>
920: <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
921: <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make
1.23 wiz 922: /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
1.154 rillig 923: <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt>
924: <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt>
925: <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
926: <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
927: <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
928: <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
929: <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt>
1.1 dsieger 930: </dl></dd>
931: </dl>
932: </div>
1.41 asau 933: <div class="chapter">
1.1 dsieger 934: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 935: <a name="help-user"></a>Chapter 2. Getting help</h2></div></div></div>
936: <p>
937: To get help when using pkgsrc, the definitive source is this
938: document, the pkgsrc guide. If you don't find anything here,
939: there are alternatives:
940: </p>
941: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
942: <li class="listitem">
943: <p>
944: The built-in pkgsrc help, which is available after bootstrapping
945: pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get
946: help for any topic, such as a variable name like
947: <code class="varname">BUILD_DEFS</code>, a make target like
948: <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like
949: <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p>
950: <p>The available help topics are listed in <a class="xref" href="#help-topics" title="Appendix D. Help topics">Appendix D, <i>Help topics</i></a>.</p>
951: </li>
952: <li class="listitem"><p>
1.163 rillig 953: To see the value of a single variable, run <span class="command"><strong>bmake
954: show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>.
955: </p></li>
956: <li class="listitem"><p>
957: To see the values of the most common variables, run
958: <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by
959: topic. To see the variables for a single topic, run
960: <span class="command"><strong>bmake
961: show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example
962: <span class="command"><strong>bmake show-all-fetch</strong></span>.
963: </p></li>
964: <li class="listitem"><p>
1.154 rillig 965: The pkgsrc-users mailing list, to which
966: <a class="ulink" href="https://www.NetBSD.org/mailinglists/#pkgsrc-users" target="_top">you
967: can subscribe</a> and then <a class="ulink" href="mailto:pkgsrc-users@NetBSD.org" target="_top">ask your
968: questions</a>.</p></li>
969: <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible
970: <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a>
971: or by using a specialized chat program such as
972: <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>.
973: Pick any user name and join the channel #pkgsrc.</p></li>
974: </ul></div>
975: </div>
976: <div class="chapter">
977: <div class="titlepage"><div><div><h2 class="title">
978: <a name="getting"></a>Chapter 3. Where to get pkgsrc and how to keep it up-to-date</h2></div></div></div>
1.1 dsieger 979: <div class="toc">
980: <p><b>Table of Contents</b></p>
1.100 leot 981: <dl class="toc">
1.154 rillig 982: <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt>
1.1 dsieger 983: <dd><dl>
1.154 rillig 984: <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt>
985: <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt>
1.1 dsieger 986: </dl></dd>
1.154 rillig 987: <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt>
1.1 dsieger 988: <dd><dl>
1.154 rillig 989: <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt>
990: <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt>
1.1 dsieger 991: </dl></dd>
992: </dl>
993: </div>
994: <p>Before you download and extract the files, you need to decide
995: where you want to extract them. When using pkgsrc as root user, pkgsrc
996: is usually installed in <code class="filename">/usr/pkgsrc</code>. You are though
997: free to install the sources and binary packages wherever you want in
998: your filesystem, provided that the pathname does not contain white-space
999: or other characters that are interpreted specially by the shell and some
1000: other programs. A safe bet is to use only letters, digits, underscores
1001: and dashes.</p>
1.41 asau 1002: <div class="sect1">
1.1 dsieger 1003: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1004: <a name="getting-first"></a>3.1. Getting pkgsrc for the first time</h2></div></div></div>
1.1 dsieger 1005: <p>Before you download any pkgsrc files, you should decide
1006: whether you want the <span class="emphasis"><em>current</em></span> branch or the
1007: <span class="emphasis"><em>stable</em></span> branch. The latter is forked on a
1008: quarterly basis from the current branch and only gets modified
1009: for security updates. The names of the stable branches are built
1010: from the year and the quarter, for example
1.174 leot 1011: <code class="literal">2020Q1</code>.</p>
1.1 dsieger 1012: <p>The second step is to decide <span class="emphasis"><em>how</em></span> you
1.23 wiz 1013: want to download pkgsrc. You can get it as a tar file or via CVS.
1014: Both ways are described here.</p>
1.51 asau 1015: <p>Note that tar archive contains CVS working copy.
1016: Thus you can switch to using CVS at any later time.</p>
1.41 asau 1017: <div class="sect2">
1.1 dsieger 1018: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1019: <a name="getting-via-tar"></a>3.1.1. As tar archive</h3></div></div></div>
1.1 dsieger 1020: <p>The primary download location for all pkgsrc files is
1.151 sevan 1021: <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/" target="_top">https://cdn.NetBSD.org/pub/pkgsrc/</a> or
1.51 asau 1022: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/</a>
1023: (it points to the same location).
1024: There are a number of subdirectories for different purposes,
1025: which are described in detail in <a class="xref" href="#ftp-layout" title="Appendix C. Directory layout of the pkgsrc FTP server">Appendix C, <i>Directory layout of the pkgsrc FTP server</i></a>.</p>
1026: <p>The tar archive for the current branch is in the directory
1.151 sevan 1027: <code class="filename">current</code> and is called <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz" target="_top"><code class="filename">pkgsrc.tar.gz</code></a>.
1.118 sevan 1028: It is autogenerated weekly.</p>
1.51 asau 1029: <p>To save download time we provide bzip2- and
1030: xz-compressed archives which are published at
1.151 sevan 1031: <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.bz2" target="_top"><code class="filename">pkgsrc.tar.bz2</code></a>
1.51 asau 1032: and
1.151 sevan 1033: <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.xz" target="_top"><code class="filename">pkgsrc.tar.xz</code></a>
1.51 asau 1034: respectively.
1035: </p>
1036: <p>You can fetch the same files using FTP.</p>
1.174 leot 1037: <p>The tar file for the stable branch 2020Q1 is in the
1038: directory <code class="filename">pkgsrc-2020Q1</code> and is also called <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/pkgsrc-2020Q1/pkgsrc.tar.gz" target="_top"><code class="filename">pkgsrc.tar.gz</code></a>.</p>
1.136 leot 1039: <p>To download the latest pkgsrc stable tarball, run:</p>
1.12 weinem 1040: <pre class="screen">
1.174 leot 1041: <code class="prompt">$</code> <strong class="userinput"><code>ftp ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc-2020Q1/pkgsrc.tar.gz</code></strong></pre>
1.78 snj 1042: <p>If you prefer, you can also fetch it using "wget", "curl",
1.51 asau 1043: or your web browser.</p>
1.12 weinem 1044: <p>Then, extract it with:</p>
1.78 snj 1045: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>tar -xzf pkgsrc.tar.gz -C /usr</code></strong></pre>
1.12 weinem 1046: <p>This will create the directory <code class="filename">pkgsrc/</code>
1047: in <code class="filename">/usr/</code> and all the package source will be
1048: stored under <code class="filename">/usr/pkgsrc/</code>.</p>
1049: <p>To download pkgsrc-current, run:</p>
1050: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>ftp ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz</code></strong></pre>
1.1 dsieger 1051: </div>
1.41 asau 1052: <div class="sect2">
1.1 dsieger 1053: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1054: <a name="getting-via-cvs"></a>3.1.2. Via anonymous CVS</h3></div></div></div>
1.23 wiz 1055: <p>To fetch a specific pkgsrc stable branch, run:</p>
1.174 leot 1056: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -r pkgsrc-2020Q1 -P pkgsrc</code></strong>
1.23 wiz 1057: </pre>
1058: <p>This will create the directory <code class="filename">pkgsrc/</code>
1059: in your <code class="filename">/usr/</code> directory and all the package source
1060: will be stored under <code class="filename">/usr/pkgsrc/</code>.</p>
1061: <p>To fetch the pkgsrc current branch, run:</p>
1.39 wiz 1062: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong>
1.1 dsieger 1063: </pre>
1.174 leot 1064: <p>Refer to the <a class="ulink" href="https://www.NetBSD.org/mirrors/#anoncvs" target="_top">list of available mirrors</a> to choose a faster CVS mirror, if needed.</p>
1.23 wiz 1065: <p>If you get error messages from <code class="literal">rsh</code>, you need to set CVS_RSH variable. E.g.:</p>
1.39 wiz 1066: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && env CVS_RSH=ssh cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong>
1.23 wiz 1067: </pre>
1068: <p>Refer to documentation on your command shell how to set CVS_RSH=ssh permanently.
1069: For Bourne shells, you can set it in your <code class="filename">.profile</code>
1070: or better globally in <code class="filename">/etc/profile</code>:</p>
1071: <pre class="programlisting">
1072: # set CVS remote shell command
1073: CVS_RSH=ssh
1074: export CVS_RSH
1075: </pre>
1076: <p>By default, CVS doesn't do things like most people would expect it to do.
1077: But there is a way to convince CVS, by creating a file called <code class="filename">.cvsrc</code>
1078: in your home directory and saving the following lines to it.
1079: This file will save you lots of headache and some bug reports, so we strongly recommend it.
1080: You can find an explanation of this file in the CVS documentation.</p>
1.2 rillig 1081: <pre class="programlisting">
1082: # recommended CVS configuration file from the pkgsrc guide
1.155 sevan 1083: cvs -q
1.2 rillig 1084: checkout -P
1.4 rillig 1085: update -dP
1086: diff -upN
1.2 rillig 1087: rdiff -u
1.23 wiz 1088: release -d
1.2 rillig 1089: </pre>
1.1 dsieger 1090: </div>
1091: </div>
1.41 asau 1092: <div class="sect1">
1.1 dsieger 1093: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1094: <a name="uptodate"></a>3.2. Keeping pkgsrc up-to-date</h2></div></div></div>
1.1 dsieger 1095: <p>The preferred way to keep pkgsrc up-to-date is via CVS
1096: (which also works if you have first installed it via a tar
1097: file). It saves bandwidth and hard disk activity, compared to
1098: downloading the tar file again.</p>
1.41 asau 1099: <div class="sect2">
1.1 dsieger 1100: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1101: <a name="uptodate-tar"></a>3.2.1. Via tar files</h3></div></div></div>
1.41 asau 1102: <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 1103: <h3 class="title">Warning</h3>
1104: <p>When updating from a tar file, you first need to
1105: completely remove the old pkgsrc directory. Otherwise those
1106: files that have been removed from pkgsrc in the mean time will
1107: not be removed on your local disk, resulting in inconsistencies.
1108: When removing the old files, any changes that you have done to
1109: the pkgsrc files will be lost after updating. Therefore updating
1110: via CVS is strongly recommended.</p>
1111: </div>
1112: <p>Note that by default the distfiles and the binary packages
1113: are saved in the pkgsrc tree, so don't forget to rescue them
1.78 snj 1114: before updating. You can also configure pkgsrc to store distfiles
1115: and packages in directories outside the pkgsrc tree by setting the
1.1 dsieger 1116: <code class="varname">DISTDIR</code> and <code class="varname">PACKAGES</code>
1.154 rillig 1117: variables. See <a class="xref" href="#configuring" title="Chapter 6. Configuring pkgsrc">Chapter 6, <i>Configuring pkgsrc</i></a> for the details.</p>
1.1 dsieger 1118: <p>To update pkgsrc from a tar file, download the tar file as
1119: explained above. Then, make sure that you have not made any
1120: changes to the files in the pkgsrc directory. Remove the pkgsrc
1121: directory and extract the new tar file. Done.</p>
1122: </div>
1.41 asau 1123: <div class="sect2">
1.1 dsieger 1124: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1125: <a name="uptodate-cvs"></a>3.2.2. Via CVS</h3></div></div></div>
1.25 spz 1126: <p>To update pkgsrc via CVS, change to the <code class="filename">pkgsrc</code> directory and run cvs:</p>
1127: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && cvs update -dP</code></strong>
1128: </pre>
1129: <p>If you get error messages from <code class="literal">rsh</code>, you need to set CVS_RSH variable as described above. E.g.:</p>
1130: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && env CVS_RSH=ssh cvs up -dP</code></strong>
1131: </pre>
1.41 asau 1132: <div class="sect3">
1.1 dsieger 1133: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 1134: <a name="uptodate-cvs-switch"></a>3.2.2.1. Switching between different pkgsrc branches</h4></div></div></div>
1.1 dsieger 1135: <p>When updating pkgsrc, the CVS program keeps track of the
1136: branch you selected. But if you, for whatever reason, want to
1137: switch from the stable branch to the current one, you can do it
1.23 wiz 1138: by adding the option <span class="quote">“<span class="quote">-A</span>”</span> after the
1139: <span class="quote">“<span class="quote">update</span>”</span> keyword. To switch from the current branch
1.1 dsieger 1140: back to the stable branch, add the
1.174 leot 1141: <span class="quote">“<span class="quote">-rpkgsrc-2020Q1</span>”</span> option.</p>
1.1 dsieger 1142: </div>
1.41 asau 1143: <div class="sect3">
1.1 dsieger 1144: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 1145: <a name="uptodate-cvs-changes"></a>3.2.2.2. What happens to my changes when updating?</h4></div></div></div>
1.1 dsieger 1146: <p>When you update pkgsrc, the CVS program will only touch
1147: those files that are registered in the CVS repository. That
1148: means that any packages that you created on your own will stay
1149: unmodified. If you change files that are managed by CVS, later
1150: updates will try to merge your changes with those that have been
1151: done by others. See the CVS manual, chapter
1.23 wiz 1152: <span class="quote">“<span class="quote">update</span>”</span> for details.</p>
1.1 dsieger 1153: </div>
1154: </div>
1155: </div>
1156: </div>
1.41 asau 1157: <div class="chapter">
1.1 dsieger 1158: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 1159: <a name="platforms"></a>Chapter 4. Using pkgsrc on systems other than NetBSD</h2></div></div></div>
1.1 dsieger 1160: <div class="toc">
1161: <p><b>Table of Contents</b></p>
1.100 leot 1162: <dl class="toc">
1.154 rillig 1163: <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt>
1164: <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt>
1.1 dsieger 1165: </dl>
1166: </div>
1.41 asau 1167: <div class="sect1">
1.1 dsieger 1168: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1169: <a name="binarydist"></a>4.1. Binary distribution</h2></div></div></div>
1170: <p>See <a class="xref" href="#using-pkg" title="5.1. Using binary packages">Section 5.1, “Using binary packages”</a>.</p>
1.1 dsieger 1171: </div>
1.41 asau 1172: <div class="sect1">
1.1 dsieger 1173: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1174: <a name="bootstrapping-pkgsrc"></a>4.2. Bootstrapping pkgsrc</h2></div></div></div>
1.43 asau 1175: <p>pkgsrc can be bootstrapped for use in two different modes:
1176: privileged and unprivileged one. In unprivileged mode in contrast
1.44 asau 1177: to privileged one all programs are installed under one particular user
1.43 asau 1178: and cannot utilise privileged operations (packages don't create
1179: special users and all special file permissions like setuid are ignored).
1180: </p>
1.1 dsieger 1181: <p>Installing the bootstrap kit from source should be as simple as:</p>
1182: <pre class="screen">
1.60 asau 1183: <code class="prompt">#</code> <strong class="userinput"><code>env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong>
1.1 dsieger 1184: <code class="prompt">#</code> <strong class="userinput"><code>cd pkgsrc/bootstrap</code></strong>
1185: <code class="prompt">#</code> <strong class="userinput"><code>./bootstrap</code></strong>
1186: </pre>
1.43 asau 1187: <p>To bootstrap in unprivileged mode pass <span class="quote">“<span class="quote">--unprivileged</span>”</span> flag to <span class="command"><strong>bootstrap</strong></span></p>
1188: <p>By default, in privileged mode pkgsrc uses
1189: <code class="filename">/usr/pkg</code> for <span class="emphasis"><em>prefix</em></span>
1190: where programs will be installed in,
1.118 sevan 1191: and <code class="filename">/usr/pkg/pkgdb</code> for the package database
1.43 asau 1192: directory where pkgsrc will do its internal bookkeeping,
1193: <code class="filename">/var</code> is used as <span class="emphasis"><em>varbase</em></span>,
1194: where packages install their persistent data.
1195: In unprivileged mode pkgsrc uses
1196: <code class="filename">~/pkg</code> for <span class="emphasis"><em>prefix</em></span>,
1.118 sevan 1197: <code class="filename">~/pkg/pkgdb</code> for the package database,
1.43 asau 1198: and <code class="filename">~/pkg/var</code> for <span class="emphasis"><em>varbase</em></span>.
1199: </p>
1200: <p>You can change default layout using command-line arguments.
1201: Run <span class="quote">“<span class="quote">./bootstrap --help</span>”</span> to get details.
1202: </p>
1.41 asau 1203: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 1204: <h3 class="title">Note</h3>
1.10 hubertf 1205: <p>The bootstrap installs a <span class="command"><strong>bmake</strong></span> tool.
1206: Use this <span class="command"><strong>bmake</strong></span> when building via pkgsrc.
1207: For examples in this guide, use <span class="command"><strong>bmake</strong></span>
1.23 wiz 1208: instead of <span class="quote">“<span class="quote">make</span>”</span>.</p>
1.1 dsieger 1209: </div>
1.43 asau 1210: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1211: <h3 class="title">Note</h3>
1212: <p>It is possible to bootstrap multiple instances of pkgsrc
1213: using non-intersecting directories. Use <span class="command"><strong>bmake</strong></span>
1214: corresponding to the installation you're working with to build
1215: and install packages.
1216: </p>
1217: </div>
1.1 dsieger 1218: </div>
1219: </div>
1.41 asau 1220: <div class="chapter">
1.1 dsieger 1221: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 1222: <a name="using"></a>Chapter 5. Using pkgsrc</h2></div></div></div>
1.1 dsieger 1223: <div class="toc">
1224: <p><b>Table of Contents</b></p>
1.100 leot 1225: <dl class="toc">
1.154 rillig 1226: <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt>
1.1 dsieger 1227: <dd><dl>
1.154 rillig 1228: <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt>
1229: <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt>
1230: <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt>
1231: <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt>
1232: <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt>
1233: <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt>
1234: <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt>
1235: </dl></dd>
1236: <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt>
1237: <dd><dl>
1238: <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt>
1239: <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt>
1240: <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt>
1.1 dsieger 1241: </dl></dd>
1242: </dl>
1243: </div>
1244: <p>Basically, there are two ways of using pkgsrc. The first
1245: is to only install the package tools and to use binary packages
1.23 wiz 1246: that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span>
1247: in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span>
1.1 dsieger 1248: of pkgsrc, too. Then you are able to build your own packages,
1249: and you can still use binary packages from someone else.</p>
1.41 asau 1250: <div class="sect1">
1.1 dsieger 1251: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1252: <a name="using-pkg"></a>5.1. Using binary packages</h2></div></div></div>
1.151 sevan 1253: <p>On the <a class="ulink" href="https://cdn.NetBSD.org/" target="_top">cdn.NetBSD.org</a>
1254: site and mirrors, there are collections of binary packages,
1.9 rillig 1255: ready to be installed. These binary packages have been built using the
1256: default settings for the directories, that is:</p>
1.41 asau 1257: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 1258: <li class="listitem"><p><code class="filename">/usr/pkg</code> for <code class="varname">LOCALBASE</code>, where most of the files are installed,</p></li>
1259: <li class="listitem"><p><code class="filename">/usr/pkg/etc</code> for configuration files,</p></li>
1260: <li class="listitem"><p><code class="filename">/var</code> for <code class="varname">VARBASE</code>, where those files are installed that may change after installation.</p></li>
1.9 rillig 1261: </ul></div>
1262: <p>If you cannot use these directories for whatever reasons (maybe
1263: because you're not root), you cannot use these binary packages, but
1.154 rillig 1264: have to build the packages yourself, which is explained in <a class="xref" href="#bootstrapping-pkgsrc" title="4.2. Bootstrapping pkgsrc">Section 4.2, “Bootstrapping pkgsrc”</a>.</p>
1.41 asau 1265: <div class="sect2">
1.1 dsieger 1266: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1267: <a name="finding-binary-packages"></a>5.1.1. Finding binary packages</h3></div></div></div>
1.5 weinem 1268: <p>To install binary packages, you first need to know from where
1269: to get them. The first place where you should look is on the main
1.151 sevan 1270: pkgsrc FTP server in the directory <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/packages/" target="_top"><code class="filename">/pub/pkgsrc/packages</code></a>.</p>
1.5 weinem 1271: <p>This directory contains binary packages for multiple
1272: platforms. First, select your operating system. (Ignore the
1273: directories with version numbers attached to it, they just exist for
1274: legacy reasons.) Then, select your hardware architecture, and in the
1.23 wiz 1275: third step, the OS version and the <span class="quote">“<span class="quote">version</span>”</span> of pkgsrc.</p>
1.9 rillig 1276: <p>In this directory, you often find a file called
1277: <code class="filename">bootstrap.tar.gz</code> which contains the package
1278: management tools. If the file is missing, it is likely that your
1279: operating system already provides those tools. Download the file and
1280: extract it in the <code class="filename">/</code> directory. It will create
1281: the directories <code class="filename">/usr/pkg</code> (containing the tools
1.118 sevan 1282: for managing binary packages and the database of installed packages).</p>
1.1 dsieger 1283: </div>
1.41 asau 1284: <div class="sect2">
1.1 dsieger 1285: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1286: <a name="installing-binary-packages"></a>5.1.2. Installing binary packages</h3></div></div></div>
1.9 rillig 1287: <p>In the directory from the last section, there is a
1.85 wiz 1288: subdirectory called <code class="filename">All/</code>, which contains all the
1.9 rillig 1289: binary packages that are available for the platform, excluding those
1290: that may not be distributed via FTP or CDROM (depending on which
1.23 wiz 1291: medium you are using).</p>
1.9 rillig 1292: <p>To install packages directly from an FTP or HTTP server, run
1293: the following commands in a Bourne-compatible shell (be sure to
1.10 hubertf 1294: <span class="command"><strong>su</strong></span> to root first):</p>
1.9 rillig 1295: <pre class="screen">
1296: <code class="prompt">#</code> <strong class="userinput"><code>PATH="/usr/pkg/sbin:$PATH"</code></strong>
1.174 leot 1297: <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages"</code></strong>
1.169 rillig 1298: <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="$PKG_PATH/<em class="replaceable"><code>OPSYS</code></em>/<em class="replaceable"><code>ARCH</code></em>/<em class="replaceable"><code>VERSIONS</code></em>/All/"</code></strong>
1.9 rillig 1299: <code class="prompt">#</code> <strong class="userinput"><code>export PATH PKG_PATH</code></strong>
1300: </pre>
1301: <p>Instead of URLs, you can also use local paths, for example if
1302: you are installing from a set of CDROMs, DVDs or an NFS-mounted
1303: repository. If you want to install packages from multiple sources,
1304: you can separate them by a semicolon in
1305: <code class="varname">PKG_PATH</code>.</p>
1306: <p>After these preparations, installing a package is very
1307: easy:</p>
1308: <pre class="screen">
1.118 sevan 1309: <code class="prompt">#</code> <strong class="userinput"><code>pkg_add libreoffice</code></strong>
1310: <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap24-php71-*</code></strong>
1.9 rillig 1311: </pre>
1.1 dsieger 1312: <p>Note that any prerequisite packages needed to run the
1313: package in question will be installed, too, assuming they are
1314: present where you install from.</p>
1.23 wiz 1315: <p>Adding packages might install vulnerable packages.
1316: Thus you should run <span class="command"><strong>pkg_admin audit</strong></span>
1.14 jmcneill 1317: regularly, especially after installing new packages, and verify
1318: that the vulnerabilities are acceptable for your configuration.</p>
1.1 dsieger 1319: <p>After you've installed packages, be sure to have
1320: <code class="filename">/usr/pkg/bin</code> and <code class="filename">/usr/pkg/sbin</code> in your
1321: <code class="varname">PATH</code> so you can actually start the just
1322: installed program.</p>
1323: </div>
1.41 asau 1324: <div class="sect2">
1.1 dsieger 1325: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1326: <a name="using.pkg_delete"></a>5.1.3. Deinstalling packages</h3></div></div></div>
1.1 dsieger 1327: <p>To deinstall a package, it does not matter whether it was
1328: installed from source code or from a binary package. The
1.10 hubertf 1329: <span class="command"><strong>pkg_delete</strong></span> command does not know it anyway.
1330: To delete a package, you can just run <span class="command"><strong>pkg_delete
1.1 dsieger 1331: <em class="replaceable"><code>package-name</code></em></strong></span>. The package
1332: name can be given with or without version number. Wildcards can
1333: also be used to deinstall a set of packages, for example
1334: <code class="literal">*emacs*</code>. Be sure to include them in quotes,
1335: so that the shell does not expand them before
1336: <code class="literal">pkg_delete</code> sees them.</p>
1337: <p>The <code class="option">-r</code> option is very powerful: it
1338: removes all the packages that require the package in question
1339: and then removes the package itself. For example:
1340:
1341: </p>
1342: <pre class="screen">
1343: <code class="prompt">#</code> <strong class="userinput"><code>pkg_delete -r jpeg</code></strong>
1344: </pre>
1345: <p>
1346:
1347: will remove jpeg and all the packages that used it; this allows
1348: upgrading the jpeg package.</p>
1349: </div>
1.41 asau 1350: <div class="sect2">
1.1 dsieger 1351: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1352: <a name="using.pkg_info"></a>5.1.4. Getting information about installed packages</h3></div></div></div>
1.10 hubertf 1353: <p>The <span class="command"><strong>pkg_info</strong></span> shows information about
1.1 dsieger 1354: installed packages or binary package files.</p>
1355: </div>
1.41 asau 1356: <div class="sect2">
1.1 dsieger 1357: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1358: <a name="vulnerabilities"></a>5.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div>
1.1 dsieger 1359: <p>
1.164 leot 1360: The pkgsrc Security Team and Packages Groups maintain a list of
1.1 dsieger 1361: known security vulnerabilities to packages which are (or have been)
1362: included in pkgsrc. The list is available from the NetBSD
1.174 leot 1363: FTP site at <a class="ulink" href="https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a>.
1.1 dsieger 1364: </p>
1365: <p>
1.22 jakllsch 1366: Through <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>,
1.1 dsieger 1367: this list can be downloaded
1368: automatically, and a security audit of all packages installed on a system
1369: can take place.
1370: </p>
1371: <p>
1.22 jakllsch 1372: There are two components to auditing. The first
1373: step, <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>,
1374: is for downloading
1.1 dsieger 1375: the list of vulnerabilities from the NetBSD FTP site. The second
1.22 jakllsch 1376: step, <span class="command"><strong>pkg_admin audit</strong></span>, checks to see if any of your
1.1 dsieger 1377: installed packages are vulnerable. If a package is vulnerable, you
1378: will see output similar to the following:
1379: </p>
1380: <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see
1.174 leot 1381: https://www.samba.org/samba/whatsnew/macroexploit.html</pre>
1.1 dsieger 1382: <p>
1.22 jakllsch 1383: You may wish to have the
1.174 leot 1384: <a class="ulink" href="https://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">vulnerabilities</a>
1.22 jakllsch 1385: file downloaded daily so that
1386: it remains current. This may be done by adding an appropriate entry
1.174 leot 1387: to the root users <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?crontab+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">crontab</span>(5)</span></a> entry. For example the entry
1.22 jakllsch 1388: </p>
1389: <pre class="screen">
1.121 sevan 1390: # Download vulnerabilities file
1.118 sevan 1391: 0 3 * * * /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1
1.121 sevan 1392: # Audit the installed packages and email results to root
1393: 9 3 * * * /usr/pkg/sbin/pkg_admin audit |mail -s "Installed package audit result" \
1394: root >/dev/null 2>&1
1.22 jakllsch 1395: </pre>
1396: <p>
1.118 sevan 1397: will update the vulnerability list every day at 3AM, followed by an audit
1398: at 3:09AM. The result of the audit are then emailed to root.
1.22 jakllsch 1399:
1.118 sevan 1400: On NetBSD this may be accomplished instead by adding the following
1401: line to <code class="filename">/etc/daily.conf</code>:
1402: </p>
1403: <pre class="screen">
1404: fetch_pkg_vulnerabilities=YES
1405: </pre>
1406: <p>
1407: to fetch the vulnerability list from the daily security script. The system
1408: is set to audit the packages by default but can be set explicitly, if
1.123 wiz 1409: desired (not required), by adding the following line to
1.118 sevan 1410: <code class="filename">/etc/security.conf</code>:
1.22 jakllsch 1411: </p>
1412: <pre class="screen">
1.118 sevan 1413: check_pkg_vulnerabilities=YES
1.22 jakllsch 1414: </pre>
1415: <p>
1.174 leot 1416: see <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?daily.conf+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">daily.conf</span>(5)</span></a> and <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?security.conf+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">security.conf</span>(5)</span></a> for more details.
1.1 dsieger 1417: </p>
1418: </div>
1.41 asau 1419: <div class="sect2">
1.1 dsieger 1420: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1421: <a name="pkg_versions"></a>5.1.6. Finding if newer versions of your installed packages are in pkgsrc</h3></div></div></div>
1.1 dsieger 1422: <p>
1.137 leot 1423: Install <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a> and run
1.23 wiz 1424: <span class="command"><strong>lintpkgsrc</strong></span> with the <span class="quote">“<span class="quote">-i</span>”</span>
1.1 dsieger 1425: argument to check if your packages are up-to-date, e.g.
1426: </p>
1427: <pre class="screen">
1428: <code class="prompt">%</code> <strong class="userinput"><code>lintpkgsrc -i</code></strong>
1429: ...
1430: Version mismatch: 'tcsh' 6.09.00 vs 6.10.00
1431: </pre>
1.10 hubertf 1432: <p>You can then use <span class="command"><strong>make update</strong></span> to update the
1.1 dsieger 1433: package on your system and rebuild any dependencies.
1434: </p>
1435: </div>
1.41 asau 1436: <div class="sect2">
1.1 dsieger 1437: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1438: <a name="using.pkg_admin"></a>5.1.7. Other administrative functions</h3></div></div></div>
1.10 hubertf 1439: <p>The <span class="command"><strong>pkg_admin</strong></span> executes various
1.1 dsieger 1440: administrative functions on the package system.</p>
1441: </div>
1442: </div>
1.41 asau 1443: <div class="sect1">
1.1 dsieger 1444: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1445: <a name="building-packages-from-source"></a>5.2. Building packages from source</h2></div></div></div>
1.1 dsieger 1446: <p>After obtaining pkgsrc, the <code class="filename">pkgsrc</code>
1447: directory now contains a set of packages, organized into
1448: categories. You can browse the online index of packages, or run
1.10 hubertf 1449: <span class="command"><strong>make readme</strong></span> from the <code class="filename">pkgsrc</code>
1.1 dsieger 1450: directory to build local <code class="filename">README.html</code> files for
1.137 leot 1451: all packages, viewable with any web browser such as <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/lynx/README.html" target="_top"><code class="filename">www/lynx</code></a> or <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a>.</p>
1.1 dsieger 1452: <p>The default <span class="emphasis"><em>prefix</em></span> for installed packages
1453: is <code class="filename">/usr/pkg</code>. If you wish to change this, you
1454: should do so by setting <code class="varname">LOCALBASE</code> in
1.10 hubertf 1455: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. You should not try to use multiple
1.1 dsieger 1456: different <code class="varname">LOCALBASE</code> definitions on the same
1457: system (inside a chroot is an exception). </p>
1458: <p>The rest of this chapter assumes that the package is already
1.10 hubertf 1459: in pkgsrc. If it is not, see <a class="xref" href="#developers-guide" title="Part II. The pkgsrc developer's guide">Part II, “The pkgsrc developer's guide”</a> for
1.1 dsieger 1460: instructions how to create your own packages.</p>
1.41 asau 1461: <div class="sect2">
1.1 dsieger 1462: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1463: <a name="requirements"></a>5.2.1. Requirements</h3></div></div></div>
1.1 dsieger 1464: <p>To build packages from source, you need a working C
1465: compiler. On NetBSD, you need to install the
1.23 wiz 1466: <span class="quote">“<span class="quote">comp</span>”</span> and the <span class="quote">“<span class="quote">text</span>”</span> distribution
1.1 dsieger 1467: sets. If you want to build X11-related packages, the
1.23 wiz 1468: <span class="quote">“<span class="quote">xbase</span>”</span> and <span class="quote">“<span class="quote">xcomp</span>”</span> distribution
1.1 dsieger 1469: sets are required, too.</p>
1470: </div>
1.41 asau 1471: <div class="sect2">
1.1 dsieger 1472: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1473: <a name="fetching-distfiles"></a>5.2.2. Fetching distfiles</h3></div></div></div>
1.1 dsieger 1474: <p>The first step for building a package is downloading the
1475: distfiles (i.e. the unmodified source). If they have not yet been
1476: downloaded, pkgsrc will fetch them automatically.</p>
1477: <p>If you have all files that you need in the
1478: <code class="filename">distfiles</code> directory,
1479: you don't need to connect. If the distfiles are on CD-ROM, you can
1480: mount the CD-ROM on <code class="filename">/cdrom</code> and add:
1481: </p>
1482: <pre class="screen">DISTDIR=/cdrom/pkgsrc/distfiles</pre>
1483: <p>
1.10 hubertf 1484: to your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
1.1 dsieger 1485: <p>By default a list of distribution sites will be randomly
1486: intermixed to prevent huge load on servers which holding popular
1487: packages (for example, SourceForge.net mirrors). Thus, every
1488: time when you need to fetch yet another distfile all the mirrors
1489: will be tried in new (random) order. You can turn this feature
1490: off by setting <code class="varname">MASTER_SORT_RANDOM=NO</code> (for
1491: <code class="varname">PKG_DEVELOPER</code>s it's already disabled).</p>
1492: <p>You can overwrite some of the major distribution sites to
1493: fit to sites that are close to your own. By setting one or two
1494: variables you can modify the order in which the master sites are
1495: accessed. <code class="varname">MASTER_SORT</code> contains a whitespace
1496: delimited list of domain suffixes.
1497: <code class="varname">MASTER_SORT_REGEX</code> is even more flexible, it
1498: contains a whitespace delimited list of regular expressions. It
1499: has higher priority than <code class="varname">MASTER_SORT</code>. Have a
1500: look at <code class="filename">pkgsrc/mk/defaults/mk.conf</code> to find
1501: some examples. This may save some of your bandwidth and
1502: time.</p>
1503: <p>You can change these settings either in your shell's environment, or,
1504: if you want to keep the settings, by editing the
1.10 hubertf 1505: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file,
1.1 dsieger 1506: and adding the definitions there.</p>
1507: <p>
1508: If a package depends on many other packages (such as
1.137 leot 1509: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a>), the build process may
1.1 dsieger 1510: alternate between periods of
1511: downloading source, and compiling. To ensure you have all the source
1512: downloaded initially you can run the command:
1513: </p>
1514: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make fetch-list | sh</code></strong></pre>
1515: <p>
1516: which will output and run a set of shell commands to fetch the
1517: necessary files into the <code class="filename">distfiles</code> directory. You can
1518: also choose to download the files manually.
1519: </p>
1520: </div>
1.41 asau 1521: <div class="sect2">
1.1 dsieger 1522: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1523: <a name="how-to-build-and-install"></a>5.2.3. How to build and install</h3></div></div></div>
1.1 dsieger 1524: <p>
1525: Once the software has downloaded, any patches will be applied, then it
1526: will be compiled for you. This may take some time depending on your
1527: computer, and how many other packages the software depends on and their
1528: compile time.
1529: </p>
1.41 asau 1530: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 1531: <h3 class="title">Note</h3>
1532: <p>If using bootstrap or pkgsrc on a non-NetBSD system,
1.10 hubertf 1533: use the pkgsrc <span class="command"><strong>bmake</strong></span> command instead of
1.23 wiz 1534: <span class="quote">“<span class="quote">make</span>”</span> in the examples in this guide.</p>
1.1 dsieger 1535: </div>
1536: <p>For example, type</p>
1537: <pre class="screen">
1538: <code class="prompt">%</code> <strong class="userinput"><code>cd misc/figlet</code></strong>
1539: <code class="prompt">%</code> <strong class="userinput"><code>make</code></strong>
1540: </pre>
1541: <p>at the shell prompt to build the various components of the
1542: package.</p>
1543: <p>The next stage is to actually install the newly compiled
1544: program onto your system. Do this by entering:
1545:
1546: </p>
1547: <pre class="screen">
1548: <code class="prompt">%</code> <strong class="userinput"><code>make install</code></strong>
1549: </pre>
1550: <p>
1551:
1552: while you are still in the directory for whatever package you
1553: are installing.</p>
1554: <p>Installing the package on your system may require you to
1555: be root. However, pkgsrc has a
1556: <span class="emphasis"><em>just-in-time-su</em></span> feature, which allows you
1557: to only become root for the actual installation step.</p>
1558: <p>That's it, the software should now be installed and setup for use.
1559: You can now enter:
1560:
1561: </p>
1562: <pre class="screen">
1563: <code class="prompt">%</code> <strong class="userinput"><code>make clean</code></strong>
1564: </pre>
1565: <p>
1566:
1567: to remove the compiled files in the work directory, as you shouldn't need
1568: them any more. If other packages were also added to your system
1569: (dependencies) to allow your program to compile, you can tidy these up
1570: also with the command:</p>
1571: <pre class="screen">
1572: <code class="prompt">%</code> <strong class="userinput"><code>make clean-depends</code></strong>
1573: </pre>
1574: <p>Taking the figlet utility as an example, we can install it on our
1.10 hubertf 1575: system by building as shown in <a class="xref" href="#logs" title="Appendix B. Build logs">Appendix B, <i>Build logs</i></a>.</p>
1.1 dsieger 1576: <p>The program is installed under the default root of the
1577: packages tree - <code class="filename">/usr/pkg</code>. Should this not
1578: conform to your tastes, set the <code class="varname">LOCALBASE</code>
1579: variable in your environment, and it will use that value as the
1580: root of your packages tree. So, to use
1581: <code class="filename">/usr/local</code>, set
1582: <code class="varname">LOCALBASE=/usr/local</code> in your environment.
1583: Please note that you should use a directory which is dedicated to
1584: packages and not shared with other programs (i.e., do not try and
1585: use <code class="varname">LOCALBASE=/usr</code>). Also, you should not try
1586: to add any of your own files or directories (such as
1587: <code class="filename">src/</code>, <code class="filename">obj/</code>, or
1588: <code class="filename">pkgsrc/</code>) below the
1589: <code class="varname">LOCALBASE</code> tree. This is to prevent possible
1590: conflicts between programs and other files installed by the
1591: package system and whatever else may have been installed
1592: there.</p>
1.10 hubertf 1593: <p>Some packages look in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to
1.1 dsieger 1594: alter some configuration options at build time. Have a look at
1595: <code class="filename">pkgsrc/mk/defaults/mk.conf</code> to get an overview
1596: of what will be set there by default. Environment variables such
1597: as <code class="varname">LOCALBASE</code> can be set in
1.10 hubertf 1598: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to save having to remember to
1.1 dsieger 1599: set them each time you want to use pkgsrc.</p>
1.23 wiz 1600: <p>Occasionally, people want to <span class="quote">“<span class="quote">look under the
1601: covers</span>”</span> to see what is going on when a package is building
1.1 dsieger 1602: or being installed. This may be for debugging purposes, or out of
1603: simple curiosity. A number of utility values have been added to
1604: help with this.</p>
1.23 wiz 1605: <div class="orderedlist"><ol class="orderedlist" type="1">
1606: <li class="listitem">
1.174 leot 1607: <p>If you invoke the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> command with
1.1 dsieger 1608: <code class="varname">PKG_DEBUG_LEVEL=2</code>, then a huge amount of
1609: information will be displayed. For example,</p>
1610: <pre class="screen"><strong class="userinput"><code>make patch PKG_DEBUG_LEVEL=2</code></strong></pre>
1611: <p>will show all the commands that are invoked, up to and
1.23 wiz 1612: including the <span class="quote">“<span class="quote">patch</span>”</span> stage.</p>
1.1 dsieger 1613: </li>
1.23 wiz 1614: <li class="listitem">
1.174 leot 1615: <p>If you want to know the value of a certain <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>
1.1 dsieger 1616: definition, then the <code class="varname">VARNAME</code> definition
1617: should be used, in conjunction with the show-var
1.174 leot 1618: target. e.g. to show the expansion of the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>
1.1 dsieger 1619: variable <code class="varname">LOCALBASE</code>:</p>
1620: <pre class="screen">
1621: <code class="prompt">%</code> <strong class="userinput"><code>make show-var VARNAME=LOCALBASE</code></strong>
1622: /usr/pkg
1623: <code class="prompt">%</code>
1624: </pre>
1625: </li>
1626: </ol></div>
1627: <p>If you want to install a binary package that you've either
1628: created yourself (see next section), that you put into
1629: pkgsrc/packages manually or that is located on a remote FTP
1630: server, you can use the "bin-install" target. This target will
1.174 leot 1631: install a binary package - if available - via <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>,
1.10 hubertf 1632: else do a <span class="command"><strong>make package</strong></span>. The list of remote FTP
1.1 dsieger 1633: sites searched is kept in the variable
1634: <code class="varname">BINPKG_SITES</code>, which defaults to
1.174 leot 1635: ftp.NetBSD.org. Any flags that should be added to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>
1.1 dsieger 1636: can be put into <code class="varname">BIN_INSTALL_FLAGS</code>. See
1637: <code class="filename">pkgsrc/mk/defaults/mk.conf</code> for more
1638: details.</p>
1639: <p>A final word of warning: If you set up a system that has a
1640: non-standard setting for <code class="varname">LOCALBASE</code>, be sure to
1641: set that before any packages are installed, as you cannot use
1642: several directories for the same purpose. Doing so will result in
1643: pkgsrc not being able to properly detect your installed packages,
1644: and fail miserably. Note also that precompiled binary packages are
1645: usually built with the default <code class="varname">LOCALBASE</code> of
1646: <code class="filename">/usr/pkg</code>, and that you should
1647: <span class="emphasis"><em>not</em></span> install any if you use a non-standard
1648: <code class="varname">LOCALBASE</code>.</p>
1649: </div>
1650: </div>
1651: </div>
1.41 asau 1652: <div class="chapter">
1.1 dsieger 1653: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 1654: <a name="configuring"></a>Chapter 6. Configuring pkgsrc</h2></div></div></div>
1.1 dsieger 1655: <div class="toc">
1656: <p><b>Table of Contents</b></p>
1.100 leot 1657: <dl class="toc">
1.154 rillig 1658: <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt>
1659: <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt>
1660: <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt>
1661: <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt>
1662: <dd><dl>
1663: <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt>
1664: <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt>
1665: <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt>
1.1 dsieger 1666: </dl></dd>
1.154 rillig 1667: <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt>
1668: <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt>
1.1 dsieger 1669: </dl>
1670: </div>
1.4 rillig 1671: <a name="mk.conf"></a><p>The whole pkgsrc system is configured in a single file, usually
1.1 dsieger 1672: called <code class="filename">mk.conf</code>. In which directory pkgsrc looks for
1673: that file depends on the installation. On NetBSD, when you use
1.174 leot 1674: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> from the base system, it is in the directory
1.1 dsieger 1675: <code class="filename">/etc/</code>. In all other cases the default location is
1676: <code class="literal">${PREFIX}/etc/</code>, depending on where you told the
1677: bootstrap program to install the binary packages.</p>
1678: <p>The format of the configuration file is that of the usual
1679: BSD-style <code class="filename">Makefile</code>s. The whole pkgsrc configuration
1680: is done by setting variables in this file. Note that you can define all
1681: kinds of variables, and no special error checking (for example for
1.112 rillig 1682: spelling mistakes) takes place.</p>
1.41 asau 1683: <div class="sect1">
1.1 dsieger 1684: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1685: <a name="general-configuration"></a>6.1. General configuration</h2></div></div></div>
1.112 rillig 1686: <p>The following variables apply to all
1.1 dsieger 1687: pkgsrc packages. A complete list of the variables that can be
1688: configured by the user is available in
1689: <code class="filename">mk/defaults/mk.conf</code>, together with some
1690: comments that describe each variable's intent.</p>
1.41 asau 1691: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 1692: <li class="listitem"><p><code class="varname">LOCALBASE</code>: Where
1.1 dsieger 1693: packages will be installed. The default is
1694: <code class="filename">/usr/pkg</code>. Do not mix binary packages
1695: with different <code class="varname">LOCALBASE</code>s!</p></li>
1.23 wiz 1696: <li class="listitem"><p><code class="varname">CROSSBASE</code>: Where
1697: <span class="quote">“<span class="quote">cross</span>”</span> category packages will be
1.1 dsieger 1698: installed. The default is
1699: <code class="filename">${LOCALBASE}/cross</code>.</p></li>
1.23 wiz 1700: <li class="listitem"><p><code class="varname">X11BASE</code>: Where
1.1 dsieger 1701: X11 is installed on the system. The default is
1.84 wiz 1702: <code class="filename">/usr/X11R7</code>.</p></li>
1.23 wiz 1703: <li class="listitem"><p><code class="varname">DISTDIR</code>: Where to store the
1.1 dsieger 1704: downloaded copies of the original source distributions used
1705: for building pkgsrc packages. The default is
1706: <code class="filename">${PKGSRCDIR}/distfiles</code>.</p></li>
1.23 wiz 1707: <li class="listitem"><p><code class="varname">PKG_DBDIR</code>: Where the
1.1 dsieger 1708: database about installed packages is stored. The default is
1.118 sevan 1709: <code class="filename">/usr/pkg/pkgdb</code>.</p></li>
1.23 wiz 1710: <li class="listitem"><p><code class="varname">MASTER_SITE_OVERRIDE</code>:
1.1 dsieger 1711: If set, override the packages'
1712: <code class="varname">MASTER_SITES</code> with this value.</p></li>
1.23 wiz 1713: <li class="listitem"><p><code class="varname">MASTER_SITE_BACKUP</code>:
1.1 dsieger 1714: Backup location(s) for distribution files and patch files
1715: if not found locally or in
1716: <code class="filename">${MASTER_SITES}</code> or
1717: <code class="filename">${PATCH_SITES}</code> respectively.
1.118 sevan 1718: The defaults is
1719: <code class="filename">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/${DIST_SUBDIR}/</code>.</p></li>
1.23 wiz 1720: <li class="listitem"><p><code class="varname">BINPKG_SITES</code>:
1.1 dsieger 1721: List of sites carrying binary pkgs. <em class="replaceable"><code>rel</code></em> and
1722: <em class="replaceable"><code>arch</code></em> are replaced with OS
1.23 wiz 1723: release (<span class="quote">“<span class="quote">2.0</span>”</span>, etc.) and architecture
1724: (<span class="quote">“<span class="quote">mipsel</span>”</span>, etc.).</p></li>
1725: <li class="listitem"><p><code class="varname">ACCEPTABLE_LICENSES</code>:
1.22 jakllsch 1726: List of acceptable licenses. License names are case-sensitive.
1727: Whenever you try to build a package whose license is not in this
1728: list, you will get an error message. If the license condition is
1729: simple enough, the error message will include specific
1730: instructions on how to change this variable.</p></li>
1.1 dsieger 1731: </ul></div>
1732: </div>
1.41 asau 1733: <div class="sect1">
1.1 dsieger 1734: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1735: <a name="variables-affecting-build"></a>6.2. Variables affecting the build process</h2></div></div></div>
1.108 rillig 1736: <p>
1.1 dsieger 1737: </p>
1.41 asau 1738: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 1739: <li class="listitem"><p><code class="varname">PACKAGES</code>: The top level
1.1 dsieger 1740: directory for the binary packages. The default is
1741: <code class="filename">${PKGSRCDIR}/packages</code>.</p></li>
1.23 wiz 1742: <li class="listitem"><p><code class="varname">WRKOBJDIR</code>:
1.1 dsieger 1743: The top level directory where, if defined, the separate
1744: working directories will get created, and symbolically
1745: linked to from <code class="filename">${WRKDIR}</code> (see below).
1746: This is useful for building packages on several
1747: architectures, then <code class="filename">${PKGSRCDIR}</code>
1748: can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code>
1749: is local to every architecture. (It should be noted that
1750: <code class="varname">PKGSRCDIR</code> should not be set by the user
1.14 jmcneill 1751: — it is an internal definition which refers to the
1.1 dsieger 1752: root of the pkgsrc tree. It is possible to have many
1753: pkgsrc tree instances.)</p></li>
1.23 wiz 1754: <li class="listitem"><p><code class="varname">LOCALPATCHES</code>:
1.1 dsieger 1755: Directory for local patches that aren't part of pkgsrc.
1.154 rillig 1756: See <a class="xref" href="#components.patches" title="13.3. patches/*">Section 13.3, “<code class="filename">patches/*</code>”</a> for more
1.1 dsieger 1757: information.</p></li>
1.23 wiz 1758: <li class="listitem"><p><code class="varname">PKGMAKECONF</code>: Location of
1.10 hubertf 1759: the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's
1.1 dsieger 1760: BSD-style Makefile. If this is not set,
1761: <code class="varname">MAKECONF</code> is set to
1762: <code class="filename">/dev/null</code> to avoid picking up
1763: settings used by builds in <code class="filename">/usr/src</code>.</p></li>
1764: </ul></div>
1765: </div>
1.41 asau 1766: <div class="sect1">
1.1 dsieger 1767: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1768: <a name="variables-affecting-installation"></a>6.3. Variables affecting the installation process</h2></div></div></div>
1.143 maya 1769: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="varname">PKGSRC_KEEP_BIN_PKGSRC</code>:
1770: By default, binary packages of built packages are
1.150 leot 1771: preserved in <code class="filename">${PACKAGES}/All</code>. Setting
1.143 maya 1772: this variable to "no" prevents this.</p></li></ul></div>
1.107 jnemeth 1773: <p>Packages have to support installation into a
1.4 rillig 1774: subdirectory of <code class="varname">WRKDIR</code>. This allows a package
1775: to be built, before the actual filesystem is touched. DESTDIR
1776: support exists in two variations:</p>
1.41 asau 1777: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 1778: <li class="listitem"><p>Basic DESTDIR support means that the package
1.24 wiz 1779: installation and packaging is still run as root.</p></li>
1780: <li class="listitem"><p>Full DESTDIR support can run the complete
1781: build, installation and packaging as normal user. Root
1782: privileges are only needed to add packages.</p></li>
1783: </ul></div>
1.4 rillig 1784: <p>With basic DESTDIR support, <strong class="userinput"><code>make
1785: clean</code></strong> needs to be run as root.</p>
1.17 imil 1786: <p>Considering the <code class="filename">foo/bar</code> package,
1787: DESTDIR full support can be tested using the following commands
1788:
1789: </p>
1790: <pre class="programlisting">
1791: <code class="prompt">$</code> id
1792: uid=1000(myusername) gid=100(users) groups=100(users),0(wheel)
1793: <code class="prompt">$</code> mkdir $HOME/packages
1794: <code class="prompt">$</code> cd $PKGSRCDIR/foo/bar
1795: </pre>
1796: <p>
1797:
1798: Verify <code class="varname">DESTDIR</code> full support, no root privileges
1799: should be needed
1800:
1801: </p>
1802: <pre class="programlisting">
1.66 asau 1803: <code class="prompt">$</code> make stage-install
1.17 imil 1804: </pre>
1805: <p>
1806:
1807: Create a package without root privileges
1808:
1809: </p>
1810: <pre class="programlisting">
1.66 asau 1811: <code class="prompt">$</code> make PACKAGES=$HOME/packages package
1.17 imil 1812: </pre>
1813: <p>
1814:
1815: For the following command, you must be able to gain root
1.174 leot 1816: privileges using <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?su+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span></a>
1.17 imil 1817:
1818: </p>
1819: <pre class="programlisting">
1.66 asau 1820: <code class="prompt">$</code> make PACKAGES=$HOME/packages install
1.17 imil 1821: </pre>
1822: <p>
1823:
1824: Then, as a simple user
1825:
1826: </p>
1827: <pre class="programlisting">
1828: <code class="prompt">$</code> make clean
1829: </pre>
1830: <p>
1831:
1832: </p>
1.4 rillig 1833: </div>
1.41 asau 1834: <div class="sect1">
1.4 rillig 1835: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1836: <a name="conf.compiler"></a>6.4. Selecting and configuring the compiler</h2></div></div></div>
1.41 asau 1837: <div class="sect2">
1.1 dsieger 1838: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1839: <a name="selecting-the-compiler"></a>6.4.1. Selecting the compiler</h3></div></div></div>
1.1 dsieger 1840: <p>By default, pkgsrc will use GCC to build packages. This may be
1841: overridden by setting the following variables in /etc/mk.conf:</p>
1.41 asau 1842: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 1843: <dt><span class="term"><code class="varname">PKGSRC_COMPILER</code>:</span></dt>
1844: <dd>
1845: <p>This is a list of values specifying the chain of
1846: compilers to invoke when building packages. Valid values
1847: are:</p>
1.41 asau 1848: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.66 asau 1849: <li class="listitem"><p><code class="varname">ccc</code>:
1850: Compaq C Compilers (Tru64)</p></li>
1851: <li class="listitem"><p><code class="varname">ccache</code>:
1852: compiler cache (chainable)</p></li>
1853: <li class="listitem"><p><code class="varname">clang</code>:
1854: Clang C and Objective-C compiler</p></li>
1.23 wiz 1855: <li class="listitem"><p><code class="varname">distcc</code>:
1.1 dsieger 1856: distributed C/C++ (chainable)</p></li>
1.66 asau 1857: <li class="listitem"><p><code class="varname">f2c</code>:
1858: Fortran 77 to C compiler (chainable)</p></li>
1859: <li class="listitem"><p><code class="varname">icc</code>:
1860: Intel C++ Compiler (Linux)</p></li>
1861: <li class="listitem"><p><code class="varname">ido</code>:
1862: SGI IRIS Development Option cc (IRIX 5)</p></li>
1.23 wiz 1863: <li class="listitem"><p><code class="varname">gcc</code>:
1.1 dsieger 1864: GNU C/C++ Compiler</p></li>
1.66 asau 1865: <li class="listitem"><p><code class="varname">hp</code>:
1866: HP-UX C/aC++ compilers</p></li>
1.23 wiz 1867: <li class="listitem"><p><code class="varname">mipspro</code>:
1.1 dsieger 1868: Silicon Graphics, Inc. MIPSpro (n32/n64)</p></li>
1.66 asau 1869: <li class="listitem"><p><code class="varname">mipspro-ucode</code>:
1.1 dsieger 1870: Silicon Graphics, Inc. MIPSpro (o32)</p></li>
1.23 wiz 1871: <li class="listitem"><p><code class="varname">sunpro</code>:
1.1 dsieger 1872: Sun Microsystems, Inc. WorkShip/Forte/Sun ONE Studio</p></li>
1.66 asau 1873: <li class="listitem"><p><code class="varname">xlc</code>:
1.118 sevan 1874: IBM's XL C/C++ compiler suite</p></li>
1.1 dsieger 1875: </ul></div>
1876: <p>The default is
1.23 wiz 1877: <span class="quote">“<span class="quote"><code class="varname">gcc</code></span>”</span>. You can use
1.1 dsieger 1878: <code class="varname">ccache</code> and/or
1879: <code class="varname">distcc</code> with an appropriate
1880: <code class="varname">PKGSRC_COMPILER</code> setting,
1.23 wiz 1881: e.g. <span class="quote">“<span class="quote"><code class="varname">ccache gcc</code></span>”</span>. This
1.1 dsieger 1882: variable should always be terminated with a value for
1883: a real compiler. Note that only one real compiler
1.23 wiz 1884: should be listed (e.g. <span class="quote">“<span class="quote"><code class="varname">sunpro gcc</code></span>”</span>
1.1 dsieger 1885: is not allowed).</p>
1886: </dd>
1887: <dt><span class="term"><code class="varname">GCC_REQD</code>:</span></dt>
1888: <dd><p>This specifies the minimum version of GCC to use
1889: when building packages. If the system GCC doesn't
1890: satisfy this requirement, then pkgsrc will build and
1891: install one of the GCC packages to use instead.</p></dd>
1.153 leot 1892: <dt><span class="term"><code class="varname">PYTHON_VERSION_DEFAULT</code>:</span></dt>
1.114 maya 1893: <dd><p>Specifies which version of python to use when several
1894: options are available.</p></dd>
1895: <dt><span class="term"><code class="varname">PKGSRC_FORTRAN</code>:</span></dt>
1.176 gutterid 1896: <dd><p>Specifies the Fortran compiler to use.
1897: The default is <code class="varname">gfortran</code>.</p></dd>
1.114 maya 1898: <dt><span class="term"><code class="varname">GFORTRAN_VERSION</code>:</span></dt>
1899: <dd><p>If <code class="varname">PKGSRC_FORTRAN</code><code class="literal">=</code>
1900: <code class="varname">gfortran</code> is used, this option specifies which
1901: version to use.</p></dd>
1.1 dsieger 1902: </dl></div>
1903: </div>
1.41 asau 1904: <div class="sect2">
1.1 dsieger 1905: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1906: <a name="conf.cflags"></a>6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</h3></div></div></div>
1.1 dsieger 1907: <p>If you wish to set the <code class="varname">CFLAGS</code> variable,
1908: please make sure to use the <code class="literal">+=</code> operator
1909: instead of the <code class="literal">=</code> operator:</p>
1910: <pre class="programlisting">
1911: CFLAGS+= -your -flags
1912: </pre>
1913: <p>Using <code class="varname">CFLAGS=</code> (i.e. without the
1.23 wiz 1914: <span class="quote">“<span class="quote">+</span>”</span>) may lead to problems with packages that
1.16 jnemeth 1915: need to add their own flags. You may want to take a look
1.137 leot 1916: at the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/cpuflags/README.html" target="_top"><code class="filename">devel/cpuflags</code></a>
1.23 wiz 1917: package if you're interested in optimization specifically
1918: for the current CPU. </p>
1.1 dsieger 1919: </div>
1.41 asau 1920: <div class="sect2">
1.1 dsieger 1921: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1922: <a name="conf.ldflags"></a>6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</h3></div></div></div>
1.1 dsieger 1923: <p>If you want to pass flags to the linker, both in the configure
1924: step and the build step, you can do this in two ways. Either set
1925: <code class="varname">LDFLAGS</code> or <code class="varname">LIBS</code>. The difference
1926: between the two is that <code class="varname">LIBS</code> will be appended to
1927: the command line, while <code class="varname">LDFLAGS</code> come earlier.
1928: <code class="varname">LDFLAGS</code> is pre-loaded with rpath settings for ELF
1929: machines depending on the setting of <code class="varname">USE_IMAKE</code> or
1930: the inclusion of <code class="filename">mk/x11.buildlink3.mk</code>. As with
1931: <code class="varname">CFLAGS</code>, if you do not wish to override these
1932: settings, use the <code class="literal">+=</code> operator:</p>
1933: <pre class="programlisting">
1934: LDFLAGS+= -your -linkerflags
1935: </pre>
1936: </div>
1937: </div>
1.41 asau 1938: <div class="sect1">
1.1 dsieger 1939: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1940: <a name="developer-advanced-settings"></a>6.5. Developer/advanced settings</h2></div></div></div>
1.84 wiz 1941: <p>
1.1 dsieger 1942: </p>
1.41 asau 1943: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 1944: <li class="listitem">
1.1 dsieger 1945: <p><code class="varname">PKG_DEVELOPER</code>:
1946: Run some sanity checks that package developers want:
1947: </p>
1.41 asau 1948: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
1.23 wiz 1949: <li class="listitem"><p>make sure patches apply with zero
1.1 dsieger 1950: fuzz</p></li>
1.23 wiz 1951: <li class="listitem"><p>run check-shlibs to see that all
1.1 dsieger 1952: binaries will find their shared libs.</p></li>
1953: </ul></div>
1954: <p>
1955: </p>
1956: </li>
1.23 wiz 1957: <li class="listitem"><p><code class="varname">PKG_DEBUG_LEVEL</code>: The level
1.1 dsieger 1958: of debugging output which is displayed whilst making and
1959: installing the package. The default value for this is 0,
1960: which will not display the commands as they are executed
1961: (normal, default, quiet operation); the value 1 will display
1962: all shell commands before their invocation, and the value 2
1963: will display both the shell commands before their invocation,
1.112 rillig 1964: as well as their actual execution progress with <span class="command"><strong>set
1965: -x</strong></span>.</p></li>
1.1 dsieger 1966: </ul></div>
1967: <p>
1968: </p>
1969: </div>
1.41 asau 1970: <div class="sect1">
1.1 dsieger 1971: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1972: <a name="selecting-build-options"></a>6.6. Selecting Build Options</h2></div></div></div>
1.1 dsieger 1973: <p>Some packages have build time options, usually to select
1974: between different dependencies, enable optional support for big
1975: dependencies or enable experimental features.</p>
1976: <p>To see which options, if any, a package supports, and which
1.10 hubertf 1977: options are mutually exclusive, run <span class="command"><strong>make
1.1 dsieger 1978: show-options</strong></span>, for example:</p>
1979: <pre class="programlisting">
1980: The following options are supported by this package:
1981: ssl Enable SSL support.
1982: Exactly one of the following gecko options is required:
1983: firefox Use firefox as gecko rendering engine.
1984: mozilla Use mozilla as gecko rendering engine.
1985: At most one of the following database options may be selected:
1986: mysql Enable support for MySQL database.
1987: pgsql Enable support for PostgreSQL database.
1988:
1989: These options are enabled by default: firefox
1990: These options are currently enabled: mozilla ssl
1991: </pre>
1992: <p>The following variables can be defined in
1.10 hubertf 1993: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to select which options to
1.1 dsieger 1994: enable for a package: <code class="varname">PKG_DEFAULT_OPTIONS</code>,
1995: which can be used to select or disable options for all packages
1996: that support them, and
1997: <code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>,
1998: which can be used to select or disable options specifically for
1999: package <em class="replaceable"><code>pkgbase</code></em>. Options listed in
1.23 wiz 2000: these variables are selected, options preceded by <span class="quote">“<span class="quote">-</span>”</span>
1.1 dsieger 2001: are disabled. A few examples:</p>
2002: <pre class="screen">
1.10 hubertf 2003: <code class="prompt">$</code> <span class="command"><strong>grep "PKG.*OPTION" <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a></strong></span>
1.1 dsieger 2004: PKG_DEFAULT_OPTIONS= -arts -dvdread -esound
2005: PKG_OPTIONS.kdebase= debug -sasl
2006: PKG_OPTIONS.apache= suexec </pre>
1.11 rillig 2007: <p>It is important to note that options that were specifically
1.18 snj 2008: suggested by the package maintainer must be explicitly removed if
1.11 rillig 2009: you do not wish to include the option. If you are unsure you can view
2010: the current state with <span class="command"><strong>make show-options</strong></span>.</p>
1.1 dsieger 2011: <p>The following settings are consulted in the order given, and
2012: the last setting that selects or disables an option is
2013: used:</p>
1.23 wiz 2014: <div class="orderedlist"><ol class="orderedlist" type="1">
2015: <li class="listitem"><p>the default options as suggested by the package
1.1 dsieger 2016: maintainer</p></li>
1.23 wiz 2017: <li class="listitem"><p>the options implied by the settings of legacy
1.1 dsieger 2018: variables (see below)</p></li>
1.23 wiz 2019: <li class="listitem"><p><code class="varname">PKG_DEFAULT_OPTIONS</code></p></li>
2020: <li class="listitem"><p><code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code></p></li>
1.1 dsieger 2021: </ol></div>
2022: <p>For groups of mutually exclusive options, the last option
2023: selected is used, all others are automatically disabled. If an
2024: option of the group is explicitly disabled, the previously
2025: selected option, if any, is used. It is an error if no option
2026: from a required group of options is selected, and building the
2027: package will fail.</p>
2028: <p>Before the options framework was introduced, build options
2029: were selected by setting a variable (often named
2030: <code class="varname">USE_<em class="replaceable"><code>FOO</code></em></code>) in
1.10 hubertf 2031: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> for each option. To ease
1.1 dsieger 2032: transition to the options framework for the user, these legacy
2033: variables are converted to the appropriate options setting
2034: (<code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>)
2035: automatically. A warning is issued to prompt the user to update
1.10 hubertf 2036: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to use the options framework
1.1 dsieger 2037: directly. Support for the legacy variables will be removed
2038: eventually.</p>
2039: </div>
2040: </div>
1.41 asau 2041: <div class="chapter">
1.1 dsieger 2042: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 2043: <a name="binary"></a>Chapter 7. Creating binary packages</h2></div></div></div>
1.1 dsieger 2044: <div class="toc">
2045: <p><b>Table of Contents</b></p>
1.100 leot 2046: <dl class="toc">
1.154 rillig 2047: <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt>
2048: <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt>
1.1 dsieger 2049: </dl>
2050: </div>
1.41 asau 2051: <div class="sect1">
1.1 dsieger 2052: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2053: <a name="building-a-single-binary-package"></a>7.1. Building a single binary package</h2></div></div></div>
1.1 dsieger 2054: <p>Once you have built and installed a package, you can create
2055: a <span class="emphasis"><em>binary package</em></span> which can be installed on
1.174 leot 2056: another system with <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>. This saves having to build
1.1 dsieger 2057: the same package on a group of hosts and wasting CPU time. It also
2058: provides a simple means for others to install your package, should
2059: you distribute it.</p>
2060: <p>To create a binary package, change into the appropriate
1.10 hubertf 2061: directory in pkgsrc, and run <span class="command"><strong>make
1.1 dsieger 2062: package</strong></span>:</p>
2063: <pre class="screen">
1.112 rillig 2064: <code class="prompt">$</code> <strong class="userinput"><code>cd misc/figlet</code></strong>
2065: <code class="prompt">$</code> <strong class="userinput"><code>make package</code></strong>
2066: </pre>
1.1 dsieger 2067: <p>This will build and install your package (if not already done),
2068: and then build a binary package from what was installed. You can
1.10 hubertf 2069: then use the <span class="command"><strong>pkg_*</strong></span> tools to manipulate
1.1 dsieger 2070: it. Binary packages are created by default in
2071: <code class="filename">/usr/pkgsrc/packages</code>, in the form of a
1.10 hubertf 2072: gzipped tar file. See <a class="xref" href="#logs.package" title="B.2. Packaging figlet">Section B.2, “Packaging figlet”</a> for a
1.137 leot 2073: continuation of the above <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/misc/figlet/README.html" target="_top"><code class="filename">misc/figlet</code></a> example.</p>
1.154 rillig 2074: <p>See <a class="xref" href="#submit" title="Chapter 23. Submitting and Committing">Chapter 23, <i>Submitting and Committing</i></a> for information on how to submit
1.1 dsieger 2075: such a binary package.</p>
2076: </div>
1.41 asau 2077: <div class="sect1">
1.1 dsieger 2078: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2079: <a name="settings-for-creationg-of-binary-packages"></a>7.2. Settings for creation of binary packages</h2></div></div></div>
2080: <p>See <a class="xref" href="#build.helpful-targets" title="19.17. Other helpful targets">Section 19.17, “Other helpful targets”</a>.</p>
1.6 rillig 2081: </div>
2082: </div>
1.41 asau 2083: <div class="chapter">
1.6 rillig 2084: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 2085: <a name="bulk"></a>Chapter 8. Creating binary packages for everything in pkgsrc (bulk
1.6 rillig 2086: builds)</h2></div></div></div>
2087: <div class="toc">
2088: <p><b>Table of Contents</b></p>
1.100 leot 2089: <dl class="toc">
1.154 rillig 2090: <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt>
2091: <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt>
2092: <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd>
2093: <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt>
1.178 ! rillig 2094: <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt>
! 2095: <dd><dl>
! 2096: <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt>
! 2097: <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt>
! 2098: <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt>
! 2099: <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt>
! 2100: <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt>
! 2101: <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt>
! 2102: <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt>
! 2103: <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt>
! 2104: <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt>
! 2105: <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt>
! 2106: <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt>
! 2107: <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt>
! 2108: </dl></dd>
! 2109: <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
! 2110: <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
1.6 rillig 2111: </dl>
2112: </div>
1.175 gutterid 2113: <p>For a number of reasons, you may want to build binary packages
2114: for a large selected set of packages in pkgsrc, or even for all pkgsrc packages.
1.71 wiz 2115: For instance, when you have multiple machines that should run the same software,
2116: it is wasted time if they all build their packages themselves from source.
2117: Or you may want to build a list of packages you want and check them before
1.175 gutterid 2118: deploying onto production systems.
1.71 wiz 2119: There is a way of getting a set of binary packages:
1.175 gutterid 2120: the bulk build system, or pbulk ("p" stands for "parallel").
1.112 rillig 2121: This chapter describes how to set it up.</p>
1.41 asau 2122: <div class="sect1">
1.6 rillig 2123: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2124: <a name="bulk.pre"></a>8.1. Preparations</h2></div></div></div>
1.71 wiz 2125: <p>First of all, you have to decide whether you build all packages
2126: or a limited set of them. Full bulk builds usually consume a lot more resources,
2127: both space and time, than builds for some practical sets of packages.
1.175 gutterid 2128: A number of particularly heavy packages exist that are not actually
2129: interesting to a wide audience. (The approximate resource consumption for a
2130: full bulk build is given in section <a class="xref" href="#bulk.req" title="8.3. Requirements of a full bulk build">Section 8.3, “Requirements of a full bulk build”</a>.)
2131: For limited bulk builds you need to make a list of packages you want to build.
1.112 rillig 2132: Note that all their dependencies will be built, so you don't need to track them manually.
1.71 wiz 2133: </p>
2134: <p>During bulk builds various packages are installed and deinstalled
2135: in <code class="filename">/usr/pkg</code> (or whatever <code class="filename">LOCALBASE</code> is),
2136: so make sure that you don't need any package during the builds.
1.112 rillig 2137: Essentially, you should provide a fresh system, either a chroot environment
1.71 wiz 2138: or something even more restrictive, depending on what the operating system provides,
2139: or dedicate the whole physical machine.
2140: As a useful side effect this makes sure that bulk builds cannot
2141: break anything in your system. There have been numerous cases where
1.6 rillig 2142: certain packages tried to install files outside the
2143: <code class="filename">LOCALBASE</code> or wanted to edit some files in
1.71 wiz 2144: <code class="filename">/etc</code>.
2145: </p>
1.6 rillig 2146: </div>
1.41 asau 2147: <div class="sect1">
1.6 rillig 2148: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2149: <a name="bulk.pbulk"></a>8.2. Running a pbulk-style bulk build</h2></div></div></div>
1.15 rillig 2150: <p>Running a pbulk-style bulk build works roughly as follows:</p>
1.41 asau 2151: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2152: <li class="listitem"><p>First, build the pbulk infrastructure in a fresh pkgsrc location.</p></li>
2153: <li class="listitem"><p>Then, build each of the packages from a clean installation directory using the infrastructure.</p></li>
1.15 rillig 2154: </ul></div>
1.41 asau 2155: <div class="sect2">
1.15 rillig 2156: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 2157: <a name="bulk.pbulk.conf"></a>8.2.1. Configuration</h3></div></div></div>
1.112 rillig 2158: <p>To simplify configuration, we provide the helper script <code class="filename">mk/pbulk/pbulk.sh</code>.</p>
1.68 asau 2159: <p>In order to use it, prepare a clear system (real one, chroot environment, jail, zone, virtual machine).
2160: Configure network access to fetch distribution files.
1.112 rillig 2161: Create a user with name "pbulk".</p>
1.68 asau 2162: <p>Fetch and extract pkgsrc. Use a command like one of these:</p>
2163: <pre class="screen">
1.151 sevan 2164: <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && ftp -o - https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz | tar -zxf-)</code></strong>
2165: <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && fetch -o - https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz | tar -zxf-)</code></strong>
1.72 wiz 2166: <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && cvs -Q -z3 -d anoncvs@anoncvs.NetBSD.org:/cvsroot get -P pkgsrc)</code></strong>
1.68 asau 2167: </pre>
2168: <p>Or any other way that fits (e.g., curl, wget).</p>
2169: <p>Deploy and configure pbulk tools, e.g.:</p>
2170: <pre class="screen">
1.118 sevan 2171: <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -n # use native make, no bootstrap kit needed (for use on NetBSD)</code></strong>
1.68 asau 2172: <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -n -c mk.conf.frag # native, apply settings from given mk.conf fragment</code></strong>
2173: <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -nlc mk.conf.frag # native, apply settings, configure for limited build</code></strong>
2174: </pre>
2175: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
2176: <h3 class="title">Note</h3>
2177: <p><code class="filename">mk.conf.frag</code> is a fragment of
2178: <code class="filename">mk.conf</code> that contains settings you want to
2179: apply to packages you build. For instance,</p>
2180: <pre class="programlisting">
1.112 rillig 2181: PKG_DEVELOPER= yes # perform more checks
2182: X11_TYPE= modular # use pkgsrc X11
2183: SKIP_LICENSE_CHECK= yes # accept all licences (useful
2184: # when building all packages)
1.68 asau 2185: </pre>
2186: </div>
2187: <p>If configured for limited list, replace the list in <code class="filename">/usr/pbulk/etc/pbulk.list</code>
1.112 rillig 2188: with your list of packages, one per line without empty lines or comments. E.g.:</p>
1.68 asau 2189: <pre class="programlisting">
2190: www/firefox
2191: mail/thunderbird
2192: misc/libreoffice4
2193: </pre>
1.69 asau 2194: <p>At this point you can also review configuration in <code class="filename">/usr/pbulk/etc</code>
2195: and make final amendments, if wanted.</p>
1.68 asau 2196: <p>Start it:</p>
2197: <pre class="screen">
2198: <code class="prompt">#</code> <strong class="userinput"><code>/usr/pbulk/bin/bulkbuild</code></strong>
2199: </pre>
2200: <p>After it finishes, you'll have <code class="filename">/mnt</code> filled with distribution files, binary packages, and reports,
2201: plain text summary in <code class="filename">/mnt/bulklog/meta/report.txt</code>
2202: </p>
2203: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
2204: <h3 class="title">Note</h3>
2205: <p>The <code class="filename">pbulk.sh</code> script does not cover all possible use cases.
2206: While being ready to run, it serves as a good starting point to understand and build more complex setups.
2207: The script is kept small enough for better understanding.</p>
2208: </div>
2209: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
2210: <h3 class="title">Note</h3>
2211: <p>The <code class="filename">pbulk.sh</code> script supports running
2212: unprivileged bulk build and helps configuring distributed bulk builds.</p>
2213: </div>
1.6 rillig 2214: </div>
2215: </div>
1.41 asau 2216: <div class="sect1">
1.6 rillig 2217: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2218: <a name="bulk.req"></a>8.3. Requirements of a full bulk build</h2></div></div></div>
1.71 wiz 2219: <p>A complete bulk build requires lots of disk space. Some of the
2220: disk space can be read-only, some other must be writable. Some can be on
2221: remote filesystems (such as NFS) and some should be local. Some can be
2222: temporary filesystems, others must survive a sudden reboot.</p>
2223: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
2224: <li class="listitem"><p>40 GB for the distfiles (read-write, remote, temporary)</p></li>
2225: <li class="listitem"><p>30 GB for the binary packages (read-write, remote, permanent)</p></li>
2226: <li class="listitem"><p>1 GB for the pkgsrc tree (read-only, remote, permanent)</p></li>
2227: <li class="listitem"><p>5 GB for <code class="filename">LOCALBASE</code> (read-write, local, temporary)</p></li>
2228: <li class="listitem"><p>10 GB for the log files (read-write, remote, permanent)</p></li>
2229: <li class="listitem"><p>5 GB for temporary files (read-write, local, temporary)</p></li>
2230: </ul></div>
2231: </div>
2232: <div class="sect1">
2233: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.178 ! rillig 2234: <a name="bulk.var"></a>8.4. Bulk build variants</h2></div></div></div>
! 2235: <p>To ensure that pkgsrc packages work in different configurations, it
! 2236: makes sense to run non-default bulk builds from time to time. This
! 2237: section lists some ideas for bulk builds that intentionally let packages
! 2238: fail if they don't follow the pkgsrc style.</p>
! 2239: <div class="sect2">
! 2240: <div class="titlepage"><div><div><h3 class="title">
! 2241: <a name="bulk.var.subst_noop"></a>8.4.1. Strict SUBST blocks</h3></div></div></div>
! 2242: <p>Up to May 2020, the SUBST blocks ignored files that didn't exist,
! 2243: as well as substitutions that didn't have any effect. There were quite a
! 2244: few SUBST blocks that were redundant, and these have been removed
! 2245: already.</p>
! 2246: <p>The next step would be to not only check that each filename pattern
! 2247: has an effect but also that each substitution in SUBST_SED or SUBST_VARS
! 2248: applies to at least one file.</p>
! 2249: <p>To do this, <code class="filename">mk/subst.mk</code> would have to be
! 2250: adjusted, in a similar way as the check for no-op SUBST_FILES. There are
! 2251: several regression tests in <code class="filename">regress/infra-unittests</code>
! 2252: that help to get all edge cases correct.</p>
! 2253: <p>When a package fails this additional check, there are various
! 2254: possible causes why the <code class="varname">SUBST_SED</code> became a
! 2255: no-op.</p>
! 2256: <div class="orderedlist"><ol class="orderedlist" type="1">
! 2257: <li class="listitem"><p>The pattern used to be found in a former version of the
! 2258: package, but is not needed anymore. In that case, just remove
! 2259: it.</p></li>
! 2260: <li class="listitem"><p>The pattern contains a typo. In that case, fix the typo
! 2261: and bump <code class="varname">PKGREVISION</code>, since the fixed typo will
! 2262: probably modify the resulting binary package.</p></li>
! 2263: <li class="listitem"><p>There is a patch that is applied before the SUBST block,
! 2264: and the patch accidentally contains the change that was intended for the
! 2265: SUBST block. In that case, remove the respective hunk from the
! 2266: patch.</p></li>
! 2267: </ol></div>
! 2268: </div>
! 2269: <div class="sect2">
! 2270: <div class="titlepage"><div><div><h3 class="title">
! 2271: <a name="bulk.var.confopt"></a>8.4.2. Detect unknown configure options</h3></div></div></div>
! 2272: <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2273: <pre class="programlisting">
! 2274: GNU_CONFIGURE_STRICT= yes
! 2275: </pre>
! 2276: <p>When a package fails this additional check, the most common cause
! 2277: is that the configure option was valid for an older version of the
! 2278: package but does not apply anymore. In that case, just remove it.</p>
! 2279: </div>
! 2280: <div class="sect2">
! 2281: <div class="titlepage"><div><div><h3 class="title">
! 2282: <a name="bulk.var.comperr"></a>8.4.3. Detect classes of bugs by forcing compiler warnings</h3></div></div></div>
! 2283: <p>The job of a compiler is not restricted to producing executable
! 2284: code, most compilers also detects typical mistakes.</p>
! 2285: <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2286: <pre class="programlisting">
! 2287: CFLAGS+= -Werror=char-subscripts
! 2288: </pre>
! 2289: <p>When a package fails this additional check, first document the
! 2290: circumstances in which the compiler produced the error message. This
! 2291: includes:</p>
! 2292: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
! 2293: <li class="listitem"><p>The platform
! 2294: (<code class="varname">MACHINE_PLATFORM</code>)</p></li>
! 2295: <li class="listitem"><p>The source file</p></li>
! 2296: <li class="listitem"><p>An excerpt of the code. GCC and Clang already do this as
! 2297: part of the diagnostic.</p></li>
! 2298: <li class="listitem"><p>The error message from the compiler.</p></li>
! 2299: </ul></div>
! 2300: <p>If a package produces these error messages, but the package is
! 2301: fine, document this in the package Makefile, like this:</p>
! 2302: <pre class="programlisting">
! 2303: # Version ${VERSION} failed on ${MACHINE_PLATFORM}:
! 2304: # error message
! 2305: # code
! 2306: # reason why the code does not need to be fixed
! 2307: BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts
! 2308: </pre>
! 2309: <p>If the error messages from the compiler are valid and the code
! 2310: needs to be fixed, prepare a patch for a single source file, or if it's a
! 2311: one-liner fix, add a SUBST block to the package Makefile. In any case,
! 2312: report it to the upstream authors of the package.</p>
! 2313: </div>
! 2314: <div class="sect2">
! 2315: <div class="titlepage"><div><div><h3 class="title">
! 2316: <a name="bulk.var.dirs"></a>8.4.4. Use custom directories</h3></div></div></div>
! 2317: <p>Some directories like <code class="varname">PREFIX</code>,
! 2318: <code class="varname">VARBASE</code>, <code class="varname">PKG_SYSCONFDIR</code>,
! 2319: <code class="varname">PKGMANDIR</code>, <code class="varname">PKG_INFODIR</code> can be
! 2320: configured in pkgsrc. Set these to arbitrary paths during bootstrap or
! 2321: afterwards in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2322: <pre class="programlisting">
! 2323: PREFIX= /a-random-uuid
! 2324: PKG_SYSCONFDIR= /a-random-uuid
! 2325: VARBASE= /a-random-uuid
! 2326: PKGMANDIR= a-random-uuid
! 2327: PKG_INFODIR= a-random-uuid
! 2328: </pre>
! 2329: </div>
! 2330: <div class="sect2">
! 2331: <div class="titlepage"><div><div><h3 class="title">
! 2332: <a name="bulk.var.warn"></a>8.4.5. Turn warnings into errors</h3></div></div></div>
! 2333: <p>When building a package, warnings are typically ignored since they
! 2334: just flow by and do not cause the build to fail immediately. To find
! 2335: these warnings, redefine them to errors in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2336: <pre class="programlisting">
! 2337: DELAYED_WARNING_MSG= ${DELAYED_ERROR_MSG} "(was warning)"
! 2338: WARNING_MSG= ${FAIL_MSG} "(was warning)"
! 2339: </pre>
! 2340: <p>(There are many more classes of warnings in pkgsrc, and most of
! 2341: them can be redefined with a simple definition like above.</p>
! 2342: <p>If a package suggest to add <code class="varname">USE_TOOLS+=perl</code> to
! 2343: the package Makefile, research whether the package actually needs Perl.
! 2344: If it does, add <code class="varname">USE_TOOLS+=perl</code> to the package
! 2345: Makefile, and if it doesn't, add
! 2346: <code class="varname">TOOLS_BROKEN+=perl</code>.</p>
! 2347: </div>
! 2348: <div class="sect2">
! 2349: <div class="titlepage"><div><div><h3 class="title">
! 2350: <a name="bulk.var.pkglint"></a>8.4.6. Reject packages for which pkglint reports errors</h3></div></div></div>
! 2351: <p>Using pkglint as part of the regular build process is mostly a
! 2352: waste of time. If you want to fix some of the warnings, just run pkglint
! 2353: recursively on the whole pkgsrc tree. This will take a few minutes (up to
! 2354: 10), which is much faster than a complete bulk build.</p>
! 2355: </div>
! 2356: <div class="sect2">
! 2357: <div class="titlepage"><div><div><h3 class="title">
! 2358: <a name="bulk.var.strings"></a>8.4.7. Reject packages that contain forbidden strings</h3></div></div></div>
! 2359: <p>To ensure that the binary packages don't contain references to the
! 2360: build directory, there is already <code class="varname">CHECK_WRKREF</code>. If
! 2361: that variable includes the item <code class="literal">extra</code>, it is
! 2362: possible to define additional patterns that must not appear in any
! 2363: installed file. This is specified in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2364: <pre class="programlisting">
! 2365: CHECK_WRKREF= extra
! 2366: CHECK_WRKREF_EXTRA_DIRS+= /usr/local
! 2367: CHECK_WRKREF_EXTRA_DIRS+= /usr/pkg
! 2368: CHECK_WRKREF_EXTRA_DIRS+= @[A-Z][A-Z]*@
! 2369: </pre>
! 2370: <p>The above patterns will probably generate many false positives,
! 2371: therefore the results need to be taken with a grain of salt.</p>
! 2372: </div>
! 2373: <div class="sect2">
! 2374: <div class="titlepage"><div><div><h3 class="title">
! 2375: <a name="bulk.var.test"></a>8.4.8. Reject packages whose self-test fails</h3></div></div></div>
! 2376: <p>To run the test suites that come with each package, add this line
! 2377: to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2378: <pre class="programlisting">
! 2379: PKGSRC_RUN_TEST= yes
! 2380: </pre>
! 2381: <p>Be prepared that even the most basic packages fail this test. When
! 2382: doing a bulk build with this, it will often abort in the early phase
! 2383: where the packages are scanned for their dependencies since there are
! 2384: cyclic dependencies. There is still a lot to do in this area.</p>
! 2385: </div>
! 2386: <div class="sect2">
! 2387: <div class="titlepage"><div><div><h3 class="title">
! 2388: <a name="bulk.var.shvar"></a>8.4.9. Reject packages that use undefined shell variables</h3></div></div></div>
! 2389: <p>To catch typos in the shell snippets from the Makefile fragments,
! 2390: add the <code class="literal">-u</code> flag to most of the commands by adding this
! 2391: line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2392: <pre class="programlisting">
! 2393: RUN= @set -eu;
! 2394: </pre>
! 2395: <p>See <code class="filename">mk/misc/common.mk</code> for the existing
! 2396: definition.</p>
! 2397: </div>
! 2398: <div class="sect2">
! 2399: <div class="titlepage"><div><div><h3 class="title">
! 2400: <a name="bulk.var.quiet"></a>8.4.10. Turn off verbose logging</h3></div></div></div>
! 2401: <p>The build logs of a package are often quite long. This allows error
! 2402: messages or other interesting details to hide between the noise. To make
! 2403: the actual error message stand out more, add these lines to
! 2404: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
! 2405: <pre class="programlisting">
! 2406: GNU_CONFIGURE_QUIET= yes
! 2407: MAKE_FLAGS+= -s
! 2408: </pre>
! 2409: <p>The <code class="literal">-s</code> option works for both GNU Make and BSD
! 2410: Make. On exotic platforms with their own make, it may be a little
! 2411: different.</p>
! 2412: </div>
! 2413: <div class="sect2">
! 2414: <div class="titlepage"><div><div><h3 class="title">
! 2415: <a name="bulk.var.options"></a>8.4.11. Select random sets of options</h3></div></div></div>
! 2416: <p>Most bulk builds run with the default package options. This means
! 2417: that other combinations of options are not regularly tested. To do this,
! 2418: run a bulk build with these configurations.</p>
! 2419: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
! 2420: <li class="listitem"><p>no options enabled</p></li>
! 2421: <li class="listitem"><p>all options enabled</p></li>
! 2422: <li class="listitem"><p>2n + 0</p></li>
! 2423: <li class="listitem"><p>2n + 1</p></li>
! 2424: <li class="listitem"><p>4n + 0..1</p></li>
! 2425: <li class="listitem"><p>4n + 2..3</p></li>
! 2426: <li class="listitem"><p>8n + 0..3</p></li>
! 2427: <li class="listitem"><p>8n + 4..7</p></li>
! 2428: <li class="listitem"><p>2048n + 0..1023</p></li>
! 2429: <li class="listitem"><p>2048n + 1024..2047</p></li>
! 2430: </ul></div>
! 2431: <p>Open questions are:</p>
! 2432: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
! 2433: <li class="listitem"><p>how to collect all options from the entire
! 2434: pkgsrc</p></li>
! 2435: <li class="listitem"><p>how to handle mutually exclusive
! 2436: options</p></li>
! 2437: <li class="listitem"><p>the sets of mutually exclusive options are defined
! 2438: per-package</p></li>
! 2439: <li class="listitem"><p>the sets of nonempty sets are defined
! 2440: per-package</p></li>
! 2441: </ul></div>
! 2442: </div>
! 2443: <div class="sect2">
! 2444: <div class="titlepage"><div><div><h3 class="title">
! 2445: <a name="bulk.var.build_defs"></a>8.4.12. Select random configurations of BUILD_DEFS</h3></div></div></div>
! 2446: <p>Just like the <code class="varname">PKG_OPTIONS</code>, the
! 2447: <code class="varname">BUILD_DEFS</code> also allow different variants of pkgsrc to
! 2448: be created. The same ideas as in <a class="xref" href="#bulk.var.options" title="8.4.11. Select random sets of options">Section 8.4.11, “Select random sets of options”</a>
! 2449: apply.</p>
! 2450: </div>
! 2451: </div>
! 2452: <div class="sect1">
! 2453: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
! 2454: <a name="creating-cdroms"></a>8.5. Creating a multiple CD-ROM packages collection</h2></div></div></div>
1.1 dsieger 2455: <p>After your pkgsrc bulk-build has completed, you may wish to
2456: create a CD-ROM set of the resulting binary packages to assist
2457: in installing packages on other machines. The
1.137 leot 2458: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/cdpack/README.html" target="_top"><code class="filename">pkgtools/cdpack</code></a> package provides
1.1 dsieger 2459: a simple tool for creating the ISO 9660 images.
1.10 hubertf 2460: <span class="command"><strong>cdpack</strong></span> arranges the packages on the CD-ROMs in a
1.1 dsieger 2461: way that keeps all the dependencies for a given package on the same
2462: CD as that package.</p>
1.41 asau 2463: <div class="sect2">
1.1 dsieger 2464: <div class="titlepage"><div><div><h3 class="title">
1.178 ! rillig 2465: <a name="cdpack-example"></a>8.5.1. Example of cdpack</h3></div></div></div>
1.1 dsieger 2466: <p>Complete documentation for cdpack is found in the cdpack(1)
2467: man page. The following short example assumes that the binary
2468: packages are left in
2469: <code class="filename">/usr/pkgsrc/packages/All</code> and that
2470: sufficient disk space exists in <code class="filename">/u2</code> to
2471: hold the ISO 9660 images.</p>
2472: <pre class="screen">
2473: <code class="prompt">#</code> <strong class="userinput"><code>mkdir /u2/images</code></strong>
2474: <code class="prompt">#</code> <strong class="userinput"><code>pkg_add /usr/pkgsrc/packages/All/cdpack</code></strong>
2475: <code class="prompt">#</code> <strong class="userinput"><code>cdpack /usr/pkgsrc/packages/All /u2/images</code></strong>
2476: </pre>
2477: <p>If you wish to include a common set of files
2478: (<code class="filename">COPYRIGHT</code>, <code class="filename">README</code>,
2479: etc.) on each CD in the collection, then you need to create a
1.175 gutterid 2480: directory which contains these files, e.g.:</p>
1.1 dsieger 2481: <pre class="screen">
2482: <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common</code></strong>
2483: <code class="prompt">#</code> <strong class="userinput"><code>echo "This is a README" > /tmp/common/README</code></strong>
2484: <code class="prompt">#</code> <strong class="userinput"><code>echo "Another file" > /tmp/common/COPYING</code></strong>
2485: <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common/bin</code></strong>
2486: <code class="prompt">#</code> <strong class="userinput"><code>echo "#!/bin/sh" > /tmp/common/bin/myscript</code></strong>
2487: <code class="prompt">#</code> <strong class="userinput"><code>echo "echo Hello world" >> /tmp/common/bin/myscript</code></strong>
2488: <code class="prompt">#</code> <strong class="userinput"><code>chmod 755 /tmp/common/bin/myscript</code></strong>
2489: </pre>
2490: <p>Now create the images:</p>
2491: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</code></strong></pre>
2492: <p>Each image will contain <code class="filename">README</code>,
2493: <code class="filename">COPYING</code>, and <code class="filename">bin/myscript</code>
2494: in their root directories.</p>
2495: </div>
2496: </div>
2497: </div>
1.41 asau 2498: <div class="chapter">
1.1 dsieger 2499: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 2500: <a name="files"></a>Chapter 9. Directory layout of the installed files</h2></div></div></div>
1.1 dsieger 2501: <div class="toc">
2502: <p><b>Table of Contents</b></p>
1.100 leot 2503: <dl class="toc">
1.154 rillig 2504: <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
2505: <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt>
1.1 dsieger 2506: </dl>
2507: </div>
2508: <p>The files that are installed by pkgsrc are organized in a way that
2509: is similar to what you find in the <code class="filename">/usr</code> directory
2510: of the base system. But some details are different. This is because
2511: pkgsrc initially came from FreeBSD and had adopted its file system
2512: hierarchy. Later it was largely influenced by NetBSD. But no matter
2513: which operating system you are using pkgsrc with, you can expect the
2514: same layout for pkgsrc.</p>
2515: <p>There are mainly four root directories for pkgsrc, which are all
2516: configurable in the <code class="filename">bootstrap/bootstrap</code> script.
2517: When pkgsrc has been installed as root, the default locations
2518: are:</p>
2519: <pre class="programlisting">
2520: LOCALBASE= /usr/pkg
2521: PKG_SYSCONFBASE= /usr/pkg/etc
2522: VARBASE= /var
1.119 sevan 2523: PKG_DBDIR= /usr/pkg/pkgdb
1.1 dsieger 2524: </pre>
2525: <p>In unprivileged mode (when pkgsrc has been installed as any other
2526: user), the default locations are:</p>
2527: <pre class="programlisting">
2528: LOCALBASE= ${HOME}/pkg
2529: PKG_SYSCONFBASE= ${HOME}/pkg/etc
2530: VARBASE= ${HOME}/pkg/var
1.119 sevan 2531: PKG_DBDIR= ${HOME}/pkg/pkgdb
1.1 dsieger 2532: </pre>
2533: <p>What these four directories are for, and what they look like is
2534: explained below.</p>
1.41 asau 2535: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2536: <li class="listitem"><p><code class="varname">LOCALBASE</code> corresponds to the
1.1 dsieger 2537: <code class="filename">/usr</code> directory in the base system. It is the
1.23 wiz 2538: <span class="quote">“<span class="quote">main</span>”</span> directory where the files are installed and contains
1.1 dsieger 2539: the well-known subdirectories like <code class="filename">bin</code>,
2540: <code class="filename">include</code>, <code class="filename">lib</code>,
2541: <code class="filename">share</code> and
2542: <code class="filename">sbin</code>.</p></li>
1.23 wiz 2543: <li class="listitem"><p><code class="varname">VARBASE</code> corresponds to
1.1 dsieger 2544: <code class="filename">/var</code> in the base system. Some programs (especially
2545: games, network daemons) need write access to it during normal
2546: operation.</p></li>
1.23 wiz 2547: <li class="listitem"><p><code class="varname">PKG_SYSCONFDIR</code> corresponds to
1.1 dsieger 2548: <code class="filename">/etc</code> in the base system. It contains configuration
1.10 hubertf 2549: files of the packages, as well as pkgsrc's <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>
1.1 dsieger 2550: itself.</p></li>
2551: </ul></div>
1.41 asau 2552: <div class="sect1">
1.1 dsieger 2553: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2554: <a name="files.localbase"></a>9.1. File system layout in <code class="literal">${LOCALBASE}</code>
1.1 dsieger 2555: </h2></div></div></div>
2556: <p>The following directories exist in a typical pkgsrc installation
2557: in <code class="filename">${LOCALBASE}</code>.</p>
1.41 asau 2558: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 2559: <dt><span class="term"><code class="filename">bin</code></span></dt>
2560: <dd><p>Contains executable programs that are intended to be
2561: directly used by the end user.</p></dd>
2562: <dt><span class="term"><code class="filename">emul</code></span></dt>
2563: <dd><p>Contains files for the emulation layers of various other
2564: operating systems, especially for
2565: NetBSD.</p></dd>
2566: <dt><span class="term"><code class="filename">etc</code> (the usual location of
2567: <code class="filename">${PKG_SYSCONFDIR}</code>)</span></dt>
2568: <dd><p>Contains
2569: the configuration files.</p></dd>
2570: <dt><span class="term"><code class="filename">include</code></span></dt>
2571: <dd><p>Contains headers for the C and C++ programming
2572: languages.</p></dd>
2573: <dt><span class="term"><code class="filename">info</code></span></dt>
2574: <dd><p>Contains GNU info files of various
2575: packages.</p></dd>
2576: <dt><span class="term"><code class="filename">lib</code></span></dt>
2577: <dd><p>Contains shared and static
2578: libraries.</p></dd>
2579: <dt><span class="term"><code class="filename">libdata</code></span></dt>
2580: <dd><p>Contains data files that don't change after
2581: installation. Other data files belong into
2582: <code class="filename">${VARBASE}</code>.</p></dd>
2583: <dt><span class="term"><code class="filename">libexec</code></span></dt>
2584: <dd><p>Contains programs that are not intended to be used by
2585: end users, such as helper programs or network
2586: daemons.</p></dd>
2587: <dt><span class="term"><code class="filename">libexec/cgi-bin</code></span></dt>
2588: <dd><p>Contains programs that are intended to be executed as
2589: CGI scripts by a web server.</p></dd>
2590: <dt><span class="term"><code class="filename">man</code> (the usual value of
2591: <code class="filename">${PKGMANDIR}</code>)</span></dt>
2592: <dd><p>Contains brief
2593: documentation in form of manual pages.</p></dd>
2594: <dt><span class="term"><code class="filename">sbin</code></span></dt>
2595: <dd><p>Contains programs that are intended to be used only by
2596: the super-user.</p></dd>
2597: <dt><span class="term"><code class="filename">share</code></span></dt>
2598: <dd><p>Contains platform-independent data files that don't
2599: change after installation.</p></dd>
2600: <dt><span class="term"><code class="filename">share/doc</code></span></dt>
2601: <dd><p>Contains documentation files provided by the
2602: packages.</p></dd>
2603: <dt><span class="term"><code class="filename">share/examples</code></span></dt>
2604: <dd><p>Contains example files provided by the packages. Among
2605: others, the original configuration files are saved here and copied to
2606: <code class="filename">${PKG_SYSCONFDIR}</code> during
2607: installation.</p></dd>
2608: <dt><span class="term"><code class="filename">share/examples/rc.d</code></span></dt>
2609: <dd><p>Contains the original files for rc.d
2610: scripts.</p></dd>
2611: <dt><span class="term"><code class="filename">var</code> (the usual location of
2612: <code class="filename">${VARBASE}</code>)</span></dt>
2613: <dd><p>Contains files
2614: that may be modified after
2615: installation.</p></dd>
2616: </dl></div>
2617: </div>
1.41 asau 2618: <div class="sect1">
1.1 dsieger 2619: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2620: <a name="files.varbase"></a>9.2. File system layout in <code class="literal">${VARBASE}</code>
1.1 dsieger 2621: </h2></div></div></div>
1.41 asau 2622: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 2623: <dt><span class="term"><code class="filename">db/pkg</code> (the usual location of
2624: <code class="filename">${PKG_DBDIR}</code>)</span></dt>
2625: <dd><p>Contains
2626: information about the currently installed
2627: packages.</p></dd>
2628: <dt><span class="term"><code class="filename">games</code></span></dt>
2629: <dd><p>Contains highscore
2630: files.</p></dd>
2631: <dt><span class="term"><code class="filename">log</code></span></dt>
2632: <dd><p>Contains log files.</p></dd>
2633: <dt><span class="term"><code class="filename">run</code></span></dt>
2634: <dd><p>Contains informational files about daemons that are
2635: currently running.</p></dd>
2636: </dl></div>
2637: </div>
2638: </div>
1.41 asau 2639: <div class="chapter">
1.1 dsieger 2640: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 2641: <a name="faq"></a>Chapter 10. Frequently Asked Questions</h2></div></div></div>
1.1 dsieger 2642: <div class="toc">
2643: <p><b>Table of Contents</b></p>
1.100 leot 2644: <dl class="toc">
1.154 rillig 2645: <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
2646: <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
2647: <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
2648: <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
2649: <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt>
2650: <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
2651: <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
2652: <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt>
2653: <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
2654: <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make
1.23 wiz 2655: /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
1.154 rillig 2656: <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt>
2657: <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt>
2658: <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
2659: <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
2660: <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
2661: <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
2662: <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt>
1.1 dsieger 2663: </dl>
2664: </div>
2665: <p>This section contains hints, tips & tricks on special things in
2666: pkgsrc that we didn't find a better place for in the previous chapters, and
2667: it contains items for both pkgsrc users and developers.</p>
1.41 asau 2668: <div class="sect1">
1.1 dsieger 2669: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2670: <a name="mailing-list-pointers"></a>10.1. Are there any mailing lists for pkg-related discussion?</h2></div></div></div>
1.1 dsieger 2671: <p>The following mailing lists may be of interest to pkgsrc users:</p>
1.41 asau 2672: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2673: <li class="listitem"><p><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#pkgsrc-users" target="_top">pkgsrc-users</a>:
1.1 dsieger 2674: This is a general purpose list for most issues regarding
2675: pkgsrc, regardless of platform, e.g. soliciting user help
2676: for pkgsrc configuration, unexpected build failures, using
2677: particular packages, upgrading pkgsrc installations,
2678: questions regarding the pkgsrc release branches, etc. General announcements or
2679: proposals for changes that impact the pkgsrc user community,
2680: e.g. major infrastructure changes, new features, package
2681: removals, etc., may also be posted.</p></li>
1.174 leot 2682: <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#pkgsrc-bulk" target="_top">pkgsrc-bulk</a>:
1.1 dsieger 2683: A list where the results of pkgsrc bulk builds are sent and
2684: discussed.</p></li>
1.174 leot 2685: <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#pkgsrc-changes" target="_top">pkgsrc-changes</a>:
1.1 dsieger 2686: This list is for those who are interested in getting a
2687: commit message for every change committed to pkgsrc. It is
2688: also available in digest form, meaning one daily message
2689: containing all commit messages for changes to the package
2690: source tree in that 24 hour period.</p></li>
2691: </ul></div>
2692: <p>To subscribe, do:</p>
2693: <pre class="programlisting">
2694: <code class="prompt">%</code> echo subscribe <em class="replaceable"><code>listname</code></em> | mail majordomo@NetBSD.org
2695: </pre>
2696: <p>Archives for all these mailing lists are available from
1.174 leot 2697: <a class="ulink" href="https://mail-index.NetBSD.org/" target="_top">https://mail-index.NetBSD.org/</a>.</p>
1.1 dsieger 2698: </div>
1.41 asau 2699: <div class="sect1">
1.1 dsieger 2700: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2701: <a name="faq-pkgtools"></a>10.2. Utilities for package management (pkgtools)</h2></div></div></div>
1.1 dsieger 2702: <p>The directory <code class="filename">pkgsrc/pkgtools</code> contains
2703: a number of useful utilities for both users and developers of pkgsrc. This
1.121 sevan 2704: section attempts only to make the reader aware of some of the utilities and when
1.1 dsieger 2705: they might be useful, and not to duplicate the documentation that comes
2706: with each package.</p>
2707: <p>Utilities used by pkgsrc (automatically installed when needed):</p>
1.137 leot 2708: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/x11-links/README.html" target="_top"><code class="filename">pkgtools/x11-links</code></a>:
1.1 dsieger 2709: Symlinks for use by buildlink.</p></li></ul></div>
2710: <p>OS tool augmentation (automatically installed when needed):</p>
1.41 asau 2711: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2712: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/digest/README.html" target="_top"><code class="filename">pkgtools/digest</code></a>:
1.121 sevan 2713: Calculates various kinds of checksums (including SHA3).</p></li>
1.137 leot 2714: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libnbcompat/README.html" target="_top"><code class="filename">pkgtools/libnbcompat</code></a>:
1.1 dsieger 2715: Compatibility library for pkgsrc tools.</p></li>
1.137 leot 2716: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/mtree/README.html" target="_top"><code class="filename">pkgtools/mtree</code></a>: Installed on
1.1 dsieger 2717: non-BSD systems due to lack of native mtree.</p></li>
1.137 leot 2718: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a>:
1.1 dsieger 2719: Up-to-date replacement for
2720: <code class="filename">/usr/sbin/pkg_install</code>, or for use on operating
2721: systems where pkg_install is not present.</p></li>
2722: </ul></div>
2723: <p>Utilities used by pkgsrc (not automatically installed):</p>
1.41 asau 2724: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2725: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_tarup/README.html" target="_top"><code class="filename">pkgtools/pkg_tarup</code></a>:
1.1 dsieger 2726: Create a binary package from an
1.10 hubertf 2727: already-installed package. Used by <span class="command"><strong>make replace</strong></span> to
1.1 dsieger 2728: save the old package.</p></li>
1.137 leot 2729: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/dfdisk/README.html" target="_top"><code class="filename">pkgtools/dfdisk</code></a>:
1.1 dsieger 2730: Adds extra functionality to pkgsrc, allowing it to fetch distfiles
2731: from multiple locations. It currently supports the following
2732: methods: multiple CD-ROMs and network FTP/HTTP connections.</p></li>
1.137 leot 2733: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/cpuflags/README.html" target="_top"><code class="filename">devel/cpuflags</code></a>: Determine
1.16 jnemeth 2734: the best compiler flags to optimise code for your current
1.23 wiz 2735: CPU and compiler. </p></li>
1.1 dsieger 2736: </ul></div>
2737: <p>Utilities for keeping track of installed packages, being up to date,
2738: etc:</p>
1.41 asau 2739: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2740: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgin/README.html" target="_top"><code class="filename">pkgtools/pkgin</code></a>: A package
1.65 wiz 2741: update tool similar to apt(1). Download, install, and upgrade
2742: binary packages easily.</p></li>
1.137 leot 2743: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_chk/README.html" target="_top"><code class="filename">pkgtools/pkg_chk</code></a>: Reports on
1.1 dsieger 2744: packages whose installed versions do not match the latest pkgsrc
2745: entries.</p></li>
1.137 leot 2746: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdep/README.html" target="_top"><code class="filename">pkgtools/pkgdep</code></a>: Makes
1.1 dsieger 2747: dependency graphs of packages, to aid in choosing a strategy for
2748: updating.</p></li>
1.137 leot 2749: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdepgraph/README.html" target="_top"><code class="filename">pkgtools/pkgdepgraph</code></a>: Makes
2750: graphs from the output of <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdep/README.html" target="_top"><code class="filename">pkgtools/pkgdep</code></a> (uses graphviz).</p></li>
2751: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>: The
1.12 weinem 2752: pkglint(1) program checks a pkgsrc entry for errors.</p></li>
1.137 leot 2753: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a>: The lintpkgsrc(1) program
1.1 dsieger 2754: does various checks on the complete pkgsrc system.</p></li>
1.137 leot 2755: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgsurvey/README.html" target="_top"><code class="filename">pkgtools/pkgsurvey</code></a>: Report what
1.1 dsieger 2756: packages you have installed.</p></li>
2757: </ul></div>
2758: <p>Utilities for people maintaining or creating individual packages:</p>
1.41 asau 2759: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2760: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a>: Automate
1.1 dsieger 2761: making and maintaining patches for a package (includes pkgdiff,
2762: pkgvi, mkpatches, etc.).</p></li>
1.137 leot 2763: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a>: Aids in
1.1 dsieger 2764: converting to pkgsrc.</p></li>
2765: </ul></div>
2766: <p>Utilities for people maintaining pkgsrc (or: more obscure pkg
2767: utilities)</p>
1.41 asau 2768: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2769: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_comp/README.html" target="_top"><code class="filename">pkgtools/pkg_comp</code></a>: Build
1.1 dsieger 2770: packages in a chrooted area.</p></li>
1.137 leot 2771: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libkver/README.html" target="_top"><code class="filename">pkgtools/libkver</code></a>: Spoof
1.1 dsieger 2772: kernel version for chrooted cross builds.</p></li>
2773: </ul></div>
2774: </div>
1.41 asau 2775: <div class="sect1">
1.1 dsieger 2776: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2777: <a name="non-root-pkgsrc"></a>10.3. How to use pkgsrc as non-root</h2></div></div></div>
1.108 rillig 2778: <p>To install packages from source as a non-root user, download
1.154 rillig 2779: pkgsrc as described in <a class="xref" href="#getting" title="Chapter 3. Where to get pkgsrc and how to keep it up-to-date">Chapter 3, <i>Where to get pkgsrc and how to keep it up-to-date</i></a>, cd into that
1.108 rillig 2780: directory and run the command <span class="command"><strong>./bootstrap/bootstrap
2781: --unprivileged</strong></span>.</p>
2782: <p>This will install the binary part of pkgsrc to
2783: <code class="filename">~/pkg</code> and put the pkgsrc configuration <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>
2784: into <code class="filename">~/pkg/etc</code>.</p>
2785: <p>For more details, see <code class="filename">mk/unprivileged.mk</code>.</p>
1.1 dsieger 2786: </div>
1.41 asau 2787: <div class="sect1">
1.1 dsieger 2788: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2789: <a name="resume-transfers"></a>10.4. How to resume transfers when fetching distfiles?</h2></div></div></div>
1.1 dsieger 2790: <p>By default, resuming transfers in pkgsrc is disabled, but you can
2791: enable this feature by adding the option
2792: <code class="varname">PKG_RESUME_TRANSFERS=YES</code> into
1.10 hubertf 2793: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. If, during a fetch step, an incomplete
1.1 dsieger 2794: distfile is found, pkgsrc will try to resume it.</p>
2795: <p>You can also
1.61 wiz 2796: use a different program than the platform default program by changing the
1.16 jnemeth 2797: <code class="varname">FETCH_USING</code> variable. You can specify the program by
2798: using of ftp, fetch, wget or curl. Alternatively, fetching can be disabled
2799: by using the value manual. A value of custom disables the system defaults
2800: and dependency tracking for the fetch program. In that case you have to
2801: provide <code class="varname">FETCH_CMD</code>, <code class="varname">FETCH_BEFORE_ARGS</code>,
2802: <code class="varname">FETCH_RESUME_ARGS</code>, <code class="varname">FETCH_OUTPUT_ARGS</code>,
2803: <code class="varname">FETCH_AFTER_ARGS</code>.</p>
1.1 dsieger 2804: <p>For example, if you want to use
1.16 jnemeth 2805: <code class="filename">wget</code> to download, you'll have to use something
1.1 dsieger 2806: like:</p>
2807: <pre class="programlisting">
1.112 rillig 2808: FETCH_USING= wget
1.1 dsieger 2809: </pre>
2810: </div>
1.41 asau 2811: <div class="sect1">
1.1 dsieger 2812: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2813: <a name="x.org-from-pkgsrc"></a>10.5. How can I install/use modular X.org from pkgsrc?</h2></div></div></div>
1.4 rillig 2814: <p>If you want to use modular X.org from pkgsrc instead of your system's own X11
1.1 dsieger 2815: (<code class="filename">/usr/X11R6</code>, <code class="filename">/usr/openwin</code>, ...)
2816: you will have to add the following line into
1.10 hubertf 2817: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p>
1.1 dsieger 2818: <pre class="programlisting">
1.4 rillig 2819: X11_TYPE=modular
1.1 dsieger 2820: </pre>
2821: </div>
1.41 asau 2822: <div class="sect1">
1.1 dsieger 2823: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2824: <a name="fetch-behind-firewall"></a>10.6. How to fetch files from behind a firewall</h2></div></div></div>
1.1 dsieger 2825: <p>If you are sitting behind a firewall which does not allow direct
2826: connections to Internet hosts (i.e. non-NAT), you may specify the
2827: relevant proxy hosts. This is done using an environment variable in the
2828: form of a URL, e.g. in Amdahl, the machine
1.23 wiz 2829: <span class="quote">“<span class="quote">orpheus.amdahl.com</span>”</span> is one of the firewalls, and it uses
1.1 dsieger 2830: port 80 as the proxy port number. So the proxy environment variables
2831: are:</p>
2832: <pre class="programlisting">
2833: ftp_proxy=ftp://orpheus.amdahl.com:80/
2834: http_proxy=http://orpheus.amdahl.com:80/
2835: </pre>
2836: </div>
1.41 asau 2837: <div class="sect1">
1.1 dsieger 2838: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2839: <a name="fetch-https"></a>10.7. How to fetch files from HTTPS sites</h2></div></div></div>
1.65 wiz 2840: <p>Some fetch tools are not prepared to support HTTPS by default
2841: (for example, the one in NetBSD 6.0), or the one installed by the
2842: pkgsrc bootstrap (to avoid an openssl dependency that low in the
2843: dependency graph).</p>
2844: <p>Usually you won't notice, because distribution files are
2845: mirrored weekly to <span class="quote">“<span class="quote">ftp.NetBSD.org</span>”</span>, but that might not
2846: be often enough if you are following pkgsrc-current. In that case, set
2847: <code class="varname">FETCH_USING</code> in your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file to
2848: <span class="quote">“<span class="quote">curl</span>”</span> or <span class="quote">“<span class="quote">wget</span>”</span>, which are both compiled
2849: with HTTPS support by default. Of course, these tools need to be
2850: installed before you can use them this way.</p>
2851: </div>
2852: <div class="sect1">
2853: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2854: <a name="passive-ftp"></a>10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</h2></div></div></div>
1.1 dsieger 2855: <p>This depends on which utility is used to retrieve distfiles. From
2856: <code class="filename">bsd.pkg.mk</code>, <code class="varname">FETCH_CMD</code> is assigned
2857: the first available command from the following list:</p>
1.41 asau 2858: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2859: <li class="listitem"><p><code class="filename">${LOCALBASE}/bin/ftp</code></p></li>
2860: <li class="listitem"><p><code class="filename">/usr/bin/ftp</code></p></li>
1.1 dsieger 2861: </ul></div>
2862: <p>On a default NetBSD installation, this will be
2863: <code class="filename">/usr/bin/ftp</code>, which automatically tries passive
2864: connections first, and falls back to active connections if the server
2865: refuses to do passive. For the other tools, add the following to your
1.10 hubertf 2866: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file:
1.1 dsieger 2867: <code class="varname">PASSIVE_FETCH=1</code>.</p>
2868: <p>Having that option present will prevent
2869: <code class="filename">/usr/bin/ftp</code> from falling back to active
2870: transfers.</p>
2871: </div>
1.41 asau 2872: <div class="sect1">
1.1 dsieger 2873: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2874: <a name="fetching-all-distfiles"></a>10.9. How to fetch all distfiles at once</h2></div></div></div>
1.1 dsieger 2875: <p>You would like to download all the distfiles in a single batch
1.10 hubertf 2876: from work or university, where you can't run a <span class="command"><strong>make
1.25 spz 2877: fetch</strong></span>. There is an archive of distfiles on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/" target="_top">ftp.NetBSD.org</a>,
1.1 dsieger 2878: but downloading the entire directory may not be appropriate.</p>
1.10 hubertf 2879: <p>The answer here is to do a <span class="command"><strong>make fetch-list</strong></span> in
1.1 dsieger 2880: <code class="filename">/usr/pkgsrc</code> or one of its subdirectories, carry the
2881: resulting list to your machine at work/school and use it there. If you
1.174 leot 2882: don't have a NetBSD-compatible <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?ftp+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">ftp</span>(1)</span></a> (like tnftp) at work, don't
1.1 dsieger 2883: forget to set <code class="varname">FETCH_CMD</code> to something that fetches a
2884: URL:</p>
2885: <p>At home:</p>
2886: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cd /usr/pkgsrc</code></strong>
2887: <code class="prompt">%</code> <strong class="userinput"><code>make fetch-list FETCH_CMD=wget DISTDIR=/tmp/distfiles >/tmp/fetch.sh</code></strong>
2888: <code class="prompt">%</code> <strong class="userinput"><code>scp /tmp/fetch.sh work:/tmp</code></strong></pre>
2889: <p>At work:</p>
2890: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>sh /tmp/fetch.sh</code></strong></pre>
2891: <p>then tar up <code class="filename">/tmp/distfiles</code> and take it
2892: home.</p>
2893: <p>If you have a machine running NetBSD, and you want to get
2894: <span class="emphasis"><em>all</em></span> distfiles (even ones that aren't for your
2895: machine architecture), you can do so by using the above-mentioned
1.10 hubertf 2896: <span class="command"><strong>make fetch-list</strong></span> approach, or fetch the distfiles
1.1 dsieger 2897: directly by running:</p>
2898: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make mirror-distfiles</code></strong></pre>
2899: <p>If you even decide to ignore
2900: <code class="varname">NO_{SRC,BIN}_ON_{FTP,CDROM}</code>, then you can get everything
2901: by running:</p>
2902: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make fetch NO_SKIP=yes</code></strong></pre>
2903: </div>
1.41 asau 2904: <div class="sect1">
1.1 dsieger 2905: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2906: <a name="tmac.andoc-missing"></a>10.10. What does <span class="quote">“<span class="quote">Don't know how to make
1.23 wiz 2907: /usr/share/tmac/tmac.andoc</span>”</span> mean?</h2></div></div></div>
1.137 leot 2908: <p>When compiling the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a>
1.1 dsieger 2909: package, you get the error from make that it doesn't know how to make
2910: <code class="filename">/usr/share/tmac/tmac.andoc</code>? This indicates that
1.23 wiz 2911: you don't have installed the <span class="quote">“<span class="quote">text</span>”</span> set (nroff, ...) from
1.1 dsieger 2912: the NetBSD base distribution on your machine. It is recommended to do
2913: that to format man pages.</p>
1.137 leot 2914: <p>In the case of the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> package, you
1.1 dsieger 2915: can get away with setting <code class="varname">NOMAN=YES</code> either in the
1.10 hubertf 2916: environment or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
1.1 dsieger 2917: </div>
1.41 asau 2918: <div class="sect1">
1.1 dsieger 2919: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2920: <a name="bsd.own.mk-missing"></a>10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</h2></div></div></div>
1.1 dsieger 2921: <p>You didn't install the compiler set, <code class="filename">comp.tgz</code>,
2922: when you installed your NetBSD machine. Please get and install it, by
2923: extracting it in <code class="filename">/</code>:</p>
2924: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cd /</code></strong>
2925: <code class="prompt">#</code> <strong class="userinput"><code>tar --unlink -zxvpf .../comp.tgz</code></strong></pre>
2926: <p><code class="filename">comp.tgz</code> is part of every NetBSD release. Get
1.10 hubertf 2927: the one that corresponds to your release (determine via <span class="command"><strong>uname
1.1 dsieger 2928: -r</strong></span>).</p>
2929: </div>
1.41 asau 2930: <div class="sect1">
1.1 dsieger 2931: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2932: <a name="using-sudo-with-pkgsrc"></a>10.12. Using 'sudo' with pkgsrc</h2></div></div></div>
1.1 dsieger 2933: <p>When installing packages as non-root user and using the just-in-time
1.174 leot 2934: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?su+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span></a> feature of pkgsrc, it can become annoying to type in the root
1.1 dsieger 2935: password for each required package installed. To avoid this, the sudo
2936: package can be used, which does password caching over a limited time. To
2937: use it, install sudo (either as binary package or from
1.137 leot 2938: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/sudo/README.html" target="_top"><code class="filename">security/sudo</code></a>) and then put the
1.10 hubertf 2939: following into your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, somewhere
1.1 dsieger 2940: <span class="emphasis"><em>after</em></span> the definition of the
2941: <code class="varname">LOCALBASE</code> variable:</p>
2942: <pre class="programlisting">
2943: .if exists(${LOCALBASE}/bin/sudo)
2944: SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c
2945: .endif
2946: </pre>
2947: </div>
1.41 asau 2948: <div class="sect1">
1.1 dsieger 2949: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2950: <a name="faq.conf"></a>10.13. How do I change the location of configuration files?</h2></div></div></div>
1.1 dsieger 2951: <p>As the system administrator, you can choose where configuration files
2952: are installed. The default settings make all these files go into
2953: <code class="filename">${PREFIX}/etc</code> or some of its subdirectories; this may
2954: be suboptimal depending on your expectations (e.g., a read-only,
2955: NFS-exported <code class="varname">PREFIX</code> with a need of per-machine
2956: configuration of the provided packages).</p>
2957: <p>In order to change the defaults, you can modify the
2958: <code class="varname">PKG_SYSCONFBASE</code> variable (in
1.10 hubertf 2959: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>) to point to your preferred configuration
1.1 dsieger 2960: directory; some common examples include <code class="filename">/etc</code> or
2961: <code class="filename">/etc/pkg</code>.</p>
2962: <p>Furthermore, you can change this value on a per-package basis by
2963: setting the <code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> variable.
2964: <code class="varname">PKG_SYSCONFVAR</code>'s value usually matches the name of the
2965: package you would like to modify, that is, the contents of
2966: <code class="varname">PKGBASE</code>.</p>
2967: <p>Note that after changing these settings, you must rebuild and
2968: reinstall any affected packages.</p>
2969: </div>
1.41 asau 2970: <div class="sect1">
1.1 dsieger 2971: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2972: <a name="audit-packages"></a>10.14. Automated security checks</h2></div></div></div>
1.1 dsieger 2973: <p>Please be aware that there can often be bugs in third-party software,
2974: and some of these bugs can leave a machine vulnerable to exploitation by
2975: attackers. In an effort to lessen the exposure, the NetBSD packages team
2976: maintains a database of known-exploits to packages which have at one time
2977: been included in pkgsrc. The database can be downloaded automatically, and
2978: a security audit of all packages installed on a system can take place. To
1.14 jmcneill 2979: do this, refer to the following two tools (installed as part of the
1.137 leot 2980: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> package):</p>
1.23 wiz 2981: <div class="orderedlist"><ol class="orderedlist" type="1">
2982: <li class="listitem">
1.20 snj 2983: <p><span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, an easy way to
1.1 dsieger 2984: download a list of the security vulnerabilities information. This list
1.25 spz 2985: is kept up to date by the pkgsrc security team, and is distributed
2986: from the NetBSD ftp server:</p>
1.177 leot 2987: <p><a class="ulink" href="https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a></p>
1.1 dsieger 2988: </li>
1.23 wiz 2989: <li class="listitem"><p><span class="command"><strong>pkg_admin audit</strong></span>, an easy way to audit the
2990: current machine, checking each known vulnerability. If a
1.1 dsieger 2991: vulnerable package is installed, it will be shown by output to stdout,
2992: including a description of the type of vulnerability, and a URL
2993: containing more information.</p></li>
2994: </ol></div>
1.121 sevan 2995: <p>Use of these tools is strongly recommended!
1.154 rillig 2996: See <a class="xref" href="#vulnerabilities" title="5.1.5. Checking for security vulnerabilities in installed packages">Section 5.1.5, “Checking for security vulnerabilities in installed packages”</a> for instructions on how to automate checking and
1.121 sevan 2997: reporting.</p>
2998: <p>If this database is installed, pkgsrc builds will use it to
2999: perform a security check before building any package.</p>
1.1 dsieger 3000: </div>
1.41 asau 3001: <div class="sect1">
1.1 dsieger 3002: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3003: <a name="ufaq-cflags"></a>10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</h2></div></div></div>
1.1 dsieger 3004: <p>When you add your own preferences to the
3005: <code class="varname">CFLAGS</code> variable in your
1.10 hubertf 3006: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, these flags are passed in
1.1 dsieger 3007: environment variables to the <code class="filename">./configure</code>
1.174 leot 3008: scripts and to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>. Some package authors ignore the
1.1 dsieger 3009: <code class="varname">CFLAGS</code> from the environment variable by
3010: overriding them in the <code class="filename">Makefile</code>s of their
3011: package.</p>
3012: <p>Currently there is no solution to this problem. If you
3013: really need the package to use your <code class="varname">CFLAGS</code>
1.10 hubertf 3014: you should run <span class="command"><strong>make patch</strong></span> in the package
1.1 dsieger 3015: directory and then inspect any <code class="filename">Makefile</code> and
3016: <code class="filename">Makefile.in</code> for whether they define
3017: <code class="varname">CFLAGS</code> explicitly. Usually you can remove
1.23 wiz 3018: these lines. But be aware that some <span class="quote">“<span class="quote">smart</span>”</span>
1.1 dsieger 3019: programmers write so bad code that it only works for the
3020: specific combination of <code class="varname">CFLAGS</code> they have
3021: chosen.</p>
1.172 rillig 3022: <p>To find out where the CFLAGS are ignored, add the following lines to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p>
3023: <pre class="programlisting">
3024: CPPFLAGS+= -Dpkgsrc___CPPFLAGS
3025: CFLAGS+= -Dpkgsrc___CFLAGS
3026: CXXFLAGS+= -Dpkgsrc___CXXFLAGS
3027: </pre>
3028: <p>Then run <span class="command"><strong>bmake show-all-configure show-all-build</strong></span>
3029: to see whether the above flags are passed to the actual build
3030: commands in general.</p>
3031: <p>To find out whether the flags are passed to individual compiler
3032: commands, have a look at the file <code class="filename">work/.work.log</code>. In
3033: most cases, the flags from the original command lines (the lines starting
3034: with <code class="literal">[*]</code>) are passed unmodified to the actual compiler
3035: (the lines starting with <code class="literal"><.></code>). If the flag is
3036: missing from the actual compiler command, it must have been removed by
3037: the <a class="link" href="#build.wrapper" title="19.10. The wrapper phase">pkgsrc compiler wrappers</a>.</p>
1.1 dsieger 3038: </div>
1.41 asau 3039: <div class="sect1">
1.1 dsieger 3040: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3041: <a name="ufaq-fail"></a>10.16. A package does not build. What shall I do?</h2></div></div></div>
1.23 wiz 3042: <div class="procedure"><ol class="procedure" type="1">
1.41 asau 3043: <li class="step"><p>Make sure that your copy of pkgsrc is consistent. A
1.1 dsieger 3044: case that occurs often is that people only update pkgsrc in
3045: parts, because of performance reasons. Since pkgsrc is one large
3046: system, not a collection of many small systems, there are
3047: sometimes changes that only work when the whole pkgsrc tree is
3048: updated.</p></li>
1.41 asau 3049: <li class="step"><p>Make sure that you don't have any CVS conflicts.
1.23 wiz 3050: Search for <span class="quote">“<span class="quote"><<<<<<</span>”</span> or
3051: <span class="quote">“<span class="quote">>>>>>></span>”</span> in all your pkgsrc
1.1 dsieger 3052: files.</p></li>
1.41 asau 3053: <li class="step"><p>Make sure that you don't have old copies of the packages
1.10 hubertf 3054: extracted. Run <span class="command"><strong>make clean clean-depends</strong></span> to
1.1 dsieger 3055: verify this.</p></li>
1.108 rillig 3056: <li class="step"><p>If you are a package developer who wants to invest
1.154 rillig 3057: some work, have a look at <a class="xref" href="#fixes" title="Chapter 21. Making your package work">Chapter 21, <i>Making your package work</i></a>.</p></li>
1.41 asau 3058: <li class="step"><p>If the problem still exists, write a mail to the
1.1 dsieger 3059: <code class="literal">pkgsrc-users</code> mailing list.</p></li>
3060: </ol></div>
3061: </div>
1.41 asau 3062: <div class="sect1">
1.1 dsieger 3063: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3064: <a name="faq.rcs-conflicts"></a>10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</h2></div></div></div>
1.1 dsieger 3065: <p>You have modified a file from pkgsrc, and someone else has
3066: modified that same file afterwards in the CVS repository. Both changes
3067: are in the same region of the file, so when you updated pkgsrc, the
3068: <code class="literal">cvs</code> command marked the conflicting changes in the
3069: file. Because of these markers, the file is no longer a valid
3070: <code class="filename">Makefile</code>.</p>
3071: <p>Have a look at that file, and if you don't need your local changes
1.10 hubertf 3072: anymore, you can remove that file and run <span class="command"><strong>cvs -q update
1.1 dsieger 3073: -dP</strong></span> in that directory to download the current version.</p>
3074: </div>
3075: </div>
3076: </div>
1.41 asau 3077: <div class="part">
1.1 dsieger 3078: <div class="titlepage"><div><div><h1 class="title">
3079: <a name="developers-guide"></a>Part II. The pkgsrc developer's guide</h1></div></div></div>
1.41 asau 3080: <div class="partintro">
1.1 dsieger 3081: <div></div>
3082: <p>This part of the book deals with creating and
1.23 wiz 3083: modifying packages. It starts with a <span class="quote">“<span class="quote">HOWTO</span>”</span>-like
1.1 dsieger 3084: guide on creating a new package. The remaining chapters are more
3085: like a reference manual for pkgsrc.</p>
3086: <div class="toc">
3087: <p><b>Table of Contents</b></p>
1.100 leot 3088: <dl class="toc">
1.154 rillig 3089: <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt>
3090: <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt>
1.1 dsieger 3091: <dd><dl>
1.154 rillig 3092: <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt>
1.1 dsieger 3093: <dd><dl>
1.154 rillig 3094: <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt>
3095: <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt>
1.160 brook 3096: <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt>
3097: <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt>
1.1 dsieger 3098: </dl></dd>
1.154 rillig 3099: <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt>
3100: <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd>
1.6 rillig 3101: </dl></dd>
1.154 rillig 3102: <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt>
1.6 rillig 3103: <dd><dl>
1.154 rillig 3104: <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt>
3105: <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt>
3106: <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt>
1.6 rillig 3107: <dd><dl>
1.154 rillig 3108: <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt>
3109: <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt>
3110: <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt>
3111: <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt>
3112: <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt>
1.6 rillig 3113: </dl></dd>
1.154 rillig 3114: <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt>
3115: <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt>
1.6 rillig 3116: <dd><dl>
1.154 rillig 3117: <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt>
3118: <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt>
3119: <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt>
1.6 rillig 3120: </dl></dd>
1.154 rillig 3121: <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt>
3122: <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt>
1.6 rillig 3123: </dl></dd>
1.154 rillig 3124: <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt>
1.6 rillig 3125: <dd><dl>
1.154 rillig 3126: <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt>
3127: <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt>
3128: <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd>
3129: <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt>
1.6 rillig 3130: <dd><dl>
1.154 rillig 3131: <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt>
3132: <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt>
3133: <dt><span class="sect2"><a href="#cflags-gnu-configure">14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt>
3134: <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt>
1.6 rillig 3135: </dl></dd>
3136: </dl></dd>
1.154 rillig 3137: <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt>
1.6 rillig 3138: <dd><dl>
1.154 rillig 3139: <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt>
3140: <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
3141: <dt><span class="sect1"><a href="#print-PLIST">15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt>
3142: <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt>
3143: <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt>
3144: <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
3145: <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt>
3146: <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt>
3147: <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt>
1.6 rillig 3148: </dl></dd>
1.154 rillig 3149: <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt>
1.6 rillig 3150: <dd><dl>
1.154 rillig 3151: <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt>
3152: <dt><span class="sect1"><a href="#creating-buildlink3.mk">16.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.6 rillig 3153: <dd><dl>
1.154 rillig 3154: <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt>
3155: <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating
1.26 wiz 3156: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
3157: and
3158: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
3159: in <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.6 rillig 3160: </dl></dd>
1.154 rillig 3161: <dt><span class="sect1"><a href="#writing-builtin.mk">16.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt>
1.6 rillig 3162: <dd><dl>
1.154 rillig 3163: <dt><span class="sect2"><a href="#anatomy-of-builtin.mk">16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt>
3164: <dt><span class="sect2"><a href="#native-or-pkgsrc-preference">16.3.2. Global preferences for native or pkgsrc software</a></span></dt>
1.6 rillig 3165: </dl></dd>
3166: </dl></dd>
1.154 rillig 3167: <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt>
1.6 rillig 3168: <dd><dl>
1.154 rillig 3169: <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt>
3170: <dd><dl>
3171: <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt>
3172: <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt>
3173: </dl></dd>
3174: <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt>
3175: <dd><dl>
3176: <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt>
3177: <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt>
3178: <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt>
3179: <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt>
3180: </dl></dd>
3181: <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt>
3182: <dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">17.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd>
3183: <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt>
3184: <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt>
3185: <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd>
3186: <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt>
3187: <dd><dl><dt><span class="sect2"><a href="#fonts-disable">17.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd>
3188: </dl></dd>
3189: <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt>
3190: <dd><dl>
3191: <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt>
3192: <dt><span class="sect1"><a href="#converting-to-options">18.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt>
3193: <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt>
3194: <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt>
3195: </dl></dd>
3196: <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt>
3197: <dd><dl>
3198: <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt>
3199: <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt>
3200: <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt>
3201: <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt>
3202: <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
3203: <dd><dl>
3204: <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt>
3205: <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt>
3206: </dl></dd>
3207: <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt>
3208: <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt>
3209: <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt>
3210: <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt>
3211: <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt>
3212: <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
3213: <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
3214: <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt>
3215: <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
3216: <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt>
3217: <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt>
3218: <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt>
3219: </dl></dd>
3220: <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt>
3221: <dd><dl>
3222: <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt>
3223: <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt>
3224: <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt>
3225: </dl></dd>
3226: <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt>
3227: <dd><dl>
3228: <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt>
3229: <dd><dl>
3230: <dt><span class="sect2"><a href="#pulling-vars-from-etc-mk.conf">21.1.1. How to pull in user-settable variables from <code class="filename">mk.conf</code></a></span></dt>
3231: <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt>
3232: <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt>
3233: <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt>
3234: <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt>
3235: <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt>
3236: <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt>
3237: <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt>
3238: <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt>
3239: <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt>
3240: <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt>
3241: </dl></dd>
3242: <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
3243: <dd><dl>
3244: <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt>
3245: <dt><span class="sect2"><a href="#modified-distfiles-same-name">21.2.2. How to handle modified distfiles with the 'old' name</a></span></dt>
3246: <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt>
3247: </dl></dd>
3248: <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
3249: <dd><dl>
3250: <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt>
3251: <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt>
3252: <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt>
3253: </dl></dd>
3254: <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt>
3255: <dd><dl>
3256: <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt>
3257: <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt>
3258: <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt>
3259: <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt>
3260: <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt>
3261: </dl></dd>
3262: <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
3263: <dd><dl>
3264: <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt>
3265: <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt>
1.172 rillig 3266: <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt>
3267: <dt><span class="sect2"><a href="#undefined-reference">21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span></a></span></dt>
3268: <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt>
1.154 rillig 3269: </dl></dd>
3270: <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
3271: <dd><dl>
3272: <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt>
3273: <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt>
3274: <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt>
3275: <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt>
3276: <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt>
3277: <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt>
3278: <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt>
3279: <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt>
3280: <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt>
3281: <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt>
3282: <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt>
3283: <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt>
3284: <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt>
3285: <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt>
3286: <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt>
3287: <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt>
3288: <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt>
3289: <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in
1.1 dsieger 3290: emulation</a></span></dt>
1.154 rillig 3291: <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt>
3292: <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt>
1.1 dsieger 3293: </dl></dd>
1.154 rillig 3294: <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt>
1.1 dsieger 3295: </dl></dd>
1.154 rillig 3296: <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt>
3297: <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt>
1.1 dsieger 3298: <dd><dl>
1.154 rillig 3299: <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt>
3300: <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt>
3301: <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt>
3302: <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt>
3303: <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt>
3304: <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt>
3305: <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt>
3306: <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt>
3307: </dl></dd>
3308: <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt>
3309: <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt>
3310: <dd><dl>
3311: <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt>
3312: <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt>
3313: <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt>
3314: <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt>
1.1 dsieger 3315: </dl></dd>
3316: </dl>
3317: </div>
3318: </div>
1.41 asau 3319: <div class="chapter">
1.1 dsieger 3320: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 3321: <a name="help-devel"></a>Chapter 11. Getting help</h2></div></div></div>
3322: <p>
3323: To get help when developing pkgsrc, the definitive source is this
3324: document, the pkgsrc guide. If you don't find anything here,
3325: there are alternatives:
3326: </p>
3327: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
3328: <li class="listitem">
3329: <p>
3330: The built-in pkgsrc help, which is available after bootstrapping
3331: pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get
3332: help for any topic, such as a variable name like
3333: <code class="varname">BUILD_DEFS</code>, a make target like
3334: <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like
3335: <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p>
3336: <p>The available help topics are listed in <a class="xref" href="#help-topics" title="Appendix D. Help topics">Appendix D, <i>Help topics</i></a>.</p>
3337: </li>
3338: <li class="listitem"><p>
1.163 rillig 3339: To see the value of a single variable, run <span class="command"><strong>bmake
3340: show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>.
3341: </p></li>
3342: <li class="listitem"><p>
3343: To see the values of the most common variables, run
3344: <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by
3345: topic. To see the variables for a single topic, run
3346: <span class="command"><strong>bmake
3347: show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example
3348: <span class="command"><strong>bmake show-all-fetch</strong></span>.
3349: </p></li>
3350: <li class="listitem"><p>
1.154 rillig 3351: The tech-pkg mailing list, to which
3352: <a class="ulink" href="https://www.NetBSD.org/mailinglists/#tech-pkg" target="_top">you
3353: can subscribe</a> and then <a class="ulink" href="mailto:tech-pkg@NetBSD.org" target="_top">ask your
3354: questions</a>.</p></li>
3355: <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible
3356: <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a>
3357: or by using a specialized chat program such as
3358: <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>.
3359: Pick any user name and join the channel #pkgsrc.</p></li>
3360: </ul></div>
3361: </div>
3362: <div class="chapter">
3363: <div class="titlepage"><div><div><h2 class="title">
3364: <a name="creating"></a>Chapter 12. Creating a new pkgsrc package from scratch</h2></div></div></div>
1.1 dsieger 3365: <div class="toc">
3366: <p><b>Table of Contents</b></p>
1.100 leot 3367: <dl class="toc">
1.154 rillig 3368: <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt>
1.1 dsieger 3369: <dd><dl>
1.154 rillig 3370: <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt>
3371: <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt>
1.160 brook 3372: <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt>
3373: <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt>
1.1 dsieger 3374: </dl></dd>
1.154 rillig 3375: <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt>
3376: <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd>
1.1 dsieger 3377: </dl>
3378: </div>
3379: <p>When you find a package that is not yet in pkgsrc, you
3380: most likely have a URL from where you can download the source
3381: code. Starting with this URL, creating a package involves only a
3382: few steps.</p>
1.23 wiz 3383: <div class="procedure"><ol class="procedure" type="1">
1.137 leot 3384: <li class="step"><p>First, install the packages <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a> and <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>.</p></li>
1.41 asau 3385: <li class="step"><p>Then, choose one of the top-level directories as the
1.1 dsieger 3386: category in which you want to place your package. You can also create a
3387: directory of your own (maybe called <code class="filename">local</code>). In that
3388: category directory, create another directory for your package and change
3389: into it.</p></li>
1.41 asau 3390: <li class="step"><p>Run the program <span class="command"><strong>url2pkg</strong></span>, which will ask
1.1 dsieger 3391: you for a URL. Enter the URL of the distribution file (in most cases a
3392: <code class="filename">.tar.gz</code> file) and watch how the basic ingredients
3393: of your package are created automatically. The distribution file is
3394: extracted automatically to fill in some details in the
3395: <code class="filename">Makefile</code> that would otherwise have to be done
3396: manually.</p></li>
1.41 asau 3397: <li class="step">
1.1 dsieger 3398: <p>Examine the extracted files to determine the dependencies of
3399: your package. Ideally, this is mentioned in some
3400: <code class="filename">README</code> file, but things may differ. For each of
3401: these dependencies, look where it exists in pkgsrc, and if there is a
3402: file called <code class="filename">buildlink3.mk</code> in that directory, add a
3403: line to your package <code class="filename">Makefile</code> which includes that
3404: file just before the last line. If the
1.25 spz 3405: <code class="filename">buildlink3.mk</code> file does not exist, it must be
1.161 leot 3406: created first. The <code class="filename">buildlink3.mk</code> file makes sure
3407: that the package's include files and libraries are provided.</p>
1.25 spz 3408: <p>If you just need binaries from a package, add a
1.1 dsieger 3409: <code class="varname">DEPENDS</code> line to the Makefile, which specifies the
3410: version of the dependency and where it can be found in pkgsrc. This line
3411: should be placed in the third paragraph. If the dependency is only
3412: needed for building the package, but not when using it, use
1.156 leot 3413: <code class="varname">TOOL_DEPENDS</code> or <code class="varname">BUILD_DEPENDS</code>
3414: instead of <code class="varname">DEPENDS</code>.
3415: The difference between <code class="varname">TOOL_DEPENDS</code> and
3416: <code class="varname">BUILD_DEPENDS</code> occurs when cross-compiling:
3417: <code class="varname">TOOL_DEPENDS</code> are <span class="emphasis"><em>native</em></span>
3418: packages, i.e. packages for the architecture where the package
3419: is built;
3420: <code class="varname">BUILD_DEPENDS</code> are <span class="emphasis"><em>target</em></span>
3421: packages, i.e. packages for the architecture for which the package
1.175 gutterid 3422: is built. There is also <code class="varname">TEST_DEPENDS</code>, which is used
3423: to specify a dependency used only for testing the resulting package
3424: built, using the upstream project's included test suite.
1.1 dsieger 3425: Your package may then look like this:</p>
3426: <pre class="programlisting">
3427: [...]
3428:
1.156 leot 3429: TOOL_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
1.1 dsieger 3430: DEPENDS+= screen-[0-9]*:../../misc/screen
3431: DEPENDS+= screen>=4.0:../../misc/screen
3432:
3433: [...]
3434:
3435: .include "../../<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>package</code></em>/buildlink3.mk"
3436: .include "../../devel/glib2/buildlink3.mk"
3437: .include "../../mk/bsd.pkg.mk"
3438: </pre>
3439: </li>
1.41 asau 3440: <li class="step"><p>Run <span class="command"><strong>pkglint</strong></span> to see what things still need
1.23 wiz 3441: to be done to make your package a <span class="quote">“<span class="quote">good</span>”</span> one. If you don't
1.10 hubertf 3442: know what pkglint's warnings want to tell you, try <span class="command"><strong>pkglint
3443: --explain</strong></span> or <span class="command"><strong>pkglint
1.1 dsieger 3444: -e</strong></span>, which outputs additional
3445: explanations.</p></li>
1.41 asau 3446: <li class="step"><p>In many cases the package is not yet ready to build. You can
1.154 rillig 3447: find instructions for the most common cases in the next section, <a class="xref" href="#creating.common" title="12.1. Common types of packages">Section 12.1, “Common types of packages”</a>. After you have followed the instructions
1.1 dsieger 3448: over there, you can hopefully continue here.</p></li>
1.41 asau 3449: <li class="step"><p>Run <span class="command"><strong>bmake clean</strong></span> to clean the working
1.1 dsieger 3450: directory from the extracted files. Besides these files, a lot of cache
3451: files and other system information has been saved in the working
3452: directory, which may become wrong after you edited the
3453: <code class="filename">Makefile</code>.</p></li>
1.41 asau 3454: <li class="step"><p>Now, run <span class="command"><strong>bmake</strong></span> to build the package. For
1.154 rillig 3455: the various things that can go wrong in this phase, consult <a class="xref" href="#fixes" title="Chapter 21. Making your package work">Chapter 21, <i>Making your package work</i></a>.</p></li>
1.41 asau 3456: <li class="step"><p>When the package builds fine, the next step is to install
1.10 hubertf 3457: the package. Run <span class="command"><strong>bmake install</strong></span> and hope that
1.1 dsieger 3458: everything works.</p></li>
1.41 asau 3459: <li class="step"><p>Up to now, the file <code class="filename">PLIST</code>, which
1.1 dsieger 3460: contains a list of the files that are installed by the package, is
1.10 hubertf 3461: nearly empty. Run <span class="command"><strong>bmake print-PLIST
1.1 dsieger 3462: >PLIST</strong></span> to generate a probably correct list. Check
3463: the file using your preferred text editor to see if the list of
3464: files looks plausible.</p></li>
1.41 asau 3465: <li class="step"><p>Run <span class="command"><strong>pkglint</strong></span> again to see if the generated
1.1 dsieger 3466: <code class="filename">PLIST</code> contains garbage or not.</p></li>
1.41 asau 3467: <li class="step"><p>When you ran <span class="command"><strong>bmake install</strong></span>, the package
1.1 dsieger 3468: has been registered in the database of installed files, but with an
1.10 hubertf 3469: empty list of files. To fix this, run <span class="command"><strong>bmake deinstall</strong></span>
3470: and <span class="command"><strong>bmake install</strong></span> again. Now the package is
1.1 dsieger 3471: registered with the list of files from
3472: <code class="filename">PLIST</code>.</p></li>
1.41 asau 3473: <li class="step"><p>Run <span class="command"><strong>bmake package</strong></span> to create a binary
1.1 dsieger 3474: package from the set of installed files.</p></li>
3475: </ol></div>
1.41 asau 3476: <div class="sect1">
1.1 dsieger 3477: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3478: <a name="creating.common"></a>12.1. Common types of packages</h2></div></div></div>
1.41 asau 3479: <div class="sect2">
1.1 dsieger 3480: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 3481: <a name="creating.perl-module"></a>12.1.1. Perl modules</h3></div></div></div>
1.1 dsieger 3482: <p>Simple Perl modules are handled automatically by
1.10 hubertf 3483: <span class="command"><strong>url2pkg</strong></span>, including dependencies.</p>
1.1 dsieger 3484: </div>
1.41 asau 3485: <div class="sect2">
1.1 dsieger 3486: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 3487: <a name="creating.python-module"></a>12.1.2. Python modules and programs</h3></div></div></div>
1.17 imil 3488: <p>Python modules and programs packages are easily created using a
3489: set of predefined variables.</p>
3490: <p>
1.63 wiz 3491: If some Python versions are not supported by the software, set the
3492: <code class="varname">PYTHON_VERSIONS_INCOMPATIBLE</code> variable to the Python versions
3493: that are not supported, e.g.
1.17 imil 3494: </p>
3495: <pre class="programlisting">
1.93 sevan 3496: PYTHON_VERSIONS_INCOMPATIBLE= 27
1.17 imil 3497: </pre>
3498: <p>
1.103 wiz 3499: If the packaged software is a Python module, include one of
3500: <code class="filename">../../lang/python/egg.mk</code>,
3501: <code class="filename">../../lang/python/distutils.mk</code>, or
3502: <code class="filename">../../lang/python/extension.mk</code>.</p>
3503: <p>Most Python packages use either <span class="quote">“<span class="quote">distutils</span>”</span> or
3504: easy-setup/setuptools (<span class="quote">“<span class="quote">eggs</span>”</span>).
1.175 gutterid 3505: If the packaged software is using setuptools, you only need
1.103 wiz 3506: to include <span class="quote">“<span class="quote"><code class="filename">../../lang/python/egg.mk</code></span>”</span>.
3507: Otherwise, if the software uses <span class="quote">“<span class="quote">distutils</span>”</span>, include
1.175 gutterid 3508: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/distutils.mk</code></span>”</span>,
1.103 wiz 3509: so pkgsrc will use this framework.
1.175 gutterid 3510: <span class="quote">“<span class="quote">distutils</span>”</span> uses a script called <code class="filename">setup.py</code>;
1.103 wiz 3511: if the <span class="quote">“<span class="quote">distutils</span>”</span> driver is not called
3512: <code class="filename">setup.py</code>, set the <code class="varname">PYSETUP</code> variable
3513: to the name of the script.</p>
3514: <p>Either way, the package directory should be called
1.23 wiz 3515: <span class="quote">“<span class="quote">py-software</span>”</span> and <code class="varname">PKGNAME</code> should be set to
3516: <span class="quote">“<span class="quote">${PYPKGPREFIX}-${DISTNAME}</span>”</span>, e.g.
1.17 imil 3517: </p>
3518: <pre class="programlisting">
3519: DISTNAME= foopymodule-1.2.10
3520: PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
3521: </pre>
1.63 wiz 3522: <p>If it is an application, include
3523: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/application.mk</code></span>”</span>.
3524: In order to correctly set the path to the Python interpreter, use the
1.17 imil 3525: <code class="varname">REPLACE_PYTHON</code> variable and set it to the list of files
1.35 wiz 3526: (paths relative to <code class="varname">WRKSRC</code>) that must be corrected.
1.63 wiz 3527: For example:
1.17 imil 3528: </p>
3529: <pre class="programlisting">
1.35 wiz 3530: REPLACE_PYTHON= *.py
1.17 imil 3531: </pre>
1.63 wiz 3532: <p>Some Python modules have separate distributions for Python-2.x
3533: and Python-3.x support. In pkgsrc this is handled by the
3534: <code class="filename">versioned_dependencies.mk</code> file. Set
3535: <code class="varname">PYTHON_VERSIONED_DEPENDENCIES</code> to the list of
3536: packages that should be depended upon and include
3537: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/versioned_dependencies.mk</code></span>”</span>,
3538: then the pkgsrc infrastructure will depend on the appropriate package
3539: version. For example:
3540: </p>
3541: <pre class="programlisting">
1.135 wiz 3542: PYTHON_VERSIONED_DEPENDENCIES=dialog
1.63 wiz 3543: </pre>
3544: <p>
3545: Look inside <code class="filename">versioned_dependencies.mk</code> for a list
3546: of supported packages.</p>
1.17 imil 3547: </div>
1.160 brook 3548: <div class="sect2">
3549: <div class="titlepage"><div><div><h3 class="title">
3550: <a name="creating.R-package"></a>12.1.3. R packages</h3></div></div></div>
3551: <p>Simple R packages from <a class="ulink" href="https://cran.r-project.org/web/packages/available_packages_by_name.html" target="_top">CRAN</a>
3552: are handled automatically by <span class="command"><strong>R2pkg</strong></span>, which is
3553: available in <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/R2pkg/README.html" target="_top"><code class="filename">pkgtools/R2pkg</code></a>.
3554: Individual packages (and optionally their dependencies) may be created
3555: and updated. R packages generally follow the same form, and most of
3556: the relevant information needed is contained in a
3557: <code class="filename">DESCRIPTION</code> file as part of each R package on
3558: <a class="ulink" href="https://cran.r-project.org/web/packages/available_packages_by_name.html" target="_top">CRAN</a>.
3559: Consequently, <span class="command"><strong>R2pkg</strong></span> downloads that information and
3560: creates or updates a package in the canonical form. The resulting
3561: package should be reviewed for correctness.</p>
3562: </div>
3563: <div class="sect2">
3564: <div class="titlepage"><div><div><h3 class="title">
3565: <a name="creating.TeX-package"></a>12.1.4. TeXlive packages</h3></div></div></div>
3566: <p>TeXlive packages from <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a> are handled automatically by
3567: <span class="command"><strong>texlive2pkg</strong></span>, which is available in <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/texlive2pkg/README.html" target="_top"><code class="filename">pkgtools/texlive2pkg</code></a>.</p>
3568: <p>If the TeXlive package name is not known, it may be useful to
3569: search <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a>. A
3570: <span class="quote">“<span class="quote">Contained in</span>”</span> field on the package page typically
3571: identifies the basename of the package file in the <a class="ulink" href="https://www.ctan.org/tex-archive/systems/texlive/tlnet/archive" target="_top">TeXlive
3572: archive</a>.</p>
3573: <p>If the TeXlive package name is known, download the files from
3574: the <a class="ulink" href="https://www.ctan.org/tex-archive/systems/texlive/tlnet/archive" target="_top">TeXlive
3575: archive</a>. For package <code class="filename">foo</code>, you will need
3576: to download <code class="filename">foo.tar.xz</code>. Most TeXlive packages
3577: also have associated documentation packages, so download
3578: <code class="filename">foo.doc.tar.xz</code> at the same time. These files
3579: should be placed in the appropriate category directory, which is often
3580: but not always <code class="filename">print</code>. Then run the following
3581: command in the category directory.</p>
3582: <pre class="programlisting">
3583: texlive2pkg foo.tar.xz foo.doc.tar.xz
3584: </pre>
3585: <p>This will create two packages, <code class="filename">tex-foo</code> and
3586: <code class="filename">tex-foo-doc</code>. Be sure to check that both packages
3587: are correct.</p>
3588: <p>Finally, <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a>
3589: currently does not include version information in package filenames
3590: and changes their contents periodically when updates occur.
3591: Consequently, pkgsrc avoids downloading distfiles directly from <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a> and instead relies on the
3592: pkgsrc archives. For each new or updated TeXlive package, e.g., the
3593: main one and the corresponding documentation, upload the distfiles
3594: with the following command in each package directory.</p>
3595: <pre class="programlisting">
3596: make upload-distfiles
3597: </pre>
3598: </div>
1.1 dsieger 3599: </div>
1.41 asau 3600: <div class="sect1">
1.1 dsieger 3601: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3602: <a name="creating.examples"></a>12.2. Examples</h2></div></div></div>
1.41 asau 3603: <div class="sect2">
1.1 dsieger 3604: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 3605: <a name="creating.nvu"></a>12.2.1. How the www/nvu package came into pkgsrc</h3></div></div></div>
1.41 asau 3606: <div class="sect3">
1.1 dsieger 3607: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 3608: <a name="creating.nvu.init"></a>12.2.1.1. The initial package</h4></div></div></div>
1.1 dsieger 3609: <p>Looking at the file <code class="filename">pkgsrc/doc/TODO</code>, I saw
1.23 wiz 3610: that the <span class="quote">“<span class="quote">nvu</span>”</span> package has not yet been imported into
1.1 dsieger 3611: pkgsrc. As the description says it has to do with the web, the obvious
1.23 wiz 3612: choice for the category is <span class="quote">“<span class="quote">www</span>”</span>.</p>
1.1 dsieger 3613: <pre class="programlisting">
3614: <code class="prompt">$</code> mkdir www/nvu
3615: <code class="prompt">$</code> cd www/nvu
3616: </pre>
3617: <p>The web site says that the sources are available as a tar file, so
1.10 hubertf 3618: I fed that URL to the <span class="command"><strong>url2pkg</strong></span> program:</p>
1.1 dsieger 3619: <pre class="programlisting">
3620: <code class="prompt">$</code> url2pkg http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2
3621: </pre>
3622: <p>My editor popped up, and I added a <code class="varname">PKGNAME</code> line
3623: below the <code class="varname">DISTNAME</code> line, as the package name should
1.23 wiz 3624: not have the word <span class="quote">“<span class="quote">sources</span>”</span> in it. I also filled in the
1.1 dsieger 3625: <code class="varname">MAINTAINER</code>, <code class="varname">HOMEPAGE</code> and
3626: <code class="varname">COMMENT</code> fields. Then the package
3627: <code class="filename">Makefile</code> looked like that:</p>
3628: <pre class="programlisting">
1.121 sevan 3629: # $NetBSD $
1.1 dsieger 3630: #
3631:
3632: DISTNAME= nvu-1.0-sources
3633: PKGNAME= nvu-1.0
3634: CATEGORIES= www
3635: MASTER_SITES= http://cvs.nvu.com/download/
3636: EXTRACT_SUFX= .tar.bz2
3637:
3638: MAINTAINER= rillig@NetBSD.org
3639: HOMEPAGE= http://cvs.nvu.com/
3640: COMMENT= Web Authoring System
3641:
3642: # url2pkg-marker (please do not remove this line.)
3643: .include "../../mk/bsd.pkg.mk"
3644: </pre>
1.124 wiz 3645: <p>On the first line of output above, an artificial space has been added between NetBSD and $,
1.121 sevan 3646: this is a workaround to prevent CVS expanding to the filename of the
3647: guide.</p>
1.1 dsieger 3648: <p>Then, I quit the editor and watched pkgsrc downloading a large
3649: source archive:</p>
3650: <pre class="programlisting">
3651: url2pkg> Running "make makesum" ...
3652: => Required installed package digest>=20010302: digest-20060826 found
3653: => Fetching nvu-1.0-sources.tar.bz2
3654: Requesting http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2
3655: 100% |*************************************| 28992 KB 150.77 KB/s00:00 ETA
3656: 29687976 bytes retrieved in 03:12 (150.77 KB/s)
3657: url2pkg> Running "make extract" ...
3658: => Required installed package digest>=20010302: digest-20060826 found
3659: => Checksum SHA1 OK for nvu-1.0-sources.tar.bz2
3660: => Checksum RMD160 OK for nvu-1.0-sources.tar.bz2
3661: work.bacc -> /tmp/roland/pkgsrc/www/nvu/work.bacc
3662: ===> Installing dependencies for nvu-1.0
3663: ===> Overriding tools for nvu-1.0
3664: ===> Extracting for nvu-1.0
3665: url2pkg> Adjusting the Makefile.
3666:
3667: Remember to correct CATEGORIES, HOMEPAGE, COMMENT, and DESCR when you're done!
3668:
3669: Good luck! (See pkgsrc/doc/pkgsrc.txt for some more help :-)
3670: </pre>
3671: </div>
1.41 asau 3672: <div class="sect3">
1.1 dsieger 3673: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 3674: <a name="creating.nvu.problems"></a>12.2.1.2. Fixing all kinds of problems to make the package work</h4></div></div></div>
1.1 dsieger 3675: <p>Now that the package has been extracted, let's see what's inside
3676: it. The package has a <code class="filename">README.txt</code>, but that only
3677: says something about mozilla, so it's probably useless for seeing what
3678: dependencies this package has. But since there is a GNU configure script
3679: in the package, let's hope that it will complain about everything it
3680: needs.</p>
3681: <pre class="programlisting">
3682: <code class="prompt">$</code> bmake
3683: => Required installed package digest>=20010302: digest-20060826 found
3684: => Checksum SHA1 OK for nvu-1.0-sources.tar.bz2
3685: => Checksum RMD160 OK for nvu-1.0-sources.tar.bz2
3686: ===> Patching for nvu-1.0
3687: ===> Creating toolchain wrappers for nvu-1.0
3688: ===> Configuring for nvu-1.0
3689: [...]
3690: configure: error: Perl 5.004 or higher is required.
3691: [...]
3692: WARNING: Please add USE_TOOLS+=perl to the package Makefile.
3693: [...]
3694: </pre>
3695: <p>That worked quite well. So I opened the package Makefile in my
3696: editor, and since it already has a <code class="varname">USE_TOOLS</code> line, I
1.23 wiz 3697: just appended <span class="quote">“<span class="quote">perl</span>”</span> to it. Since the dependencies of the
1.1 dsieger 3698: package have changed now, and since a perl wrapper is automatically
1.23 wiz 3699: installed in the <span class="quote">“<span class="quote">tools</span>”</span> phase, I need to build the package
1.1 dsieger 3700: from scratch.</p>
3701: <pre class="programlisting">
3702: <code class="prompt">$</code> bmake clean
3703: ===> Cleaning for nvu-1.0
3704: <code class="prompt">$</code> bmake
3705: [...]
3706: *** /tmp/roland/pkgsrc/www/nvu/work.bacc/.tools/bin/make is not \
3707: GNU Make. You will not be able to build Mozilla without GNU Make.
3708: [...]
3709: </pre>
1.23 wiz 3710: <p>So I added <span class="quote">“<span class="quote">gmake</span>”</span> to the
1.1 dsieger 3711: <code class="varname">USE_TOOLS</code> line and tried again (from scratch).</p>
3712: <pre class="programlisting">
3713: [...]
3714: checking for GTK - version >= 1.2.0... no
3715: *** Could not run GTK test program, checking why...
3716: [...]
3717: </pre>
3718: <p>Now to the other dependencies. The first question is: Where is the
3719: GTK package hidden in pkgsrc?</p>
3720: <pre class="programlisting">
3721: <code class="prompt">$</code> echo ../../*/gtk*
3722: [many packages ...]
3723: <code class="prompt">$</code> echo ../../*/gtk
3724: ../../x11/gtk
3725: <code class="prompt">$</code> echo ../../*/gtk2
3726: ../../x11/gtk2
3727: <code class="prompt">$</code> echo ../../*/gtk2/bui*
3728: ../../x11/gtk2/buildlink3.mk
3729: </pre>
3730: <p>The first try was definitely too broad. The second one had exactly
3731: one result, which is very good. But there is one pitfall with GNOME
3732: packages. Before GNOME 2 had been released, there were already many
3733: GNOME 1 packages in pkgsrc. To be able to continue to use these
3734: packages, the GNOME 2 packages were imported as separate packages, and
1.23 wiz 3735: their names usually have a <span class="quote">“<span class="quote">2</span>”</span> appended. So I checked
1.1 dsieger 3736: whether this was the case here, and indeed it was.</p>
3737: <p>Since the GTK2 package has a <code class="filename">buildlink3.mk</code>
3738: file, adding the dependency is very easy. I just inserted an
3739: <code class="literal">.include</code> line before the last line of the package
3740: <code class="filename">Makefile</code>, so that it now looks like this:</p>
3741: <pre class="programlisting">
3742: [...]
3743: .include "../../x11/gtk2/buildlink3.mk"
3744: .include "../../mk/bsd.pkg.mk
3745: </pre>
1.10 hubertf 3746: <p>After another <span class="command"><strong>bmake clean && bmake</strong></span>, the answer
1.1 dsieger 3747: was:</p>
3748: <pre class="programlisting">
3749: [...]
3750: checking for gtk-config... /home/roland/pkg/bin/gtk-config
3751: checking for GTK - version >= 1.2.0... no
3752: *** Could not run GTK test program, checking why...
3753: *** The test program failed to compile or link. See the file config.log for the
3754: *** exact error that occured. This usually means GTK was incorrectly installed
3755: *** or that you have moved GTK since it was installed. In the latter case, you
3756: *** may want to edit the gtk-config script: /home/roland/pkg/bin/gtk-config
3757: configure: error: Test for GTK failed.
3758: [...]
3759: </pre>
1.23 wiz 3760: <p>In this particular case, the assumption that <span class="quote">“<span class="quote">every package
3761: prefers GNOME 2</span>”</span> had been wrong. The first of the lines above
1.1 dsieger 3762: told me that this package really wanted to have the GNOME 1 version of
3763: GTK. If the package had looked for GTK2, it would have looked for
1.10 hubertf 3764: <span class="command"><strong>pkg-config</strong></span> instead of <span class="command"><strong>gtk-config</strong></span>.
1.1 dsieger 3765: So I changed the <code class="literal">x11/gtk2</code> to
3766: <code class="literal">x11/gtk</code> in the package <code class="filename">Makefile</code>,
3767: and tried again.</p>
3768: <pre class="programlisting">
3769: [...]
1.59 jnemeth 3770: cc -o xpidl.o -c -DOSTYPE=\"NetBSD3\" -DOSARCH=\"NetBSD\" [...]
1.1 dsieger 3771: In file included from xpidl.c:42:
3772: xpidl.h:53:24: libIDL/IDL.h: No such file or directory
3773: In file included from xpidl.c:42:
3774: xpidl.h:132: error: parse error before "IDL_ns"
3775: [...]
3776: </pre>
3777: <p>The package still does not find all of its dependencies. Now the
3778: question is: Which package provides the
3779: <code class="filename">libIDL/IDL.h</code> header file?</p>
3780: <pre class="programlisting">
3781: <code class="prompt">$</code> echo ../../*/*idl*
3782: ../../devel/py-idle ../../wip/idled ../../x11/acidlaunch
3783: <code class="prompt">$</code> echo ../../*/*IDL*
3784: ../../net/libIDL
3785: </pre>
3786: <p>Let's take the one from the second try. So I included the
3787: <code class="filename">../../net/libIDL/buildlink3.mk</code> file and tried
3788: again. But the error didn't change. After digging through some of the
3789: code, I concluded that the build process of the package was broken and
3790: couldn't have ever worked, but since the Mozilla source tree is quite
3791: large, I didn't want to fix it. So I added the following to the package
3792: <code class="filename">Makefile</code> and tried again:</p>
3793: <pre class="programlisting">
3794: CPPFLAGS+= -I${BUILDLINK_PREFIX.libIDL}/include/libIDL-2.0
1.139 leot 3795: BUILDLINK_TRANSFORM+= l:IDL:IDL-2
1.1 dsieger 3796: </pre>
3797: <p>The latter line is needed because the package expects the library
3798: <code class="filename">libIDL.so</code>, but only
3799: <code class="filename">libIDL-2.so</code> is available. So I told the compiler
3800: wrapper to rewrite that on the fly.</p>
3801: <p>The next problem was related to a recent change of the FreeType
1.137 leot 3802: interface. I looked up in <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/seamonkey/README.html" target="_top"><code class="filename">www/seamonkey</code></a>
1.1 dsieger 3803: which patch files were relevant for this issue and copied them to the
3804: <code class="filename">patches</code> directory. Then I retried, fixed the
3805: patches so that they applied cleanly and retried again. This time,
3806: everything worked.</p>
3807: </div>
1.41 asau 3808: <div class="sect3">
1.1 dsieger 3809: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 3810: <a name="creating.nvu.inst"></a>12.2.1.3. Installing the package</h4></div></div></div>
1.1 dsieger 3811: <pre class="programlisting">
3812: <code class="prompt">$</code> bmake CHECK_FILES=no install
3813: [...]
3814: <code class="prompt">$</code> bmake print-PLIST >PLIST
3815: <code class="prompt">$</code> bmake deinstall
3816: <code class="prompt">$</code> bmake install
3817: </pre>
3818: </div>
3819: </div>
3820: </div>
3821: </div>
1.41 asau 3822: <div class="chapter">
1.1 dsieger 3823: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 3824: <a name="components"></a>Chapter 13. Package components - files, directories and contents</h2></div></div></div>
1.1 dsieger 3825: <div class="toc">
3826: <p><b>Table of Contents</b></p>
1.100 leot 3827: <dl class="toc">
1.154 rillig 3828: <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt>
3829: <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt>
3830: <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt>
3831: <dd><dl>
3832: <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt>
3833: <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt>
3834: <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt>
3835: <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt>
3836: <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt>
3837: </dl></dd>
3838: <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt>
3839: <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt>
3840: <dd><dl>
3841: <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt>
3842: <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt>
3843: <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt>
1.1 dsieger 3844: </dl></dd>
1.154 rillig 3845: <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt>
3846: <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt>
1.1 dsieger 3847: </dl>
3848: </div>
3849: <p>Whenever you're preparing a package, there are a number of
3850: files involved which are described in the following
3851: sections.</p>
1.41 asau 3852: <div class="sect1">
1.1 dsieger 3853: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3854: <a name="components.Makefile"></a>13.1. <code class="filename">Makefile</code>
1.1 dsieger 3855: </h2></div></div></div>
3856: <p>Building, installation and creation of a binary package are all
3857: controlled by the package's <code class="filename">Makefile</code>.
3858: The <code class="filename">Makefile</code> describes various things about
3859: a package, for example from where to get it, how to configure,
3860: build, and install it.</p>
3861: <p>A package <code class="filename">Makefile</code> contains several
3862: sections that describe the package.</p>
3863: <p>In the first section there are the following variables, which
3864: should appear exactly in the order given here. The order and
3865: grouping of the variables is mostly historical and has no further
3866: meaning.</p>
1.41 asau 3867: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 3868: <li class="listitem"><p><code class="varname">DISTNAME</code> is the basename of the
1.1 dsieger 3869: distribution file to be downloaded from the package's
3870: website.</p></li>
1.23 wiz 3871: <li class="listitem"><p><code class="varname">PKGNAME</code> is the name of the
1.66 asau 3872: package, as used by pkgsrc. You need to provide it if
1.1 dsieger 3873: <code class="varname">DISTNAME</code> (which is the default) is not a good
1.66 asau 3874: name for the package in pkgsrc or <code class="varname">DISTNAME</code> is not
3875: provided (no distribution file is required). Usually it is the pkgsrc
1.1 dsieger 3876: directory name together with the version number. It must match the
3877: regular expression
3878: <code class="varname">^[A-Za-z0-9][A-Za-z0-9-_.+]*$</code>, that is, it
3879: starts with a letter or digit, and contains only letters, digits,
3880: dashes, underscores, dots and plus signs.</p></li>
1.23 wiz 3881: <li class="listitem">
1.1 dsieger 3882: <p><code class="varname">CATEGORIES</code> is a list of categories
3883: which the package fits in. You can choose any of the top-level
3884: directories of pkgsrc for it.</p>
3885: <p>Currently the following values are available for
3886: <code class="varname">CATEGORIES</code>. If more than
3887: one is used, they need to be separated by spaces:</p>
3888: <pre class="programlisting">
3889: archivers cross geography meta-pkgs security
3890: audio databases graphics misc shells
3891: benchmarks devel ham multimedia sysutils
3892: biology editors inputmethod net textproc
3893: cad emulators lang news time
3894: chat finance mail parallel wm
3895: comms fonts math pkgtools www
3896: converters games mbone print x11
3897: </pre>
3898: </li>
1.23 wiz 3899: <li class="listitem"><p><code class="varname">MASTER_SITES</code>,
1.1 dsieger 3900: <code class="varname">DYNAMIC_MASTER_SITES</code>,
3901: <code class="varname">DIST_SUBDIR</code>, <code class="varname">EXTRACT_SUFX</code>
3902: and <code class="varname">DISTFILES</code> are discussed in detail in
1.154 rillig 3903: <a class="xref" href="#build.fetch" title="19.5. The fetch phase">Section 19.5, “The <span class="emphasis"><em>fetch</em></span> phase”</a>.</p></li>
1.1 dsieger 3904: </ul></div>
3905: <p>The second section contains information about separately
3906: downloaded patches, if any.
3907: </p>
1.41 asau 3908: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.80 wiz 3909: <li class="listitem"><p><code class="varname">PATCHFILES</code>:
1.1 dsieger 3910: Name(s) of additional files that contain distribution patches.
3911: There is no default. pkgsrc will look for them at
3912: <code class="varname">PATCH_SITES</code>.
3913: They will automatically be uncompressed before patching if
3914: the names end with <code class="filename">.gz</code> or
3915: <code class="filename">.Z</code>.</p></li>
1.23 wiz 3916: <li class="listitem"><p><code class="varname">PATCH_SITES</code>:
1.1 dsieger 3917: Primary location(s) for distribution patch files (see
1.80 wiz 3918: <code class="varname">PATCHFILES</code> above) if not found locally.</p></li>
3919: <li class="listitem"><p><code class="varname">PATCH_DIST_STRIP</code>:
1.174 leot 3920: an argument to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?patch+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">patch</span>(1)</span></a> that sets the pathname strip count to
1.80 wiz 3921: help find the correct files to patch. It defaults to
3922: <span class="command"><strong>-p0</strong></span>.</p></li>
1.1 dsieger 3923: </ul></div>
3924: <p>The third section contains the following variables.
3925: </p>
1.41 asau 3926: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 3927: <li class="listitem"><p><code class="varname">MAINTAINER</code> is the email
1.14 jmcneill 3928: address of the person who feels responsible for this package,
3929: and who is most likely to look at problems or questions regarding
1.174 leot 3930: this package which have been reported with <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">send-pr</span>(1)</span></a>.
1.14 jmcneill 3931: Other developers may contact the <code class="varname">MAINTAINER</code>
3932: before making changes to the package, but are not required to
3933: do so. When packaging a new program, set <code class="varname">MAINTAINER</code>
3934: to yourself. If you really can't maintain the package for future
3935: updates, set it to
1.10 hubertf 3936: <code class="email"><<a class="email" href="mailto:pkgsrc-users@NetBSD.org">pkgsrc-users@NetBSD.org</a>></code>.</p></li>
1.23 wiz 3937: <li class="listitem"><p><code class="varname">OWNER</code> should be used instead
1.14 jmcneill 3938: of <code class="varname">MAINTAINER</code> when you do not want other
3939: developers to update or change the package without contacting
3940: you first. A package Makefile should contain one of
3941: <code class="varname">MAINTAINER</code> or <code class="varname">OWNER</code>, but
3942: not both. </p></li>
1.23 wiz 3943: <li class="listitem"><p><code class="varname">HOMEPAGE</code> is a URL where users can
1.1 dsieger 3944: find more information about the package.</p></li>
1.23 wiz 3945: <li class="listitem"><p><code class="varname">COMMENT</code> is a one-line
1.1 dsieger 3946: description of the package (should not include the package
3947: name).</p></li>
1.122 leot 3948: <li class="listitem"><p><code class="varname">LICENSE</code> indicates the license(s)
1.154 rillig 3949: applicable for the package. See <a class="xref" href="#handling-licenses" title="21.1.3. Handling licenses">Section 21.1.3, “Handling licenses”</a> for further details.</p></li>
1.1 dsieger 3950: </ul></div>
3951: <p>Other variables that affect the build:
3952: </p>
1.41 asau 3953: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
1.1 dsieger 3954: <p><code class="varname">WRKSRC</code>: The directory where the
3955: interesting distribution files of the package are found. The
3956: default is <code class="filename">${WRKDIR}/${DISTNAME}</code>, which
3957: works for most packages.</p>
3958: <p>If a package doesn't create a subdirectory for itself
3959: (most GNU software does, for instance), but extracts itself in
3960: the current directory, you should set
3961: <code class="varname">WRKSRC=${WRKDIR}</code>.</p>
3962: <p>If a package doesn't create a subdirectory with the
3963: name of <code class="varname">DISTNAME</code> but some different name,
3964: set <code class="varname">WRKSRC</code> to point to the proper name in
3965: <code class="filename">${WRKDIR}</code>, for example
3966: <code class="varname">WRKSRC=${WRKDIR}/${DISTNAME}/unix</code>. See
1.137 leot 3967: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/lang/tcl/README.html" target="_top"><code class="filename">lang/tcl</code></a> and <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/x11/tk/README.html" target="_top"><code class="filename">x11/tk</code></a> for other examples.</p>
1.1 dsieger 3968: <p>The name of the working directory created by pkgsrc is
3969: taken from the <code class="varname">WRKDIR_BASENAME</code>
3970: variable. By default, its value is
3971: <code class="filename">work</code>. If you want to use the same
3972: pkgsrc tree for building different kinds of binary packages,
3973: you can change the variable according to your needs. Two
3974: other variables handle common cases of setting
3975: <code class="varname">WRKDIR_BASENAME</code> individually. If
3976: <code class="varname">OBJHOSTNAME</code> is defined in
1.10 hubertf 3977: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, the first component of
1.1 dsieger 3978: the host's name is attached to the directory name. If
3979: <code class="varname">OBJMACHINE</code> is defined, the platform name
3980: is attached, which might look like
3981: <code class="filename">work.i386</code> or
3982: <code class="filename">work.sparc</code>.</p>
3983: </li></ul></div>
3984: <p>Please pay attention to the following gotchas:</p>
1.41 asau 3985: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 3986: <li class="listitem"><p>Add <code class="varname">MANCOMPRESSED</code> if man pages are
1.1 dsieger 3987: installed in compressed form by the package. For packages using
3988: BSD-style makefiles which honor MANZ, there is
3989: <code class="varname">MANCOMPRESSED_IF_MANZ</code>.</p></li>
1.23 wiz 3990: <li class="listitem"><p>Replace <code class="filename">/usr/local</code> with
3991: <span class="quote">“<span class="quote">${PREFIX}</span>”</span> in all files (see patches,
1.1 dsieger 3992: below).</p></li>
1.154 rillig 3993: <li class="listitem"><p>If the package installs any info files, see <a class="xref" href="#faq.info-files" title="21.6.7. Packages installing info files">Section 21.6.7, “Packages installing info files”</a>.</p></li>
1.1 dsieger 3994: </ul></div>
3995: </div>
1.41 asau 3996: <div class="sect1">
1.1 dsieger 3997: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3998: <a name="components.distinfo"></a>13.2. <code class="filename">distinfo</code>
1.1 dsieger 3999: </h2></div></div></div>
4000: <p>The <code class="filename">distinfo</code> file contains the message
4001: digest, or checksum, of each distfile needed for the package. This
4002: ensures that the distfiles retrieved from the Internet have not been
4003: corrupted during transfer or altered by a malign force to introduce
1.108 rillig 4004: a security hole. To provide maximum security, all distfiles are
4005: protected using three different message digest algorithms (SHA1,
4006: RMD160, SHA512), as well as the file size.</p>
1.1 dsieger 4007: <p>The <code class="filename">distinfo</code> file also contains the
4008: checksums for all the patches found in the
1.154 rillig 4009: <code class="filename">patches</code> directory (see <a class="xref" href="#components.patches" title="13.3. patches/*">Section 13.3, “<code class="filename">patches/*</code>”</a>). These checksums ensure that patches
1.145 leot 4010: are only applied intentionally and that they don't accidentally change,
4011: e.g. when merging different changes together. They also make sure that
4012: new patches are actually added to CVS and old ones are removed.
4013: Too see whether the patches and the <code class="filename">distinfo</code> file
4014: match, run <span class="command"><strong>pkglint</strong></span> after changing the patches.</p>
1.1 dsieger 4015: <p>To regenerate the <code class="filename">distinfo</code> file, use the
1.108 rillig 4016: <span class="command"><strong>make distinfo</strong></span> command.</p>
1.1 dsieger 4017: <p>Some packages have different sets of distfiles depending on
1.178 ! rillig 4018: the platform, for example <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/lang/openjdk8/README.html" target="_top"><code class="filename">lang/openjdk8</code></a>. These are kept in the same
1.1 dsieger 4019: <code class="filename">distinfo</code> file and care should be taken when
4020: upgrading such a package to ensure distfile information is not
4021: lost.</p>
4022: </div>
1.41 asau 4023: <div class="sect1">
1.1 dsieger 4024: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4025: <a name="components.patches"></a>13.3. <code class="filename">patches/*</code>
1.108 rillig 4026: </h2></div></div></div>
4027: <p>Some packages don't work out-of-the box on the various
4028: platforms that are supported by pkgsrc. These packages need
4029: to be patched to make them work. The patch files can be
1.1 dsieger 4030: found in the <code class="filename">patches/</code> directory.</p>
4031: <p>In the <span class="emphasis"><em>patch</em></span> phase, these patches are
4032: applied to the files in <code class="varname">WRKSRC</code> directory after
1.108 rillig 4033: extracting them, in alphabetic order.</p>
1.41 asau 4034: <div class="sect2">
1.1 dsieger 4035: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4036: <a name="components.patch.structure"></a>13.3.1. Structure of a single patch file</h3></div></div></div>
1.1 dsieger 4037: <p>The <code class="filename">patch-*</code> files should be in
1.10 hubertf 4038: <span class="command"><strong>diff -bu</strong></span> format, and apply without a fuzz to avoid
1.1 dsieger 4039: problems. (To force patches to apply with fuzz you can set
4040: <code class="varname">PATCH_FUZZ_FACTOR=-F2</code>). Furthermore, each patch
4041: should contain only changes for a single file, and no file should be
4042: patched by more than one patch file. This helps to keep future
4043: modifications simple.</p>
4044: <p>Each patch file is structured as follows: In the first line,
4045: there is the RCS Id of the patch itself. The second line should be
4046: empty for aesthetic reasons. After that, there should be a comment for
4047: each change that the patch does. There are a number of standard
4048: cases:</p>
1.41 asau 4049: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4050: <li class="listitem"><p>Patches for commonly known vulnerabilities should
1.1 dsieger 4051: mention the vulnerability ID (CAN, CVE).</p></li>
1.23 wiz 4052: <li class="listitem"><p>Patches that change source code should mention the
1.1 dsieger 4053: platform and other environment (for example, the compiler) that the
4054: patch is needed for.</p></li>
4055: </ul></div>
1.108 rillig 4056: <p>The patch should be commented so that any
1.1 dsieger 4057: developer who knows the code of the application can make some use of
4058: the patch. Special care should be taken for the upstream developers,
4059: since we generally want that they accept our patches, so we have less
4060: work in the future.</p>
4061: </div>
1.41 asau 4062: <div class="sect2">
1.1 dsieger 4063: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4064: <a name="components.patches.caveats"></a>13.3.2. Creating patch files</h3></div></div></div>
1.1 dsieger 4065: <p>One important thing to mention is to pay attention that no RCS
4066: IDs get stored in the patch files, as these will cause problems when
4067: later checked into the NetBSD CVS tree. Use the
1.137 leot 4068: <span class="command"><strong>pkgdiff</strong></span> command from the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a> package to avoid these
1.1 dsieger 4069: problems.</p>
4070: <p>For even more automation, we recommend using
1.10 hubertf 4071: <span class="command"><strong>mkpatches</strong></span> from the same package to make a
1.1 dsieger 4072: whole set of patches. You just have to backup files before you
4073: edit them to <code class="filename">filename.orig</code>, e.g. with
1.10 hubertf 4074: <span class="command"><strong>cp -p filename filename.orig</strong></span> or, easier, by
4075: using <span class="command"><strong>pkgvi</strong></span> again from the same package. If
1.1 dsieger 4076: you upgrade a package this way, you can easily compare the new
4077: set of patches with the previously existing one with
1.24 wiz 4078: <span class="command"><strong>patchdiff</strong></span>. The files in <code class="filename">patches</code>
4079: are replaced by new files, so carefully check if you want to take all
4080: the changes.</p>
1.1 dsieger 4081: <p>When you have finished a package, remember to generate
1.10 hubertf 4082: the checksums for the patch files by using the <span class="command"><strong>make
1.154 rillig 4083: makepatchsum</strong></span> command, see <a class="xref" href="#components.distinfo" title="13.2. distinfo">Section 13.2, “<code class="filename">distinfo</code>”</a>.</p>
1.1 dsieger 4084: <p>When adding a patch that corrects a problem in the
4085: distfile (rather than e.g. enforcing pkgsrc's view of where
4086: man pages should go), send the patch as a bug report to the
4087: maintainer. This benefits non-pkgsrc users of the package,
4088: and usually makes it possible to remove the patch in future
4089: version.</p>
1.2 rillig 4090: <p>The file names of the patch files are usually of the form
1.24 wiz 4091: <code class="filename">patch-<em class="replaceable"><code>path_to_file__with__underscores.c</code></em></code>.
4092: Many packages still use the previous convention
4093: <code class="filename">patch-<em class="replaceable"><code>[a-z][a-z]</code></em></code>,
4094: but new patches should be of the form containing the filename.
1.137 leot 4095: <span class="command"><strong>mkpatches</strong></span> included in <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a> takes care of the name
1.24 wiz 4096: automatically.</p>
1.1 dsieger 4097: </div>
1.41 asau 4098: <div class="sect2">
1.1 dsieger 4099: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4100: <a name="components.patches.sources"></a>13.3.3. Sources where the patch files come from</h3></div></div></div>
1.1 dsieger 4101: <p>If you want to share patches between multiple packages
4102: in pkgsrc, e.g. because they use the same distfiles, set
4103: <code class="varname">PATCHDIR</code> to the path where the patch files
4104: can be found, e.g.:</p>
4105: <pre class="programlisting">
1.159 rillig 4106: PATCHDIR= ../../editors/xemacs/patches
1.1 dsieger 4107: </pre>
4108: <p>Patch files that are distributed by the author or other
4109: maintainers can be listed in
4110: <code class="varname">PATCHFILES</code>.</p>
4111: <p>If it is desired to store any patches that should not be
4112: committed into pkgsrc, they can be kept outside the pkgsrc
4113: tree in the <code class="filename">$LOCALPATCHES</code> directory. The
4114: directory tree there is expected to have the same
1.23 wiz 4115: <span class="quote">“<span class="quote">category/package</span>”</span> structure as pkgsrc, and
1.1 dsieger 4116: patches are expected to be stored inside these dirs (also
4117: known as <code class="filename">$LOCALPATCHES/$PKGPATH</code>). For
4118: example, if you want to keep a private patch for
4119: <code class="filename">pkgsrc/graphics/png</code>, keep it in
4120: <code class="filename">$LOCALPATCHES/graphics/png/mypatch</code>. All
4121: files in the named directory are expected to be patch files,
4122: and <span class="emphasis"><em>they are applied after pkgsrc patches are
4123: applied</em></span>.</p>
4124: </div>
1.41 asau 4125: <div class="sect2">
1.1 dsieger 4126: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4127: <a name="components.patches.guidelines"></a>13.3.4. Patching guidelines</h3></div></div></div>
1.1 dsieger 4128: <p>When fixing a portability issue in the code do not use
4129: preprocessor magic to check for the current operating system nor
4130: platform. Doing so hurts portability to other platforms because
4131: the OS-specific details are not abstracted appropriately.</p>
4132: <p>The general rule to follow is: instead of checking for the
4133: operating system the application is being built on, check for the
4134: specific <span class="emphasis"><em>features</em></span> you need. For example,
4135: instead of assuming that kqueue is available under NetBSD and
4136: using the <code class="varname">__NetBSD__</code> macro to conditionalize
1.14 jmcneill 4137: kqueue support, add a check that detects kqueue itself —
1.1 dsieger 4138: yes, this generally involves patching the
1.10 hubertf 4139: <span class="command"><strong>configure</strong></span> script. There is absolutely nothing
1.1 dsieger 4140: that prevents some OSes from adopting interfaces from other OSes
4141: (e.g. Linux implementing kqueue), something that the above checks
4142: cannot take into account.</p>
4143: <p>Of course, checking for features generally involves more
4144: work on the developer's side, but the resulting changes are
4145: cleaner and there are chances they will work on many other
4146: platforms. Not to mention that there are higher chances of being
4147: later integrated into the mainstream sources. Remember:
4148: <span class="emphasis"><em>It doesn't work unless it is right!</em></span></p>
4149: <p>Some typical examples:</p>
4150: <div class="table">
1.154 rillig 4151: <a name="patch-examples"></a><p class="title"><b>Table 13.1. Patching examples</b></p>
1.106 tnn 4152: <div class="table-contents"><table class="table" summary="Patching examples" border="1">
1.1 dsieger 4153: <colgroup>
4154: <col>
4155: <col>
4156: <col>
4157: </colgroup>
4158: <thead><tr>
4159: <th>Where</th>
4160: <th>Incorrect</th>
4161: <th>Correct</th>
4162: </tr></thead>
4163: <tbody>
4164: <tr>
4165: <td>configure script</td>
4166: <td>
4167: <pre class="programlisting">
4168: case ${target_os} in
4169: netbsd*) have_kvm=yes ;;
4170: *) have_kvm=no ;;
4171: esac
4172: </pre>
4173: </td>
4174: <td>
4175: <pre class="programlisting">
4176: AC_CHECK_LIB(kvm, kvm_open, have_kvm=yes, have_kvm=no)
4177: </pre>
4178: </td>
4179: </tr>
4180: <tr>
4181: <td>C source file</td>
4182: <td>
4183: <pre class="programlisting">
4184: #if defined(__NetBSD__)
4185: # include <sys/event.h>
4186: #endif
4187: </pre>
4188: </td>
4189: <td>
4190: <pre class="programlisting">
4191: #if defined(HAVE_SYS_EVENT_H)
4192: # include <sys/event.h>
4193: #endif
4194: </pre>
4195: </td>
4196: </tr>
4197: <tr>
4198: <td>C source file</td>
4199: <td>
4200: <pre class="programlisting">
4201: int
4202: monitor_file(...)
4203: {
4204: #if defined(__NetBSD__)
4205: int fd = kqueue();
4206: ...
4207: #else
4208: ...
4209: #endif
4210: }
4211: </pre>
4212: </td>
4213: <td>
4214: <pre class="programlisting">
4215: int
4216: monitor_file(...)
4217: {
4218: #if defined(HAVE_KQUEUE)
4219: int fd = kqueue();
4220: ...
4221: #else
1.112 rillig 4222: ...
1.1 dsieger 4223: #endif
4224: }
4225: </pre>
4226: </td>
4227: </tr>
4228: </tbody>
4229: </table></div>
4230: </div>
1.141 maya 4231: <br class="table-break">
1.1 dsieger 4232: </div>
1.41 asau 4233: <div class="sect2">
1.1 dsieger 4234: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4235: <a name="components.patches.feedback"></a>13.3.5. Feedback to the author</h3></div></div></div>
1.1 dsieger 4236: <p>Always, always, <span class="strong"><strong>always</strong></span>
4237: feed back any <span class="emphasis"><em>portability fixes</em></span> or
4238: improvements you do to a package to the mainstream developers.
4239: This is the only way to get their attention on portability issues
4240: and to ensure that future versions can be built out-of-the box on
4241: NetBSD. Furthermore, any user that gets newer distfiles will get
4242: the fixes straight from the packaged code.</p>
4243: <p>This generally involves cleaning up the patches
4244: (because sometimes the patches that are
1.40 wiz 4245: added to pkgsrc are quick hacks), filing bug reports in the
1.1 dsieger 4246: appropriate trackers for the projects and working with the
4247: mainstream authors to accept your changes. It is
4248: <span class="emphasis"><em>extremely important</em></span> that you do it so that
4249: the packages in pkgsrc are kept simple and thus further changes
4250: can be done without much hassle.</p>
1.24 wiz 4251: <p>When you have done this, please add a URL to the upstream
4252: bug report to the patch comment.</p>
1.1 dsieger 4253: <p>Support the idea of free software!</p>
4254: </div>
4255: </div>
1.41 asau 4256: <div class="sect1">
1.1 dsieger 4257: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4258: <a name="other-mandatory-files"></a>13.4. Other mandatory files</h2></div></div></div>
1.41 asau 4259: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4260: <dt><span class="term"><code class="filename">DESCR</code></span></dt>
4261: <dd><p>A multi-line description of the piece of software. This should include
4262: any credits where they are due. Please bear in mind that others do not
4263: share your sense of humour (or spelling idiosyncrasies), and that others
4264: will read everything that you write here.</p></dd>
4265: <dt><span class="term"><code class="filename">PLIST</code></span></dt>
4266: <dd><p>This file governs the files that are installed on your
4267: system: all the binaries, manual pages, etc. There are other
4268: directives which may be entered in this file, to control the
4269: creation and deletion of directories, and the location of
1.154 rillig 4270: inserted files. See <a class="xref" href="#plist" title="Chapter 15. PLIST issues">Chapter 15, <i>PLIST issues</i></a> for more
1.1 dsieger 4271: information.</p></dd>
4272: </dl></div>
4273: </div>
1.41 asau 4274: <div class="sect1">
1.1 dsieger 4275: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4276: <a name="components.optional"></a>13.5. Optional files</h2></div></div></div>
1.41 asau 4277: <div class="sect2">
1.1 dsieger 4278: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4279: <a name="components.optional.bin"></a>13.5.1. Files affecting the binary package</h3></div></div></div>
1.41 asau 4280: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4281: <dt><span class="term"><code class="filename">INSTALL</code></span></dt>
1.28 wiz 4282: <dd>
1.174 leot 4283: <p>This shell script is invoked twice by <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>.
1.1 dsieger 4284: First time after package extraction and before files are
4285: moved in place, the second time after the files to install
4286: are moved in place. This can be used to do any custom
4287: procedures not possible with @exec commands in
1.174 leot 4288: <code class="filename">PLIST</code>. See <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a> and
4289: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_create</span>(1)</span></a> for more information. See also <a class="xref" href="#files-and-dirs-outside-prefix" title="17.1. Files and directories outside the installation prefix">Section 17.1, “Files and directories outside the installation prefix”</a>.
1.28 wiz 4290: Please note that you can modify variables in it easily by using
4291: <code class="varname">FILES_SUBST</code> in the package's
4292: <code class="filename">Makefile</code>:</p>
4293: <pre class="programlisting">
4294: FILES_SUBST+= SOMEVAR="somevalue"
4295: </pre>
4296: <p>replaces "@SOMEVAR@" with <span class="quote">“<span class="quote">somevalue</span>”</span> in the
4297: <code class="filename">INSTALL</code>. By default, substitution is
4298: performed for <code class="varname">PREFIX</code>,
4299: <code class="varname">LOCALBASE</code>, <code class="varname">X11BASE</code>,
4300: <code class="varname">VARBASE</code>, and a few others, type
4301: <span class="command"><strong>make help topic=FILES_SUBST</strong></span> for a
4302: complete list.</p>
4303: </dd>
1.1 dsieger 4304: <dt><span class="term"><code class="filename">DEINSTALL</code></span></dt>
4305: <dd><p>This script is executed before and after any files are removed. It is
4306: this script's responsibility to clean up any additional messy details
4307: around the package's installation, since all pkg_delete knows is how to
4308: delete the files created in the original distribution.
1.174 leot 4309: See <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_delete</span>(1)</span></a>
4310: and <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_create</span>(1)</span></a> for more information.
1.28 wiz 4311: The same methods to replace variables can be used as for
4312: the <code class="filename">INSTALL</code> file.</p></dd>
1.1 dsieger 4313: <dt><span class="term"><code class="filename">MESSAGE</code></span></dt>
4314: <dd>
4315: <p>This file is displayed after installation of the package.
4316: Useful for things like legal notices on almost-free
4317: software and hints for updating config files after
4318: installing modules for apache, PHP etc.
4319: Please note that you can modify variables in it easily by using
4320: <code class="varname">MESSAGE_SUBST</code> in the package's
4321: <code class="filename">Makefile</code>:</p>
4322: <pre class="programlisting">
4323: MESSAGE_SUBST+= SOMEVAR="somevalue"
4324: </pre>
1.23 wiz 4325: <p>replaces "${SOMEVAR}" with <span class="quote">“<span class="quote">somevalue</span>”</span> in
1.1 dsieger 4326: <code class="filename">MESSAGE</code>. By default, substitution is
4327: performed for <code class="varname">PKGNAME</code>,
4328: <code class="varname">PKGBASE</code>, <code class="varname">PREFIX</code>,
1.99 sevan 4329: <code class="varname">LOCALBASE</code>, <code class="varname">X11BASE</code>,
1.1 dsieger 4330: <code class="varname">PKG_SYSCONFDIR</code>,
4331: <code class="varname">ROOT_GROUP</code>, and
1.16 jnemeth 4332: <code class="varname">ROOT_USER</code>.</p>
1.1 dsieger 4333: <p>You can display a different or additional files by
4334: setting the <code class="varname">MESSAGE_SRC</code> variable. Its
4335: default is <code class="filename">MESSAGE</code>, if the file
4336: exists.</p>
4337: </dd>
4338: <dt><span class="term"><code class="filename">ALTERNATIVES</code></span></dt>
1.66 asau 4339: <dd>
4340: <p>This file is used by the alternatives framework.
4341: It creates, configures, and destroys generic wrappers used to
4342: run programs with similar interfaces.
4343: See pkg_alternatives(8) from pkgtools/pkg_alternatives
4344: for more information.</p>
4345: <p>Each line of the file contains two filenames, first
4346: the wrapper and then the alternative provided by the package.
4347: Both paths are relative to <code class="varname">PREFIX</code>.</p>
4348: </dd>
1.1 dsieger 4349: </dl></div>
4350: </div>
1.41 asau 4351: <div class="sect2">
1.1 dsieger 4352: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4353: <a name="components.optional.build"></a>13.5.2. Files affecting the build process</h3></div></div></div>
1.41 asau 4354: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4355: <dt><span class="term"><code class="filename">Makefile.common</code></span></dt>
4356: <dd><p>This file contains arbitrary things that could
4357: also go into a <code class="filename">Makefile</code>, but its purpose is
4358: to be used by more than one package. This file should only be
4359: used when the packages that will use the file are known in
4360: advance. For other purposes it is often better to write a
4361: <code class="filename">*.mk</code> file and give it a good name that
4362: describes what it does.</p></dd>
4363: <dt><span class="term"><code class="filename">buildlink3.mk</code></span></dt>
4364: <dd><p>This file contains the dependency information
1.154 rillig 4365: for the buildlink3 framework (see <a class="xref" href="#buildlink" title="Chapter 16. Buildlink methodology">Chapter 16, <i>Buildlink methodology</i></a>).</p></dd>
1.1 dsieger 4366: <dt><span class="term"><code class="filename">hacks.mk</code></span></dt>
4367: <dd><p>This file contains workarounds for compiler bugs
4368: and similar things. It is included automatically by the pkgsrc
4369: infrastructure, so you don't need an extra
4370: <code class="literal">.include</code> line for
4371: it.</p></dd>
4372: <dt><span class="term"><code class="filename">options.mk</code></span></dt>
4373: <dd><p>This file contains the code for the
1.154 rillig 4374: package-specific options (see <a class="xref" href="#options" title="Chapter 18. Options handling">Chapter 18, <i>Options handling</i></a>) that can be
1.1 dsieger 4375: selected by the user. If a package has only one or two options,
4376: it is equally acceptable to put the code directly into the
4377: <code class="filename">Makefile</code>.</p></dd>
4378: </dl></div>
4379: </div>
1.41 asau 4380: <div class="sect2">
1.1 dsieger 4381: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4382: <a name="components.optional.none"></a>13.5.3. Files affecting nothing at all</h3></div></div></div>
1.41 asau 4383: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4384: <dt><span class="term"><code class="filename">README*</code></span></dt>
4385: <dd><p>These files do not take place in the creation of
4386: a package and thus are purely informative to the package
4387: developer.</p></dd>
4388: <dt><span class="term"><code class="filename">TODO</code></span></dt>
4389: <dd><p>This file contains things that need to be done
4390: to make the package even
4391: better.</p></dd>
4392: </dl></div>
4393: </div>
4394: </div>
1.41 asau 4395: <div class="sect1">
1.1 dsieger 4396: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4397: <a name="work-dir"></a>13.6. <code class="filename">work*</code>
1.1 dsieger 4398: </h2></div></div></div>
1.10 hubertf 4399: <p>When you type <span class="command"><strong>make</strong></span>, the distribution files are
1.1 dsieger 4400: unpacked into the directory denoted by
4401: <code class="varname">WRKDIR</code>. It can be removed by running
1.10 hubertf 4402: <span class="command"><strong>make clean</strong></span>. Besides the sources, this
1.1 dsieger 4403: directory is also used to keep various timestamp files.
4404: The directory gets <span class="emphasis"><em>removed completely</em></span> on clean.
4405: The default is <code class="filename">${.CURDIR}/work</code>
4406: or <code class="filename">${.CURDIR}/work.${MACHINE_ARCH}</code>
4407: if <code class="varname">OBJMACHINE</code> is set.</p>
4408: </div>
1.41 asau 4409: <div class="sect1">
1.1 dsieger 4410: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4411: <a name="files-dir"></a>13.7. <code class="filename">files/*</code>
1.1 dsieger 4412: </h2></div></div></div>
1.172 rillig 4413: <p>If you have any files that you wish to be placed in the package
4414: prior to configuration or building, you can place these files here
4415: and use a <span class="command"><strong>${CP}</strong></span> command in the
4416: <span class="quote">“<span class="quote">post-extract</span>”</span> target to achieve this.</p>
1.1 dsieger 4417: <p>If you want to share files in this way with other
4418: packages, set the <code class="varname">FILESDIR</code> variable to point
4419: to the other package's <code class="filename">files</code> directory,
4420: e.g.:</p>
4421: <pre class="programlisting">
1.159 rillig 4422: FILESDIR= ../../editors/xemacs/files
1.1 dsieger 4423: </pre>
4424: </div>
4425: </div>
1.41 asau 4426: <div class="chapter">
1.1 dsieger 4427: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 4428: <a name="makefile"></a>Chapter 14. Programming in <code class="filename">Makefile</code>s</h2></div></div></div>
1.1 dsieger 4429: <div class="toc">
4430: <p><b>Table of Contents</b></p>
1.100 leot 4431: <dl class="toc">
1.154 rillig 4432: <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt>
4433: <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt>
4434: <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd>
4435: <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt>
4436: <dd><dl>
4437: <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt>
4438: <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt>
4439: <dt><span class="sect2"><a href="#cflags-gnu-configure">14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt>
4440: <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt>
1.1 dsieger 4441: </dl></dd>
4442: </dl>
4443: </div>
4444: <p>Pkgsrc consists of many <code class="filename">Makefile</code> fragments,
4445: each of which forms a well-defined part of the pkgsrc system. Using
1.174 leot 4446: the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> system as a programming language for a big system
1.1 dsieger 4447: like pkgsrc requires some discipline to keep the code correct and
4448: understandable.</p>
4449: <p>The basic ingredients for <code class="filename">Makefile</code>
1.154 rillig 4450: programming are variables and shell
1.1 dsieger 4451: commands. Among these shell commands may even be more complex ones
1.174 leot 4452: like <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?awk+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">awk</span>(1)</span></a> programs. To make sure that every shell command runs
1.1 dsieger 4453: as intended it is necessary to quote all variables correctly when they
4454: are used.</p>
1.154 rillig 4455: <p>This chapter describes some patterns that appear quite often in
1.1 dsieger 4456: <code class="filename">Makefile</code>s, including the pitfalls that come along
4457: with them.</p>
1.41 asau 4458: <div class="sect1">
1.1 dsieger 4459: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4460: <a name="makefile.style"></a>14.1. Caveats</h2></div></div></div>
1.41 asau 4461: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
1.1 dsieger 4462: <p>When you are creating a file as a
4463: target of a rule, always write the data to a temporary file first
4464: and finally rename that file. Otherwise there might occur an error
4465: in the middle of generating the file, and when the user runs
1.174 leot 4466: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> for the second time, the file exists and will not be
1.1 dsieger 4467: regenerated properly. Example:</p>
4468: <pre class="programlisting">
4469: wrong:
4470: @echo "line 1" > ${.TARGET}
4471: @echo "line 2" >> ${.TARGET}
4472: @false
4473:
4474: correct:
4475: @echo "line 1" > ${.TARGET}.tmp
4476: @echo "line 2" >> ${.TARGET}.tmp
4477: @false
4478: @mv ${.TARGET}.tmp ${.TARGET}
4479: </pre>
1.10 hubertf 4480: <p>When you run <span class="command"><strong>make wrong</strong></span> twice, the file
1.1 dsieger 4481: <code class="filename">wrong</code> will exist, although there was an error
1.10 hubertf 4482: message in the first run. On the other hand, running <span class="command"><strong>make
1.1 dsieger 4483: correct</strong></span> gives an error message twice, as expected.</p>
1.174 leot 4484: <p>You might remember that <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> sometimes removes
1.1 dsieger 4485: <code class="literal">${.TARGET}</code> in case of error, but this only
4486: happens when it is interrupted, for example by pressing
1.154 rillig 4487: <code class="literal">Ctrl+C</code>. This does <span class="emphasis"><em>not</em></span> happen
1.174 leot 4488: when one of the commands fails (like <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?false+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">false</span>(1)</span></a> above).</p>
1.1 dsieger 4489: </li></ul></div>
4490: </div>
1.41 asau 4491: <div class="sect1">
1.1 dsieger 4492: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4493: <a name="makefile.variables"></a>14.2. <code class="filename">Makefile</code> variables</h2></div></div></div>
1.1 dsieger 4494: <p><code class="filename">Makefile</code> variables contain strings that
1.154 rillig 4495: can be processed using the five operators <code class="code">=</code>,
4496: <code class="code">+=</code>, <code class="code">?=</code>, <code class="code">:=</code> and
1.174 leot 4497: <code class="code">!=</code>, which are described in the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man
1.1 dsieger 4498: page.</p>
4499: <p>When a variable's value is parsed from a
1.154 rillig 4500: <code class="filename">Makefile</code>, the hash character <code class="code">#</code> and
4501: the backslash character <code class="code">\</code> are handled specially. If a
4502: backslash is the last character in a line, that backslash is removed
4503: from the line and the line continues with the next line of the file.</p>
4504: <p>The <code class="code">#</code> character starts a comment that reaches
4505: until the end of the line. To get an actual <code class="code">#</code> character,
4506: such as in a URL, write <code class="code">\#</code> instead.</p>
1.108 rillig 4507: <p>The evaluation of variables either happens immediately or lazy.
1.154 rillig 4508: It happens immediately when the variable occurs on the right-hand
4509: side of the <code class="code">:=</code> or the <code class="code">!=</code> operator, in a
1.108 rillig 4510: <code class="varname">.if</code> condition or a <code class="varname">.for</code> loop.
4511: In the other cases, it is evaluated lazily.</p>
1.1 dsieger 4512: <p>Some of the modifiers split the string into words and then
1.154 rillig 4513: operate on the words, others operate on the string as a whole. When a
4514: string is split into words, double quotes and single quotes are
1.174 leot 4515: interpreted as delimiters, just like in <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?sh+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">sh</span>(1)</span></a>.</p>
1.41 asau 4516: <div class="sect2">
1.1 dsieger 4517: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4518: <a name="makefile.variables.names"></a>14.2.1. Naming conventions</h3></div></div></div>
1.41 asau 4519: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4520: <li class="listitem"><p>All variable names starting with an underscore
1.1 dsieger 4521: are reserved for use by the pkgsrc infrastructure. They shall
1.154 rillig 4522: not be used by packages.</p></li>
1.23 wiz 4523: <li class="listitem"><p>In <span class="command"><strong>.for</strong></span> loops you should use
1.1 dsieger 4524: lowercase variable names for the iteration
4525: variables.</p></li>
1.154 rillig 4526: <li class="listitem"><p>All list variables should have a plural name,
4527: such as <code class="varname">PKG_OPTIONS</code> or
1.1 dsieger 4528: <code class="varname">DISTFILES</code>.</p></li>
4529: </ul></div>
4530: </div>
4531: </div>
1.41 asau 4532: <div class="sect1">
1.1 dsieger 4533: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4534: <a name="makefile.code"></a>14.3. Code snippets</h2></div></div></div>
1.41 asau 4535: <div class="sect2">
1.1 dsieger 4536: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4537: <a name="adding-to-list"></a>14.3.1. Adding things to a list</h3></div></div></div>
1.108 rillig 4538: <p>When adding a string that possibly contains whitespace or quotes to
4539: a list (example 1), it must be quoted using the <code class="code">:Q</code>
4540: modifier.</p>
4541: <p>When adding another list to a list (example 2), it must not be
4542: quoted, since its elements are already quoted.</p>
1.1 dsieger 4543: <pre class="programlisting">
1.108 rillig 4544: STRING= foo * bar `date`
4545: LIST= # empty
4546: ANOTHER_LIST= a=b c=d
4547:
4548: LIST+= ${STRING:Q} # 1
4549: LIST+= ${ANOTHER_LIST} # 2
1.1 dsieger 4550: </pre>
4551: </div>
1.41 asau 4552: <div class="sect2">
1.1 dsieger 4553: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4554: <a name="echo-literal"></a>14.3.2. Echoing a string exactly as-is</h3></div></div></div>
1.108 rillig 4555: <p>Echoing a string containing special characters needs special
4556: work.</p>
1.1 dsieger 4557: <pre class="programlisting">
4558: STRING= foo bar < > * `date` $$HOME ' "
1.108 rillig 4559: EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words
1.1 dsieger 4560:
4561: all:
4562: echo ${STRING} # 1
1.108 rillig 4563: echo ${STRING:Q} # 2
4564: printf '%s\n' ${STRING:Q}'' # 3
4565: env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4
4566: </pre>
4567: <p>Example 1 leads to a syntax error in the shell, as the characters
4568: are just copied.</p>
4569: <p>Example 2 quotes the string so that the shell interprets it
4570: correctly. But the echo command may additionally interpret strings with a
4571: leading dash or those containing backslashes.</p>
1.174 leot 4572: <p>Example 3 can handle arbitrary strings, since <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?printf+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">printf</span>(1)</span></a> only
1.139 leot 4573: interprets the format string, but not the next argument. The trailing
4574: single quotes handle the case when the string is empty. In that case, the
4575: :Q modifier would result in an empty string too, which would then be
1.174 leot 4576: skipped by the shell. For <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?printf+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">printf</span>(1)</span></a> this doesn't make a difference,
1.139 leot 4577: but other programs may care.</p>
1.108 rillig 4578: <p>In example 4, the <code class="varname">EXAMPLE_ENV</code> does not
4579: need to be quoted because the quoting has already been done
4580: when adding elements to the list.</p>
1.1 dsieger 4581: </div>
1.41 asau 4582: <div class="sect2">
1.1 dsieger 4583: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4584: <a name="cflags-gnu-configure"></a>14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</h3></div></div></div>
1.108 rillig 4585: <p>When passing <code class="varname">CFLAGS</code> or similar variables to a
4586: GNU-style configure script (especially those that call other configure
4587: scripts), it must not have leading or trailing whitespace, since
4588: otherwise the configure script gets confused. To trim leading and
4589: trailing whitespace, use the <code class="code">:M</code> modifier, as in the
4590: following example:</p>
1.1 dsieger 4591: <pre class="programlisting">
4592: CPPFLAGS= # empty
1.108 rillig 4593: CPPFLAGS+= -Wundef -DPREFIX=\"${PREFIX}\"
1.1 dsieger 4594: CPPFLAGS+= ${MY_CPPFLAGS}
4595:
4596: CONFIGURE_ARGS+= CPPFLAGS=${CPPFLAGS:M*:Q}
4597:
4598: all:
4599: echo x${CPPFLAGS:Q}x # leading and trailing whitespace
1.108 rillig 4600: echo x${CONFIGURE_ARGS:Q}x # properly trimmed
1.1 dsieger 4601: </pre>
1.108 rillig 4602: <p>In this example, <code class="varname">CPPFLAGS</code> has both leading and
4603: trailing whitespace because the <code class="code">+=</code> operator always adds a
4604: space.</p>
4605: </div>
4606: <div class="sect2">
4607: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4608: <a name="empty-variables"></a>14.3.4. Handling possibly empty variables</h3></div></div></div>
1.108 rillig 4609: <p>When a possibly empty variable is used in a shell program, it may
4610: lead to a syntax error.</p>
4611: <pre class="programlisting">
4612: EGFILES= # empty
4613:
4614: install-examples: # produces a syntax error in the shell
4615: for egfile in ${EGFILES}; do \
4616: echo "Installing $$egfile"; \
4617: done
4618: </pre>
4619: <p>The shell only sees the text <code class="code">for egfile in ; do</code>, since
1.174 leot 4620: <code class="code">${EGFILES}</code> is replaced with an empty string by <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>.
1.108 rillig 4621: To fix this syntax error, use one of the snippets below.</p>
4622: <pre class="programlisting">
4623: EMPTY= # empty
4624:
4625: install-examples:
4626: for egfile in ${EGFILES} ""; do \
4627: [ -n "$$egfile" ] || continue; \
4628: echo "Installing $$egfile"; \
1.1 dsieger 4629: done
1.108 rillig 4630: </pre>
4631: <p>In this case, an empty string is appended to the iteration list (to
4632: prevent the syntax error) and filtered out later.</p>
4633: <pre class="programlisting">
4634: EGFILES= # empty
1.1 dsieger 4635:
1.108 rillig 4636: install-examples:
4637: .for egfile in ${EGFILES}
4638: echo "Installing ${egfile}"
1.1 dsieger 4639: .endfor
4640: </pre>
1.154 rillig 4641: <p>If one of the filenames contains special characters, it should be
4642: enclosed in single or double quotes.</p>
1.108 rillig 4643: <p>To have a shell command test whether a make variable is empty, use
4644: the following code: <code class="code">${TEST} -z ${POSSIBLY_EMPTY:Q}""</code>.</p>
1.1 dsieger 4645: </div>
4646: </div>
4647: </div>
1.41 asau 4648: <div class="chapter">
1.1 dsieger 4649: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 4650: <a name="plist"></a>Chapter 15. PLIST issues</h2></div></div></div>
1.1 dsieger 4651: <div class="toc">
4652: <p><b>Table of Contents</b></p>
1.100 leot 4653: <dl class="toc">
1.154 rillig 4654: <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt>
4655: <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
4656: <dt><span class="sect1"><a href="#print-PLIST">15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt>
4657: <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt>
4658: <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt>
4659: <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
4660: <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt>
4661: <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt>
4662: <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt>
1.1 dsieger 4663: </dl>
4664: </div>
4665: <p>The <code class="filename">PLIST</code> file contains a package's
1.23 wiz 4666: <span class="quote">“<span class="quote">packing list</span>”</span>, i.e. a list of files that belong to
1.1 dsieger 4667: the package (relative to the <code class="filename">${PREFIX}</code>
4668: directory it's been installed in) plus some additional statements
1.174 leot 4669: - see the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_create</span>(1)</span></a> man page for a full list.
1.1 dsieger 4670: This chapter addresses some issues that need attention when
4671: dealing with the <code class="filename">PLIST</code> file (or files, see
4672: below!).</p>
1.41 asau 4673: <div class="sect1">
1.1 dsieger 4674: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4675: <a name="rcs-id"></a>15.1. RCS ID</h2></div></div></div>
1.1 dsieger 4676: <p>Be sure to add a RCS ID line as the first thing in any
4677: <code class="filename">PLIST</code> file you write:</p>
4678: <pre class="programlisting">
1.121 sevan 4679: @comment $NetBSD $
1.111 sevan 4680: </pre>
1.123 wiz 4681: <p>An artificial space has been added between NetBSD and $, this is a
1.121 sevan 4682: workaround here to prevent CVS expanding to the filename of the guide. When
1.125 leot 4683: adding the RCS ID the space should be omitted.</p>
1.1 dsieger 4684: </div>
1.41 asau 4685: <div class="sect1">
1.1 dsieger 4686: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4687: <a name="automatic-plist-generation"></a>15.2. Semi-automatic <code class="filename">PLIST</code> generation</h2></div></div></div>
1.10 hubertf 4688: <p>You can use the <span class="command"><strong>make print-PLIST</strong></span> command
1.1 dsieger 4689: to output a PLIST that matches any new files since the package
1.154 rillig 4690: was extracted. See <a class="xref" href="#build.helpful-targets" title="19.17. Other helpful targets">Section 19.17, “Other helpful targets”</a> for
1.1 dsieger 4691: more information on this target.</p>
4692: </div>
1.41 asau 4693: <div class="sect1">
1.1 dsieger 4694: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4695: <a name="print-PLIST"></a>15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span>
1.1 dsieger 4696: </h2></div></div></div>
4697: <p>The <code class="varname">PRINT_PLIST_AWK</code> variable takes a set
4698: of AWK patterns and actions that are used to filter the output of
4699: print-PLIST. You can <span class="emphasis"><em>append</em></span> any chunk of AWK
4700: scripting you like to it, but be careful with quoting.</p>
4701: <p>For example, to get all files inside the
4702: <code class="filename">libdata/foo</code> directory removed from the
4703: resulting PLIST:</p>
4704: <pre class="programlisting">
4705: PRINT_PLIST_AWK+= /^libdata\/foo/ { next; }
1.111 sevan 4706: </pre>
1.1 dsieger 4707: </div>
1.41 asau 4708: <div class="sect1">
1.1 dsieger 4709: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4710: <a name="plist.misc"></a>15.4. Variable substitution in PLIST</h2></div></div></div>
1.1 dsieger 4711: <p>A number of variables are substituted automatically in
4712: PLISTs when a package is installed on a system. This includes the
4713: following variables:</p>
1.41 asau 4714: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4715: <dt><span class="term"><code class="varname">${MACHINE_ARCH}</code>, <code class="varname">${MACHINE_GNU_ARCH}</code></span></dt>
4716: <dd>
4717: <p>Some packages like emacs and perl embed information
4718: about which architecture they were built on into the
4719: pathnames where they install their files. To handle this
4720: case, PLIST will be preprocessed before actually used, and
4721: the symbol
1.23 wiz 4722: <span class="quote">“<span class="quote"><code class="varname">${MACHINE_ARCH}</code></span>”</span> will be
1.10 hubertf 4723: replaced by what <span class="command"><strong>uname -p</strong></span> gives. The
1.1 dsieger 4724: same is done if the string
4725: <code class="varname">${MACHINE_GNU_ARCH}</code> is embedded in
4726: PLIST somewhere - use this on packages that have GNU
4727: autoconf-created configure scripts.</p>
1.41 asau 4728: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 4729: <h3 class="title">Legacy note</h3>
4730: <p>There used to be a symbol
1.23 wiz 4731: <span class="quote">“<span class="quote"><code class="varname">$ARCH</code></span>”</span> that
1.10 hubertf 4732: was replaced by the output of <span class="command"><strong>uname
1.1 dsieger 4733: -m</strong></span>, but that's no longer supported and has
4734: been removed.</p>
4735: </div>
4736: </dd>
4737: <dt><span class="term"><code class="varname">${OPSYS}</code>, <code class="varname">${LOWER_OPSYS}</code>, <code class="varname">${OS_VERSION}</code></span></dt>
4738: <dd>
4739: <p>Some packages want to embed the OS name and version
4740: into some paths. To do this, use these variables in the
4741: <code class="filename">PLIST</code>:
4742: </p>
1.41 asau 4743: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4744: <li class="listitem"><p><code class="varname">${OPSYS}</code> - output of <span class="quote">“<span class="quote"><span class="command"><strong>uname -s</strong></span></span>”</span></p></li>
4745: <li class="listitem"><p><code class="varname">${LOWER_OPSYS}</code> - lowercase common name (eg. <span class="quote">“<span class="quote">solaris</span>”</span>)</p></li>
4746: <li class="listitem"><p><code class="varname">${OS_VERSION}</code> - <span class="quote">“<span class="quote"><span class="command"><strong>uname -r</strong></span></span>”</span></p></li>
1.1 dsieger 4747: </ul></div>
4748: </dd>
4749: </dl></div>
1.88 tnn 4750: <p>For a list of values which are replaced by
4751: default, the output of <span class="command"><strong>make help topic=PLIST_SUBST</strong></span> as
4752: well as searching the <code class="filename">pkgsrc/mk</code> directory with <span class="command"><strong>grep</strong></span> for
4753: <code class="varname">PLIST_SUBST</code> should help.</p>
1.1 dsieger 4754: <p>If you want to change other variables not listed above, you
4755: can add variables and their expansions to this variable in the
1.154 rillig 4756: following way, similar to <code class="varname">MESSAGE_SUBST</code> (see <a class="xref" href="#components.optional" title="13.5. Optional files">Section 13.5, “Optional files”</a>):</p>
1.1 dsieger 4757: <pre class="programlisting">
4758: PLIST_SUBST+= SOMEVAR="somevalue"
1.111 sevan 4759: </pre>
1.23 wiz 4760: <p>This replaces all occurrences of <span class="quote">“<span class="quote">${SOMEVAR}</span>”</span>
1.1 dsieger 4761: in the <code class="filename">PLIST</code> with
1.23 wiz 4762: <span class="quote">“<span class="quote">somevalue</span>”</span>.</p>
1.18 snj 4763: <p>The <code class="varname">PLIST_VARS</code> variable can be used to simplify
4764: the common case of conditionally including some
4765: <code class="filename">PLIST</code> entries. It can be done by adding
4766: <code class="literal"><code class="varname">PLIST_VARS</code>+=foo</code> and
4767: setting the corresponding <code class="varname">PLIST.foo</code> variable
4768: to <code class="literal">yes</code> if the entry should be included.
1.23 wiz 4769: This will substitute <span class="quote">“<span class="quote"><code class="varname">${PLIST.foo}</code></span>”</span>
1.18 snj 4770: in the <code class="filename">PLIST</code> with either
1.23 wiz 4771: <span class="quote">“<span class="quote"><code class="literal">""</code></span>”</span> or
4772: <span class="quote">“<span class="quote"><code class="literal">"@comment "</code></span>”</span>.
1.18 snj 4773: For example, in <code class="filename">Makefile</code>:</p>
4774: <pre class="programlisting">
1.112 rillig 4775: PLIST_VARS+= foo
1.18 snj 4776: .if <em class="replaceable"><code>condition</code></em>
1.112 rillig 4777: PLIST.foo= yes
1.18 snj 4778: .else
1.111 sevan 4779: </pre>
1.18 snj 4780: <p>And then in <code class="filename">PLIST</code>:</p>
4781: <pre class="programlisting">
1.121 sevan 4782: @comment $NetBSD $
1.18 snj 4783: bin/bar
4784: man/man1/bar.1
4785: ${PLIST.foo}bin/foo
4786: ${PLIST.foo}man/man1/foo.1
4787: ${PLIST.foo}share/bar/foo.data
1.111 sevan 4788: </pre>
1.123 wiz 4789: <p>An artificial space has been added between NetBSD and $, this is a
1.121 sevan 4790: workaround here to prevent CVS expanding to the filename of the guide. When
4791: adding the RCS ID the space should be ommited.</p>
1.1 dsieger 4792: </div>
1.41 asau 4793: <div class="sect1">
1.1 dsieger 4794: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4795: <a name="manpage-compression"></a>15.5. Man page compression</h2></div></div></div>
1.1 dsieger 4796: <p>Man pages should be installed in compressed form if
4797: <code class="varname">MANZ</code> is set (in <code class="filename">bsd.own.mk</code>),
4798: and uncompressed otherwise. To handle this in the
1.23 wiz 4799: <code class="filename">PLIST</code> file, the suffix <span class="quote">“<span class="quote">.gz</span>”</span> is
1.1 dsieger 4800: appended/removed automatically for man pages according to
4801: <code class="varname">MANZ</code> and <code class="varname">MANCOMPRESSED</code> being set
4802: or not, see above for details. This modification of the
4803: <code class="filename">PLIST</code> file is done on a copy of it, not
4804: <code class="filename">PLIST</code> itself.</p>
4805: </div>
1.41 asau 4806: <div class="sect1">
1.1 dsieger 4807: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4808: <a name="using-PLIST_SRC"></a>15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code>
1.1 dsieger 4809: </h2></div></div></div>
4810: <p>To use one or more files as source for the <code class="filename">PLIST</code> used
4811: in generating the binary package, set the variable
4812: <code class="varname">PLIST_SRC</code> to the names of that file(s).
1.174 leot 4813: The files are later concatenated using <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?cat+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">cat</span>(1)</span></a>, and the order of things is
1.1 dsieger 4814: important. The default for <code class="varname">PLIST_SRC</code> is
4815: <code class="filename">${PKGDIR}/PLIST</code>.</p>
4816: </div>
1.41 asau 4817: <div class="sect1">
1.1 dsieger 4818: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4819: <a name="platform-specific-plist"></a>15.7. Platform-specific and differing PLISTs</h2></div></div></div>
1.1 dsieger 4820: <p>Some packages decide to install a different set of files based on
4821: the operating system being used. These differences can be
4822: automatically handled by using the following files:</p>
1.41 asau 4823: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4824: <li class="listitem"><p><code class="filename">PLIST.common</code></p></li>
4825: <li class="listitem"><p><code class="filename">PLIST.${OPSYS}</code></p></li>
4826: <li class="listitem"><p><code class="filename">PLIST.${MACHINE_ARCH}</code></p></li>
4827: <li class="listitem"><p><code class="filename">PLIST.${OPSYS}-${MACHINE_ARCH}</code></p></li>
4828: <li class="listitem"><p><code class="filename">PLIST.common_end</code></p></li>
1.1 dsieger 4829: </ul></div>
4830: </div>
1.41 asau 4831: <div class="sect1">
1.1 dsieger 4832: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4833: <a name="build-plist"></a>15.8. Build-specific PLISTs</h2></div></div></div>
1.86 wiz 4834: <p>Some packages decide to generate hard-to-guess file names
4835: during installation that are hard to wire down.</p>
4836: <p>In such cases, you can set the
4837: <code class="varname">GENERATE_PLIST</code> variable to shell code
4838: terminated (with a semicolon) that will output PLIST entries which
4839: will be appended to the PLIST</p>
4840: <p>You can find one example in editors/xemacs:</p>
4841: <pre class="programlisting">
1.111 sevan 4842: GENERATE_PLIST+= ${ECHO} bin/${DISTNAME}-`${WRKSRC}/src/xemacs -sd`.dmp ;
4843: </pre>
1.86 wiz 4844: <p>which will append something like
4845: <code class="filename">bin/xemacs-21.4.23-54e8ea71.dmp</code> to the
4846: <code class="filename">PLIST</code>.
4847: </p>
4848: </div>
4849: <div class="sect1">
4850: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4851: <a name="faq.common-dirs"></a>15.9. Sharing directories between packages</h2></div></div></div>
1.23 wiz 4852: <p>A <span class="quote">“<span class="quote">shared directory</span>”</span> is a directory where
1.1 dsieger 4853: multiple (and unrelated) packages install files. These
1.22 jakllsch 4854: directories were problematic because you had to add special
4855: tricks in the PLIST to conditionally remove them, or have some
1.1 dsieger 4856: centralized package handle them.</p>
1.22 jakllsch 4857: <p>In pkgsrc, it is now easy: Each package should create
4858: directories and install files as needed; <span class="command"><strong>pkg_delete</strong></span>
4859: will remove any directories left empty after uninstalling a
4860: package.</p>
4861: <p>If a package needs an empty directory to work, create
4862: the directory during installation as usual, and also add an
4863: entry to the PLIST:
1.111 sevan 4864:
4865: </p>
1.1 dsieger 4866: <pre class="programlisting">
1.22 jakllsch 4867: @pkgdir path/to/empty/directory
1.111 sevan 4868: </pre>
1.22 jakllsch 4869: <p>
1.111 sevan 4870:
1.86 wiz 4871: or take a look at <code class="varname">MAKE_DIRS</code> and
4872: <code class="varname">OWN_DIRS</code>.
1.22 jakllsch 4873: </p>
1.1 dsieger 4874: </div>
4875: </div>
1.41 asau 4876: <div class="chapter">
1.1 dsieger 4877: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 4878: <a name="buildlink"></a>Chapter 16. Buildlink methodology</h2></div></div></div>
1.1 dsieger 4879: <div class="toc">
4880: <p><b>Table of Contents</b></p>
1.100 leot 4881: <dl class="toc">
1.154 rillig 4882: <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt>
4883: <dt><span class="sect1"><a href="#creating-buildlink3.mk">16.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.1 dsieger 4884: <dd><dl>
1.154 rillig 4885: <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt>
4886: <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating
1.26 wiz 4887: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
4888: and
4889: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
4890: in <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.1 dsieger 4891: </dl></dd>
1.154 rillig 4892: <dt><span class="sect1"><a href="#writing-builtin.mk">16.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt>
1.1 dsieger 4893: <dd><dl>
1.154 rillig 4894: <dt><span class="sect2"><a href="#anatomy-of-builtin.mk">16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt>
4895: <dt><span class="sect2"><a href="#native-or-pkgsrc-preference">16.3.2. Global preferences for native or pkgsrc software</a></span></dt>
1.1 dsieger 4896: </dl></dd>
4897: </dl>
4898: </div>
4899: <p>Buildlink is a framework in pkgsrc that controls what headers and libraries
4900: are seen by a package's configure and build processes. This is implemented
4901: in a two step process:</p>
1.23 wiz 4902: <div class="orderedlist"><ol class="orderedlist" type="1">
4903: <li class="listitem"><p>Symlink headers and libraries for dependencies into
1.1 dsieger 4904: <code class="varname">BUILDLINK_DIR</code>, which by default is a subdirectory
4905: of <code class="varname">WRKDIR</code>.</p></li>
1.23 wiz 4906: <li class="listitem"><p>Create wrapper scripts that are used in place of the normal compiler
1.1 dsieger 4907: tools that translate <code class="option">-I${LOCALBASE}/include</code> and
4908: <code class="option">-L${LOCALBASE}/lib</code> into references to
4909: <code class="varname">BUILDLINK_DIR</code>. The wrapper scripts also make
4910: native compiler on some operating systems look like GCC, so that
4911: packages that expect GCC won't require modifications to build with
4912: those native compilers.</p></li>
4913: </ol></div>
4914: <p>This normalizes the environment in which a package is built so that the
4915: package may be built consistently despite what other software may be
4916: installed. Please note that the normal system header and library paths,
4917: e.g. <code class="filename">/usr/include</code>,
4918: <code class="filename">/usr/lib</code>, etc., are always searched -- buildlink3 is
4919: designed to insulate the package build from non-system-supplied
4920: software.</p>
1.41 asau 4921: <div class="sect1">
1.1 dsieger 4922: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4923: <a name="converting-to-buildlink3"></a>16.1. Converting packages to use buildlink3</h2></div></div></div>
1.1 dsieger 4924: <p>The process of converting packages to use the buildlink3
1.23 wiz 4925: framework (<span class="quote">“<span class="quote">bl3ifying</span>”</span>) is fairly straightforward.
1.1 dsieger 4926: The things to keep in mind are:</p>
1.23 wiz 4927: <div class="orderedlist"><ol class="orderedlist" type="1">
4928: <li class="listitem"><p>Ensure that the build always calls the wrapper scripts
1.1 dsieger 4929: instead of the actual toolchain. Some packages are tricky,
4930: and the only way to know for sure is the check
4931: <code class="filename">${WRKDIR}/.work.log</code> to see if the
4932: wrappers are being invoked.</p></li>
1.23 wiz 4933: <li class="listitem"><p>Don't override <code class="varname">PREFIX</code> from within
1.1 dsieger 4934: the package Makefile, e.g. Java VMs, standalone shells,
4935: etc., because the code to symlink files into
4936: <code class="filename">${BUILDLINK_DIR}</code> looks for files
1.23 wiz 4937: relative to <span class="quote">“<span class="quote">pkg_info -qp <em class="replaceable"><code>pkgname</code></em></span>”</span>.
1.1 dsieger 4938: </p></li>
1.23 wiz 4939: <li class="listitem"><p>Remember that <span class="emphasis"><em>only</em></span> the
1.1 dsieger 4940: <code class="filename">buildlink3.mk</code> files that you list in a
4941: package's Makefile are added as dependencies for that package.
4942: </p></li>
4943: </ol></div>
4944: <p>If a dependency on a particular package is required for its libraries and
4945: headers, then we replace:</p>
4946: <pre class="programlisting">
4947: DEPENDS+= foo>=1.1.0:../../category/foo
4948: </pre>
4949: <p>with</p>
4950: <pre class="programlisting">
4951: .include "../../category/foo/buildlink3.mk"
4952: </pre>
4953: <p>The buildlink3.mk files usually define the required dependencies.
4954: If you need a newer version of the dependency when using buildlink3.mk
4955: files, then you can define it in your Makefile; for example:</p>
4956: <pre class="programlisting">
4957: BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0
4958: .include "../../category/foo/buildlink3.mk"
4959: </pre>
4960: <p>There are several <code class="filename">buildlink3.mk</code>
4961: files in <code class="filename">pkgsrc/mk</code>
4962: that handle special package issues:</p>
1.41 asau 4963: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4964: <li class="listitem"><p><code class="filename">bdb.buildlink3.mk</code> chooses either
1.1 dsieger 4965: the native or a pkgsrc Berkeley DB implementation based on
4966: the values of <code class="varname">BDB_ACCEPTED</code> and
4967: <code class="varname">BDB_DEFAULT</code>.</p></li>
1.23 wiz 4968: <li class="listitem"><p><code class="filename">curses.buildlink3.mk</code>: If the system
1.1 dsieger 4969: comes with neither Curses nor NCurses, this will take care
1.137 leot 4970: to install the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/ncurses/README.html" target="_top"><code class="filename">devel/ncurses</code></a> package.</p></li>
1.23 wiz 4971: <li class="listitem"><p><code class="filename">krb5.buildlink3.mk</code> uses the value
1.1 dsieger 4972: of <code class="varname">KRB5_ACCEPTED</code> to choose between
4973: adding a dependency on Heimdal or MIT-krb5 for packages that
4974: require a Kerberos 5 implementation.</p></li>
1.23 wiz 4975: <li class="listitem"><p><code class="filename">motif.buildlink3.mk</code> checks for a
1.1 dsieger 4976: system-provided Motif installation or adds a dependency on
1.137 leot 4977: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/x11/lesstif/README.html" target="_top"><code class="filename">x11/lesstif</code></a> or <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/x11/motif/README.html" target="_top"><code class="filename">x11/motif</code></a>. The user can set
1.23 wiz 4978: <code class="varname">MOTIF_TYPE</code> to <span class="quote">“<span class="quote">dt</span>”</span>,
1.126 leot 4979: <span class="quote">“<span class="quote">lesstif</span>”</span> or <span class="quote">“<span class="quote">motif</span>”</span>
4980: to choose which Motif version will be used.</p></li>
1.55 ryoon 4981: <li class="listitem"><p><code class="filename">readline.buildlink3.mk</code> checks for a
1.56 wiz 4982: system-provided GNU readline or editline (libedit) installation,
1.137 leot 4983: or adds a dependency on <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/readline/README.html" target="_top"><code class="filename">devel/readline</code></a>,
4984: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/editline/README.html" target="_top"><code class="filename">devel/editline</code></a>. The user can set
1.55 ryoon 4985: <code class="varname">READLINE_DEFAULT</code> to choose readline implementation.
4986: If your package really needs GNU readline library, its Makefile
4987: should include <code class="filename">devel/readline/buildlink3.mk</code>
4988: instead of <code class="filename">readline.buildlink3.mk</code>.</p></li>
1.23 wiz 4989: <li class="listitem"><p><code class="filename">oss.buildlink3.mk</code> defines several
1.1 dsieger 4990: variables that may be used by packages that use the
4991: Open Sound System (OSS) API.</p></li>
1.23 wiz 4992: <li class="listitem"><p><code class="filename">pgsql.buildlink3.mk</code> will accept
1.35 wiz 4993: any of the Postgres versions in the variable
4994: <code class="varname">PGSQL_VERSIONS_ACCEPTED</code> and default to
4995: the version <code class="varname">PGSQL_VERSION_DEFAULT</code>. See
1.1 dsieger 4996: the file for more information.</p></li>
1.23 wiz 4997: <li class="listitem"><p><code class="filename">pthread.buildlink3.mk</code> uses the value of
1.1 dsieger 4998: <code class="varname">PTHREAD_OPTS</code> and checks for native pthreads or adds
1.137 leot 4999: a dependency on <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/pth/README.html" target="_top"><code class="filename">devel/pth</code></a> as needed.</p></li>
1.23 wiz 5000: <li class="listitem"><p><code class="filename">xaw.buildlink3.mk</code> uses the value of
1.1 dsieger 5001: <code class="varname">XAW_TYPE</code> to choose a particular Athena widgets
5002: library.</p></li>
5003: </ul></div>
5004: <p>The comments in those <code class="filename">buildlink3.mk</code>
5005: files provide a more complete
5006: description of how to use them properly.</p>
5007: </div>
1.41 asau 5008: <div class="sect1">
1.1 dsieger 5009: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5010: <a name="creating-buildlink3.mk"></a>16.2. Writing <code class="filename">buildlink3.mk</code> files</h2></div></div></div>
1.7 rillig 5011: <a name="buildlink3.mk"></a><p>A package's <code class="filename">buildlink3.mk</code> file is
1.1 dsieger 5012: included by Makefiles to indicate the need to compile and link
5013: against header files and libraries provided by the package. A
5014: <code class="filename">buildlink3.mk</code> file should always provide
5015: enough information to add the correct type of dependency
5016: relationship and include any other
5017: <code class="filename">buildlink3.mk</code> files that it needs to find
5018: headers and libraries that it needs in turn.</p>
5019: <p>To generate an initial <code class="filename">buildlink3.mk</code>
1.137 leot 5020: file for further editing, Rene Hexel's <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/createbuildlink/README.html" target="_top"><code class="filename">pkgtools/createbuildlink</code></a>
1.1 dsieger 5021: package is highly recommended. For most packages, the following
5022: command will generate a good starting point for
5023: <code class="filename">buildlink3.mk</code> files:</p>
5024: <pre class="screen">
5025: <code class="prompt">%</code> <strong class="userinput"><code>cd pkgsrc/<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>pkgdir</code></em>
5026: <code class="prompt">%</code> createbuildlink >buildlink3.mk</code></strong>
5027: </pre>
1.41 asau 5028: <div class="sect2">
1.1 dsieger 5029: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5030: <a name="anatomy-of-bl3"></a>16.2.1. Anatomy of a buildlink3.mk file</h3></div></div></div>
1.1 dsieger 5031: <p>The following real-life example
5032: <code class="filename">buildlink3.mk</code> is taken
5033: from <code class="filename">pkgsrc/graphics/tiff</code>:</p>
5034: <pre class="programlisting">
1.18 snj 5035: # $NetBSD: buildlink3.mk,v 1.16 2009/03/20 19:24:45 joerg Exp $
1.1 dsieger 5036:
1.112 rillig 5037: BUILDLINK_TREE+= tiff
1.1 dsieger 5038:
1.18 snj 5039: .if !defined(TIFF_BUILDLINK3_MK)
5040: TIFF_BUILDLINK3_MK:=
1.1 dsieger 5041:
1.112 rillig 5042: BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1
5043: BUILDLINK_ABI_DEPENDS.tiff+= tiff>=3.7.2nb1
5044: BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
1.1 dsieger 5045:
5046: .include "../../devel/zlib/buildlink3.mk"
5047: .include "../../graphics/jpeg/buildlink3.mk"
1.18 snj 5048: .endif # TIFF_BUILDLINK3_MK
1.1 dsieger 5049:
1.112 rillig 5050: BUILDLINK_TREE+= -tiff
1.1 dsieger 5051: </pre>
5052: <p>The header and footer manipulate
1.18 snj 5053: <code class="varname">BUILDLINK_TREE</code>, which is common across all
1.1 dsieger 5054: <code class="filename">buildlink3.mk</code> files and is used to track
1.18 snj 5055: the dependency tree.</p>
5056: <p>The main section is protected from multiple inclusion
1.1 dsieger 5057: and controls how the dependency on <em class="replaceable"><code>pkg</code></em> is
5058: added. Several important variables are set in the section:</p>
1.41 asau 5059: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5060: <li class="listitem"><p><code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5061: is the actual dependency recorded in the installed
5062: package; this should always be set using
1.10 hubertf 5063: <span class="command"><strong>+=</strong></span> to ensure that
1.1 dsieger 5064: we're appending to any pre-existing list of values. This
5065: variable should be set to the first version of the
1.26 wiz 5066: package that had an backwards-incompatible API change.
1.1 dsieger 5067: </p></li>
1.23 wiz 5068: <li class="listitem"><p><code class="varname">BUILDLINK_PKGSRCDIR.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5069: is the location of the <em class="replaceable"><code>pkg</code></em>
5070: pkgsrc directory.</p></li>
1.23 wiz 5071: <li class="listitem"><p><code class="varname">BUILDLINK_DEPMETHOD.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5072: (not shown above) controls whether we use
5073: <code class="varname">BUILD_DEPENDS</code> or
5074: <code class="varname">DEPENDS</code> to add the dependency on
5075: <em class="replaceable"><code>pkg</code></em>. The build dependency is
5076: selected by setting
5077: <code class="varname">BUILDLINK_DEPMETHOD.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5078: to <span class="quote">“<span class="quote">build</span>”</span>. By default, the full dependency is
1.1 dsieger 5079: used.</p></li>
1.23 wiz 5080: <li class="listitem"><p><code class="varname">BUILDLINK_INCDIRS.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5081: and
5082: <code class="varname">BUILDLINK_LIBDIRS.<em class="replaceable"><code>pkg</code></em></code>
5083: (not shown above) are lists of subdirectories of
5084: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>
5085: to add to the header and library search paths. These
1.23 wiz 5086: default to <span class="quote">“<span class="quote">include</span>”</span> and <span class="quote">“<span class="quote">lib</span>”</span>
1.1 dsieger 5087: respectively.</p></li>
1.23 wiz 5088: <li class="listitem"><p><code class="varname">BUILDLINK_CPPFLAGS.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5089: (not shown above) is the list of preprocessor flags to add
5090: to <code class="varname">CPPFLAGS</code>, which are passed on to the
1.23 wiz 5091: configure and build phases. The <span class="quote">“<span class="quote">-I</span>”</span> option
1.1 dsieger 5092: should be avoided and instead be handled using
5093: <code class="varname">BUILDLINK_INCDIRS.<em class="replaceable"><code>pkg</code></em></code> as
5094: above.</p></li>
5095: </ul></div>
5096: <p>The following variables are all optionally defined within
5097: this second section (protected against multiple inclusion) and
5098: control which package files are symlinked into
5099: <code class="filename">${BUILDLINK_DIR}</code> and how their names are
5100: transformed during the symlinking:</p>
1.41 asau 5101: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5102: <li class="listitem"><p><code class="varname">BUILDLINK_FILES.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5103: (not shown above) is a shell glob pattern relative to
5104: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>
5105: to be symlinked into
5106: <code class="filename">${BUILDLINK_DIR}</code>,
5107: e.g. <code class="filename">include/*.h</code>.</p></li>
1.23 wiz 5108: <li class="listitem"><p><code class="varname">BUILDLINK_FILES_CMD.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5109: (not shown above) is a shell pipeline that
5110: outputs to stdout a list of files relative to
5111: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>.
5112: The resulting files are to be symlinked
5113: into <code class="filename">${BUILDLINK_DIR}</code>. By default,
5114: this takes the <code class="filename">+CONTENTS</code> of a
5115: <em class="replaceable"><code>pkg</code></em> and filters it through
5116: <code class="varname">${BUILDLINK_CONTENTS_FILTER.<em class="replaceable"><code>pkg</code></em>}</code>.</p></li>
1.23 wiz 5117: <li class="listitem"><p><code class="varname">BUILDLINK_CONTENTS_FILTER.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5118: (not shown above) is a filter command that filters
5119: <code class="filename">+CONTENTS</code> input into a list of files
5120: relative to
5121: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>
1.84 wiz 5122: on stdout. By default,
1.1 dsieger 5123: <code class="varname">BUILDLINK_CONTENTS_FILTER.<em class="replaceable"><code>pkg</code></em></code>
5124: outputs the contents of the <code class="filename">include</code>
5125: and <code class="filename">lib</code> directories in the package
1.84 wiz 5126: <code class="filename">+CONTENTS</code>.</p></li>
1.23 wiz 5127: <li class="listitem"><p><code class="varname">BUILDLINK_FNAME_TRANSFORM.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5128: (not shown above) is a list of sed arguments used to
5129: transform the name of the source filename into a
1.10 hubertf 5130: destination filename, e.g. <span class="command"><strong>-e
1.1 dsieger 5131: "s|/curses.h|/ncurses.h|g"</strong></span>.</p></li>
5132: </ul></div>
1.18 snj 5133: <p>This section can additionally include any
1.1 dsieger 5134: <code class="filename">buildlink3.mk</code> needed for
5135: <em class="replaceable"><code>pkg</code></em>'s library dependencies.
5136: Including these <code class="filename">buildlink3.mk</code> files
5137: means that the headers and libraries for these
5138: dependencies are also symlinked into
5139: <code class="filename">${BUILDLINK_DIR}</code>
5140: whenever the <em class="replaceable"><code>pkg</code></em>
5141: <code class="filename">buildlink3.mk</code>
1.18 snj 5142: file is included. Dependencies are only added for directly
5143: include <code class="filename">buildlink3.mk</code> files.</p>
1.47 wiz 5144: <p>When providing a <code class="filename">buildlink3.mk</code> and
5145: including other <code class="filename">buildlink3.mk</code> files in it,
1.50 wiz 5146: please only add necessary ones, i.e., those whose libraries or
1.47 wiz 5147: header files are automatically exposed when the package is
5148: use.</p>
5149: <p>In particular, if only an executable
5150: (<code class="filename">bin/foo</code>) is linked against a library, that
5151: library does not need to be propagated in the
5152: <code class="filename">buildlink3.mk</code> file.</p>
5153: <p>The following steps should help you decide if a
5154: <code class="filename">buildlink3.mk</code> file needs to be included:
5155: </p>
5156: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
5157: <li class="listitem"><p>Look at the installed header files: What
5158: headers do they include? The packages providing these files
5159: must be buildlinked.</p></li>
1.49 wiz 5160: <li class="listitem"><p>Run <code class="filename">ldd</code> on all installed
5161: libraries and look against what other libraries they link.
5162: Some of the packages providing these probably need to be
5163: buildlinked; however, it's not automatic, since e.g. GTK on
5164: some systems pulls in the X libraries, so they will show up in
5165: the <code class="filename">ldd</code> output, while on others (like OS
1.50 wiz 5166: X) it won't. <code class="filename">ldd</code> output can thus only be
1.49 wiz 5167: used as a hint.</p></li>
1.47 wiz 5168: </ul></div>
5169: <p>
5170: </p>
1.1 dsieger 5171: </div>
1.41 asau 5172: <div class="sect2">
1.1 dsieger 5173: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5174: <a name="updating-buildlink-depends"></a>16.2.2. Updating
1.1 dsieger 5175: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.26 wiz 5176: and
5177: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5178: in <code class="filename">buildlink3.mk</code> files</h3></div></div></div>
5179: <p>These two variables differ in that one describes source
5180: compatibility (API) and the other binary compatibility (ABI).
5181: The difference is that a change in the API breaks compilation of
5182: programs while changes in the ABI stop compiled programs from
5183: running.</p>
5184: <p>Changes to the
1.27 wiz 5185: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.26 wiz 5186: variable in a <code class="filename">buildlink3.mk</code> file happen
5187: very rarely. One possible reason is that all packages depending
5188: on this already need a newer version. In case it is bumped see
5189: the description below.</p>
5190: <p>The most common example of an ABI change is that the major
5191: version of a shared library is increased. In this case,
5192: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5193: should be adjusted to require at least the new package version.
5194: Then the packages that depend on this package need their
5195: <code class="varname">PKGREVISION</code>s increased and, if they have
5196: <code class="filename">buildlink3.mk</code> files, their
5197: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5198: adjusted, too. This is needed so pkgsrc will require the correct
5199: package dependency and not settle for an older one when building
5200: the source.</p>
1.154 rillig 5201: <p>See <a class="xref" href="#dependencies" title="21.1.5. Handling dependencies">Section 21.1.5, “Handling dependencies”</a> for
1.26 wiz 5202: more information about dependencies on other packages,
5203: including the <code class="varname">BUILDLINK_ABI_DEPENDS</code> and
1.1 dsieger 5204: <code class="varname">ABI_DEPENDS</code> definitions.</p>
5205: <p>Please take careful consideration before adjusting
5206: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5207: or
5208: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5209: as we don't want to cause unneeded package deletions and
5210: rebuilds. In many cases, new versions of packages work just
5211: fine with older dependencies.</p>
5212: <p>Also it is not needed to set
1.26 wiz 5213: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5214: when it is identical to
1.1 dsieger 5215: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>. </p>
5216: </div>
5217: </div>
1.41 asau 5218: <div class="sect1">
1.1 dsieger 5219: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5220: <a name="writing-builtin.mk"></a>16.3. Writing <code class="filename">builtin.mk</code> files</h2></div></div></div>
1.1 dsieger 5221: <p>Some packages in pkgsrc install headers and libraries that
5222: coincide with headers and libraries present in the base system.
5223: Aside from a <code class="filename">buildlink3.mk</code> file, these
5224: packages should also include a <code class="filename">builtin.mk</code>
5225: file that includes the necessary checks to decide whether using
5226: the built-in software or the pkgsrc software is
5227: appropriate.</p>
5228: <p>The only requirements of a builtin.mk file for
5229: <em class="replaceable"><code>pkg</code></em> are:</p>
1.23 wiz 5230: <div class="orderedlist"><ol class="orderedlist" type="1">
5231: <li class="listitem"><p>It should set
1.1 dsieger 5232: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5233: to either <span class="quote">“<span class="quote">yes</span>”</span> or <span class="quote">“<span class="quote">no</span>”</span>
1.1 dsieger 5234: after it is included.</p></li>
1.23 wiz 5235: <li class="listitem"><p>It should <span class="emphasis"><em>not</em></span> override any
1.1 dsieger 5236: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5237: which is already set before the
5238: <code class="filename">builtin.mk</code> file is included.</p></li>
1.23 wiz 5239: <li class="listitem"><p>It should be written to allow multiple inclusion. This
1.1 dsieger 5240: is <span class="emphasis"><em>very</em></span> important and takes careful
5241: attention to <code class="filename">Makefile</code> coding.</p></li>
5242: </ol></div>
1.41 asau 5243: <div class="sect2">
1.1 dsieger 5244: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5245: <a name="anatomy-of-builtin.mk"></a>16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</h3></div></div></div>
1.1 dsieger 5246: <p>The following is the recommended template for builtin.mk
5247: files:</p>
5248: <pre class="programlisting">
5249: .if !defined(IS_BUILTIN.foo)
5250: #
5251: # IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo"
5252: # genuinely exists in the system or not.
5253: #
5254: IS_BUILTIN.foo?= no
5255:
5256: # BUILTIN_PKG.foo should be set here if "foo" is built-in and its package
5257: # version can be determined.
5258: #
5259: . if !empty(IS_BUILTIN.foo:M[yY][eE][sS])
5260: BUILTIN_PKG.foo?= foo-1.0
5261: . endif
5262: .endif # IS_BUILTIN.foo
5263:
5264: .if !defined(USE_BUILTIN.foo)
5265: USE_BUILTIN.foo?= ${IS_BUILTIN.foo}
5266: . if defined(BUILTIN_PKG.foo)
5267: . for _depend_ in ${BUILDLINK_API_DEPENDS.foo}
5268: . if !empty(USE_BUILTIN.foo:M[yY][eE][sS])
5269: USE_BUILTIN.foo!= \
5270: ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo} \
5271: && ${ECHO} "yes" || ${ECHO} "no"
5272: . endif
5273: . endfor
5274: . endif
5275: .endif # USE_BUILTIN.foo
5276:
5277: CHECK_BUILTIN.foo?= no
5278: .if !empty(CHECK_BUILTIN.foo:M[nN][oO])
5279: #
5280: # Here we place code that depends on whether USE_BUILTIN.foo is set to
5281: # "yes" or "no".
5282: #
5283: .endif # CHECK_BUILTIN.foo
5284: </pre>
5285: <p>The first section sets
5286: <code class="varname">IS_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5287: depending on if <em class="replaceable"><code>pkg</code></em> really exists
5288: in the base system. This should not be a base system software
5289: with similar functionality to <em class="replaceable"><code>pkg</code></em>;
1.23 wiz 5290: it should only be <span class="quote">“<span class="quote">yes</span>”</span> if the actual package is
1.1 dsieger 5291: included as part of the base system. This variable is only
5292: used internally within the <code class="filename">builtin.mk</code>
5293: file.</p>
5294: <p>The second section sets
5295: <code class="varname">BUILTIN_PKG.<em class="replaceable"><code>pkg</code></em></code>
5296: to the version of <em class="replaceable"><code>pkg</code></em> in the base
5297: system if it exists (if
5298: <code class="varname">IS_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5299: is <span class="quote">“<span class="quote">yes</span>”</span>). This variable is only used internally
1.1 dsieger 5300: within the <code class="filename">builtin.mk</code> file.</p>
5301: <p>The third section sets
5302: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5303: and is <span class="emphasis"><em>required</em></span> in all
5304: <code class="filename">builtin.mk</code> files. The code in this
5305: section must make the determination whether the built-in
5306: software is adequate to satisfy the dependencies listed in
5307: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>.
5308: This is typically done by comparing
5309: <code class="varname">BUILTIN_PKG.<em class="replaceable"><code>pkg</code></em></code>
5310: against each of the dependencies in
5311: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>.
5312: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5313: <span class="emphasis"><em>must</em></span> be set to the correct value by the
5314: end of the <code class="filename">builtin.mk</code> file. Note that
5315: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5316: may be <span class="quote">“<span class="quote">yes</span>”</span> even if
1.1 dsieger 5317: <code class="varname">IS_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5318: is <span class="quote">“<span class="quote">no</span>”</span> because we may make the determination
1.1 dsieger 5319: that the built-in version of the software is similar enough to
5320: be used as a replacement.</p>
5321: <p>The last section is guarded by
5322: <code class="varname">CHECK_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>,
5323: and includes code that uses the value of
5324: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5325: set in the previous section. This typically includes, e.g.,
5326: adding additional dependency restrictions and listing additional
5327: files to symlink into <code class="filename">${BUILDLINK_DIR}</code> (via
5328: <code class="varname">BUILDLINK_FILES.<em class="replaceable"><code>pkg</code></em></code>).</p>
5329: </div>
1.41 asau 5330: <div class="sect2">
1.1 dsieger 5331: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5332: <a name="native-or-pkgsrc-preference"></a>16.3.2. Global preferences for native or pkgsrc software</h3></div></div></div>
1.1 dsieger 5333: <p>When building packages, it's possible to choose whether to set
5334: a global preference for using either the built-in (native)
5335: version or the pkgsrc version of software to satisfy a
5336: dependency. This is controlled by setting
5337: <code class="varname">PREFER_PKGSRC</code> and
5338: <code class="varname">PREFER_NATIVE</code>. These variables take values
1.23 wiz 5339: of either <span class="quote">“<span class="quote">yes</span>”</span>, <span class="quote">“<span class="quote">no</span>”</span>, or a list of
1.1 dsieger 5340: packages. <code class="varname">PREFER_PKGSRC</code> tells pkgsrc to
5341: use the pkgsrc versions of software, while
5342: <code class="varname">PREFER_NATIVE</code> tells pkgsrc to use the
5343: built-in versions. Preferences are determined by the most
5344: specific instance of the package in either
5345: <code class="varname">PREFER_PKGSRC</code> or
5346: <code class="varname">PREFER_NATIVE</code>. If a package is specified
5347: in neither or in both variables, then
5348: <code class="varname">PREFER_PKGSRC</code> has precedence over
5349: <code class="varname">PREFER_NATIVE</code>. For example, to require
5350: using pkgsrc versions of software for all but the most basic
5351: bits on a NetBSD system, you can set:</p>
5352: <pre class="programlisting">
5353: PREFER_PKGSRC= yes
5354: PREFER_NATIVE= getopt skey tcp_wrappers
5355: </pre>
5356: <p>A package <span class="emphasis"><em>must</em></span> have a
5357: <code class="filename">builtin.mk</code>
5358: file to be listed in <code class="varname">PREFER_NATIVE</code>,
5359: otherwise it is simply ignored in that list.</p>
1.117 sevan 5360: <p>Setting <code class="varname">PREFER_NATIVE</code> should be performed
5361: straight after bootstrap and <code class="varname">PREFER_PKGSRC</code> during
5362: bootstrap.
5363: Switching between settings globally at a later date can introduce
5364: complications with dependency resolution. This is caused by packages
5365: built with the opposite preference being installed alongside each other.</p>
5366: <pre class="screen">
5367: <code class="prompt">#</code> <strong class="userinput"><code>./bootstrap --prefer-pkgsrc yes</code></strong>
5368: </pre>
1.1 dsieger 5369: </div>
5370: </div>
5371: </div>
1.41 asau 5372: <div class="chapter">
1.1 dsieger 5373: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 5374: <a name="pkginstall"></a>Chapter 17. The pkginstall framework</h2></div></div></div>
1.1 dsieger 5375: <div class="toc">
5376: <p><b>Table of Contents</b></p>
1.100 leot 5377: <dl class="toc">
1.154 rillig 5378: <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt>
1.1 dsieger 5379: <dd><dl>
1.154 rillig 5380: <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt>
5381: <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt>
1.1 dsieger 5382: </dl></dd>
1.154 rillig 5383: <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt>
1.1 dsieger 5384: <dd><dl>
1.154 rillig 5385: <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt>
5386: <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt>
5387: <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt>
5388: <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt>
5389: </dl></dd>
5390: <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt>
5391: <dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">17.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd>
5392: <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt>
5393: <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt>
5394: <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd>
5395: <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt>
5396: <dd><dl><dt><span class="sect2"><a href="#fonts-disable">17.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd>
1.1 dsieger 5397: </dl>
5398: </div>
5399: <p>This chapter describes the framework known as
5400: <code class="literal">pkginstall</code>, whose key features are:</p>
1.41 asau 5401: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5402: <li class="listitem"><p>Generic installation and manipulation of directories and files
1.1 dsieger 5403: outside the pkgsrc-handled tree, <code class="varname">LOCALBASE</code>.</p></li>
1.23 wiz 5404: <li class="listitem"><p>Automatic handling of configuration files during installation,
1.1 dsieger 5405: provided that packages are correctly designed.</p></li>
1.23 wiz 5406: <li class="listitem"><p>Generation and installation of system startup scripts.</p></li>
5407: <li class="listitem"><p>Registration of system users and groups.</p></li>
5408: <li class="listitem"><p>Registration of system shells.</p></li>
5409: <li class="listitem"><p>Automatic updating of fonts databases.</p></li>
1.1 dsieger 5410: </ul></div>
5411: <p>The following sections inspect each of the above points in detail.</p>
5412: <p>You may be thinking that many of the things described here could be
5413: easily done with simple code in the package's post-installation target
5414: (<code class="literal">post-install</code>). <span class="emphasis"><em>This is incorrect</em></span>,
5415: as the code in them is only executed when building from source. Machines
5416: using binary packages could not benefit from it at all (as the code itself
5417: could be unavailable). Therefore, the only way to achieve any of the items
5418: described above is by means of the installation scripts, which are
5419: automatically generated by pkginstall.</p>
1.41 asau 5420: <div class="sect1">
1.1 dsieger 5421: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5422: <a name="files-and-dirs-outside-prefix"></a>17.1. Files and directories outside the installation prefix</h2></div></div></div>
1.1 dsieger 5423: <p>As you already know, the <code class="filename">PLIST</code> file holds a list
5424: of files and directories that belong to a package. The names used in it
5425: are relative to the installation prefix (<code class="filename">${PREFIX}</code>),
5426: which means that it cannot register files outside this directory (absolute
5427: path names are not allowed). Despite this restriction, some packages need
5428: to install files outside this location; e.g., under
5429: <code class="filename">${VARBASE}</code> or
5430: <code class="filename">${PKG_SYSCONFDIR}</code>. The only way to achieve this
5431: is to create such files during installation time by using
5432: installation scripts.</p>
5433: <p>The generic installation scripts are shell scripts that can
5434: contain arbitrary code. The list of scripts to execute is taken from
5435: the <code class="varname">INSTALL_FILE</code> variable, which defaults to
5436: <code class="filename">INSTALL</code>. A similar variable exists for package
5437: removal (<code class="varname">DEINSTALL_FILE</code>, whose default is
5438: <code class="filename">DEINSTALL</code>). These scripts can run arbitrary
5439: commands, so they have the potential to create and manage files
5440: anywhere in the file system.</p>
5441: <p>Using these general installation files is not recommended, but
5442: may be needed in some special cases. One reason for avoiding them is
5443: that the user has to trust the packager that there is no unwanted or
5444: simply erroneous code included in the installation script. Also,
5445: previously there were many similar scripts for the same functionality,
5446: and fixing a common error involved finding and changing all of
5447: them.</p>
5448: <p>The pkginstall framework offers another, standardized way. It
5449: provides generic scripts to abstract the manipulation of such files
5450: and directories based on variables set in the package's
5451: <code class="filename">Makefile</code>. The rest of this section describes
5452: these variables.</p>
1.41 asau 5453: <div class="sect2">
1.1 dsieger 5454: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5455: <a name="dirs-outside-prefix"></a>17.1.1. Directory manipulation</h3></div></div></div>
1.1 dsieger 5456: <p>The following variables can be set to request the creation of
5457: directories anywhere in the file system:</p>
1.41 asau 5458: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.108 rillig 5459: <li class="listitem">
5460: <p><code class="varname">MAKE_DIRS</code> and <code class="varname">OWN_DIRS</code>
1.1 dsieger 5461: contain a list of directories that should be created and should attempt
5462: to be destroyed by the installation scripts. The difference between
5463: the two is that the latter prompts the administrator to remove any
5464: directories that may be left after deinstallation (because they were
1.108 rillig 5465: not empty), while the former does not. Example:</p>
5466: <pre class="programlisting">
5467: MAKE_DIRS+= ${VARBASE}/foo/private
5468: </pre>
5469: </li>
1.23 wiz 5470: <li class="listitem">
1.1 dsieger 5471: <p><code class="varname">MAKE_DIRS_PERMS</code> and
5472: <code class="varname">OWN_DIRS_PERMS</code> contain a list of tuples describing
5473: which directories should be created and should attempt to be destroyed
5474: by the installation scripts. Each tuple holds the following values,
5475: separated by spaces: the directory name, its owner, its group and its
5476: numerical mode. For example:</p>
5477: <pre class="programlisting">
1.108 rillig 5478: MAKE_DIRS_PERMS+= ${VARBASE}/foo/private \
5479: ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0700
1.1 dsieger 5480: </pre>
5481: <p>The difference between the two is exactly the same as their
5482: non-<code class="varname">PERMS</code> counterparts.</p>
5483: </li>
5484: </ul></div>
5485: </div>
1.41 asau 5486: <div class="sect2">
1.1 dsieger 5487: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5488: <a name="files-outside-prefix"></a>17.1.2. File manipulation</h3></div></div></div>
1.1 dsieger 5489: <p>Creating non-empty files outside the installation prefix is tricky
5490: because the <code class="filename">PLIST</code> forces all files to be inside it.
5491: To overcome this problem, the only solution is to extract the file in the
5492: known place (i.e., inside the installation prefix) and copy it to the
5493: appropriate location during installation (done by the installation scripts
5494: generated by pkginstall). We will call the former the <span class="emphasis"><em>master
5495: file</em></span> in the following paragraphs, which describe the variables
5496: that can be used to automatically and consistently handle files outside the
5497: installation prefix:</p>
1.41 asau 5498: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5499: <li class="listitem">
1.1 dsieger 5500: <p><code class="varname">CONF_FILES</code> and
1.30 wiz 5501: <code class="varname">REQD_FILES</code> are pairs of master and target files.
1.1 dsieger 5502: During installation time, the master file is copied to the target one
5503: if and only if the latter does not exist. Upon deinstallation, the
5504: target file is removed provided that it was not modified by the
5505: installation.</p>
5506: <p>The difference between the two is that the latter prompts the
5507: administrator to remove any files that may be left after
5508: deinstallation (because they were not empty), while the former does
5509: not.</p>
5510: </li>
1.23 wiz 5511: <li class="listitem">
1.1 dsieger 5512: <p><code class="varname">CONF_FILES_PERMS</code> and
1.30 wiz 5513: <code class="varname">REQD_FILES_PERMS</code> contain tuples describing master
1.1 dsieger 5514: files as well as their target locations. For each of them, it also
5515: specifies their owner, their group and their numeric permissions, in
5516: this order. For example:</p>
5517: <pre class="programlisting">
1.108 rillig 5518: REQD_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile \
5519: ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0700
1.1 dsieger 5520: </pre>
5521: <p>The difference between the two is exactly the same as their
5522: non-<code class="varname">PERMS</code> counterparts.</p>
5523: </li>
5524: </ul></div>
5525: </div>
5526: </div>
1.41 asau 5527: <div class="sect1">
1.1 dsieger 5528: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5529: <a name="conf-files"></a>17.2. Configuration files</h2></div></div></div>
1.1 dsieger 5530: <p>Configuration files are special in the sense that they are installed
5531: in their own specific directory, <code class="varname">PKG_SYSCONFDIR</code>, and
5532: need special treatment during installation (most of which is automated by
5533: pkginstall). The main concept you must bear in mind is that files marked
5534: as configuration files are automatically copied to the right place (somewhere
5535: inside <code class="varname">PKG_SYSCONFDIR</code>) during installation <span class="emphasis"><em>if
5536: and only if</em></span> they didn't exist before. Similarly, they will not
5537: be removed if they have local modifications. This ensures that
5538: administrators never lose any custom changes they may have made.</p>
1.41 asau 5539: <div class="sect2">
1.1 dsieger 5540: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5541: <a name="conf-files-sysconfdir"></a>17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</h3></div></div></div>
1.1 dsieger 5542: <p>As said before, the <code class="varname">PKG_SYSCONFDIR</code> variable
5543: specifies where configuration files shall be installed. Its contents are
5544: set based upon the following variables:</p>
1.41 asau 5545: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5546: <li class="listitem"><p><code class="varname">PKG_SYSCONFBASE</code>: The configuration's root
1.1 dsieger 5547: directory. Defaults to <code class="filename">${PREFIX}/etc</code> although it may
5548: be overridden by the user to point to his preferred location (e.g.,
5549: <code class="filename">/etc</code>, <code class="filename">/etc/pkg</code>, etc.).
5550: Packages must not use it directly.</p></li>
1.23 wiz 5551: <li class="listitem">
1.1 dsieger 5552: <p><code class="varname">PKG_SYSCONFSUBDIR</code>: A subdirectory of
5553: <code class="varname">PKG_SYSCONFBASE</code> under which the configuration files
5554: for the package being built shall be installed. The definition of this
5555: variable only makes sense in the package's
5556: <code class="filename">Makefile</code> (i.e., it is not user-customizable).</p>
5557: <p>As an example, consider the Apache package,
1.137 leot 5558: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/apache24/README.html" target="_top"><code class="filename">www/apache24</code></a>, which places its
1.1 dsieger 5559: configuration files under the
5560: <code class="filename">httpd/</code> subdirectory of
5561: <code class="varname">PKG_SYSCONFBASE</code>. This should be set in the package
5562: Makefile.</p>
5563: </li>
1.23 wiz 5564: <li class="listitem"><p><code class="varname">PKG_SYSCONFVAR</code>: Specifies the name of the
1.1 dsieger 5565: variable that holds this package's configuration directory (if
5566: different from <code class="varname">PKG_SYSCONFBASE</code>). It defaults to
5567: <code class="varname">PKGBASE</code>'s value, and is always prefixed with
5568: <code class="literal">PKG_SYSCONFDIR</code>.</p></li>
1.23 wiz 5569: <li class="listitem"><p><code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code>: Holds the
1.1 dsieger 5570: directory where the configuration files for the package identified by
5571: <code class="varname">PKG_SYSCONFVAR</code>'s shall be placed.</p></li>
5572: </ul></div>
5573: <p>Based on the above variables, pkginstall determines the value of
5574: <code class="varname">PKG_SYSCONFDIR</code>, which is the <span class="emphasis"><em>only</em></span>
5575: variable that can be used within a package to refer to its configuration
5576: directory. The algorithm used to set its value is basically the
5577: following:</p>
1.23 wiz 5578: <div class="orderedlist"><ol class="orderedlist" type="1">
5579: <li class="listitem"><p>If <code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> is set,
1.1 dsieger 5580: its value is used.</p></li>
1.23 wiz 5581: <li class="listitem"><p>If the previous variable is not defined but
1.1 dsieger 5582: <code class="varname">PKG_SYSCONFSUBDIR</code> is set in the package's
5583: <code class="filename">Makefile</code>, the resulting value is
5584: <code class="filename">${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</code>.</p></li>
1.23 wiz 5585: <li class="listitem"><p>Otherwise, it is set to
1.1 dsieger 5586: <code class="filename">${PKG_SYSCONFBASE}</code>.</p></li>
5587: </ol></div>
5588: <p>It is worth mentioning that <code class="filename">${PKG_SYSCONFDIR}</code> is
1.154 rillig 5589: automatically added to <code class="filename">OWN_DIRS</code>. See <a class="xref" href="#dirs-outside-prefix" title="17.1.1. Directory manipulation">Section 17.1.1, “Directory manipulation”</a> what this means. This does not apply to
1.16 jnemeth 5590: subdirectories of <code class="filename">${PKG_SYSCONFDIR}</code>, they still have to
5591: be created with OWN_DIRS or MAKE_DIRS.</p>
1.1 dsieger 5592: </div>
1.41 asau 5593: <div class="sect2">
1.1 dsieger 5594: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5595: <a name="conf-files-configure"></a>17.2.2. Telling the software where configuration files are</h3></div></div></div>
1.1 dsieger 5596: <p>Given that pkgsrc (and users!) expect configuration files to be in a
5597: known place, you need to teach each package where it shall install its
5598: files. In some cases you will have to patch the package Makefiles to
5599: achieve it. If you are lucky, though, it may be as easy as passing an
5600: extra flag to the configuration script; this is the case of GNU Autoconf-
5601: generated files:</p>
5602: <pre class="programlisting">
5603: CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
5604: </pre>
5605: <p>Note that this specifies where the package has to <span class="emphasis"><em>look
5606: for</em></span> its configuration files, not where they will be originally
5607: installed (although the difference is never explicit,
5608: unfortunately).</p>
5609: </div>
1.41 asau 5610: <div class="sect2">
1.1 dsieger 5611: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5612: <a name="conf-files-patching"></a>17.2.3. Patching installations</h3></div></div></div>
1.1 dsieger 5613: <p>As said before, pkginstall automatically handles configuration files.
5614: This means that <span class="strong"><strong>the packages themselves must not
5615: touch the contents of <code class="filename">${PKG_SYSCONFDIR}</code>
5616: directly</strong></span>. Bad news is that many software installation scripts
5617: will, out of the box, mess with the contents of that directory. So what is
5618: the correct procedure to fix this issue?</p>
5619: <p>You must teach the package (usually by manually patching it) to
5620: install any configuration files under the examples hierarchy,
5621: <code class="filename">share/examples/${PKGBASE}/</code>. This way, the
5622: <code class="filename">PLIST</code> registers them and the administrator always
5623: has the original copies available.</p>
5624: <p>Once the required configuration files are in place (i.e., under the
5625: examples hierarchy), the pkginstall framework can use them as master copies
5626: during the package installation to update what is in
5627: <code class="filename">${PKG_SYSCONFDIR}</code>. To achieve this, the variables
5628: <code class="varname">CONF_FILES</code> and <code class="varname">CONF_FILES_PERMS</code> are
1.154 rillig 5629: used. Check out <a class="xref" href="#files-outside-prefix" title="17.1.2. File manipulation">Section 17.1.2, “File manipulation”</a> for information
1.1 dsieger 5630: about their syntax and their purpose. Here is an example, taken from the
1.137 leot 5631: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/mail/mutt/README.html" target="_top"><code class="filename">mail/mutt</code></a> package:</p>
1.1 dsieger 5632: <pre class="programlisting">
5633: EGDIR= ${PREFIX}/share/doc/mutt/samples
5634: CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc
5635: </pre>
5636: <p>Note that the <code class="varname">EGDIR</code> variable is specific to that
5637: package and has no meaning outside it.</p>
5638: </div>
1.41 asau 5639: <div class="sect2">
1.1 dsieger 5640: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5641: <a name="conf-files-disable"></a>17.2.4. Disabling handling of configuration files</h3></div></div></div>
1.1 dsieger 5642: <p>The automatic copying of config files can be toggled by setting the
5643: environment variable <code class="varname">PKG_CONFIG</code> prior to package
5644: installation.</p>
5645: </div>
5646: </div>
1.41 asau 5647: <div class="sect1">
1.1 dsieger 5648: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5649: <a name="rcd-scripts"></a>17.3. System startup scripts</h2></div></div></div>
1.1 dsieger 5650: <p>System startup scripts are special files because they must be
5651: installed in a place known by the underlying OS, usually outside the
1.154 rillig 5652: installation prefix. Therefore, the same rules described in <a class="xref" href="#files-and-dirs-outside-prefix" title="17.1. Files and directories outside the installation prefix">Section 17.1, “Files and directories outside the installation prefix”</a> apply, and the same solutions
1.1 dsieger 5653: can be used. However, pkginstall provides a special mechanism to handle
5654: these files.</p>
5655: <p>In order to provide system startup scripts, the package has
5656: to:</p>
1.23 wiz 5657: <div class="orderedlist"><ol class="orderedlist" type="1">
5658: <li class="listitem"><p>Store the script inside <code class="filename">${FILESDIR}</code>, with
1.1 dsieger 5659: the <code class="literal">.sh</code> suffix appended. Considering the
1.137 leot 5660: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/print/cups/README.html" target="_top"><code class="filename">print/cups</code></a> package as an example, it has a
1.1 dsieger 5661: <code class="filename">cupsd.sh</code> in its files directory.</p></li>
1.23 wiz 5662: <li class="listitem">
1.1 dsieger 5663: <p>Tell pkginstall to handle it, appending the name of the script,
5664: without its extension, to the <code class="varname">RCD_SCRIPTS</code> variable.
5665: Continuing the previous example:</p>
5666: <pre class="programlisting">
5667: RCD_SCRIPTS+= cupsd
5668: </pre>
5669: </li>
5670: </ol></div>
5671: <p>Once this is done, pkginstall will do the following steps for each
5672: script in an automated fashion:</p>
1.23 wiz 5673: <div class="orderedlist"><ol class="orderedlist" type="1">
5674: <li class="listitem"><p>Process the file found in the files directory applying all the
1.1 dsieger 5675: substitutions described in the <code class="filename">FILES_SUBST</code>
5676: variable.</p></li>
1.23 wiz 5677: <li class="listitem"><p>Copy the script from the files directory to the examples
1.1 dsieger 5678: hierarchy, <code class="filename">${PREFIX}/share/examples/rc.d/</code>. Note
5679: that this master file must be explicitly registered in the
5680: <code class="filename">PLIST</code>.</p></li>
1.23 wiz 5681: <li class="listitem"><p>Add code to the installation scripts to copy the startup script
1.1 dsieger 5682: from the examples hierarchy into the system-wide startup scripts
5683: directory.</p></li>
5684: </ol></div>
1.41 asau 5685: <div class="sect2">
1.1 dsieger 5686: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5687: <a name="rcd-scripts-disable"></a>17.3.1. Disabling handling of system startup scripts</h3></div></div></div>
1.1 dsieger 5688: <p>The automatic copying of config files can be toggled by setting the
5689: environment variable <code class="varname">PKG_RCD_SCRIPTS</code> prior to package
5690: installation. Note that the scripts will be always copied inside the
5691: examples hierarchy, <code class="filename">${PREFIX}/share/examples/rc.d/</code>, no
5692: matter what the value of this variable is.</p>
5693: </div>
5694: </div>
1.41 asau 5695: <div class="sect1">
1.1 dsieger 5696: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5697: <a name="users-and-groups"></a>17.4. System users and groups</h2></div></div></div>
1.1 dsieger 5698: <p>If a package needs to create special users and/or groups during
5699: installation, it can do so by using the pkginstall framework.</p>
5700: <p>Users can be created by adding entries to the
5701: <code class="varname">PKG_USERS</code> variable. Each entry has the following
5702: syntax:</p>
5703: <pre class="programlisting">
5704: user:group
5705: </pre>
5706: <p>Further specification of user details may be done by setting
5707: per-user variables.
5708: <code class="varname">PKG_UID.<em class="replaceable"><code>user</code></em></code> is the
5709: numeric UID for the user.
5710: <code class="varname">PKG_GECOS.<em class="replaceable"><code>user</code></em></code> is the
5711: user's description or comment.
5712: <code class="varname">PKG_HOME.<em class="replaceable"><code>user</code></em></code> is the
5713: user's home directory, and defaults to
5714: <code class="filename">/nonexistent</code> if not specified.
5715: <code class="varname">PKG_SHELL.<em class="replaceable"><code>user</code></em></code> is the
5716: user's shell, and defaults to <code class="filename">/sbin/nologin</code> if
5717: not specified.</p>
5718: <p>Similarly, groups can be created by adding entries to the
5719: <code class="varname">PKG_GROUPS</code> variable, whose syntax is:</p>
5720: <pre class="programlisting">
5721: group
5722: </pre>
5723: <p>The numeric GID of the group may be set by defining
5724: <code class="varname">PKG_GID.<em class="replaceable"><code>group</code></em></code>.</p>
5725: <p>If a package needs to create the users and groups at an earlier
1.116 wiz 5726: stage, then it can set <code class="varname">USERGROUP_PHASE</code> to either
5727: <code class="literal">configure</code>,<code class="literal">build</code>, or
5728: <code class="literal">pre-install</code> to indicate the phase before which the
5729: users and groups are created. In this case, the numeric UIDs and GIDs
5730: of the created users and groups are automatically hardcoded into the
5731: final installation scripts.</p>
1.1 dsieger 5732: </div>
1.41 asau 5733: <div class="sect1">
1.1 dsieger 5734: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5735: <a name="shells"></a>17.5. System shells</h2></div></div></div>
1.1 dsieger 5736: <p>Packages that install system shells should register them in the shell
5737: database, <code class="filename">/etc/shells</code>, to make things easier to the
5738: administrator. This must be done from the installation scripts to keep
5739: binary packages working on any system. pkginstall provides an easy way to
5740: accomplish this task.</p>
5741: <p>When a package provides a shell interpreter, it has to set the
5742: <code class="varname">PKG_SHELL</code> variable to its absolute file name. This will
5743: add some hooks to the installation scripts to handle it. Consider the
1.137 leot 5744: following example, taken from <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/zsh/README.html" target="_top"><code class="filename">shells/zsh</code></a>:</p>
1.1 dsieger 5745: <pre class="programlisting">
5746: PKG_SHELL= ${PREFIX}/bin/zsh
5747: </pre>
1.41 asau 5748: <div class="sect2">
1.1 dsieger 5749: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5750: <a name="shells-disable"></a>17.5.1. Disabling shell registration</h3></div></div></div>
1.1 dsieger 5751: <p>The automatic registration of shell interpreters can be disabled by
5752: the administrator by setting the <code class="filename">PKG_REGISTER_SHELLS</code>
5753: environment variable to <code class="literal">NO</code>.</p>
5754: </div>
5755: </div>
1.41 asau 5756: <div class="sect1">
1.1 dsieger 5757: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5758: <a name="fonts"></a>17.6. Fonts</h2></div></div></div>
1.1 dsieger 5759: <p>Packages that install X11 fonts should update the database files
5760: that index the fonts within each fonts directory. This can easily be
5761: accomplished within the pkginstall framework.</p>
5762: <p>When a package installs X11 fonts, it must list the directories in
5763: which fonts are installed in the
5764: <code class="varname">FONTS_DIRS.<em class="replaceable"><code>type</code></em></code> variables,
1.23 wiz 5765: where <em class="replaceable"><code>type</code></em> can be one of <span class="quote">“<span class="quote">ttf</span>”</span>,
5766: <span class="quote">“<span class="quote">type1</span>”</span> or <span class="quote">“<span class="quote">x11</span>”</span>. This will add hooks to the
1.1 dsieger 5767: installation scripts to run the appropriate commands to update the fonts
5768: database files within each of those directories. For convenience, if the
5769: directory path is relative, it is taken to be relative to the package's
1.137 leot 5770: installation prefix. Consider the following example, taken from <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/dbz-ttf/README.html" target="_top"><code class="filename">fonts/dbz-ttf</code></a>:</p>
1.1 dsieger 5771: <pre class="programlisting">
1.67 wiz 5772: FONTS_DIRS.ttf= ${PREFIX}/share/fonts/X11/TTF
1.1 dsieger 5773: </pre>
1.41 asau 5774: <div class="sect2">
1.1 dsieger 5775: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5776: <a name="fonts-disable"></a>17.6.1. Disabling automatic update of the fonts databases</h3></div></div></div>
1.1 dsieger 5777: <p>The automatic update of fonts databases can be disabled by
5778: the administrator by setting the <code class="filename">PKG_UPDATE_FONTS_DB</code>
5779: environment variable to <code class="literal">NO</code>.</p>
5780: </div>
5781: </div>
5782: </div>
1.41 asau 5783: <div class="chapter">
1.1 dsieger 5784: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 5785: <a name="options"></a>Chapter 18. Options handling</h2></div></div></div>
1.1 dsieger 5786: <div class="toc">
5787: <p><b>Table of Contents</b></p>
1.100 leot 5788: <dl class="toc">
1.154 rillig 5789: <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt>
5790: <dt><span class="sect1"><a href="#converting-to-options">18.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt>
5791: <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt>
5792: <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt>
1.1 dsieger 5793: </dl>
5794: </div>
5795: <p>Many packages have the ability to be built to support different
5796: sets of features. <code class="filename">bsd.options.mk</code> is a framework
5797: in pkgsrc that provides generic handling of those options that
5798: determine different ways in which the packages can be built. It's
5799: possible for the user to specify exactly which sets of options will be
5800: built into a package or to allow a set of global default options
5801: apply.</p>
1.7 rillig 5802: <p>There are two broad classes of behaviors that one might want to
5803: control via options. One is whether some particular feature is
5804: enabled in a program that will be built anyway, often by including or
5805: not including a dependency on some other package. The other is
5806: whether or not an additional program will be built as part of the
5807: package. Generally, it is better to make a split package for such
5808: additional programs instead of using options, because it enables
5809: binary packages to be built which can then be added separately. For
5810: example, the foo package might have minimal dependencies (those
5811: packages without which foo doesn't make sense), and then the foo-gfoo
5812: package might include the GTK frontend program gfoo. This is better
5813: than including a gtk option to foo that adds gfoo, because either that
5814: option is default, in which case binary users can't get foo without
5815: gfoo, or not default, in which case they can't get gfoo. With split
5816: packages, they can install foo without having GTK, and later decide to
5817: install gfoo (pulling in GTK at that time). This is an advantage to
5818: source users too, avoiding the need for rebuilds.</p>
5819: <p>Plugins with widely varying dependencies should usually be split
5820: instead of options.</p>
5821: <p>It is often more work to maintain split packages, especially if
5822: the upstream package does not support this. The decision of split
5823: vs. option should be made based on the likelihood that users will want
5824: or object to the various pieces, the size of the dependencies that are
5825: included, and the amount of work.</p>
5826: <p>A further consideration is licensing. Non-free parts, or parts
5827: that depend on non-free dependencies (especially plugins) should
5828: almost always be split if feasible.</p>
1.41 asau 5829: <div class="sect1">
1.1 dsieger 5830: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5831: <a name="global-default-options"></a>18.1. Global default options</h2></div></div></div>
1.1 dsieger 5832: <p>Global default options are listed in
5833: <code class="varname">PKG_DEFAULT_OPTIONS</code>, which is a list of the options
5834: that should be built into every package if that option is supported.
1.10 hubertf 5835: This variable should be set in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
1.1 dsieger 5836: </div>
1.41 asau 5837: <div class="sect1">
1.1 dsieger 5838: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5839: <a name="converting-to-options"></a>18.2. Converting packages to use <code class="filename">bsd.options.mk</code>
1.1 dsieger 5840: </h2></div></div></div>
5841: <p>The following example shows how
5842: <code class="filename">bsd.options.mk</code> should be used
5843: by the hypothetical ``wibble'' package, either in the package
5844: <code class="filename">Makefile</code>, or in a file,
5845: e.g. <code class="filename">options.mk</code>, that is included by the
5846: main package <code class="filename">Makefile</code>.</p>
5847: <pre class="programlisting">
5848: PKG_OPTIONS_VAR= PKG_OPTIONS.wibble
5849: PKG_SUPPORTED_OPTIONS= wibble-foo ldap
5850: PKG_OPTIONS_OPTIONAL_GROUPS= database
5851: PKG_OPTIONS_GROUP.database= mysql pgsql
5852: PKG_SUGGESTED_OPTIONS= wibble-foo
5853: PKG_OPTIONS_LEGACY_VARS+= WIBBLE_USE_OPENLDAP:ldap
5854: PKG_OPTIONS_LEGACY_OPTS+= foo:wibble-foo
5855:
5856: .include "../../mk/bsd.prefs.mk"
5857:
5858: # this package was previously named wibble2
5859: .if defined(PKG_OPTIONS.wibble2)
5860: PKG_LEGACY_OPTIONS+= ${PKG_OPTIONS.wibble2}
5861: PKG_OPTIONS_DEPRECATED_WARNINGS+= \
5862: "Deprecated variable PKG_OPTIONS.wibble2 used, use ${PKG_OPTIONS_VAR} instead."
5863: .endif
5864:
5865: .include "../../mk/bsd.options.mk"
5866:
5867: # Package-specific option-handling
5868:
5869: ###
5870: ### FOO support
5871: ###
5872: .if !empty(PKG_OPTIONS:Mwibble-foo)
5873: CONFIGURE_ARGS+= --enable-foo
5874: .endif
5875:
5876: ###
5877: ### LDAP support
5878: ###
5879: .if !empty(PKG_OPTIONS:Mldap)
5880: . include "../../databases/openldap-client/buildlink3.mk"
5881: CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap-client}
5882: .endif
5883:
5884: ###
5885: ### database support
5886: ###
5887: .if !empty(PKG_OPTIONS:Mmysql)
5888: . include "../../mk/mysql.buildlink3.mk"
5889: .endif
5890: .if !empty(PKG_OPTIONS:Mpgsql)
5891: . include "../../mk/pgsql.buildlink3.mk"
5892: .endif
5893: </pre>
5894: <p>The first section contains the information about which build
5895: options are supported by the package, and any default options settings
5896: if needed.</p>
1.23 wiz 5897: <div class="orderedlist"><ol class="orderedlist" type="1">
5898: <li class="listitem"><p><code class="varname">PKG_OPTIONS_VAR</code> is the name of the
1.174 leot 5899: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> variable that the user can set to override the default
1.1 dsieger 5900: options. It should be set to
5901: PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em>. Do not set it to
5902: PKG_OPTIONS.${PKGBASE}, since <code class="varname">PKGBASE</code> is not defined
5903: at the point where the options are processed.</p></li>
1.23 wiz 5904: <li class="listitem"><p><code class="varname">PKG_SUPPORTED_OPTIONS</code> is a list of
1.1 dsieger 5905: build options supported by the package.</p></li>
1.23 wiz 5906: <li class="listitem"><p><code class="varname">PKG_OPTIONS_OPTIONAL_GROUPS</code> is a
1.1 dsieger 5907: list of names of groups of mutually exclusive options. The options in
5908: each group are listed in
5909: <code class="varname">PKG_OPTIONS_GROUP.<em class="replaceable"><code>groupname</code></em></code>.
5910: The most specific setting of any option from the group takes
5911: precedence over all other options in the group. Options from the
5912: groups will be automatically added to
5913: <code class="varname">PKG_SUPPORTED_OPTIONS</code>.</p></li>
1.23 wiz 5914: <li class="listitem"><p><code class="varname">PKG_OPTIONS_REQUIRED_GROUPS</code> is like
1.1 dsieger 5915: <code class="varname">PKG_OPTIONS_OPTIONAL_GROUPS</code>, but building the
5916: packages will fail if no option from the group is
5917: selected.</p></li>
1.23 wiz 5918: <li class="listitem"><p><code class="varname">PKG_OPTIONS_NONEMPTY_SETS</code> is a list
1.1 dsieger 5919: of names of sets of options. At least one option from each set must
5920: be selected. The options in each set are listed in
5921: <code class="varname">PKG_OPTIONS_SET.<em class="replaceable"><code>setname</code></em></code>.
5922: Options from the sets will be automatically added to
5923: <code class="varname">PKG_SUPPORTED_OPTIONS</code>. Building the package will
5924: fail if no option from the set is selected.</p></li>
1.23 wiz 5925: <li class="listitem"><p><code class="varname">PKG_SUGGESTED_OPTIONS</code> is a list of
1.1 dsieger 5926: build options which are enabled by default.</p></li>
1.23 wiz 5927: <li class="listitem"><p><code class="varname">PKG_OPTIONS_LEGACY_VARS</code> is a list
1.1 dsieger 5928: of
1.23 wiz 5929: <span class="quote">“<span class="quote"><em class="replaceable"><code>USE_VARIABLE</code></em>:<em class="replaceable"><code>option</code></em></span>”</span>
1.10 hubertf 5930: pairs that map legacy <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> variables to
1.1 dsieger 5931: their option counterparts. Pairs should be added with
1.23 wiz 5932: <span class="quote">“<span class="quote">+=</span>”</span> to keep the listing of global legacy variables. A
1.1 dsieger 5933: warning will be issued if the user uses a legacy
5934: variable.</p></li>
1.23 wiz 5935: <li class="listitem"><p><code class="varname">PKG_OPTIONS_LEGACY_OPTS</code> is a list
1.1 dsieger 5936: of
1.23 wiz 5937: <span class="quote">“<span class="quote"><em class="replaceable"><code>old-option</code></em>:<em class="replaceable"><code>new-option</code></em></span>”</span>
1.1 dsieger 5938: pairs that map options that have been renamed to their new
1.23 wiz 5939: counterparts. Pairs should be added with <span class="quote">“<span class="quote">+=</span>”</span> to keep
1.1 dsieger 5940: the listing of global legacy options. A warning will be issued if
5941: the user uses a legacy option.</p></li>
1.23 wiz 5942: <li class="listitem"><p><code class="varname">PKG_LEGACY_OPTIONS</code> is a list of
1.1 dsieger 5943: options implied by deprecated variables used. This can be used for
5944: cases that neither <code class="varname">PKG_OPTIONS_LEGACY_VARS</code> nor
5945: <code class="varname">PKG_OPTIONS_LEGACY_OPTS</code> can handle, e. g. when
5946: <code class="varname">PKG_OPTIONS_VAR</code> is renamed.</p></li>
1.23 wiz 5947: <li class="listitem"><p><code class="varname">PKG_OPTIONS_DEPRECATED_WARNINGS</code> is
1.1 dsieger 5948: a list of warnings about deprecated variables or options used, and
5949: what to use instead.</p></li>
5950: </ol></div>
5951: <p>A package should never modify
5952: <code class="varname">PKG_DEFAULT_OPTIONS</code> or the variable named in
5953: <code class="varname">PKG_OPTIONS_VAR</code>. These are strictly user-settable.
5954: To suggest a default set of options, use
5955: <code class="varname">PKG_SUGGESTED_OPTIONS</code>.</p>
5956: <p><code class="varname">PKG_OPTIONS_VAR</code> must be defined before
5957: including <code class="filename">bsd.options.mk</code>. If none of
5958: <code class="varname">PKG_SUPPORTED_OPTIONS</code>,
5959: <code class="varname">PKG_OPTIONS_OPTIONAL_GROUPS</code>, and
5960: <code class="varname">PKG_OPTIONS_REQUIRED_GROUPS</code> are defined (as can
5961: happen with platform-specific options if none of them is supported on
5962: the current platform), <code class="varname">PKG_OPTIONS</code> is set to the
5963: empty list and the package is otherwise treated as not using the
5964: options framework.</p>
5965: <p>After the inclusion of <code class="filename">bsd.options.mk</code>, the
5966: variable <code class="varname">PKG_OPTIONS</code> contains the list of selected
5967: build options, properly filtered to remove unsupported and duplicate
5968: options.</p>
5969: <p>The remaining sections contain the logic that is specific to
5970: each option. The correct way to check for an option is to check
5971: whether it is listed in <code class="varname">PKG_OPTIONS</code>:</p>
5972: <pre class="programlisting">
5973: .if !empty(PKG_OPTIONS:M<em class="replaceable"><code>option</code></em>)
5974: </pre>
5975: </div>
1.41 asau 5976: <div class="sect1">
1.1 dsieger 5977: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5978: <a name="option-names"></a>18.3. Option Names</h2></div></div></div>
1.1 dsieger 5979: <p>Options that enable similar features in different packages (like
5980: optional support for a library) should use a common name in all
5981: packages that support it (like the name of the library). If another
5982: package already has an option with the same meaning, use the same
5983: name.</p>
5984: <p>Options that enable features specific to one package, where it's
5985: unlikely that another (unrelated) package has the same (or a similar)
5986: optional feature, should use a name prefixed with
5987: <code class="varname"><em class="replaceable"><code>pkgname</code></em>-</code>.</p>
5988: <p>If a group of related packages share an optional feature
5989: specific to that group, prefix it with the name of the
1.23 wiz 5990: <span class="quote">“<span class="quote">main</span>”</span> package
1.1 dsieger 5991: (e. g. <code class="varname">djbware-errno-hack</code>).</p>
5992: <p>For new options, add a line to
5993: <code class="filename">mk/defaults/options.description</code>. Lines have two
5994: fields, separated by tab. The first field is the option name, the
5995: second its description. The description should be a whole sentence
5996: (starting with an uppercase letter and ending with a period) that
1.23 wiz 5997: describes what enabling the option does. E. g. <span class="quote">“<span class="quote">Enable ispell
5998: support.</span>”</span> The file is sorted by option names.</p>
1.1 dsieger 5999: </div>
1.41 asau 6000: <div class="sect1">
1.7 rillig 6001: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6002: <a name="option-build"></a>18.4. Determining the options of dependencies</h2></div></div></div>
1.10 hubertf 6003: <p>When writing <a class="link" href="#buildlink3.mk"><code class="filename">buildlink3.mk</code></a> files, it is often necessary to list
1.7 rillig 6004: different dependencies based on the options with which the package was
6005: built. For querying these options, the file
6006: <code class="filename">pkgsrc/mk/pkg-build-options.mk</code> should be used. A
6007: typical example looks like this:</p>
6008: <pre class="programlisting">
6009: pkgbase := libpurple
6010: .include "../../mk/pkg-build-options.mk"
6011:
6012: .if !empty(PKG_BUILD_OPTIONS.libpurple:Mdbus)
6013: ...
6014: .endif
6015: </pre>
6016: <p>Including <code class="filename">pkg-build-options.mk</code> here will set
6017: the variable <code class="varname">PKG_BUILD_OPTIONS.libpurple</code> to the build
6018: options of the libpurple package, which can then be queried like
6019: <code class="varname">PKG_OPTIONS</code> in the <code class="filename">options.mk</code>
6020: file. See the file <code class="filename">pkg-build-options.mk</code> for more
6021: details.</p>
6022: </div>
1.1 dsieger 6023: </div>
1.41 asau 6024: <div class="chapter">
1.1 dsieger 6025: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 6026: <a name="build"></a>Chapter 19. The build process</h2></div></div></div>
1.1 dsieger 6027: <div class="toc">
6028: <p><b>Table of Contents</b></p>
1.100 leot 6029: <dl class="toc">
1.154 rillig 6030: <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt>
6031: <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt>
6032: <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt>
6033: <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt>
6034: <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
6035: <dd><dl>
6036: <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt>
6037: <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt>
6038: </dl></dd>
6039: <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt>
6040: <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt>
6041: <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt>
6042: <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt>
6043: <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt>
6044: <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
6045: <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
6046: <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt>
6047: <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
6048: <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt>
6049: <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt>
6050: <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt>
1.1 dsieger 6051: </dl>
6052: </div>
1.41 asau 6053: <div class="sect1">
1.1 dsieger 6054: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6055: <a name="build.intro"></a>19.1. Introduction</h2></div></div></div>
1.1 dsieger 6056: <p>This chapter gives a detailed description on how a package is
6057: built. Building a package is separated into different
6058: <span class="emphasis"><em>phases</em></span> (for example <code class="varname">fetch</code>,
6059: <code class="varname">build</code>, <code class="varname">install</code>), all of which are
1.18 snj 6060: described in the following sections. Each phase is split into
1.1 dsieger 6061: so-called <span class="emphasis"><em>stages</em></span>, which take the name of the
6062: containing phase, prefixed by one of <code class="varname">pre-</code>,
6063: <code class="varname">do-</code> or <code class="varname">post-</code>. (Examples are
6064: <code class="varname">pre-configure</code>, <code class="varname">post-build</code>.) Most
6065: of the actual work is done in the <code class="varname">do-*</code> stages.</p>
6066: <p>Never override the regular targets (like
6067: <code class="varname">fetch</code>), if you have to, override the
6068: <code class="varname">do-*</code> ones instead.</p>
6069: <p>The basic steps for building a program are always the same. First
6070: the program's source (<span class="emphasis"><em>distfile</em></span>) must be brought to
6071: the local system and then extracted. After any pkgsrc-specific patches
6072: to compile properly are applied, the software can be configured, then
6073: built (usually by compiling), and finally the generated binaries, etc.
6074: can be put into place on the system.</p>
6075: <p>To get more details about what is happening at each step,
6076: you can set the <code class="varname">PKG_VERBOSE</code> variable, or the
6077: <code class="varname">PATCH_DEBUG</code> variable if you are just interested
6078: in more details about the <span class="emphasis"><em>patch</em></span> step.</p>
6079: </div>
1.41 asau 6080: <div class="sect1">
1.1 dsieger 6081: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6082: <a name="build.prefix"></a>19.2. Program location</h2></div></div></div>
1.1 dsieger 6083: <p>Before outlining the process performed by the NetBSD package system in
6084: the next section, here's a brief discussion on where programs are
6085: installed, and which variables influence this.</p>
6086: <p>The automatic variable <code class="varname">PREFIX</code> indicates
6087: where all files of the final program shall be installed. It is
6088: usually set to <code class="varname">LOCALBASE</code>
6089: (<code class="filename">/usr/pkg</code>), or <code class="varname">CROSSBASE</code>
6090: for pkgs in the <code class="filename">cross</code> category. The value of
6091: <code class="varname">PREFIX</code> needs to be put
6092: into the various places in the program's source where paths to
1.154 rillig 6093: these files are encoded. See <a class="xref" href="#components.patches" title="13.3. patches/*">Section 13.3, “<code class="filename">patches/*</code>”</a> and <a class="xref" href="#fixes.libtool" title="21.3.1. Shared libraries - libtool">Section 21.3.1, “Shared libraries - libtool”</a> for more details.</p>
1.1 dsieger 6094: <p>When choosing which of these variables to use,
6095: follow the following rules:</p>
1.41 asau 6096: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 6097: <li class="listitem"><p><code class="varname">PREFIX</code> always points to the location
1.1 dsieger 6098: where the current pkg will be installed. When referring to a
6099: pkg's own installation path, use
1.23 wiz 6100: <span class="quote">“<span class="quote">${PREFIX}</span>”</span>.</p></li>
6101: <li class="listitem"><p><code class="varname">LOCALBASE</code> is where all non-X11 pkgs
1.1 dsieger 6102: are installed. If you need to construct a -I or -L argument
6103: to the compiler to find includes and libraries installed by
1.23 wiz 6104: another non-X11 pkg, use <span class="quote">“<span class="quote">${LOCALBASE}</span>”</span>. The name
1.1 dsieger 6105: <code class="varname">LOCALBASE</code> stems from FreeBSD, which
6106: installed all packages in <code class="filename">/usr/local</code>. As
6107: pkgsrc leaves <code class="filename">/usr/local</code> for the system
6108: administrator, this variable is a misnomer.</p></li>
1.23 wiz 6109: <li class="listitem"><p><code class="varname">X11BASE</code> is where the actual X11
1.1 dsieger 6110: distribution (from xsrc, etc.) is installed. When looking for
6111: <span class="emphasis"><em>standard</em></span> X11 includes (not those
1.23 wiz 6112: installed by a package), use <span class="quote">“<span class="quote">${X11BASE}</span>”</span>.</p></li>
1.99 sevan 6113: <li class="listitem"><p>X11-based packages using imake must set
6114: <code class="varname">USE_IMAKE</code> to be installed correctly under
6115: <code class="varname">LOCALBASE</code>.</p></li>
1.23 wiz 6116: <li class="listitem"><p>Within <code class="filename">${PREFIX}</code>, packages should
1.174 leot 6117: install files according to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?hier+7.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">hier</span>(7)</span></a>, with the exception that
1.1 dsieger 6118: manual pages go into <code class="filename">${PREFIX}/man</code>, not
6119: <code class="filename">${PREFIX}/share/man</code>.</p></li>
6120: </ul></div>
6121: </div>
1.41 asau 6122: <div class="sect1">
1.1 dsieger 6123: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6124: <a name="build.builddirs"></a>19.3. Directories used during the build process</h2></div></div></div>
1.14 jmcneill 6125: <p>When building a package, various directories are used to store
1.1 dsieger 6126: source files, temporary files, pkgsrc-internal files, and so on. These
6127: directories are explained here.</p>
6128: <p>Some of the directory variables contain relative pathnames. There
6129: are two common base directories for these relative directories:
6130: <code class="varname">PKGSRCDIR/PKGPATH</code> is used for directories that are
6131: pkgsrc-specific. <code class="varname">WRKSRC</code> is used for directories
6132: inside the package itself.</p>
1.41 asau 6133: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6134: <dt><span class="term"><code class="varname">PKGSRCDIR</code></span></dt>
6135: <dd><p>This is an absolute pathname that points to the pkgsrc
6136: root directory. Generally, you don't need
6137: it.</p></dd>
6138: <dt><span class="term"><code class="varname">PKGDIR</code></span></dt>
6139: <dd><p>This is an absolute pathname that points to the
6140: current package.</p></dd>
6141: <dt><span class="term"><code class="varname">PKGPATH</code></span></dt>
6142: <dd><p>This is a pathname relative to
6143: <code class="varname">PKGSRCDIR</code> that points to the current
6144: package.</p></dd>
6145: <dt><span class="term"><code class="varname">WRKDIR</code></span></dt>
6146: <dd><p>This is an absolute pathname pointing to the directory
6147: where all work takes place. The distfiles are extracted to this
6148: directory. It also contains temporary directories and log files used by
6149: the various pkgsrc frameworks, like <span class="emphasis"><em>buildlink</em></span> or
6150: the <span class="emphasis"><em>wrappers</em></span>.</p></dd>
6151: <dt><span class="term"><code class="varname">WRKSRC</code></span></dt>
6152: <dd><p>This is an absolute pathname pointing to the directory
6153: where the distfiles are extracted. It is usually a direct subdirectory
6154: of <code class="varname">WRKDIR</code>, and often it's the only directory entry
6155: that isn't hidden. This variable may be changed by a package
6156: <code class="filename">Makefile</code>.</p></dd>
6157: </dl></div>
1.14 jmcneill 6158: <p>The <code class="varname">CREATE_WRKDIR_SYMLINK</code> definition takes either
6159: the value <span class="emphasis"><em>yes</em></span> or <span class="emphasis"><em>no</em></span> and defaults
1.15 rillig 6160: to <span class="emphasis"><em>no</em></span>. It indicates whether a symbolic link to the
1.14 jmcneill 6161: <code class="varname">WRKDIR</code> is to be created in the pkgsrc entry's directory.
6162: If users would like to have their pkgsrc trees behave in a
6163: read-only manner, then the value of
6164: <code class="varname">CREATE_WRKDIR_SYMLINK</code> should be set to
6165: <span class="emphasis"><em>no</em></span>.</p>
1.1 dsieger 6166: </div>
1.41 asau 6167: <div class="sect1">
1.1 dsieger 6168: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6169: <a name="build.running"></a>19.4. Running a phase</h2></div></div></div>
1.10 hubertf 6170: <p>You can run a particular phase by typing <span class="command"><strong>make
1.1 dsieger 6171: phase</strong></span>, where <span class="emphasis"><em>phase</em></span> is the name of the
6172: phase. This will automatically run all phases that are required for this
6173: phase. The default phase is <code class="varname">build</code>, that is, when you
1.10 hubertf 6174: run <span class="command"><strong>make</strong></span> without parameters in a package directory,
1.1 dsieger 6175: the package will be built, but not installed.</p>
6176: </div>
1.41 asau 6177: <div class="sect1">
1.1 dsieger 6178: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6179: <a name="build.fetch"></a>19.5. The <span class="emphasis"><em>fetch</em></span> phase</h2></div></div></div>
1.1 dsieger 6180: <p>The first step in building a package is to fetch the
6181: distribution files (distfiles) from the sites that are providing
6182: them. This is the task of the <span class="emphasis"><em>fetch</em></span>
6183: phase.</p>
1.41 asau 6184: <div class="sect2">
1.1 dsieger 6185: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 6186: <a name="build.fetch.what"></a>19.5.1. What to fetch and where to get it from</h3></div></div></div>
1.1 dsieger 6187: <p>In simple cases, <code class="varname">MASTER_SITES</code>
6188: defines all URLs from where the distfile, whose name is
6189: derived from the <code class="varname">DISTNAME</code> variable, is
6190: fetched. The more complicated cases are described
6191: below.</p>
6192: <p>The variable <code class="varname">DISTFILES</code> specifies
6193: the list of distfiles that have to be fetched. Its value
1.66 asau 6194: defaults to <code class="literal">${DEFAULT_DISTFILES}</code> and
6195: its value is <code class="literal">${DISTNAME}${EXTRACT_SUFX}</code>,
1.1 dsieger 6196: so that most packages don't need to define it at all.
6197: <code class="varname">EXTRACT_SUFX</code> is
6198: <code class="literal">.tar.gz</code> by default, but can be changed
6199: freely. Note that if your package requires additional
6200: distfiles to the default one, you cannot just append the
6201: additional filenames using the <code class="literal">+=</code>
6202: operator, but you have write for example:</p>
6203: <pre class="programlisting">
1.66 asau 6204: DISTFILES= ${DEFAULT_DISTFILES} additional-files.tar.gz
1.1 dsieger 6205: </pre>
6206: <p>Each distfile is fetched from a list of sites, usually
6207: <code class="varname">MASTER_SITES</code>. If the package has multiple
6208: <code class="varname">DISTFILES</code> or multiple
6209: <code class="varname">PATCHFILES</code> from different sites, you can
6210: set
6211: <code class="varname">SITES.<em class="replaceable"><code>distfile</code></em></code>
6212: to the list of URLs where the file
6213: <code class="filename"><em class="replaceable"><code>distfile</code></em></code>
6214: (including the suffix) can be found.</p>
6215: <pre class="programlisting">
6216: DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
6217: DISTFILES+= foo-file.tar.gz
6218: SITES.foo-file.tar.gz= \
1.174 leot 6219: https://www.somewhere.com/somehow/ \
6220: https://www.somewhereelse.com/mirror/somehow/
1.1 dsieger 6221: </pre>
6222: <p>When actually fetching the distfiles, each item from
6223: <code class="varname">MASTER_SITES</code> or
6224: <code class="varname">SITES.*</code> gets the name of each distfile
6225: appended to it, without an intermediate slash. Therefore,
6226: all site values have to end with a slash or other separator
6227: character. This allows for example to set
6228: <code class="varname">MASTER_SITES</code> to a URL of a CGI script
6229: that gets the name of the distfile as a parameter. In this
6230: case, the definition would look like:</p>
6231: <pre class="programlisting">
1.174 leot 6232: MASTER_SITES= https://www.example.com/download.cgi?file=
1.1 dsieger 6233: </pre>
1.22 jakllsch 6234: <p> The exception to this rule are URLs starting with a dash.
1.66 asau 6235: In that case the URL is taken as is, fetched and the result
6236: stored under the name of the distfile. You can use this style
6237: for the case when the download URL style does not match the
6238: above common case. For example, if permanent download URL is a
6239: redirector to the real download URL, or the download file name
6240: is offered by an HTTP Content-Disposition header. In the
6241: following example, <code class="filename">foo-1.0.0.tar.gz</code> will be
6242: created instead of the default
6243: <code class="filename">v1.0.0.tar.gz</code>.</p>
6244: <pre class="programlisting">
6245: DISTNAME= foo-1.0.0
1.174 leot 6246: MASTER_SITES= -https://www.example.com/archive/v1.0.0.tar.gz
1.66 asau 6247: </pre>
1.1 dsieger 6248: <p>There are some predefined values for
6249: <code class="varname">MASTER_SITES</code>, which can be used in
6250: packages. The names of the variables should speak for
6251: themselves.</p>
1.156 leot 6252: <table border="0" summary="Simple list" class="simplelist">
6253: <tr>
6254: <td>MASTER_SITE_APACHE</td>
6255: <td>MASTER_SITE_BACKUP</td>
6256: </tr>
6257: <tr>
6258: <td>MASTER_SITE_CRATESIO</td>
6259: <td>MASTER_SITE_CYGWIN</td>
6260: </tr>
6261: <tr>
6262: <td>MASTER_SITE_DEBIAN</td>
6263: <td>MASTER_SITE_FREEBSD</td>
6264: </tr>
6265: <tr>
6266: <td>MASTER_SITE_FREEBSD_LOCAL</td>
6267: <td>MASTER_SITE_GENTOO</td>
6268: </tr>
6269: <tr>
6270: <td>MASTER_SITE_GITHUB</td>
6271: <td>MASTER_SITE_GNOME</td>
6272: </tr>
6273: <tr>
6274: <td>MASTER_SITE_GNU</td>
6275: <td>MASTER_SITE_GNUSTEP</td>
6276: </tr>
6277: <tr>
6278: <td>MASTER_SITE_HASKELL_HACKAGE</td>
6279: <td>MASTER_SITE_IFARCHIVE</td>
6280: </tr>
6281: <tr>
6282: <td>MASTER_SITE_KDE</td>
6283: <td>MASTER_SITE_MOZILLA</td>
6284: </tr>
6285: <tr>
6286: <td>MASTER_SITE_MOZILLA_ALL</td>
6287: <td>MASTER_SITE_MYSQL</td>
6288: </tr>
6289: <tr>
6290: <td>MASTER_SITE_NETLIB</td>
6291: <td>MASTER_SITE_OPENBSD</td>
6292: </tr>
6293: <tr>
6294: <td>MASTER_SITE_OPENOFFICE</td>
6295: <td>MASTER_SITE_OSDN</td>
6296: </tr>
6297: <tr>
6298: <td>MASTER_SITE_PERL_CPAN</td>
6299: <td>MASTER_SITE_PGSQL</td>
6300: </tr>
6301: <tr>
6302: <td>MASTER_SITE_PYPI</td>
6303: <td>MASTER_SITE_RUBYGEMS</td>
6304: </tr>
6305: <tr>
6306: <td>MASTER_SITE_R_CRAN</td>
6307: <td>MASTER_SITE_SOURCEFORGE</td>
6308: </tr>
6309: <tr>
6310: <td>MASTER_SITE_SUNSITE</td>
6311: <td>MASTER_SITE_SUSE</td>
6312: </tr>
6313: <tr>
6314: <td>MASTER_SITE_TEX_CTAN</td>
6315: <td>MASTER_SITE_XCONTRIB</td>
6316: </tr>
6317: <tr>
6318: <td>MASTER_SITE_XEMACS</td>
6319: <td>MASTER_SITE_XORG</td>
6320: </tr>
6321: </table>
1.1 dsieger 6322: <p>Some explanations for the less self-explaining ones:
6323: <code class="varname">MASTER_SITE_BACKUP</code> contains backup sites
1.26 wiz 6324: for packages that are maintained in <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/%24%7BDIST_SUBDIR%7D" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/${DIST_SUBDIR}</a>. <code class="varname">MASTER_SITE_LOCAL</code> contains local
1.25 spz 6325: package source distributions that are maintained in <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/LOCAL_PORTS/" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/LOCAL_PORTS/</a>.</p>
1.1 dsieger 6326: <p>If you choose one of these predefined sites, you may
6327: want to specify a subdirectory of that site. Since these
6328: macros may expand to more than one actual site, you
6329: <span class="emphasis"><em>must</em></span> use the following construct to
6330: specify a subdirectory:</p>
6331: <pre class="programlisting">
6332: MASTER_SITES= ${MASTER_SITE_GNU:=subdirectory/name/}
6333: MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=project_name/}
6334: </pre>
6335: <p>Note the trailing slash after the subdirectory
6336: name.</p>
6337: </div>
1.41 asau 6338: <div class="sect2">
1.1 dsieger 6339: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 6340: <a name="build.fetch.how"></a>19.5.2. How are the files fetched?</h3></div></div></div>
1.1 dsieger 6341: <p>The <span class="emphasis"><em>fetch</em></span> phase makes sure that
6342: all the distfiles exist in a local directory
6343: (<code class="varname">DISTDIR</code>, which can be set by the pkgsrc
6344: user). If the files do not exist, they are fetched using
6345: commands of the form</p>
6346: <pre class="programlisting">
6347: ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS}
6348: </pre>
6349: <p>where <code class="literal">${site}</code> varies through
6350: several possibilities in turn: first,
6351: <code class="varname">MASTER_SITE_OVERRIDE</code> is tried, then the
6352: sites specified in either <code class="varname">SITES.file</code> if
6353: defined, else <code class="varname">MASTER_SITES</code> or
6354: <code class="varname">PATCH_SITES</code>, as applies, then finally the
6355: value of <code class="varname">MASTER_SITE_BACKUP</code>. The order of
6356: all except the first and the last can be optionally sorted
6357: by the user, via setting either
6358: <code class="varname">MASTER_SORT_RANDOM</code>, and
6359: <code class="varname">MASTER_SORT_AWK</code> or
6360: <code class="varname">MASTER_SORT_REGEX</code>.</p>
1.16 jnemeth 6361: <p> The specific command and arguments used depend on the
6362: <code class="varname">FETCH_USING</code> parameter. The example above is
6363: for <code class="literal">FETCH_USING=custom</code>.</p>
1.1 dsieger 6364: <p>The distfiles mirror run by the NetBSD Foundation uses the
6365: <span class="emphasis"><em>mirror-distfiles</em></span> target to mirror the
6366: distfiles, if they are freely distributable. Packages setting
6367: <code class="varname">NO_SRC_ON_FTP</code> (usually to
1.23 wiz 6368: <span class="quote">“<span class="quote">${RESTRICTED}</span>”</span>) will not have their distfiles
1.1 dsieger 6369: mirrored.</p>
6370: </div>
6371: </div>
1.41 asau 6372: <div class="sect1">
1.1 dsieger 6373: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6374: <a name="build.checksum"></a>19.6. The <span class="emphasis"><em>checksum</em></span> phase</h2></div></div></div>
1.1 dsieger 6375: <p>After the distfile(s) are fetched, their checksum is
6376: generated and compared with the checksums stored in the
6377: distinfo file. If the checksums don't match, the build is
6378: aborted. This is to ensure the same distfile is used for
6379: building, and that the distfile wasn't changed, e.g. by some
6380: malign force, deliberately changed distfiles on the master
6381: distribution site or network lossage.</p>
6382: </div>
1.41 asau 6383: <div class="sect1">
1.1 dsieger 6384: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6385: <a name="build.extract"></a>19.7. The <span class="emphasis"><em>extract</em></span> phase</h2></div></div></div>
1.1 dsieger 6386: <p>When the distfiles are present on the local system, they
6387: need to be extracted, as they usually come in the form of some
6388: compressed archive format.</p>
6389: <p>By default, all <code class="varname">DISTFILES</code> are
6390: extracted. If you only need some of them, you can set the
6391: <code class="varname">EXTRACT_ONLY</code> variable to the list of those
6392: files.</p>
6393: <p>Extracting the files is usually done by a little
6394: program, <code class="filename">mk/extract/extract</code>, which
6395: already knows how to extract various archive formats, so most
6396: likely you will not need to change anything here. But if you
6397: need, the following variables may help you:</p>
1.41 asau 6398: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6399: <dt><span class="term"><code class="varname">EXTRACT_OPTS_{BIN,LHA,PAX,RAR,TAR,ZIP,ZOO}</code></span></dt>
6400: <dd><p>Use these variables to override the default
6401: options for an extract command, which are defined in
6402: <code class="filename">mk/extract/extract</code>.</p></dd>
6403: <dt><span class="term"><code class="varname">EXTRACT_USING</code></span></dt>
6404: <dd><p>This variable can be set to
1.14 jmcneill 6405: <code class="literal">bsdtar</code>, <code class="literal">gtar</code>, <code class="literal">nbtar</code>
6406: (which is the default value), <code class="literal">pax</code>, or an
1.1 dsieger 6407: absolute pathname pointing to the command with which tar
1.14 jmcneill 6408: archives should be extracted. It is preferred to choose bsdtar over gtar
6409: if NetBSD's pax-as-tar is not good enough.</p></dd>
1.1 dsieger 6410: </dl></div>
6411: <p>If the <code class="filename">extract</code> program doesn't
6412: serve your needs, you can also override the
6413: <code class="varname">EXTRACT_CMD</code> variable, which holds the
6414: command used for extracting the files. This command is
6415: executed in the <code class="filename">${WRKSRC}</code>
6416: directory. During execution of this command, the shell
6417: variable <code class="varname">extract_file</code> holds the absolute
6418: pathname of the file that is going to be extracted.</p>
6419: <p>And if that still does not suffice, you can override the
6420: <code class="varname">do-extract</code> target in the package
6421: Makefile.</p>
6422: </div>
1.41 asau 6423: <div class="sect1">
1.1 dsieger 6424: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6425: <a name="build.patch"></a>19.8. The <span class="emphasis"><em>patch</em></span> phase</h2></div></div></div>
1.1 dsieger 6426: <p>After extraction, all the patches named by the
6427: <code class="varname">PATCHFILES</code>, those present in the patches
6428: subdirectory of the package as well as in
6429: $LOCALPATCHES/$PKGPATH (e.g.
6430: <code class="filename">/usr/local/patches/graphics/png</code>) are
6431: applied. Patchfiles ending in <code class="filename">.Z</code> or
6432: <code class="filename">.gz</code> are uncompressed before they are
6433: applied, files ending in <code class="filename">.orig</code> or
6434: <code class="filename">.rej</code> are ignored. Any special options to
1.174 leot 6435: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?patch+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">patch</span>(1)</span></a> can be handed in
1.154 rillig 6436: <code class="varname">PATCH_DIST_ARGS</code>. See <a class="xref" href="#components.patches" title="13.3. patches/*">Section 13.3, “<code class="filename">patches/*</code>”</a> for more details.</p>
1.174 leot 6437: <p>By default <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?patch+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">patch</span>(1)</span></a> is given special args to make
1.1 dsieger 6438: it fail if the patches apply with some lines of fuzz. Please
6439: fix (regen) the patches so that they apply cleanly. The
6440: rationale behind this is that patches that don't apply cleanly
6441: may end up being applied in the wrong place, and cause severe
6442: harm there.</p>
6443: </div>
1.41 asau 6444: <div class="sect1">
1.1 dsieger 6445: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6446: <a name="build.tools"></a>19.9. The <span class="emphasis"><em>tools</em></span> phase</h2></div></div></div>
6447: <p>This is covered in <a class="xref" href="#tools" title="Chapter 20. Tools needed for building or running">Chapter 20, <i>Tools needed for building or running</i></a>.
1.1 dsieger 6448: </p>
6449: </div>
1.41 asau 6450: <div class="sect1">
1.1 dsieger 6451: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6452: <a name="build.wrapper"></a>19.10. The <span class="emphasis"><em>wrapper</em></span> phase</h2></div></div></div>
1.1 dsieger 6453: <p>This phase creates wrapper programs for the compilers and
6454: linkers. The following variables can be used to tweak the
6455: wrappers.</p>
1.41 asau 6456: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6457: <dt><span class="term"><code class="varname">ECHO_WRAPPER_MSG</code></span></dt>
6458: <dd><p>The command used to print progress
6459: messages. Does nothing by default. Set to
6460: <code class="literal">${ECHO}</code> to see the progress
6461: messages.</p></dd>
6462: <dt><span class="term"><code class="varname">WRAPPER_DEBUG</code></span></dt>
6463: <dd><p>This variable can be set to
6464: <code class="literal">yes</code> (default) or <code class="literal">no</code>,
6465: depending on whether you want additional information in the
6466: wrapper log file.</p></dd>
6467: <dt><span class="term"><code class="varname">WRAPPER_UPDATE_CACHE</code></span></dt>
6468: <dd><p>This variable can be set to
6469: <code class="literal">yes</code> or <code class="literal">no</code>, depending
6470: on whether the wrapper should use its cache, which will
6471: improve the speed. The default value is
6472: <code class="literal">yes</code>, but is forced to
6473: <code class="literal">no</code> if the platform does not support
6474: it.</p></dd>
6475: <dt><span class="term"><code class="varname">WRAPPER_REORDER_CMDS</code></span></dt>
6476: <dd><p>A list of reordering commands. A reordering
6477: command has the form
6478: <code class="literal">reorder:l:<em class="replaceable"><code>lib1</code></em>:<em class="replaceable"><code>lib2</code></em></code>.
6479: It ensures that that
6480: <code class="literal">-l<em class="replaceable"><code>lib1</code></em></code> occurs
6481: before <code class="literal">-l<em class="replaceable"><code>lib2</code></em></code>.
6482: </p></dd>
6483: </dl></div>
6484: </div>
1.41 asau 6485: <div class="sect1">
1.1 dsieger 6486: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6487: <a name="build.configure"></a>19.11. The <span class="emphasis"><em>configure</em></span> phase</h2></div></div></div>
1.1 dsieger 6488: <p>Most pieces of software need information on the header
6489: files, system calls, and library routines which are available
6490: on the platform they run on. The process of determining this
6491: information is known as configuration, and is usually
6492: automated. In most cases, a script is supplied with the
6493: distfiles, and its invocation results in generation of header
6494: files, Makefiles, etc.</p>
6495: <p>If the package contains a configure script, this can be
6496: invoked by setting <code class="varname">HAS_CONFIGURE</code> to
1.23 wiz 6497: <span class="quote">“<span class="quote">yes</span>”</span>. If the configure script is a GNU autoconf
1.1 dsieger 6498: script, you should set <code class="varname">GNU_CONFIGURE</code> to
1.23 wiz 6499: <span class="quote">“<span class="quote">yes</span>”</span> instead. What happens in the
1.1 dsieger 6500: <span class="emphasis"><em>configure</em></span> phase is roughly:</p>
6501: <pre class="programlisting">
6502: .for d in ${CONFIGURE_DIRS}
6503: cd ${WRKSRC} \
6504: && cd ${d} \
6505: && env ${CONFIGURE_ENV} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
6506: .endfor
6507: </pre>
6508: <p><code class="varname">CONFIGURE_DIRS</code> (default:
1.23 wiz 6509: <span class="quote">“<span class="quote">.</span>”</span>) is a list of pathnames relative to
1.1 dsieger 6510: <code class="varname">WRKSRC</code>. In each of these directories, the
6511: configure script is run with the environment
6512: <code class="varname">CONFIGURE_ENV</code> and arguments
6513: <code class="varname">CONFIGURE_ARGS</code>. The variables
6514: <code class="varname">CONFIGURE_ENV</code>,
6515: <code class="varname">CONFIGURE_SCRIPT</code> (default:
1.23 wiz 6516: <span class="quote">“<span class="quote">./configure</span>”</span>) and
1.1 dsieger 6517: <code class="varname">CONFIGURE_ARGS</code> may all be changed by the
6518: package.</p>
1.37 wiz 6519: <p>If the program uses the Perl way of configuration (mainly Perl
6520: modules, but not only), i.e. a file called
6521: <code class="filename">Makefile.PL</code>, it should include
6522: <code class="filename">../../lang/perl5/module.mk</code>. To set any parameter for
6523: <code class="filename">Makefile.PL</code> use the <code class="varname">MAKE_PARAMS</code>
6524: variable (e.g., <code class="literal">MAKE_PARAMS+=foo=bar</code></p>
1.1 dsieger 6525: <p>If the program uses an <code class="filename">Imakefile</code>
6526: for configuration, the appropriate steps can be invoked by
6527: setting <code class="varname">USE_IMAKE</code> to
1.99 sevan 6528: <span class="quote">“<span class="quote">yes</span>”</span>. If you only need xmkmf, add it to <code class="varname">USE_TOOLS</code>.
6529: You can add variables to xmkmf's environment by adding them to the
1.1 dsieger 6530: <code class="varname">SCRIPTS_ENV</code> variable.</p>
1.11 rillig 6531: <p>If the program uses <code class="filename">cmake</code>
6532: for configuration, the appropriate steps can be invoked by
1.23 wiz 6533: setting <code class="varname">USE_CMAKE</code> to <span class="quote">“<span class="quote">yes</span>”</span>.
1.11 rillig 6534: You can add variables to cmake's environment by adding them to the
6535: <code class="varname">CONFIGURE_ENV</code> variable and arguments to cmake
6536: by adding them to the <code class="varname">CMAKE_ARGS</code> variable.
6537: The top directory argument is given by the
6538: <code class="varname">CMAKE_ARG_PATH</code> variable, that defaults to
1.23 wiz 6539: <span class="quote">“<span class="quote">.</span>”</span> (relative to <code class="varname">CONFIGURE_DIRS</code>)</p>
1.1 dsieger 6540: <p>If there is no configure step at all, set
1.23 wiz 6541: <code class="varname">NO_CONFIGURE</code> to <span class="quote">“<span class="quote">yes</span>”</span>.</p>
1.1 dsieger 6542: </div>
1.41 asau 6543: <div class="sect1">
1.1 dsieger 6544: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6545: <a name="build.build"></a>19.12. The <span class="emphasis"><em>build</em></span> phase</h2></div></div></div>
1.1 dsieger 6546: <p>For building a package, a rough equivalent of the
6547: following code is executed.</p>
6548: <pre class="programlisting">
6549: .for d in ${BUILD_DIRS}
6550: cd ${WRKSRC} \
6551: && cd ${d} \
6552: && env ${MAKE_ENV} \
6553: ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \
6554: -f ${MAKE_FILE} \
6555: ${BUILD_TARGET}
6556: .endfor
6557: </pre>
6558: <p><code class="varname">BUILD_DIRS</code> (default:
1.23 wiz 6559: <span class="quote">“<span class="quote">.</span>”</span>) is a list of pathnames relative to
1.1 dsieger 6560: <code class="varname">WRKSRC</code>. In each of these directories,
6561: <code class="varname">MAKE_PROGRAM</code> is run with the environment
6562: <code class="varname">MAKE_ENV</code> and arguments
6563: <code class="varname">BUILD_MAKE_FLAGS</code>. The variables
6564: <code class="varname">MAKE_ENV</code>,
6565: <code class="varname">BUILD_MAKE_FLAGS</code>,
6566: <code class="varname">MAKE_FILE</code> and
6567: <code class="varname">BUILD_TARGET</code> may all be changed by the
6568: package.</p>
6569: <p>The default value of <code class="varname">MAKE_PROGRAM</code> is
1.23 wiz 6570: <span class="quote">“<span class="quote">gmake</span>”</span> if <code class="varname">USE_TOOLS</code> contains
6571: <span class="quote">“<span class="quote">gmake</span>”</span>, <span class="quote">“<span class="quote">make</span>”</span> otherwise. The
1.1 dsieger 6572: default value of <code class="varname">MAKE_FILE</code> is
1.23 wiz 6573: <span class="quote">“<span class="quote">Makefile</span>”</span>, and <code class="varname">BUILD_TARGET</code>
6574: defaults to <span class="quote">“<span class="quote">all</span>”</span>.</p>
1.1 dsieger 6575: <p>If there is no build step at all, set
1.23 wiz 6576: <code class="varname">NO_BUILD</code> to <span class="quote">“<span class="quote">yes</span>”</span>.</p>
1.1 dsieger 6577: </div>
1.41 asau 6578: <div class="sect1">
1.1 dsieger 6579: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6580: <a name="build.test"></a>19.13. The <span class="emphasis"><em>test</em></span> phase</h2></div></div></div>
1.1 dsieger 6581: <p>[TODO]</p>
6582: </div>
1.41 asau 6583: <div class="sect1">
1.1 dsieger 6584: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6585: <a name="build.install"></a>19.14. The <span class="emphasis"><em>install</em></span> phase</h2></div></div></div>
1.1 dsieger 6586: <p>Once the build stage has completed, the final step is to
6587: install the software in public directories, so users can
6588: access the programs and files.</p>
6589: <p>In the <span class="emphasis"><em>install</em></span> phase, a rough
6590: equivalent of the following code is executed. Additionally,
6591: before and after this code, much magic is performed to do
6592: consistency checks, registering the package, and so on.</p>
6593: <pre class="programlisting">
6594: .for d in ${INSTALL_DIRS}
6595: cd ${WRKSRC} \
6596: && cd ${d} \
6597: && env ${MAKE_ENV} \
6598: ${MAKE_PROGRAM} ${INSTALL_MAKE_FLAGS} \
6599: -f ${MAKE_FILE} \
6600: ${INSTALL_TARGET}
6601: .endfor
6602: </pre>
6603: <p>The variable's meanings are analogous to the ones in the
6604: <span class="emphasis"><em>build</em></span> phase.
6605: <code class="varname">INSTALL_DIRS</code> defaults to
6606: <code class="varname">BUILD_DIRS</code>. <code class="varname">INSTALL_TARGET</code>
1.23 wiz 6607: is <span class="quote">“<span class="quote">install</span>”</span> by default, plus
6608: <span class="quote">“<span class="quote">install.man</span>”</span> if <code class="varname">USE_IMAKE</code> is
1.1 dsieger 6609: defined and <code class="varname">NO_INSTALL_MANPAGES</code> is not
6610: defined.</p>
6611: <p>In the <span class="emphasis"><em>install</em></span> phase, the following
6612: variables are useful. They are all variations of the
1.174 leot 6613: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?install+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">install</span>(1)</span></a> command that have the owner, group and
1.1 dsieger 6614: permissions preset. <code class="varname">INSTALL</code> is the plain
6615: install command. The specialized variants, together with their
6616: intended use, are:</p>
1.41 asau 6617: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6618: <dt><span class="term"><code class="varname">INSTALL_PROGRAM_DIR</code></span></dt>
6619: <dd><p>directories that contain
6620: binaries</p></dd>
6621: <dt><span class="term"><code class="varname">INSTALL_SCRIPT_DIR</code></span></dt>
6622: <dd><p>directories that contain
6623: scripts</p></dd>
6624: <dt><span class="term"><code class="varname">INSTALL_LIB_DIR</code></span></dt>
6625: <dd><p>directories that contain shared and static
6626: libraries</p></dd>
6627: <dt><span class="term"><code class="varname">INSTALL_DATA_DIR</code></span></dt>
6628: <dd><p>directories that contain data
6629: files</p></dd>
6630: <dt><span class="term"><code class="varname">INSTALL_MAN_DIR</code></span></dt>
6631: <dd><p>directories that contain man
6632: pages</p></dd>
1.100 leot 6633: <dt><span class="term"><code class="varname">INSTALL_GAME_DIR</code></span></dt>
6634: <dd><p>directories that contain data files for games
6635: </p></dd>
1.1 dsieger 6636: <dt><span class="term"><code class="varname">INSTALL_PROGRAM</code></span></dt>
6637: <dd><p>binaries that can be stripped from debugging
6638: symbols</p></dd>
6639: <dt><span class="term"><code class="varname">INSTALL_SCRIPT</code></span></dt>
6640: <dd><p>binaries that cannot be
6641: stripped</p></dd>
6642: <dt><span class="term"><code class="varname">INSTALL_GAME</code></span></dt>
6643: <dd><p>game
6644: binaries</p></dd>
6645: <dt><span class="term"><code class="varname">INSTALL_LIB</code></span></dt>
6646: <dd><p>shared and static
6647: libraries</p></dd>
6648: <dt><span class="term"><code class="varname">INSTALL_DATA</code></span></dt>
6649: <dd><p>data files</p></dd>
6650: <dt><span class="term"><code class="varname">INSTALL_GAME_DATA</code></span></dt>
6651: <dd><p>data files for
6652: games</p></dd>
6653: <dt><span class="term"><code class="varname">INSTALL_MAN</code></span></dt>
6654: <dd><p>man pages</p></dd>
6655: </dl></div>
6656: <p>Some other variables are:</p>
1.41 asau 6657: <div class="variablelist"><dl class="variablelist">
1.106 tnn 6658: <dt><span class="term"><code class="varname">INSTALL_UNSTRIPPED</code></span></dt>
1.174 leot 6659: <dd><p>If set to <code class="literal">yes</code>, do not run <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?strip+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">strip</span>(1)</span></a>
1.106 tnn 6660: when installing binaries. Any debugging sections and symbols present in
6661: binaries will be preserved.
6662: </p></dd>
1.1 dsieger 6663: <dt><span class="term"><code class="varname">INSTALLATION_DIRS</code></span></dt>
6664: <dd><p>A list of directories relative to
6665: <code class="varname">PREFIX</code> that are created by pkgsrc at the
6666: beginning of the <span class="emphasis"><em>install</em></span> phase.
6667: The package is supposed to create all needed directories itself
6668: before installing files to it and list all other directories here.
6669: </p></dd>
6670: </dl></div>
6671: <p>In the rare cases that a package shouldn't install anything,
1.23 wiz 6672: set <code class="varname">NO_INSTALL</code> to <span class="quote">“<span class="quote">yes</span>”</span>. This is
1.1 dsieger 6673: mostly relevant for packages in the <code class="filename">regress</code>
6674: category.</p>
6675: </div>
1.41 asau 6676: <div class="sect1">
1.1 dsieger 6677: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6678: <a name="build.package"></a>19.15. The <span class="emphasis"><em>package</em></span> phase</h2></div></div></div>
1.1 dsieger 6679: <p>Once the install stage has completed, a binary package of
6680: the installed files can be built. These binary packages can be
6681: used for quick installation without previous compilation, e.g. by
1.10 hubertf 6682: the <span class="command"><strong>make bin-install</strong></span> or by using
6683: <span class="command"><strong>pkg_add</strong></span>.</p>
1.1 dsieger 6684: <p>By default, the binary packages are created in
6685: <code class="filename">${PACKAGES}/All</code> and symlinks are created in
6686: <code class="filename">${PACKAGES}/<em class="replaceable"><code>category</code></em></code>,
6687: one for each category in the <code class="varname">CATEGORIES</code>
6688: variable. <code class="varname">PACKAGES</code> defaults to
6689: <code class="filename">pkgsrc/packages</code>.</p>
6690: </div>
1.41 asau 6691: <div class="sect1">
1.1 dsieger 6692: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6693: <a name="build.clean"></a>19.16. Cleaning up</h2></div></div></div>
1.1 dsieger 6694: <p>Once you're finished with a package, you can clean the work
1.10 hubertf 6695: directory by running <span class="command"><strong>make clean</strong></span>. If you want
1.1 dsieger 6696: to clean the work directories of all dependencies too, use
1.10 hubertf 6697: <span class="command"><strong>make clean-depends</strong></span>.</p>
1.1 dsieger 6698: </div>
1.41 asau 6699: <div class="sect1">
1.1 dsieger 6700: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6701: <a name="build.helpful-targets"></a>19.17. Other helpful targets</h2></div></div></div>
1.41 asau 6702: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6703: <dt><span class="term">pre/post-*</span></dt>
6704: <dd><p>For any of the main targets described in the
6705: previous section, two auxiliary targets exist with
1.23 wiz 6706: <span class="quote">“<span class="quote">pre-</span>”</span> and <span class="quote">“<span class="quote">post-</span>”</span> used as a
1.1 dsieger 6707: prefix for the main target's name. These targets are
6708: invoked before and after the main target is called,
6709: allowing extra configuration or installation steps be
6710: performed from a package's Makefile, for example, which
6711: a program's configure script or install target
6712: omitted.</p></dd>
6713: <dt><span class="term">do-*</span></dt>
6714: <dd><p>Should one of the main targets do the wrong thing,
6715: and should there be no variable to fix this, you can
6716: redefine it with the do-* target. (Note that redefining
6717: the target itself instead of the do-* target is a bad
6718: idea, as the pre-* and post-* targets won't be called
6719: anymore, etc.) You will not usually need to do
6720: this.</p></dd>
6721: <dt><span class="term">reinstall</span></dt>
6722: <dd>
1.10 hubertf 6723: <p>If you did a <span class="command"><strong>make install</strong></span> and
1.1 dsieger 6724: you noticed some file was not installed properly, you
6725: can repeat the installation with this target, which will
1.23 wiz 6726: ignore the <span class="quote">“<span class="quote">already installed</span>”</span> flag.</p>
1.1 dsieger 6727: <p>This is the default value of
6728: <code class="varname">DEPENDS_TARGET</code> except in the case of
1.10 hubertf 6729: <span class="command"><strong>make update</strong></span> and <span class="command"><strong>make
1.1 dsieger 6730: package</strong></span>, where the defaults are
1.23 wiz 6731: <span class="quote">“<span class="quote">package</span>”</span> and <span class="quote">“<span class="quote">update</span>”</span>,
1.1 dsieger 6732: respectively.</p>
6733: </dd>
6734: <dt><span class="term">deinstall</span></dt>
6735: <dd>
1.174 leot 6736: <p>This target does a <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_delete</span>(1)</span></a> in the
1.1 dsieger 6737: current directory, effectively de-installing the
6738: package. The following variables can be used to tune the
6739: behaviour:</p>
1.41 asau 6740: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6741: <dt><span class="term"><code class="varname">PKG_VERBOSE</code></span></dt>
1.174 leot 6742: <dd><p>Add a "-v" to the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_delete</span>(1)</span></a> command.</p></dd>
1.1 dsieger 6743: <dt><span class="term"><code class="varname">DEINSTALLDEPENDS</code></span></dt>
6744: <dd><p>Remove all packages that require (depend on)
6745: the given package. This can be used to remove any
6746: packages that may have been pulled in by a given
1.10 hubertf 6747: package, e.g. if <span class="command"><strong>make deinstall
1.1 dsieger 6748: DEINSTALLDEPENDS=1</strong></span> is done in
6749: <code class="filename">pkgsrc/x11/kde</code>, this is
6750: likely to remove whole KDE. Works by adding
1.174 leot 6751: <span class="quote">“<span class="quote">-R</span>”</span> to the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_delete</span>(1)</span></a>
1.1 dsieger 6752: command line.</p></dd>
6753: </dl></div>
6754: </dd>
6755: <dt><span class="term">bin-install</span></dt>
6756: <dd><p>Install a binary package from local disk and via FTP
6757: from a list of sites (see the
6758: <code class="varname">BINPKG_SITES</code> variable), and do a
1.10 hubertf 6759: <span class="command"><strong>make package</strong></span> if no binary package is
1.1 dsieger 6760: available anywhere. The arguments given to
1.10 hubertf 6761: <span class="command"><strong>pkg_add</strong></span> can be set via
1.1 dsieger 6762: <code class="varname">BIN_INSTALL_FLAGS</code> e.g., to do verbose
6763: operation, etc.</p></dd>
1.95 wiz 6764: <dt><span class="term">install-clean</span></dt>
6765: <dd><p>This target removes the state files for the "install" and later
6766: phases so that the "install" target may be re-invoked. This can be
6767: used after editing the PLIST to install the package without
6768: rebuilding it.</p></dd>
6769: <dt><span class="term">build-clean</span></dt>
6770: <dd><p>This target removes the state files for the "build" and later
6771: phases so that the "build" target may be re-invoked.</p></dd>
1.1 dsieger 6772: <dt><span class="term">update</span></dt>
6773: <dd>
6774: <p>This target causes the current package to be
6775: updated to the latest version. The package and all
6776: depending packages first get de-installed, then current
6777: versions of the corresponding packages get compiled and
6778: installed. This is similar to manually noting which
6779: packages are currently installed, then performing a
1.10 hubertf 6780: series of <span class="command"><strong>make deinstall</strong></span> and
6781: <span class="command"><strong>make install</strong></span> (or whatever
1.1 dsieger 6782: <code class="varname">UPDATE_TARGET</code> is set to) for these
6783: packages.</p>
1.23 wiz 6784: <p>You can use the <span class="quote">“<span class="quote">update</span>”</span> target to
1.10 hubertf 6785: resume package updating in case a previous <span class="command"><strong>make
1.1 dsieger 6786: update</strong></span> was interrupted for some reason.
6787: However, in this case, make sure you don't call
1.10 hubertf 6788: <span class="command"><strong>make clean</strong></span> or otherwise remove the
1.1 dsieger 6789: list of dependent packages in <code class="varname">WRKDIR</code>.
6790: Otherwise, you lose the ability to automatically update
6791: the current package along with the dependent packages
6792: you have installed.</p>
1.10 hubertf 6793: <p>Resuming an interrupted <span class="command"><strong>make
1.1 dsieger 6794: update</strong></span> will only work as long as the package
6795: tree remains unchanged. If the source code for one of
6796: the packages to be updated has been changed, resuming
1.10 hubertf 6797: <span class="command"><strong>make update</strong></span> will most certainly
1.1 dsieger 6798: fail!</p>
6799: <p>The following variables can be used either on the
1.10 hubertf 6800: command line or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to
6801: alter the behaviour of <span class="command"><strong>make
1.1 dsieger 6802: update</strong></span>:</p>
1.41 asau 6803: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6804: <dt><span class="term"><code class="varname">UPDATE_TARGET</code></span></dt>
6805: <dd><p>Install target to recursively use for the
6806: updated package and the dependent packages.
6807: Defaults to <code class="varname">DEPENDS_TARGET</code> if
1.23 wiz 6808: set, <span class="quote">“<span class="quote">install</span>”</span> otherwise for
1.10 hubertf 6809: <span class="command"><strong>make update</strong></span>. Other good
1.23 wiz 6810: targets are <span class="quote">“<span class="quote">package</span>”</span> or
6811: <span class="quote">“<span class="quote">bin-install</span>”</span>. Do not set this to
6812: <span class="quote">“<span class="quote">update</span>”</span> or you will get stuck in an
1.1 dsieger 6813: endless loop!</p></dd>
6814: <dt><span class="term"><code class="varname">NOCLEAN</code></span></dt>
6815: <dd><p>Don't clean up after updating. Useful if
6816: you want to leave the work sources of the updated
6817: packages around for inspection or other purposes.
6818: Be sure you eventually clean up the source tree
1.23 wiz 6819: (see the <span class="quote">“<span class="quote">clean-update</span>”</span> target below)
1.1 dsieger 6820: or you may run into troubles with old source code
6821: still lying around on your next
1.10 hubertf 6822: <span class="command"><strong>make</strong></span> or <span class="command"><strong>make
1.1 dsieger 6823: update</strong></span>.</p></dd>
6824: <dt><span class="term"><code class="varname">REINSTALL</code></span></dt>
6825: <dd><p>Deinstall each package before installing
6826: (making <code class="varname">DEPENDS_TARGET</code>). This
6827: may be necessary if the
1.23 wiz 6828: <span class="quote">“<span class="quote">clean-update</span>”</span> target (see below) was
1.10 hubertf 6829: called after interrupting a running <span class="command"><strong>make
1.1 dsieger 6830: update</strong></span>.</p></dd>
6831: <dt><span class="term"><code class="varname">DEPENDS_TARGET</code></span></dt>
6832: <dd><p>Allows you to disable recursion and hardcode
6833: the target for packages. The default is
1.23 wiz 6834: <span class="quote">“<span class="quote">update</span>”</span> for the update target,
1.1 dsieger 6835: facilitating a recursive update of prerequisite
6836: packages. Only set
6837: <code class="varname">DEPENDS_TARGET</code> if you want to
6838: disable recursive updates. Use
6839: <code class="varname">UPDATE_TARGET</code> instead to just
6840: set a specific target for each package to be
1.10 hubertf 6841: installed during <span class="command"><strong>make update</strong></span>
1.1 dsieger 6842: (see above).</p></dd>
6843: </dl></div>
6844: </dd>
6845: <dt><span class="term">clean-update</span></dt>
6846: <dd>
6847: <p>Clean the source tree for all packages that would
1.10 hubertf 6848: get updated if <span class="command"><strong>make update</strong></span> was called
1.1 dsieger 6849: from the current directory. This target should not be
6850: used if the current package (or any of its depending
6851: packages) have already been de-installed (e.g., after
1.10 hubertf 6852: calling <span class="command"><strong>make update</strong></span>) or you may lose
1.1 dsieger 6853: some packages you intended to update. As a rule of
6854: thumb: only use this target <span class="emphasis"><em>before</em></span>
1.10 hubertf 6855: the first time you run <span class="command"><strong>make update</strong></span>
1.1 dsieger 6856: and only if you have a dirty package tree (e.g., if you
6857: used <code class="varname">NOCLEAN</code>).</p>
6858: <p>If you are unsure about whether your tree is
1.10 hubertf 6859: clean, you can either perform a <span class="command"><strong>make
1.1 dsieger 6860: clean</strong></span> at the top of the tree, or use the
6861: following sequence of commands from the directory of the
6862: package you want to update (<span class="emphasis"><em>before</em></span>
1.10 hubertf 6863: running <span class="command"><strong>make update</strong></span> for the first
1.1 dsieger 6864: time, otherwise you lose all the packages you wanted to
6865: update!):</p>
6866: <pre class="screen">
6867: <code class="prompt">#</code> <strong class="userinput"><code>make clean-update</code></strong>
6868: <code class="prompt">#</code> <strong class="userinput"><code>make clean CLEANDEPENDS=YES</code></strong>
6869: <code class="prompt">#</code> <strong class="userinput"><code>make update</code></strong>
6870: </pre>
6871: <p>The following variables can be used either on the
1.10 hubertf 6872: command line or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to alter the behaviour of
6873: <span class="command"><strong>make clean-update</strong></span>:</p>
1.41 asau 6874: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6875: <dt><span class="term"><code class="varname">CLEAR_DIRLIST</code></span></dt>
1.10 hubertf 6876: <dd><p>After <span class="command"><strong>make clean</strong></span>, do not
1.1 dsieger 6877: reconstruct the list of directories to update for
1.10 hubertf 6878: this package. Only use this if <span class="command"><strong>make
1.1 dsieger 6879: update</strong></span> successfully installed all
6880: packages you wanted to update. Normally, this is
1.10 hubertf 6881: done automatically on <span class="command"><strong>make
1.1 dsieger 6882: update</strong></span>, but may have been suppressed by
6883: the <code class="varname">NOCLEAN</code> variable (see
6884: above).</p></dd>
6885: </dl></div>
6886: </dd>
6887: <dt><span class="term">replace</span></dt>
6888: <dd>
6889: <p>Update the installation of the current package. This
6890: differs from update in that it does not replace dependent
1.137 leot 6891: packages. You will need to install <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_tarup/README.html" target="_top"><code class="filename">pkgtools/pkg_tarup</code></a> for this
1.1 dsieger 6892: target to work.</p>
6893: <p><span class="emphasis"><em>Be careful when using this
6894: target!</em></span> There are no guarantees that dependent
6895: packages will still work, in particular they will most
1.10 hubertf 6896: certainly break if you <span class="command"><strong>make replace</strong></span> a
1.1 dsieger 6897: library package whose shared library major version changed
6898: between your installed version and the new one. For this
6899: reason, this target is not officially supported and only
6900: recommended for advanced users.</p>
6901: </dd>
6902: <dt><span class="term">info</span></dt>
1.174 leot 6903: <dd><p>This target invokes <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_info+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_info</span>(1)</span></a> for the current
1.1 dsieger 6904: package. You can use this to check which version of a
6905: package is installed.</p></dd>
6906: <dt><span class="term">index</span></dt>
6907: <dd>
6908: <p>This is a top-level command, i.e. it should be used in
6909: the <code class="filename">pkgsrc</code> directory. It creates a
6910: database of all packages in the local pkgsrc tree, including
6911: dependencies, comment, maintainer, and some other useful
6912: information. Individual entries are created by running
1.10 hubertf 6913: <span class="command"><strong>make describe</strong></span> in the packages'
1.1 dsieger 6914: directories. This index file is saved as
6915: <code class="filename">pkgsrc/INDEX</code>. It can be displayed in
1.10 hubertf 6916: verbose format by running <span class="command"><strong>make
1.1 dsieger 6917: print-index</strong></span>. You can search in it with
1.10 hubertf 6918: <span class="command"><strong>make search
1.1 dsieger 6919: key=<em class="replaceable"><code>something</code></em></strong></span>. You can
6920: extract a list of all packages that depend on a particular
1.10 hubertf 6921: one by running <span class="command"><strong>make show-deps
1.1 dsieger 6922: PKG=<em class="replaceable"><code>somepackage</code></em></strong></span>.</p>
6923: <p>Running this command takes a very long time, some
6924: hours even on fast machines!</p>
6925: </dd>
6926: <dt><span class="term">readme</span></dt>
6927: <dd>
6928: <p>This target generates a
6929: <code class="filename">README.html</code> file, which can be
1.137 leot 6930: viewed using a browser such as <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a> or <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/links/README.html" target="_top"><code class="filename">www/links</code></a>. The generated files
1.1 dsieger 6931: contain references to any packages which are in the
6932: <code class="varname">PACKAGES</code> directory on the local
6933: host. The generated files can be made to refer to URLs
6934: based on <code class="varname">FTP_PKG_URL_HOST</code> and
6935: <code class="varname">FTP_PKG_URL_DIR</code>. For example, if I
6936: wanted to generate <code class="filename">README.html</code>
6937: files which pointed to binary packages on the local
6938: machine, in the directory
6939: <code class="filename">/usr/packages</code>, set
6940: <code class="varname">FTP_PKG_URL_HOST=file://localhost</code> and
6941: <code class="varname">FTP_PKG_URL_DIR=/usr/packages</code>. The
6942: <code class="varname">${PACKAGES}</code> directory and its
6943: subdirectories will be searched for all the binary
6944: packages.</p>
6945: <p>The target can be run at the toplevel or in category
6946: directories, in which case it descends recursively.</p>
6947: </dd>
6948: <dt><span class="term">readme-all</span></dt>
6949: <dd><p>This is a top-level command, run it in
6950: <code class="filename">pkgsrc</code>. Use this target to create a
6951: file <code class="filename">README-all.html</code> which contains a
6952: list of all packages currently available in the NetBSD
6953: Packages Collection, together with the category they belong
6954: to and a short description. This file is compiled from the
6955: <code class="filename">pkgsrc/*/README.html</code> files, so be sure
1.10 hubertf 6956: to run this <span class="emphasis"><em>after</em></span> a <span class="command"><strong>make
1.1 dsieger 6957: readme</strong></span>.</p></dd>
6958: <dt><span class="term">cdrom-readme</span></dt>
6959: <dd><p>This is very much the same as the
1.23 wiz 6960: <span class="quote">“<span class="quote">readme</span>”</span> target (see above), but is to be
1.1 dsieger 6961: used when generating a pkgsrc tree to be written to a
6962: CD-ROM. This target also produces
6963: <code class="filename">README.html</code> files, and can be made
6964: to refer to URLs based on
6965: <code class="varname">CDROM_PKG_URL_HOST</code> and
6966: <code class="varname">CDROM_PKG_URL_DIR</code>.</p></dd>
6967: <dt><span class="term">show-distfiles</span></dt>
6968: <dd><p>This target shows which distfiles and patchfiles
6969: are needed to build the package
6970: (<code class="varname">ALLFILES</code>, which contains all
6971: <code class="varname">DISTFILES</code> and
6972: <code class="varname">PATCHFILES</code>, but not
6973: <code class="filename">patches/*</code>).</p></dd>
6974: <dt><span class="term">show-downlevel</span></dt>
6975: <dd><p>This target shows nothing if the package is not
6976: installed. If a version of this package is installed,
6977: but is not the version provided in this version of
6978: pkgsrc, then a warning message is displayed. This target
6979: can be used to show which of your installed packages are
6980: downlevel, and so the old versions can be deleted, and
6981: the current ones added.</p></dd>
6982: <dt><span class="term">show-pkgsrc-dir</span></dt>
6983: <dd><p>This target shows the directory in the pkgsrc
6984: hierarchy from which the package can be built and
6985: installed. This may not be the same directory as the one
6986: from which the package was installed. This target is
6987: intended to be used by people who may wish to upgrade
6988: many packages on a single host, and can be invoked from
6989: the top-level pkgsrc Makefile by using the
1.23 wiz 6990: <span class="quote">“<span class="quote">show-host-specific-pkgs</span>”</span> target.</p></dd>
1.1 dsieger 6991: <dt><span class="term">show-installed-depends</span></dt>
6992: <dd><p>This target shows which installed packages match
6993: the current package's <code class="varname">DEPENDS</code>. Useful
6994: if out of date dependencies are causing build
6995: problems.</p></dd>
1.95 wiz 6996: <dt><span class="term">print-build-depends-list</span></dt>
6997: <dd><p>This target shows the list of packages that the current package
6998: depends on for building.</p></dd>
6999: <dt><span class="term">print-run-depends-list</span></dt>
7000: <dd><p>This target shows the list of packages that the current package
7001: depends on for running.</p></dd>
1.1 dsieger 7002: <dt><span class="term">check-shlibs</span></dt>
7003: <dd><p>After a package is installed, check all its
7004: binaries and (on ELF platforms) shared libraries to see
7005: if they find the shared libs they need. Run by default
1.10 hubertf 7006: if <code class="varname">PKG_DEVELOPER</code> is set in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p></dd>
1.1 dsieger 7007: <dt><span class="term">print-PLIST</span></dt>
7008: <dd>
1.23 wiz 7009: <p>After a <span class="quote">“<span class="quote">make install</span>”</span> from a new or
1.1 dsieger 7010: upgraded pkg, this prints out an attempt to generate a
1.10 hubertf 7011: new <code class="filename">PLIST</code> from a <span class="command"><strong>find
1.1 dsieger 7012: -newer work/.extract_done</strong></span>. An attempt is made
7013: to care for shared libs etc., but it is
7014: <span class="emphasis"><em>strongly</em></span> recommended to review the
7015: result before putting it into
7016: <code class="filename">PLIST</code>. On upgrades, it's useful to
7017: diff the output of this command against an already
7018: existing <code class="filename">PLIST</code> file.</p>
1.174 leot 7019: <p>If the package installs files via <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?tar+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">tar</span>(1)</span></a> or
1.1 dsieger 7020: other methods that don't update file access times, be
7021: sure to add these files manually to your
1.23 wiz 7022: <code class="filename">PLIST</code>, as the <span class="quote">“<span class="quote">find
7023: -newer</span>”</span> command used by this target won't catch
1.1 dsieger 7024: them!</p>
1.154 rillig 7025: <p>See <a class="xref" href="#print-PLIST" title="15.3. Tweaking output of make print-PLIST">Section 15.3, “Tweaking output of <span class="command"><strong>make print-PLIST</strong></span>”</a> for more
1.1 dsieger 7026: information on this target.</p>
7027: </dd>
7028: <dt><span class="term">bulk-package</span></dt>
7029: <dd>
7030: <p>Used to do bulk builds. If an appropriate binary
7031: package already exists, no action is taken. If not, this
7032: target will compile, install and package it (and its
7033: depends, if <code class="varname">PKG_DEPENDS</code> is set
1.154 rillig 7034: properly. See <a class="xref" href="#bulk" title="Chapter 8. Creating binary packages for everything in pkgsrc (bulk builds)">Chapter 8, <i>Creating binary packages for everything in pkgsrc (bulk
1.66 asau 7035: builds)</i></a>).
1.1 dsieger 7036: After creating the binary package, the sources, the
7037: just-installed package and its required packages are
7038: removed, preserving free disk space.</p>
7039: <p><span class="emphasis"><em>Beware that this target may deinstall
7040: all packages installed on a system!</em></span></p>
7041: </dd>
7042: <dt><span class="term">bulk-install</span></dt>
7043: <dd>
7044: <p>Used during bulk-installs to install required
7045: packages. If an up-to-date binary package is available,
1.174 leot 7046: it will be installed via <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>. If not,
1.10 hubertf 7047: <span class="command"><strong>make bulk-package</strong></span> will be executed,
1.1 dsieger 7048: but the installed binary won't be removed.</p>
7049: <p>A binary package is considered
1.23 wiz 7050: <span class="quote">“<span class="quote">up-to-date</span>”</span> to be installed via
1.174 leot 7051: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a> if:</p>
1.41 asau 7052: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 7053: <li class="listitem"><p>None of the package's files
1.1 dsieger 7054: (<code class="filename">Makefile</code>, ...) were modified
7055: since it was built.</p></li>
1.23 wiz 7056: <li class="listitem"><p>None of the package's required (binary)
1.1 dsieger 7057: packages were modified since it was built.</p></li>
7058: </ul></div>
7059: <p><span class="emphasis"><em>Beware that this target may deinstall
7060: all packages installed on a system!</em></span></p>
7061: </dd>
7062: </dl></div>
7063: </div>
7064: </div>
1.41 asau 7065: <div class="chapter">
1.1 dsieger 7066: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 7067: <a name="tools"></a>Chapter 20. Tools needed for building or running</h2></div></div></div>
1.1 dsieger 7068: <div class="toc">
7069: <p><b>Table of Contents</b></p>
1.100 leot 7070: <dl class="toc">
1.154 rillig 7071: <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt>
7072: <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt>
7073: <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt>
1.1 dsieger 7074: </dl>
7075: </div>
7076: <p>The <code class="varname">USE_TOOLS</code> definition is used both internally
7077: by pkgsrc and also for individual packages to define what commands
1.156 leot 7078: are needed for building a package (like <code class="varname">TOOL_DEPENDS</code>)
1.1 dsieger 7079: or for later run-time of an installed packaged (such as
7080: <code class="varname">DEPENDS</code>).
7081: If the native system provides an adequate tool, then in many cases, a pkgsrc
7082: package will not be used.</p>
7083: <p>When building a package, the replacement tools are
7084: made available in a directory (as symlinks or wrapper scripts)
7085: that is early in the executable search path. Just like the buildlink
7086: system, this helps with consistent builds.</p>
7087: <p>A tool may be needed to help build a specific package. For example,
7088: perl, GNU make (gmake) or yacc may be needed.</p>
7089: <p>Also a tool may be needed, for example, because the native system's supplied
7090: tool may be inefficient for building a package with pkgsrc.
7091: For example, a package may need GNU awk, bison (instead of
7092: yacc) or a better sed.</p>
7093: <p>The tools used by a package can be listed by running
1.10 hubertf 7094: <span class="command"><strong>make show-tools</strong></span>.</p>
1.41 asau 7095: <div class="sect1">
1.1 dsieger 7096: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7097: <a name="pkgsrc-tools"></a>20.1. Tools for pkgsrc builds</h2></div></div></div>
1.1 dsieger 7098: <p>The default set of tools used by pkgsrc is defined in
7099: <code class="filename">bsd.pkg.mk</code>. This includes standard Unix tools,
1.10 hubertf 7100: such as: <span class="command"><strong>cat</strong></span>, <span class="command"><strong>awk</strong></span>,
7101: <span class="command"><strong>chmod</strong></span>, <span class="command"><strong>test</strong></span>, and so on.
1.1 dsieger 7102: These can be seen by running:
1.10 hubertf 7103: <span class="command"><strong>make show-var VARNAME=USE_TOOLS</strong></span>.</p>
1.1 dsieger 7104: <p>If a package needs a specific program to build
7105: then the <code class="varname">USE_TOOLS</code> variable can be used
7106: to define the tools needed.</p>
7107: </div>
1.41 asau 7108: <div class="sect1">
1.1 dsieger 7109: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7110: <a name="package-tools"></a>20.2. Tools needed by packages</h2></div></div></div>
1.28 wiz 7111: <p>In the following examples, the :run means that it is needed at
7112: run-time (and becomes a DEPENDS).
1.1 dsieger 7113: The default is a build dependency which can be set with
7114: :build. (So in this example, it is the same as gmake:build
7115: and pkg-config:build.)</p>
7116: <pre class="programlisting">
7117: USE_TOOLS+= gmake perl:run pkg-config
7118: </pre>
7119: <p>When using the tools framework, a
7120: <code class="varname">TOOLS_PATH.foo</code> variable is defined
7121: which contains the full path to the appropriate tool. For example,
1.23 wiz 7122: <code class="varname">TOOLS_PATH.bash</code> could be <span class="quote">“<span class="quote">/bin/bash</span>”</span>
1.1 dsieger 7123: on Linux systems.</p>
7124: <p>If you always need a pkgsrc version of the
7125: tool at run-time, then just use <code class="varname">DEPENDS</code> instead.
7126: </p>
7127: </div>
1.41 asau 7128: <div class="sect1">
1.1 dsieger 7129: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7130: <a name="platform-tools"></a>20.3. Tools provided by platforms</h2></div></div></div>
1.1 dsieger 7131: <p>When improving or porting pkgsrc to a new platform, have a look
7132: at (or create) the corresponding platform specific make file fragment under
7133: <code class="filename">pkgsrc/mk/tools/tools.${OPSYS}.mk</code> which defines
7134: the name of the common tools. For example:</p>
7135: <pre class="programlisting">
7136: .if exists(/usr/bin/bzcat)
7137: TOOLS_PLATFORM.bzcat?= /usr/bin/bzcat
7138: .elif exists(/usr/bin/bzip2)
7139: TOOLS_PLATFORM.bzcat?= /usr/bin/bzip2 -cd
7140: .endif
7141:
7142: TOOLS_PLATFORM.true?= true # shell builtin
7143: </pre>
7144: </div>
7145: </div>
1.41 asau 7146: <div class="chapter">
1.1 dsieger 7147: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 7148: <a name="fixes"></a>Chapter 21. Making your package work</h2></div></div></div>
1.1 dsieger 7149: <div class="toc">
7150: <p><b>Table of Contents</b></p>
1.100 leot 7151: <dl class="toc">
1.154 rillig 7152: <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt>
1.1 dsieger 7153: <dd><dl>
1.154 rillig 7154: <dt><span class="sect2"><a href="#pulling-vars-from-etc-mk.conf">21.1.1. How to pull in user-settable variables from <code class="filename">mk.conf</code></a></span></dt>
7155: <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt>
7156: <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt>
7157: <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt>
7158: <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt>
7159: <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt>
7160: <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt>
7161: <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt>
7162: <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt>
7163: <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt>
7164: <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt>
7165: </dl></dd>
7166: <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
7167: <dd><dl>
7168: <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt>
7169: <dt><span class="sect2"><a href="#modified-distfiles-same-name">21.2.2. How to handle modified distfiles with the 'old' name</a></span></dt>
7170: <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt>
7171: </dl></dd>
7172: <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
7173: <dd><dl>
7174: <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt>
7175: <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt>
7176: <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt>
7177: </dl></dd>
7178: <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt>
7179: <dd><dl>
7180: <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt>
7181: <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt>
7182: <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt>
7183: <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt>
7184: <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt>
7185: </dl></dd>
7186: <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
7187: <dd><dl>
7188: <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt>
7189: <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt>
1.172 rillig 7190: <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt>
7191: <dt><span class="sect2"><a href="#undefined-reference">21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span></a></span></dt>
7192: <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt>
1.154 rillig 7193: </dl></dd>
7194: <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
7195: <dd><dl>
7196: <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt>
7197: <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt>
7198: <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt>
7199: <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt>
7200: <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt>
7201: <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt>
7202: <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt>
7203: <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt>
7204: <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt>
7205: <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt>
7206: <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt>
7207: <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt>
7208: <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt>
7209: <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt>
7210: <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt>
7211: <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt>
7212: <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt>
7213: <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in
1.1 dsieger 7214: emulation</a></span></dt>
1.154 rillig 7215: <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt>
7216: <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt>
1.1 dsieger 7217: </dl></dd>
1.154 rillig 7218: <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt>
1.1 dsieger 7219: </dl>
7220: </div>
1.41 asau 7221: <div class="sect1">
1.1 dsieger 7222: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7223: <a name="general-operation"></a>21.1. General operation</h2></div></div></div>
1.1 dsieger 7224: <p>One appealing feature of pkgsrc is that it runs on many
1.108 rillig 7225: different platforms. As a result, it is important to ensure,
7226: where possible, that packages in pkgsrc are portable. This
7227: chapter mentions some particular details you should pay
7228: attention to while working on pkgsrc.</p>
1.41 asau 7229: <div class="sect2">
1.1 dsieger 7230: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7231: <a name="pulling-vars-from-etc-mk.conf"></a>21.1.1. How to pull in user-settable variables from <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>
1.1 dsieger 7232: </h3></div></div></div>
7233: <p>The pkgsrc user can configure pkgsrc by overriding several
7234: variables in the file pointed to by <code class="varname">MAKECONF</code>,
1.10 hubertf 7235: which is <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> by default. When you
1.1 dsieger 7236: want to use those variables in the preprocessor directives of
1.174 leot 7237: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> (for example <code class="literal">.if</code> or
1.1 dsieger 7238: <code class="literal">.for</code>), you need to include the file
7239: <code class="filename">../../mk/bsd.prefs.mk</code> before, which in turn
7240: loads the user preferences.</p>
7241: <p>But note that some variables may not be completely defined
7242: after <code class="filename">../../mk/bsd.prefs.mk</code> has been
7243: included, as they may contain references to variables that are
1.108 rillig 7244: not yet defined. In shell commands (the lines in
7245: <code class="filename">Makefile</code> that are indented with a tab) this
7246: is no problem, since variables are only expanded when they are
7247: used. But in the preprocessor directives mentioned above and in
7248: dependency lines (of the form <code class="literal">target:
1.1 dsieger 7249: dependencies</code>) the variables are expanded at load
7250: time.</p>
1.41 asau 7251: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 7252: <h3 class="title">Note</h3>
1.108 rillig 7253: <p>To check whether a variable can be used at load time,
7254: run <span class="command"><strong>pkglint -Wall</strong></span> on your package.</p>
1.1 dsieger 7255: </div>
7256: </div>
1.41 asau 7257: <div class="sect2">
1.1 dsieger 7258: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7259: <a name="user-interaction"></a>21.1.2. User interaction</h3></div></div></div>
1.1 dsieger 7260: <p>Occasionally, packages require interaction from the user,
7261: and this can be in a number of ways:</p>
1.41 asau 7262: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 7263: <li class="listitem"><p>When fetching the distfiles, some packages require user
1.1 dsieger 7264: interaction such as entering username/password or accepting a
7265: license on a web page.</p></li>
1.23 wiz 7266: <li class="listitem"><p>When extracting the distfiles, some packages may ask for
1.1 dsieger 7267: passwords.</p></li>
1.23 wiz 7268: <li class="listitem"><p>help to configure the package before it is built</p></li>
7269: <li class="listitem"><p>help during the build process</p></li>
7270: <li class="listitem"><p>help during the installation of a package</p></li>
1.1 dsieger 7271: </ul></div>
1.108 rillig 7272: <p>A package can set the <code class="varname">INTERACTIVE_STAGE</code>
7273: variable to define which stages need interaction. This should be
7274: done in the package's <code class="filename">Makefile</code>, e.g.:</p>
1.1 dsieger 7275: <pre class="programlisting">
7276: INTERACTIVE_STAGE= configure install
1.111 sevan 7277: </pre>
1.1 dsieger 7278: <p>The user can then decide to skip this package by setting the
1.108 rillig 7279: <code class="varname">BATCH</code> variable. Packages that require interaction
7280: are also excluded from bulk builds.</p>
1.1 dsieger 7281: </div>
1.41 asau 7282: <div class="sect2">
1.1 dsieger 7283: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7284: <a name="handling-licenses"></a>21.1.3. Handling licenses</h3></div></div></div>
1.111 sevan 7285: <p>Authors of software can choose the licence under which software
7286: can be copied. The Free Software Foundation has declared some
7287: licenses "Free", and the Open Source Initiative has a definition of
7288: "Open Source".</p>
7289: <p>By default, pkgsrc allows packages with Free or Open Source
7290: licenses to be built. To allow packages with other licenses to be
7291: built as well, the pkgsrc user needs to add these licenses to the
7292: <code class="varname">ACCEPTABLE_LICENSES</code> variable in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. Note
7293: that this variable only affects which packages may be
7294: <span class="emphasis"><em>built</em></span>, while the license terms often also
7295: restrict the actual use of the package and its redistribution.</p>
1.1 dsieger 7296: <p>One might want to only install packages with a BSD license,
1.108 rillig 7297: or the GPL, and not the other. The free licenses are added to the
1.111 sevan 7298: default <code class="varname">ACCEPTABLE_LICENSES</code> variable. The pkgsrc
1.19 jnemeth 7299: user can override the default by setting the
7300: <code class="varname">ACCEPTABLE_LICENSES</code> variable with "=" instead
1.111 sevan 7301: of "+=". The licenses accepted by default are defined in the
7302: <code class="varname">DEFAULT_ACCEPTABLE_LICENSES</code> variable in the file
7303: <code class="filename">pkgsrc/mk/license.mk</code>.</p>
1.1 dsieger 7304: <p>The license tag mechanism is intended to address
7305: copyright-related issues surrounding building, installing and
7306: using a package, and not to address redistribution issues (see
7307: <code class="varname">RESTRICTED</code> and
1.111 sevan 7308: <code class="varname">NO_SRC_ON_FTP</code>, etc.).
1.19 jnemeth 7309: Packages with redistribution restrictions should set these
7310: tags.</p>
1.1 dsieger 7311: <p>Denoting that a package may be copied according to a
7312: particular license is done by placing the license in
7313: <code class="filename">pkgsrc/licenses</code> and setting the
7314: <code class="varname">LICENSE</code> variable to a string identifying the
1.137 leot 7315: license, e.g. in <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/graphics/xv/README.html" target="_top"><code class="filename">graphics/xv</code></a>:</p>
1.1 dsieger 7316: <pre class="programlisting">
7317: LICENSE= xv-license
1.111 sevan 7318: </pre>
1.1 dsieger 7319: <p>When trying to build, the user will get a notice that the
7320: package is covered by a license which has not been placed in the
7321: <code class="varname">ACCEPTABLE_LICENSES</code> variable:</p>
7322: <pre class="programlisting">
7323: <code class="prompt">%</code> <strong class="userinput"><code>make</code></strong>
7324: ===> xv-3.10anb9 has an unacceptable license: xv-license.
7325: ===> To view the license, enter "/usr/bin/make show-license".
7326: ===> To indicate acceptance, add this line to your /etc/mk.conf:
7327: ===> ACCEPTABLE_LICENSES+=xv-license
7328: *** Error code 1
1.111 sevan 7329: </pre>
1.10 hubertf 7330: <p>The license can be viewed with <span class="command"><strong>make
1.1 dsieger 7331: show-license</strong></span>, and if the user so chooses, the line
1.10 hubertf 7332: printed above can be added to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to
1.1 dsieger 7333: convey to pkgsrc that it should not in the future fail because of
7334: that license:</p>
7335: <pre class="programlisting">
7336: ACCEPTABLE_LICENSES+=xv-license
1.111 sevan 7337: </pre>
7338: <p>The use of <code class="varname">LICENSE=shareware</code>,
7339: <code class="varname">LICENSE=no-commercial-use</code>, and similar language
7340: is deprecated because it does not crisply refer to a particular
7341: license text. Another problem with such usage is that it does not
7342: enable a user to tell pkgsrc to proceed for a single package
7343: without also telling pkgsrc to proceed for all packages with that
7344: tag.</p>
7345: <div class="sect3">
7346: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 7347: <a name="new-license"></a>21.1.3.1. Adding a package with a new license</h4></div></div></div>
1.48 rodent 7348: <p>When adding a package with a new license, the following steps
7349: are required:</p>
7350: <div class="orderedlist"><ol class="orderedlist" type="1">
7351: <li class="listitem">
1.169 rillig 7352: <p>Check whether the license qualifies as Free or Open Source by
7353: referencing <a class="ulink" href="https://www.gnu.org/licenses/license-list.en.html" target="_top">Various
7354: Licenses and Comments about Them</a> and <a class="ulink" href="https://opensource.org/licenses/alphabetical" target="_top">Licenses by Name |
1.111 sevan 7355: Open Source Initiative</a>. If this is the case, the filename in
7356: <code class="filename">pkgsrc/licenses/</code> does not need the
7357: <code class="filename">-license</code> suffix, and the license name should be
7358: added to:</p>
1.48 rodent 7359: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.169 rillig 7360: <li class="listitem"><p>DEFAULT_ACCEPTABLE_LICENSES in
7361: <code class="filename">pkgsrc/mk/license.mk</code></p></li>
7362: <li class="listitem"><p>default_acceptable_licenses in
7363: <code class="filename">pkgsrc/pkgtools/pkg_install/files/lib/license.c</code></p></li>
1.48 rodent 7364: </ul></div>
7365: </li>
1.169 rillig 7366: <li class="listitem"><p>The license text should be added to
7367: <code class="filename">pkgsrc/licenses</code> for displaying. A list of known
7368: licenses can be seen in this directory.</p></li>
1.48 rodent 7369: </ol></div>
1.111 sevan 7370: </div>
7371: <div class="sect3">
7372: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 7373: <a name="change-license"></a>21.1.3.2. Change to the license</h4></div></div></div>
1.1 dsieger 7374: <p>When the license changes (in a way other than formatting),
1.111 sevan 7375: make sure that the new license has a different name (e.g.,
1.1 dsieger 7376: append the version number if it exists, or the date). Just
7377: because a user told pkgsrc to build programs under a previous
7378: version of a license does not mean that pkgsrc should build
7379: programs under the new licenses. The higher-level point is that
7380: pkgsrc does not evaluate licenses for reasonableness; the only
7381: test is a mechanistic test of whether a particular text has been
1.111 sevan 7382: approved by either of two bodies (FSF or OSI).</p>
7383: </div>
1.1 dsieger 7384: </div>
1.41 asau 7385: <div class="sect2">
1.1 dsieger 7386: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7387: <a name="restricted-packages"></a>21.1.4. Restricted packages</h3></div></div></div>
1.1 dsieger 7388: <p>Some licenses restrict how software may be re-distributed.
1.111 sevan 7389: By declaring the restrictions, package tools can
1.1 dsieger 7390: automatically refrain from e.g. placing binary packages on FTP
7391: sites.</p>
1.111 sevan 7392: <p>There are four possible restrictions, which are
1.1 dsieger 7393: the cross product of sources (distfiles) and binaries not being
7394: placed on FTP sites and CD-ROMs. Because this is rarely the exact
7395: language in any license, and because non-Free licenses tend to be
7396: different from each other, pkgsrc adopts a definition of FTP and
1.111 sevan 7397: CD-ROM.
7398:
7399: "FTP" means making the source or binary file available over the
7400: Internet at no charge.
7401:
7402: "CD-ROM" means making the source or binary available on some kind of
7403: media, together with other source and binary packages, which is sold
7404: for a distribution charge.
1.1 dsieger 7405: </p>
7406: <p>In order to encode these restrictions, the package system
7407: defines five make variables that can be set to note these
7408: restrictions:</p>
1.41 asau 7409: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 7410: <li class="listitem">
1.1 dsieger 7411: <p><code class="varname">RESTRICTED</code></p>
7412: <p>This variable should be set whenever a restriction
7413: exists (regardless of its kind). Set this variable to a
7414: string containing the reason for the restriction. It should
7415: be understood that those wanting to understand the restriction
7416: will have to read the license, and perhaps seek advice of
7417: counsel.</p>
7418: </li>
1.23 wiz 7419: <li class="listitem">
1.1 dsieger 7420: <p><code class="varname">NO_BIN_ON_CDROM</code></p>
7421: <p>Binaries may not be placed on CD-ROM containing other
7422: binary packages, for which a distribution charge may be made.
7423: In this case, set this variable to
7424: <code class="varname">${RESTRICTED}</code>.</p>
7425: </li>
1.23 wiz 7426: <li class="listitem">
1.1 dsieger 7427: <p><code class="varname">NO_BIN_ON_FTP</code></p>
7428: <p>Binaries may not made available on the Internet without
7429: charge. In this case, set this variable to
7430: <code class="varname">${RESTRICTED}</code>. If this variable is set,
7431: binary packages will not be included on ftp.NetBSD.org.</p>
7432: </li>
1.23 wiz 7433: <li class="listitem">
1.1 dsieger 7434: <p><code class="varname">NO_SRC_ON_CDROM</code></p>
7435: <p>Distfiles may not be placed on CD-ROM, together with
7436: other distfiles, for which a fee may be charged. In this
7437: case, set this variable to <code class="varname">${RESTRICTED}</code>.
7438: </p>
7439: </li>
1.23 wiz 7440: <li class="listitem">
1.1 dsieger 7441: <p><code class="varname">NO_SRC_ON_FTP</code></p>
7442: <p>Distfiles may not made available via FTP at no charge.
7443: In this case, set this variable to
7444: <code class="varname">${RESTRICTED}</code>. If this variable is set,
7445: the distfile(s) will not be mirrored on ftp.NetBSD.org.</p>
7446: </li>
7447: </ul></div>
1.111 sevan 7448: <p>Please note that packages will be removed from pkgsrc when the
7449: distfiles are not distributable and cannot be obtained for a period
7450: of one full quarter branch. Packages with manual/interactive fetch
7451: must have a maintainer and it is his/her responsibility to ensure
7452: this.</p>
1.1 dsieger 7453: </div>
1.41 asau 7454: <div class="sect2">
1.1 dsieger 7455: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7456: <a name="dependencies"></a>21.1.5. Handling dependencies</h3></div></div></div>
1.175 gutterid 7457: <p>Your package may depend on some other package being present,
7458: and there are various ways of expressing this dependency.
7459: pkgsrc supports the <code class="varname">DEPENDS</code>,
7460: <code class="varname">BUILD_DEPENDS</code>,
7461: <code class="varname">TOOL_DEPENDS</code>, and
7462: <code class="varname">TEST_DEPENDS</code> definitions, the
1.1 dsieger 7463: <code class="varname">USE_TOOLS</code> definition, as well as dependencies
7464: via <code class="filename">buildlink3.mk</code>, which is the preferred way
7465: to handle dependencies, and which uses the variables named above.
1.154 rillig 7466: See <a class="xref" href="#buildlink" title="Chapter 16. Buildlink methodology">Chapter 16, <i>Buildlink methodology</i></a> for more information.</p>
1.175 gutterid 7467: <p>The basic difference is that the <code class="varname">DEPENDS</code>
7468: definition registers that pre-requisite in the binary package so it
7469: will be pulled in when the binary package is later installed, whilst
7470: the <code class="varname">BUILD_DEPENDS</code>, <code class="varname">TOOL_DEPENDS</code>,
7471: and <code class="varname">TEST_DEPENDS</code> definitions do not, marking a
7472: dependency that is only needed for building or testing the resulting
7473: package. See also <a class="xref" href="#creating" title="Chapter 12. Creating a new pkgsrc package from scratch">Chapter 12, <i>Creating a new pkgsrc package from scratch</i></a> for more information.</p>
1.1 dsieger 7474: <p>This means that if you only need a package present whilst
1.175 gutterid 7475: you are building or testing, it should be noted as a
7476: <code class="varname">TOOL_DEPENDS</code>,
7477: <code class="varname">BUILD_DEPENDS</code>, or
7478: <code class="varname">TEST_DEPENDS</code>. When cross-compiling,
1.156 leot 7479: <code class="varname">TOOL_DEPENDS</code> are <span class="emphasis"><em>native</em></span>
7480: packages, i.e. packages for the architecture where the package
7481: is built;
7482: <code class="varname">BUILD_DEPENDS</code> are <span class="emphasis"><em>target</em></span>
1.175 gutterid 7483: packages, i.e., packages for the architecture for which the package
1.156 leot 7484: is built.</p>
1.175 gutterid 7485: <p>The format for a <code class="varname">DEPENDS</code>,
7486: <code class="varname">BUILD_DEPENDS</code>, <code class="varname">TOOL_DEPENDS</code>,
7487: and <code class="varname">TEST_DEPENDS</code> definition is:</p>
1.1 dsieger 7488: <pre class="programlisting">
7489: <pre-req-package-name>:../../<category>/<pre-req-package>
1.111 sevan 7490: </pre>
1.23 wiz 7491: <p>Please note that the <span class="quote">“<span class="quote">pre-req-package-name</span>”</span>
1.1 dsieger 7492: may include any of the wildcard version numbers recognized by
1.174 leot 7493: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_info+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_info</span>(1)</span></a>.</p>
1.23 wiz 7494: <div class="orderedlist"><ol class="orderedlist" type="1">
7495: <li class="listitem">
1.1 dsieger 7496: <p>If your package needs another package's binaries or
1.54 wiz 7497: libraries to build and run, and if that package has a
1.1 dsieger 7498: <code class="filename">buildlink3.mk</code> file available, use it:</p>
7499: <pre class="programlisting">
7500: .include "../../graphics/jpeg/buildlink3.mk"
1.111 sevan 7501: </pre>
1.1 dsieger 7502: </li>
1.23 wiz 7503: <li class="listitem">
1.54 wiz 7504: <p>If your package needs another package's binaries or
7505: libraries only for building, and if that package has a
7506: <code class="filename">buildlink3.mk</code> file available, use it:</p>
7507: <pre class="programlisting">
7508: .include "../../graphics/jpeg/buildlink3.mk"
1.111 sevan 7509: </pre>
1.54 wiz 7510: <p>but set
7511: <code class="varname">BUILDLINK_DEPMETHOD.<em class="replaceable"><code>jpeg</code></em>?=build</code>
7512: to make it a build dependency only. This case is rather
7513: rare.</p>
7514: </li>
7515: <li class="listitem">
1.25 spz 7516: <p>If your package needs binaries from another package to build,
1.156 leot 7517: use the <code class="varname">TOOL_DEPENDS</code> definition:</p>
1.1 dsieger 7518: <pre class="programlisting">
1.156 leot 7519: TOOL_DEPENDS+= itstool-[0-9]*:../../textproc/itstool
1.111 sevan 7520: </pre>
1.1 dsieger 7521: </li>
1.156 leot 7522: <li class="listitem"><p>If your package needs static libraries to link against, header
7523: files to include, etc. from another package to build,
7524: use the <code class="varname">BUILD_DEPENDS</code> definition.</p></li>
1.25 spz 7525: <li class="listitem"><p>If your package needs a library with which to link and
7526: there is no <code class="filename">buildlink3.mk</code> file
7527: available, create one. Using
7528: <code class="varname">DEPENDS</code> won't be sufficient because the
7529: include files and libraries will be hidden from the compiler.</p></li>
1.23 wiz 7530: <li class="listitem">
1.25 spz 7531: <p>If your package needs some executable to be able to run
7532: correctly and if there's no
7533: <code class="filename">buildlink3.mk</code> file, this is specified
7534: using the <code class="varname">DEPENDS</code> variable. The
1.137 leot 7535: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/print/lyx/README.html" target="_top"><code class="filename">print/lyx</code></a> package needs to
1.129 wiz 7536: be able to execute the latex binary from the tex-latex-bin package
1.25 spz 7537: when it runs, and that is specified:</p>
1.1 dsieger 7538: <pre class="programlisting">
1.129 wiz 7539: DEPENDS+= tex-latex-bin-[0-9]*:../../print/tex-latex-bin
1.111 sevan 7540: </pre>
1.25 spz 7541: </li>
1.175 gutterid 7542: <li class="listitem"><p>If your package includes a test suite that has extra
7543: dependencies only required for this purpose (frequently this
7544: can be run as a <span class="quote">“<span class="quote">make test</span>”</span> target), use the
7545: <code class="varname">TEST_DEPENDS</code> variable.</p></li>
1.25 spz 7546: <li class="listitem">
7547: <p>You can use wildcards in package dependencies. Note that
7548: such wildcard dependencies are retained when creating binary
7549: packages. The dependency is checked when installing the binary
7550: package and any package which matches the pattern will be
7551: used. Wildcard dependencies should be used with care.</p>
1.23 wiz 7552: <p>The <span class="quote">“<span class="quote">-[0-9]*</span>”</span> should be used instead of
7553: <span class="quote">“<span class="quote">-*</span>”</span> to avoid potentially ambiguous matches
7554: such as <span class="quote">“<span class="quote">tk-postgresql</span>”</span> matching a
7555: <span class="quote">“<span class="quote">tk-*</span>”</span> <code class="varname">DEPENDS</code>.</p>
1.1 dsieger 7556: <p>Wildcards can also be used to specify that a package
7557: will only build against a certain minimum version of a
7558: pre-requisite:</p>
7559: <pre class="programlisting">
1.25 spz 7560: DEPENDS+= ImageMagick>=6.0:../../graphics/ImageMagick
1.111 sevan 7561: </pre>
1.25 spz 7562: <p>This means that the package will build using version 6.0
7563: of ImageMagick or newer. Such a dependency may be warranted
7564: if, for example, the command line options of an executable
7565: have changed.</p>
7566: <p>If you need to depend on minimum versions of libraries,
7567: see the buildlink section of the pkgsrc guide.</p>
1.1 dsieger 7568: <p>For security fixes, please update the package
1.154 rillig 7569: vulnerabilities file. See <a class="xref" href="#security-handling" title="21.1.9. Handling packages with security problems">Section 21.1.9, “Handling packages with security problems”</a> for more
1.1 dsieger 7570: information.</p>
7571: </li>
7572: </ol></div>
7573: <p>If your package needs files from another package to build,
7574: add the relevant distribution files to
7575: <code class="varname">DISTFILES</code>, so they will be extracted
1.137 leot 7576: automatically. See the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/print/ghostscript/README.html" target="_top"><code class="filename">print/ghostscript</code></a> package for an example.
1.1 dsieger 7577: (It relies on the jpeg sources being present in source form
7578: during the build.)</p>
7579: </div>
1.41 asau 7580: <div class="sect2">
1.1 dsieger 7581: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7582: <a name="conflicts"></a>21.1.6. Handling conflicts with other packages</h3></div></div></div>
1.1 dsieger 7583: <p>Your package may conflict with other packages a user might
7584: already have installed on his system, e.g. if your package
7585: installs the same set of files as another package in the pkgsrc
1.80 wiz 7586: tree or has the same <code class="varname">PKGNAME</code>.</p>
1.142 leot 7587: <p>For example, <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/x11/libXaw3d/README.html" target="_top"><code class="filename">x11/libXaw3d</code></a>
7588: and <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/x11/Xaw-Xpm/README.html" target="_top"><code class="filename">x11/Xaw-Xpm</code></a>
7589: install the same shared library, thus you set in
7590: <code class="filename">pkgsrc/x11/libXaw3d/Makefile</code>:</p>
7591: <pre class="programlisting">
7592: CONFLICTS= Xaw-Xpm-[0-9]*
7593: </pre>
7594: <p>and in <code class="filename">pkgsrc/x11/Xaw-Xpm/Makefile</code>:</p>
7595: <pre class="programlisting">
7596: CONFLICTS= libXaw3d-[0-9]*
7597: </pre>
1.174 leot 7598: <p><a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a> is able to detect attempts to install packages
1.142 leot 7599: that conflict with existing packages and abort. However, in many
7600: situations this is too late in the process. Binary package managers
7601: will not know about the conflict until they attempt to install the
7602: package after already downloading it and all its dependencies.
7603: Users may also waste time building a package and its dependencies
7604: only to find out at the end that it conflicts with another package
7605: they have installed.</p>
7606: <p>To avoid these issues <code class="varname">CONFLICTS</code> entries
7607: should be added in all cases where it is known that packages conflict
7608: with each other. These <code class="varname">CONFLICTS</code> entries are
1.174 leot 7609: exported in <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_summary+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_summary</span>(5)</span></a> files and consumed by binary package
1.142 leot 7610: managers to inform users that packages cannot be installed onto
7611: the target system.</p>
1.1 dsieger 7612: </div>
1.41 asau 7613: <div class="sect2">
1.1 dsieger 7614: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7615: <a name="not-building-packages"></a>21.1.7. Packages that cannot or should not be built</h3></div></div></div>
1.1 dsieger 7616: <p>There are several reasons why a package might be
7617: instructed to not build under certain circumstances. If the
7618: package builds and runs on most platforms, the exceptions
1.83 dholland 7619: should be noted with <code class="varname">BROKEN_ON_PLATFORM</code>. If
7620: the package builds and runs on a small handful of platforms,
7621: set <code class="varname">BROKEN_EXCEPT_ON_PLATFORM</code> instead.
7622: Both <code class="varname">BROKEN_ON_PLATFORM</code> and
7623: <code class="varname">BROKEN_EXCEPT_ON_PLATFORM</code> are OS triples
7624: (OS-version-platform) that can use glob-style
7625: wildcards.</p>
7626: <p>If a package is not appropriate for some platforms (as
1.114 maya 7627: opposed to merely broken), a different set of variables should be
1.83 dholland 7628: used as this affects failure reporting and statistics.
7629: If the package is appropriate for most platforms, the exceptions
1.1 dsieger 7630: should be noted with <code class="varname">NOT_FOR_PLATFORM</code>. If
1.83 dholland 7631: the package is appropriate for only a small handful of platforms
7632: (often exactly one), set <code class="varname">ONLY_FOR_PLATFORM</code> instead.
1.1 dsieger 7633: Both <code class="varname">ONLY_FOR_PLATFORM</code> and
7634: <code class="varname">NOT_FOR_PLATFORM</code> are OS triples
7635: (OS-version-platform) that can use glob-style
7636: wildcards.</p>
7637: <p>Some packages are tightly bound to a specific version of an
1.137 leot 7638: operating system, e.g. LKMs or <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/lsof/README.html" target="_top"><code class="filename">sysutils/lsof</code></a>. Such binary packages are not
1.1 dsieger 7639: backwards compatible with other versions of the OS, and should be
7640: uploaded to a version specific directory on the FTP server. Mark
7641: these packages by setting <code class="varname">OSVERSION_SPECIFIC</code> to
1.23 wiz 7642: <span class="quote">“<span class="quote">yes</span>”</span>. This variable is not currently used by any of
1.1 dsieger 7643: the package system internals, but may be used in the
7644: future.</p>
7645: <p>If the package should be skipped (for example, because it
7646: provides functionality already provided by the system), set
7647: <code class="varname">PKG_SKIP_REASON</code> to a descriptive message. If
7648: the package should fail because some preconditions are not met,
7649: set <code class="varname">PKG_FAIL_REASON</code> to a descriptive
7650: message.</p>
7651: </div>
1.41 asau 7652: <div class="sect2">
1.1 dsieger 7653: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7654: <a name="undeletable-packages"></a>21.1.8. Packages which should not be deleted, once installed</h3></div></div></div>
1.1 dsieger 7655: <p>To ensure that a package may not be deleted, once it has been
7656: installed, the <code class="varname">PKG_PRESERVE</code> definition should
7657: be set in the package Makefile. This will be carried into any
7658: binary package that is made from this pkgsrc entry. A
1.23 wiz 7659: <span class="quote">“<span class="quote">preserved</span>”</span> package will
1.174 leot 7660: not be deleted using <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_delete</span>(1)</span></a> unless the
1.23 wiz 7661: <span class="quote">“<span class="quote">-f</span>”</span> option is used.</p>
1.1 dsieger 7662: </div>
1.41 asau 7663: <div class="sect2">
1.1 dsieger 7664: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7665: <a name="security-handling"></a>21.1.9. Handling packages with security problems</h3></div></div></div>
1.1 dsieger 7666: <p>When a vulnerability is found, this should be noted in
7667: <code class="filename">localsrc/security/advisories/pkg-vulnerabilities</code>,
1.31 wiz 7668: and after committing that file, ask pkgsrc-security@NetBSD.org to
7669: update the file on ftp.NetBSD.org.</p>
1.1 dsieger 7670: <p>After fixing the vulnerability by a patch, its
1.31 wiz 7671: <code class="varname">PKGREVISION</code> should be increased (this is of
7672: course not necessary if the problem is fixed by using a newer
7673: release of the software), and the pattern in the
7674: pkg-vulnerabilities file must be updated.</p>
1.1 dsieger 7675: <p>Also, if the fix should be applied to the stable pkgsrc
7676: branch, be sure to submit a pullup request!</p>
7677: <p>Binary packages already on ftp.NetBSD.org will be handled
7678: semi-automatically by a weekly cron job.</p>
7679: </div>
1.41 asau 7680: <div class="sect2">
1.1 dsieger 7681: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7682: <a name="bumping-pkgrevision"></a>21.1.10. How to handle incrementing versions when fixing an existing package</h3></div></div></div>
1.1 dsieger 7683: <p>When making fixes to an existing package it can be useful
7684: to change the version number in <code class="varname">PKGNAME</code>. To
7685: avoid conflicting with future versions by the original author, a
1.23 wiz 7686: <span class="quote">“<span class="quote">nb1</span>”</span>, <span class="quote">“<span class="quote">nb2</span>”</span>, ... suffix can be used
1.1 dsieger 7687: on package versions by setting <code class="varname">PKGREVISION=1</code>
1.23 wiz 7688: (2, ...). The <span class="quote">“<span class="quote">nb</span>”</span> is treated like a
7689: <span class="quote">“<span class="quote">.</span>”</span> by the package tools. e.g.</p>
1.1 dsieger 7690: <pre class="programlisting">
7691: DISTNAME= foo-17.42
7692: PKGREVISION= 9
1.111 sevan 7693: </pre>
1.1 dsieger 7694: <p>will result in a <code class="varname">PKGNAME</code> of
1.23 wiz 7695: <span class="quote">“<span class="quote">foo-17.42nb9</span>”</span>. If you want to use the original
7696: value of <code class="varname">PKGNAME</code> without the <span class="quote">“<span class="quote">nbX</span>”</span>
1.1 dsieger 7697: suffix, e.g. for setting <code class="varname">DIST_SUBDIR</code>, use
7698: <code class="varname">PKGNAME_NOREV</code>.</p>
7699: <p>When a new release of the package is released, the
7700: <code class="varname">PKGREVISION</code> should be removed, e.g. on a new
7701: minor release of the above package, things should be like:</p>
7702: <pre class="programlisting">
7703: DISTNAME= foo-17.43
1.111 sevan 7704: </pre>
1.1 dsieger 7705: <p><code class="varname">PKGREVISION</code> should be incremented for any
7706: non-trivial change in the resulting binary package. Without a
7707: <code class="varname">PKGREVISION</code> bump, someone with the previous
7708: version installed has no way of knowing that their package is out
7709: of date. Thus, changes without increasing
7710: <code class="varname">PKGREVISION</code> are essentially labeled "this is so
7711: trivial that no reasonable person would want to upgrade", and this
7712: is the rough test for when increasing
7713: <code class="varname">PKGREVISION</code> is appropriate. Examples of
7714: changes that do not merit increasing
7715: <code class="varname">PKGREVISION</code> are:</p>
1.41 asau 7716: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 7717: <li class="listitem"><p>Changing <code class="varname">HOMEPAGE</code>,
1.169 rillig 7718: <code class="varname">MAINTAINER</code>, <code class="varname">OWNER</code>, or
7719: comments in Makefile.</p></li>
7720: <li class="listitem"><p>Changing build variables if the resulting binary
7721: package is the same.</p></li>
7722: <li class="listitem"><p>Changing
7723: <code class="filename">DESCR</code>.</p></li>
7724: <li class="listitem"><p>Adding <code class="varname">PKG_OPTIONS</code> if the
7725: default options don't change.</p></li>
1.1 dsieger 7726: </ul></div>
7727: <p>Examples of changes that do merit an increase to
7728: <code class="varname">PKGREVISION</code> include:</p>
1.41 asau 7729: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.169 rillig 7730: <li class="listitem"><p>Security fixes</p></li>
7731: <li class="listitem"><p>Changes or additions to a patch
7732: file</p></li>
7733: <li class="listitem"><p>Changes to the
7734: <code class="filename">PLIST</code></p></li>
7735: <li class="listitem"><p>A dependency is changed or
7736: renamed.</p></li>
1.1 dsieger 7737: </ul></div>
7738: <p>PKGREVISION must also be incremented when dependencies have ABI
7739: changes.</p>
7740: </div>
1.41 asau 7741: <div class="sect2">
1.1 dsieger 7742: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7743: <a name="fixes.subst"></a>21.1.11. Substituting variable text in the package files (the SUBST framework)</h3></div></div></div>
1.1 dsieger 7744: <p>When you want to replace the same text in multiple files
7745: or when the replacement text varies, patches alone cannot help.
7746: This is where the SUBST framework comes in. It provides an
7747: easy-to-use interface for replacing text in files.
1.172 rillig 7748: It just needs the following information:</p>
7749: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
7750: <li class="listitem"><p><span class="emphasis"><em>When</em></span> should the replacement
7751: happen?</p></li>
7752: <li class="listitem"><p><span class="emphasis"><em>Where</em></span> should the replacement happen,
7753: i.e. in which files?</p></li>
7754: <li class="listitem"><p><span class="emphasis"><em>Which</em></span> text should be
7755: replaced with what?</p></li>
7756: </ul></div>
7757: <p>This information is encoded in a block of <code class="varname">SUBST</code>
7758: variables, like in this example:</p>
1.1 dsieger 7759: <pre class="programlisting">
7760: SUBST_CLASSES+= fix-paths
7761: SUBST_STAGE.fix-paths= pre-configure
7762: SUBST_MESSAGE.fix-paths= Fixing absolute paths.
7763: SUBST_FILES.fix-paths= src/*.c
7764: SUBST_FILES.fix-paths+= scripts/*.sh
7765: SUBST_SED.fix-paths= -e 's,"/usr/local,"${PREFIX},g'
7766: SUBST_SED.fix-paths+= -e 's,"/var/log,"${VARBASE}/log,g'
1.111 sevan 7767: </pre>
1.1 dsieger 7768: <p><code class="varname">SUBST_CLASSES</code> is a list of identifiers
7769: that are used to identify the different SUBST blocks that are
7770: defined. The SUBST framework is heavily used by pkgsrc, so it is
7771: important to always use the <code class="literal">+=</code> operator with
1.172 rillig 7772: this variable. Otherwise some substitutions may be skipped.</p>
1.1 dsieger 7773: <p>The remaining variables of each SUBST block are
7774: parameterized with the identifier from the first line
7775: (<code class="literal">fix-paths</code> in this case.) They can be seen as
7776: parameters to a function call.</p>
7777: <p><code class="varname">SUBST_STAGE.*</code> specifies the stage at
7778: which the replacement will take place. All combinations of
7779: <code class="literal">pre-</code>, <code class="literal">do-</code> and
7780: <code class="literal">post-</code> together with a phase name are
7781: possible, though only few are actually used. Most commonly used
7782: are <code class="literal">post-patch</code> and
7783: <code class="literal">pre-configure</code>. Of these two,
7784: <code class="literal">pre-configure</code> should be preferred because
1.10 hubertf 7785: then it is possible to run <span class="command"><strong>bmake patch</strong></span> and
1.1 dsieger 7786: have the state after applying the patches but before making any
7787: other changes. This is especially useful when you are debugging
7788: a package in order to create new patches for it. Similarly,
7789: <code class="literal">post-build</code> is preferred over
7790: <code class="literal">pre-install</code>, because the install phase should
7791: generally be kept as simple as possible. When you use
7792: <code class="literal">post-build</code>, you have the same files in the
7793: working directory that will be installed later, so you can check
7794: if the substitution has succeeded.</p>
7795: <p><code class="varname">SUBST_MESSAGE.*</code> is an optional text
7796: that is printed just before the substitution is done.</p>
7797: <p><code class="varname">SUBST_FILES.*</code> is the list of shell
7798: globbing patterns that specifies the files in which the
7799: substitution will take place. The patterns are interpreted
7800: relatively to the <code class="varname">WRKSRC</code> directory.</p>
7801: <p><code class="varname">SUBST_SED.*</code> is a list of arguments to
1.174 leot 7802: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?sed+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">sed</span>(1)</span></a> that specify the actual substitution. Every sed
1.1 dsieger 7803: command should be prefixed with <code class="literal">-e</code>, so that
7804: all SUBST blocks look uniform.</p>
1.172 rillig 7805: <p><code class="varname">SUBST_VARS.*</code> is a list of variable names.
7806: For each of these variables, the text <code class="literal">@VAR@</code> is
7807: replaced with the value of the variable
7808: <code class="varname">VAR</code>.</p>
1.1 dsieger 7809: <p>There are some more variables, but they are so seldomly
7810: used that they are only documented in the
7811: <code class="filename">mk/subst.mk</code> file.</p>
7812: </div>
7813: </div>
1.41 asau 7814: <div class="sect1">
1.1 dsieger 7815: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7816: <a name="fixes.fetch"></a>21.2. The <span class="emphasis"><em>fetch</em></span> phase</h2></div></div></div>
1.41 asau 7817: <div class="sect2">
1.1 dsieger 7818: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7819: <a name="no-plain-download"></a>21.2.1. Packages whose distfiles aren't available for plain downloading</h3></div></div></div>
1.1 dsieger 7820: <p>If you need to download from a dynamic URL you can set
1.10 hubertf 7821: <code class="varname">DYNAMIC_MASTER_SITES</code> and a <span class="command"><strong>make
1.1 dsieger 7822: fetch</strong></span> will call <code class="filename">files/getsite.sh</code>
7823: with the name of each file to download as an argument, expecting
7824: it to output the URL of the directory from which to download
1.137 leot 7825: it. <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/graphics/ns-cult3d/README.html" target="_top"><code class="filename">graphics/ns-cult3d</code></a> is an
1.1 dsieger 7826: example of this usage.</p>
7827: <p>If the download can't be automated, because the user must
7828: submit personal information to apply for a password, or must pay
7829: for the source, or whatever, you can set
7830: <code class="varname">FETCH_MESSAGE</code> to a list of lines that are
7831: displayed to the user before aborting the build. Example:</p>
7832: <pre class="programlisting">
7833: FETCH_MESSAGE= "Please download the files"
7834: FETCH_MESSAGE+= " "${DISTFILES:Q}
7835: FETCH_MESSAGE+= "manually from "${MASTER_SITES:Q}"."
1.111 sevan 7836: </pre>
1.1 dsieger 7837: </div>
1.41 asau 7838: <div class="sect2">
1.1 dsieger 7839: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7840: <a name="modified-distfiles-same-name"></a>21.2.2. How to handle modified distfiles with the 'old' name</h3></div></div></div>
1.1 dsieger 7841: <p>Sometimes authors of a software package make some
7842: modifications after the software was released, and they put up a
7843: new distfile without changing the package's version number. If a
7844: package is already in pkgsrc at that time, the checksum will
7845: no longer match. The contents of the new distfile should be
7846: compared against the old one before changing anything, to make
7847: sure the distfile was really updated on purpose, and that
7848: no trojan horse or so crept in.
7849: Please mention that the distfiles were compared and what was found
1.53 rodent 7850: in your commit message.</p>
1.109 wiz 7851: <p>Then, the correct way to work around this is to set
7852: <code class="varname">DIST_SUBDIR</code> to a unique directory name, usually
7853: based on <code class="varname">PKGNAME_NOREV</code> (but take care with
7854: python or ruby packages, where <code class="varname">PKGNAME</code> includes
7855: a variable prefix). All <code class="varname">DISTFILES</code> and
1.1 dsieger 7856: <code class="varname">PATCHFILES</code> for this package will be put in that
1.154 rillig 7857: subdirectory of the local distfiles directory. (See <a class="xref" href="#bumping-pkgrevision" title="21.1.10. How to handle incrementing versions when fixing an existing package">Section 21.1.10, “How to handle incrementing versions when fixing an existing package”</a> for more details.) In case this
1.1 dsieger 7858: happens more often, <code class="varname">PKGNAME</code> can be used (thus
1.109 wiz 7859: including the <code class="filename">nbX</code> suffix) or a date stamp can
7860: be appended, like
7861: <code class="varname">${PKGNAME_NOREV}-YYYYMMDD</code>.</p>
1.169 rillig 7862: <p><code class="varname">DIST_SUBDIR</code> is also used when a distfile's
7863: name does not contain a version and the distfile is apt to change. In
7864: cases where the likelihood of this is very small,
7865: <code class="varname">DIST_SUBDIR</code> might not be required. Additionally,
7866: <code class="varname">DIST_SUBDIR</code> must not be removed unless the
7867: distfile name changes, even if a package is being moved or
7868: renamed.</p>
1.53 rodent 7869: <p>Do not forget regenerating the <code class="filename">distinfo</code> file
1.1 dsieger 7870: after that, since it contains the <code class="varname">DIST_SUBDIR</code>
7871: path in the filenames.
1.53 rodent 7872: Also, increase the PKGREVISION if the installed package is different.
1.1 dsieger 7873: Furthermore, a mail to the package's authors seems appropriate
7874: telling them that changing distfiles after releases without
7875: changing the file names is not good practice.</p>
7876: </div>
1.88 tnn 7877: <div class="sect2">
7878: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7879: <a name="build.fetch.github"></a>21.2.3. Packages hosted on github.com</h3></div></div></div>
1.169 rillig 7880: <p>Helper methods exist for packages hosted on github.com which
7881: will often have distfile names that clash with other packages, for
7882: example <code class="filename">1.0.tar.gz</code>. Use one of the three recipes
7883: from below:</p>
1.88 tnn 7884: <div class="sect3">
7885: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 7886: <a name="build.fetch.github.tag"></a>21.2.3.1. Fetch based on a tagged release</h4></div></div></div>
1.169 rillig 7887: <p>If your distfile URL looks similar to
1.174 leot 7888: <code class="literal">https://github.com/username/exampleproject/archive/v1.0.zip</code>,
1.169 rillig 7889: then you are packaging a tagged release.</p>
1.88 tnn 7890: <pre class="programlisting">
7891: DISTNAME= exampleproject-1.0
1.90 tnn 7892: MASTER_SITES= ${MASTER_SITE_GITHUB:=username/}
7893: #GITHUB_PROJECT= # can be omitted if same as DISTNAME
7894: GITHUB_TAG= v${PKGVERSION_NOREV}
1.88 tnn 7895: EXTRACT_SUFX= .zip
7896: </pre>
7897: </div>
7898: <div class="sect3">
7899: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 7900: <a name="build.fetch.github.commit"></a>21.2.3.2. Fetch based on a specific commit</h4></div></div></div>
1.169 rillig 7901: <p>If your distfile URL looks similar to
1.174 leot 7902: <code class="literal">https://github.com​/example​/example​/archive​/988881adc9fc3655077dc2d4d757d480b5ea0e11.tar.gz</code>,
1.169 rillig 7903: then you are packaging a specific commit not tied to a
7904: release.</p>
1.88 tnn 7905: <pre class="programlisting">
7906: DISTNAME= example-1.0
1.107 jnemeth 7907: MASTER_SITES= ${MASTER_SITE_GITHUB:=example/}
1.90 tnn 7908: #GITHUB_PROJECT= # can be omitted if same as DISTNAME
7909: GITHUB_TAG= 988881adc9fc3655077dc2d4d757d480b5ea0e11
1.111 sevan 7910: </pre>
1.88 tnn 7911: </div>
7912: <div class="sect3">
7913: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 7914: <a name="build.fetch.github.release"></a>21.2.3.3. Fetch based on release</h4></div></div></div>
1.169 rillig 7915: <p>If your distfile URL looks similar to
1.174 leot 7916: <code class="literal">https://github.com​/username/exampleproject​/releases​/download​/rel-1.6​/offensive-1.6.zip</code>,
1.169 rillig 7917: then you are packaging a release.</p>
1.88 tnn 7918: <pre class="programlisting">
7919: DISTNAME= offensive-1.6
1.90 tnn 7920: PKGNAME= ${DISTNAME:S/offensive/proper/}
7921: MASTER_SITES= ${MASTER_SITE_GITHUB:=username/}
7922: GITHUB_PROJECT= exampleproject
7923: GITHUB_RELEASE= rel-${PKGVERSION_NOREV} # usually just set this to ${DISTNAME}
7924: EXTRACT_SUFX= .zip
1.111 sevan 7925: </pre>
1.88 tnn 7926: </div>
7927: </div>
1.1 dsieger 7928: </div>
1.41 asau 7929: <div class="sect1">
1.1 dsieger 7930: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7931: <a name="fixes.configure"></a>21.3. The <span class="emphasis"><em>configure</em></span> phase</h2></div></div></div>
1.41 asau 7932: <div class="sect2">
1.1 dsieger 7933: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7934: <a name="fixes.libtool"></a>21.3.1. Shared libraries - libtool</h3></div></div></div>
1.1 dsieger 7935: <p>pkgsrc supports many different machines, with different
7936: object formats like a.out and ELF, and varying abilities to do
7937: shared library and dynamic loading at all. To accompany this,
7938: varying commands and options have to be passed to the
7939: compiler, linker, etc. to get the Right Thing, which can be
7940: pretty annoying especially if you don't have all the machines
7941: at your hand to test things. The
1.137 leot 7942: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/libtool/README.html" target="_top"><code class="filename">devel/libtool</code></a> pkg
1.23 wiz 7943: can help here, as it just <span class="quote">“<span class="quote">knows</span>”</span> how to build
1.1 dsieger 7944: both static and dynamic libraries from a set of source files,
7945: thus being platform-independent.</p>
7946: <p>Here's how to use libtool in a package in seven simple
7947: steps:</p>
1.23 wiz 7948: <div class="orderedlist"><ol class="orderedlist" type="1">
7949: <li class="listitem"><p>Add <code class="varname">USE_LIBTOOL=yes</code> to the package
1.1 dsieger 7950: Makefile.</p></li>
1.23 wiz 7951: <li class="listitem"><p>For library objects, use <span class="quote">“<span class="quote">${LIBTOOL} --mode=compile
7952: ${CC}</span>”</span> in place of <span class="quote">“<span class="quote">${CC}</span>”</span>. You could even
1.1 dsieger 7953: add it to the definition of <code class="varname">CC</code>, if only
7954: libraries are being built in a given Makefile. This one command
7955: will build both PIC and non-PIC library objects, so you need not
7956: have separate shared and non-shared library rules.</p></li>
1.23 wiz 7957: <li class="listitem">
1.1 dsieger 7958: <p>For the linking of the library, remove any
1.23 wiz 7959: <span class="quote">“<span class="quote">ar</span>”</span>, <span class="quote">“<span class="quote">ranlib</span>”</span>, and <span class="quote">“<span class="quote">ld
7960: -Bshareable</span>”</span> commands, and instead use:</p>
1.1 dsieger 7961: <pre class="programlisting">
7962: ${LIBTOOL} --mode=link \
7963: ${CC} -o ${.TARGET:.a=.la} \
7964: ${OBJS:.o=.lo} \
7965: -rpath ${PREFIX}/lib \
7966: -version-info major:minor
1.111 sevan 7967: </pre>
1.1 dsieger 7968: <p>Note that the library is changed to have a
7969: <code class="filename">.la</code> extension, and the objects are
7970: changed to have a <code class="filename">.lo</code>
7971: extension. Change <code class="varname">OBJS</code> as
7972: necessary. This automatically creates all of the
7973: <code class="filename">.a</code>,
7974: <code class="filename">.so.major.minor</code>, and ELF symlinks (if
7975: necessary) in the build directory. Be sure to include
1.23 wiz 7976: <span class="quote">“<span class="quote">-version-info</span>”</span>, especially when major and
1.1 dsieger 7977: minor are zero, as libtool will otherwise strip off the
7978: shared library version.</p>
7979: <p>From the libtool manual:</p>
7980: <pre class="programlisting">
7981: So, libtool library versions are described by three integers:
7982:
7983: CURRENT
7984: The most recent interface number that this library implements.
7985:
7986: REVISION
7987: The implementation number of the CURRENT interface.
7988:
7989: AGE
7990: The difference between the newest and oldest interfaces that
7991: this library implements. In other words, the library implements
7992: all the interface numbers in the range from number `CURRENT -
7993: AGE' to `CURRENT'.
7994:
7995: If two libraries have identical CURRENT and AGE numbers, then the
7996: dynamic linker chooses the library with the greater REVISION number.
1.111 sevan 7997: </pre>
1.23 wiz 7998: <p>The <span class="quote">“<span class="quote">-release</span>”</span> option will produce
1.1 dsieger 7999: different results for a.out and ELF (excluding symlinks)
8000: in only one case. An ELF library of the form
1.23 wiz 8001: <span class="quote">“<span class="quote">libfoo-release.so.<span class="emphasis"><em>x</em></span>.<span class="emphasis"><em>y</em></span></span>”</span>
1.1 dsieger 8002: will have a symlink of
1.23 wiz 8003: <span class="quote">“<span class="quote">libfoo.so.<span class="emphasis"><em>x</em></span>.<span class="emphasis"><em>y</em></span></span>”</span>
1.1 dsieger 8004: on an a.out platform. This is handled
8005: automatically.</p>
1.23 wiz 8006: <p>The <span class="quote">“<span class="quote">-rpath argument</span>”</span> is the install
1.1 dsieger 8007: directory of the library being built.</p>
8008: <p>In the <code class="filename">PLIST</code>, include only the
8009: <code class="filename">.la</code> file, the other files will be
8010: added automatically.</p>
8011: </li>
1.23 wiz 8012: <li class="listitem">
1.1 dsieger 8013: <p>When linking shared object (<code class="filename">.so</code>)
1.174 leot 8014: files, i.e. files that are loaded via <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?dlopen+3.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">dlopen</span>(3)</span></a>, NOT
1.23 wiz 8015: shared libraries, use <span class="quote">“<span class="quote">-module
8016: -avoid-version</span>”</span> to prevent them getting version
1.1 dsieger 8017: tacked on.</p>
8018: <p>The <code class="filename">PLIST</code> file gets the
8019: <code class="filename">foo.so</code> entry.</p>
8020: </li>
1.23 wiz 8021: <li class="listitem">
1.1 dsieger 8022: <p>When linking programs that depend on these libraries
8023: <span class="emphasis"><em>before</em></span> they are installed, preface
1.174 leot 8024: the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?cc+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">cc</span>(1)</span></a> or <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?ld+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">ld</span>(1)</span></a> line with <span class="quote">“<span class="quote">${LIBTOOL}
1.23 wiz 8025: --mode=link</span>”</span>, and it will find the correct
1.1 dsieger 8026: libraries (static or shared), but please be aware that
8027: libtool will not allow you to specify a relative path in
1.23 wiz 8028: -L (such as <span class="quote">“<span class="quote">-L../somelib</span>”</span>), because it
1.1 dsieger 8029: expects you to change that argument to be the
8030: <code class="filename">.la</code> file. e.g.</p>
8031: <pre class="programlisting">
8032: ${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib
1.111 sevan 8033: </pre>
1.1 dsieger 8034: <p>should be changed to:</p>
8035: <pre class="programlisting">
8036: ${LIBTOOL} --mode=link ${CC} -o <em class="replaceable"><code>someprog</code></em> <em class="replaceable"><code>../somelib/somelib.la</code></em>
1.111 sevan 8037: </pre>
1.1 dsieger 8038: <p>and it will do the right thing with the libraries.</p>
8039: </li>
1.23 wiz 8040: <li class="listitem">
1.174 leot 8041: <p>When installing libraries, preface the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?install+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">install</span>(1)</span></a>
8042: or <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?cp+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">cp</span>(1)</span></a> command with <span class="quote">“<span class="quote">${LIBTOOL}
1.23 wiz 8043: --mode=install</span>”</span>, and change the library name to
1.1 dsieger 8044: <code class="filename">.la</code>. e.g.</p>
8045: <pre class="programlisting">
1.22 jakllsch 8046: ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} ${SOMELIB:.a=.la} ${PREFIX}/lib
1.111 sevan 8047: </pre>
1.1 dsieger 8048: <p>This will install the static <code class="filename">.a</code>,
8049: shared library, any needed symlinks, and run
1.174 leot 8050: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?ldconfig+8.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">ldconfig</span>(8)</span></a>.</p>
1.1 dsieger 8051: </li>
1.23 wiz 8052: <li class="listitem"><p>In your <code class="filename">PLIST</code>, include only
1.1 dsieger 8053: the <code class="filename">.la</code>
8054: file (this is a change from previous behaviour).</p></li>
8055: </ol></div>
8056: </div>
1.41 asau 8057: <div class="sect2">
1.1 dsieger 8058: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8059: <a name="using-libtool"></a>21.3.2. Using libtool on GNU packages that already support libtool</h3></div></div></div>
1.1 dsieger 8060: <p>Add <code class="varname">USE_LIBTOOL=yes</code> to the
8061: package Makefile. This will override the package's own libtool
8062: in most cases. For older libtool using packages, libtool is
8063: made by ltconfig script during the do-configure step; you can
1.10 hubertf 8064: check the libtool script location by doing <span class="command"><strong>make
1.1 dsieger 8065: configure; find work*/ -name libtool</strong></span>.</p>
8066: <p><code class="varname">LIBTOOL_OVERRIDE</code> specifies which libtool
8067: scripts, relative to <code class="varname">WRKSRC</code>, to override. By
1.23 wiz 8068: default, it is set to <span class="quote">“<span class="quote">libtool */libtool
8069: */*/libtool</span>”</span>. If this does not match the location of the
1.1 dsieger 8070: package's libtool script(s), set it as appropriate.</p>
8071: <p>If you do not need <code class="filename">*.a</code> static
8072: libraries built and installed, then use
8073: <code class="varname">SHLIBTOOL_OVERRIDE</code> instead.</p>
8074: <p>If your package makes use of the platform-independent library
8075: for loading dynamic shared objects, that comes with libtool
8076: (libltdl), you should include devel/libltdl/buildlink3.mk.</p>
8077: <p>Some packages use libtool incorrectly so that the package
8078: may not work or build in some circumstances. Some of the more
8079: common errors are:</p>
1.41 asau 8080: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 8081: <li class="listitem">
1.1 dsieger 8082: <p>The inclusion of a shared object (-module) as a dependent library in an
8083: executable or library. This in itself isn't a problem if one of two things
8084: has been done:</p>
1.23 wiz 8085: <div class="orderedlist"><ol class="orderedlist" type="1">
8086: <li class="listitem"><p>The shared object is named correctly, i.e.
1.1 dsieger 8087: <code class="filename">libfoo.la</code>, not
8088: <code class="filename">foo.la</code></p></li>
1.23 wiz 8089: <li class="listitem"><p>The -dlopen option is used when linking an executable.</p></li>
1.1 dsieger 8090: </ol></div>
8091: </li>
1.23 wiz 8092: <li class="listitem"><p>The use of libltdl without the correct calls to initialisation routines.
1.1 dsieger 8093: The function lt_dlinit() should be called and the macro
8094: <code class="varname">LTDL_SET_PRELOADED_SYMBOLS</code> included in
8095: executables.</p></li>
8096: </ul></div>
8097: </div>
1.41 asau 8098: <div class="sect2">
1.1 dsieger 8099: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8100: <a name="autoconf-automake"></a>21.3.3. GNU Autoconf/Automake</h3></div></div></div>
1.1 dsieger 8101: <p>If a package needs GNU autoconf or automake to be executed
8102: to regenerate the configure script and Makefile.in makefile
8103: templates, then they should be executed in a pre-configure
8104: target.</p>
8105: <p>For packages that need only autoconf:</p>
8106: <pre class="programlisting">
8107: AUTOCONF_REQD= 2.50 # if default version is not good enough
8108: USE_TOOLS+= autoconf # use "autoconf213" for autoconf-2.13
8109: ...
8110:
8111: pre-configure:
8112: cd ${WRKSRC} && autoconf
8113:
8114: ...
1.111 sevan 8115: </pre>
1.1 dsieger 8116: <p>and for packages that need automake and autoconf:</p>
8117: <pre class="programlisting">
8118: AUTOMAKE_REQD= 1.7.1 # if default version is not good enough
8119: USE_TOOLS+= automake # use "automake14" for automake-1.4
8120: ...
8121:
8122: pre-configure:
8123: set -e; cd ${WRKSRC}; \
8124: aclocal; autoheader; automake -a --foreign -i; autoconf
8125:
8126: ...
1.111 sevan 8127: </pre>
1.1 dsieger 8128: <p>Packages which use GNU Automake will almost certainly
8129: require GNU Make.</p>
8130: <p>There are times when the configure process makes
8131: additional changes to the generated files, which then causes
8132: the build process to try to re-execute the automake sequence.
8133: This is prevented by touching various files in the configure
8134: stage. If this causes problems with your package you can set
8135: <code class="varname">AUTOMAKE_OVERRIDE=NO</code> in the package
8136: Makefile.</p>
8137: </div>
8138: </div>
1.41 asau 8139: <div class="sect1">
1.1 dsieger 8140: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 8141: <a name="programming-languages"></a>21.4. Programming languages</h2></div></div></div>
1.41 asau 8142: <div class="sect2">
1.1 dsieger 8143: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8144: <a name="basic-programming-languages"></a>21.4.1. C, C++, and Fortran</h3></div></div></div>
1.1 dsieger 8145: <p>Compilers for the C, C++, and Fortran languages comes with
8146: the NetBSD base system. By default, pkgsrc assumes that a package
8147: is written in C and will hide all other compilers (via the wrapper
1.154 rillig 8148: framework, see <a class="xref" href="#buildlink" title="Chapter 16. Buildlink methodology">Chapter 16, <i>Buildlink methodology</i></a>).</p>
1.1 dsieger 8149: <p>To declare which language's compiler a package needs, set
8150: the <code class="varname">USE_LANGUAGES</code> variable. Allowed values
1.23 wiz 8151: currently are <span class="quote">“<span class="quote">c</span>”</span>, <span class="quote">“<span class="quote">c++</span>”</span>, and
8152: <span class="quote">“<span class="quote">fortran</span>”</span> (and any combination). The default is
8153: <span class="quote">“<span class="quote">c</span>”</span>. Packages using GNU configure scripts, even if
1.1 dsieger 8154: written in C++, usually need a C compiler for the configure
8155: phase.</p>
8156: </div>
1.41 asau 8157: <div class="sect2">
1.1 dsieger 8158: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8159: <a name="java-programming-language"></a>21.4.2. Java</h3></div></div></div>
1.1 dsieger 8160: <p>If a program is written in Java, use the Java framework in
8161: pkgsrc. The package must include
8162: <code class="filename">../../mk/java-vm.mk</code>. This Makefile fragment
8163: provides the following variables:</p>
1.41 asau 8164: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 8165: <li class="listitem"><p><code class="varname">USE_JAVA</code> defines if a build
1.1 dsieger 8166: dependency on the JDK is added. If
1.23 wiz 8167: <code class="varname">USE_JAVA</code> is set to <span class="quote">“<span class="quote">run</span>”</span>, then
1.1 dsieger 8168: there is only a runtime dependency on the JDK. The default is
1.23 wiz 8169: <span class="quote">“<span class="quote">yes</span>”</span>, which also adds a build dependency on the
1.1 dsieger 8170: JDK.</p></li>
1.23 wiz 8171: <li class="listitem"><p>Set <code class="varname">USE_JAVA2</code> to declare that
1.1 dsieger 8172: a package needs a Java2 implementation. The supported values
1.23 wiz 8173: are <span class="quote">“<span class="quote">yes</span>”</span>, <span class="quote">“<span class="quote">1.4</span>”</span>, and
8174: <span class="quote">“<span class="quote">1.5</span>”</span>. <span class="quote">“<span class="quote">yes</span>”</span> accepts any Java2
8175: implementation, <span class="quote">“<span class="quote">1.4</span>”</span> insists on versions 1.4 or
8176: above, and <span class="quote">“<span class="quote">1.5</span>”</span> only accepts versions 1.5 or
1.1 dsieger 8177: above. This variable is not set by default.</p></li>
1.24 wiz 8178: <li class="listitem"><p><code class="varname">PKG_JAVA_HOME</code> is
8179: automatically set to the runtime location of the used Java
8180: implementation dependency. It may be used to set
8181: <code class="varname">JAVA_HOME</code> to a good value if the program
8182: needs this variable to be defined.
8183: </p></li>
1.1 dsieger 8184: </ul></div>
8185: </div>
1.41 asau 8186: <div class="sect2">
1.1 dsieger 8187: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8188: <a name="perl-scripts"></a>21.4.3. Packages containing perl scripts</h3></div></div></div>
1.1 dsieger 8189: <p>If your package contains interpreted perl scripts, add
1.23 wiz 8190: <span class="quote">“<span class="quote">perl</span>”</span> to the <code class="varname">USE_TOOLS</code> variable
1.1 dsieger 8191: and set <code class="varname">REPLACE_PERL</code> to ensure that the proper
8192: interpreter path is set. <code class="varname">REPLACE_PERL</code> should
8193: contain a list of scripts, relative to <code class="varname">WRKSRC</code>,
1.74 wiz 8194: that you want adjusted. Every occurrence of
8195: <code class="filename">*/bin/perl</code> in a she-bang line will be
8196: replaced with the full path to the perl executable.</p>
1.1 dsieger 8197: <p>If a particular version of perl is needed, set the
8198: <code class="varname">PERL5_REQD</code> variable to the version number. The
1.23 wiz 8199: default is <span class="quote">“<span class="quote">5.0</span>”</span>.</p>
1.154 rillig 8200: <p>See <a class="xref" href="#perl-modules" title="21.6.6. Packages installing perl modules">Section 21.6.6, “Packages installing perl modules”</a> for information
1.1 dsieger 8201: about handling perl modules.</p>
8202: </div>
1.41 asau 8203: <div class="sect2">
1.1 dsieger 8204: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8205: <a name="shell-scripts"></a>21.4.4. Packages containing shell scripts</h3></div></div></div>
1.40 wiz 8206: <p><code class="varname">REPLACE_SH</code>,
8207: <code class="varname">REPLACE_BASH</code>, <code class="varname">REPLACE_CSH</code>,
8208: and <code class="varname">REPLACE_KSH</code> can be used to replace shell
8209: hash bangs in files. Please use the appropriate one, prefering
8210: <code class="varname">REPLACE_SH</code> in case this shell is sufficient.
1.74 wiz 8211: Each should contain a list of scripts, relative to
8212: <code class="varname">WRKSRC</code>, that you want adjusted. Every
8213: occurrence of the matching shell in a she-bang line will be
8214: replaced with the full path to the shell executable.
1.40 wiz 8215: When using <code class="varname">REPLACE_BASH</code>, don't forget to add
8216: <code class="filename">bash</code> to <code class="varname">USE_TOOLS</code>.</p>
8217: </div>
1.41 asau 8218: <div class="sect2">
1.40 wiz 8219: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8220: <a name="other-programming-languages"></a>21.4.5. Other programming languages</h3></div></div></div>
1.1 dsieger 8221: <p>Currently, there is no special handling for other languages
8222: in pkgsrc. If a compiler package provides a
8223: <code class="filename">buildlink3.mk</code> file, include that, otherwise
8224: just add a (build) dependency on the appropriate compiler
8225: package.</p>
8226: </div>
8227: </div>
1.41 asau 8228: <div class="sect1">
1.1 dsieger 8229: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 8230: <a name="fixes.build"></a>21.5. The <span class="emphasis"><em>build</em></span> phase</h2></div></div></div>
1.1 dsieger 8231: <p>The most common failures when building a package are that
8232: some platforms do not provide certain header files, functions or
8233: libraries, or they provide the functions in a library that the
8234: original package author didn't know. To work around this, you
8235: can rewrite the source code in most cases so that it does not
8236: use the missing functions or provides a replacement function.</p>
1.41 asau 8237: <div class="sect2">
1.1 dsieger 8238: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8239: <a name="fixes.build.cpp"></a>21.5.1. Compiling C and C++ code conditionally</h3></div></div></div>
1.1 dsieger 8240: <p>If a package already comes with a GNU configure script, the
8241: preferred way to fix the build failure is to change the
8242: configure script, not the code. In the other cases, you can
8243: utilize the C preprocessor, which defines certain macros
8244: depending on the operating system and hardware architecture it
8245: compiles for. These macros can be queried using for example
8246: <code class="varname">#if defined(__i386)</code>. Almost every operating
8247: system, hardware architecture and compiler has its own macro.
8248: For example, if the macros <code class="varname">__GNUC__</code>,
8249: <code class="varname">__i386__</code> and <code class="varname">__NetBSD__</code>
8250: are all defined, you know that you are using NetBSD on an i386
8251: compatible CPU, and your compiler is GCC.</p>
8252: <p>The list of the following macros for hardware and
8253: operating system depends on the compiler that is used. For
8254: example, if you want to conditionally compile code on Solaris,
8255: don't use <code class="varname">__sun__</code>, as the SunPro compiler
8256: does not define it. Use <code class="varname">__sun</code> instead.</p>
1.41 asau 8257: <div class="sect3">
1.1 dsieger 8258: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8259: <a name="fixes.build.cpp.os"></a>21.5.1.1. C preprocessor macros to identify the operating system</h4></div></div></div>
1.1 dsieger 8260: <p>To distinguish between 4.4 BSD-derived systems and the
8261: rest of the world, you should use the following code.</p>
8262: <pre class="programlisting">
8263: #include <sys/param.h>
8264: #if (defined(BSD) && BSD >= 199306)
8265: /* BSD-specific code goes here */
8266: #else
8267: /* non-BSD-specific code goes here */
8268: #endif
8269: </pre>
8270: <p>If this distinction is not fine enough, you can also test
8271: for the following macros.</p>
8272: <pre class="programlisting">
1.45 obache 8273: Cygwin __CYGWIN__
8274: DragonFly __DragonFly__
1.1 dsieger 8275: FreeBSD __FreeBSD__
1.45 obache 8276: Haiku __HAIKU__
1.1 dsieger 8277: Interix __INTERIX
8278: IRIX __sgi (TODO: get a definite source for this)
8279: Linux linux, __linux, __linux__
1.83 dholland 8280: Mac OS X __APPLE__
1.45 obache 8281: MirBSD __MirBSD__ (__OpenBSD__ is also defined)
8282: Minix3 __minix
1.1 dsieger 8283: NetBSD __NetBSD__
8284: OpenBSD __OpenBSD__
8285: Solaris sun, __sun
8286: </pre>
8287: </div>
1.41 asau 8288: <div class="sect3">
1.1 dsieger 8289: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8290: <a name="fixes.build.cpp.arch"></a>21.5.1.2. C preprocessor macros to identify the hardware architecture</h4></div></div></div>
1.1 dsieger 8291: <pre class="programlisting">
8292: i386 i386, __i386, __i386__
8293: MIPS __mips
8294: SPARC sparc, __sparc
8295: </pre>
8296: </div>
1.41 asau 8297: <div class="sect3">
1.1 dsieger 8298: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8299: <a name="fixes.build.cpp.compiler"></a>21.5.1.3. C preprocessor macros to identify the compiler</h4></div></div></div>
1.1 dsieger 8300: <pre class="programlisting">
8301: GCC __GNUC__ (major version), __GNUC_MINOR__
8302: MIPSpro _COMPILER_VERSION (0x741 for MIPSpro 7.41)
8303: SunPro __SUNPRO_C (0x570 for Sun C 5.7)
8304: SunPro C++ __SUNPRO_CC (0x580 for Sun C++ 5.8)
8305: </pre>
8306: </div>
8307: </div>
1.41 asau 8308: <div class="sect2">
1.1 dsieger 8309: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8310: <a name="compiler-bugs"></a>21.5.2. How to handle compiler bugs</h3></div></div></div>
1.1 dsieger 8311: <p>Some source files trigger bugs in the compiler, based on
8312: combinations of compiler version and architecture and almost
8313: always relation to optimisation being enabled. Common symptoms
8314: are gcc internal errors or never finishing compiling a
8315: file.</p>
8316: <p>Typically, a workaround involves testing the
8317: <code class="varname">MACHINE_ARCH</code> and compiler version, disabling
8318: optimisation for that combination of file,
1.87 tnn 8319: <code class="varname">MACHINE_ARCH</code> and compiler.</p>
8320: <p>This used to be a big problem in the past, but is rarely
8321: needed now as compiler technology has matured. If you still need
8322: to add a compiler specific workaround, please do so in the file
8323: <code class="filename">hacks.mk</code> and describe the symptom and
8324: compiler version as detailed as possible.</p>
1.1 dsieger 8325: </div>
1.41 asau 8326: <div class="sect2">
1.1 dsieger 8327: <div class="titlepage"><div><div><h3 class="title">
1.172 rillig 8328: <a name="fixes.build.header"></a>21.5.3. No such file or directory</h3></div></div></div>
8329: <p>Compilation sometimes fails with an error message like this:</p>
8330: <pre class="programlisting">
8331: .../x11/gtk3/work/gtk+-3.24.12/gdk/gdktypes.h:35:10:
8332: fatal error: pango/pango.h: No such file or directory
8333: </pre>
8334: <p>The proper way to fix this problem depends on the type of the
8335: header, which is described in the following sections.</p>
8336: <div class="sect3">
8337: <div class="titlepage"><div><div><h4 class="title">
8338: <a name="fixes.build.header.bl3"></a>21.5.3.1. Headers from other packages</h4></div></div></div>
8339: <p>If the header name looks like it comes from a different package,
8340: that other package should be included via the buildlink3
8341: framework.</p>
8342: <p>First, look whether the header is somewhere in the buildlink3
8343: directory below <code class="varname">WRKDIR</code>. In the above case of
8344: the missing Pango header:</p>
8345: <pre class="programlisting">
8346: <code class="prompt">$</code> find work/.buildlink/ -print | grep -F pango/pango.h
8347: </pre>
8348: <p>In the case of Pango, the output is:</p>
8349: <pre class="programlisting">
8350: work/.buildlink/include/pango-1.0/pango/pango.h
8351: </pre>
8352: <p>If the <code class="filename">pango/pango.h</code> file were placed directly
8353: in the <code class="filename">.buildlink</code> directory, it would have been
8354: found automatically. There is an extra <code class="filename">pango-1.0</code>
8355: path component though, which means that the compiler command line must
8356: contain an option of the form
8357: <code class="literal">-I${BUILDLINK3_PREFIX.pango}/include/pango-1.0</code>. In
8358: most cases this option is generated by the configure script, which can be examined using:</p>
8359: <pre class="programlisting">
8360: <code class="prompt">$</code> $ grep -o '[-]I[^[:space:]]*/pango[^[:space:]]*' work/*/Makefile
8361: -I/usr/pkg/include/pango-1.0
8362: -I/usr/pkg/include/pango-1.0
8363: -I/usr/pkg/include/pango-1.0
8364: -I/usr/pkg/include/pango-1.0
8365: -I/usr/pkg/include/pango-1.0
8366: </pre>
8367: <p>This looks good. These options are transformed by the buildlink
8368: wrapper to refer to the correct path inside
8369: <code class="filename">work/.buildlink</code>.</p>
8370: <p>Since the compilation fails though, examine the compiler command
8371: lines in <code class="filename">work/.work.log</code> to see whether the
8372: <code class="literal">-I</code> option is included in the particular command
8373: line.</p>
8374: <p>To further analyze the situation, run <span class="command"><strong>bmake
8375: build-env</strong></span>, which sets up an interactive, realistic environment
8376: including all the pkgsrc wrapper commands and environment variables. From
8377: there, try to compile some simple example programs that use the
8378: header.</p>
8379: </div>
8380: <div class="sect3">
8381: <div class="titlepage"><div><div><h4 class="title">
8382: <a name="fixes.build.header.gen"></a>21.5.3.2. Headers generated during the build</h4></div></div></div>
8383: <p>If the name of the header seems to come from the package itself,
8384: and if the build is run with parallel jobs, the package may have some
8385: undeclared dependencies between the <code class="filename">.c</code> and the
8386: <code class="filename">.h</code> files, and a C file is compiled before its
8387: required header is generated.</p>
8388: <p>To see whether the build runs with parallel jobs, run
8389: <span class="command"><strong>bmake show-all-build | grep JOBS</strong></span>. Its output looks
8390: like this:</p>
8391: <pre class="programlisting">
8392: usr MAKE_JOBS= 7
8393: pkg MAKE_JOBS_SAFE # undefined
8394: def _MAKE_JOBS_N= 7
8395: </pre>
8396: <p>In this case the pkgsrc user has asked pkgsrc to build packages
8397: with 7 jobs in parallel (<code class="varname">MAKE_JOBS</code>). The
8398: package could have disabled parallel builds by setting
8399: <code class="varname">MAKE_JOBS_SAFE</code> to <code class="literal">no</code>, but
8400: in this case it hasn't.</p>
8401: <p>To see whether the build failure is caused by parallel builds,
8402: first save the exact error message and a bit of context, maybe you need
8403: it later for reporting a bug. Next, run:</p>
8404: <pre class="programlisting">
8405: MAKE_JOBS_SAFE=no bmake clean build
8406: </pre>
8407: <p>If that succeeds, <a class="ulink" href="https://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd" target="_top">file a bug
8408: report</a> against the pkgsrc package, including the exact error
8409: message and the contents of your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file.</p>
8410: </div>
1.173 rillig 8411: <div class="sect3">
8412: <div class="titlepage"><div><div><h4 class="title">
8413: <a name="fixes.build.header.symlink"></a>21.5.3.3. Symlinks</h4></div></div></div>
8414: <p>Pkgsrc does not work reliably if any of
8415: <code class="varname">LOCALBASE</code>, <code class="varname">VARBASE</code> or
8416: <code class="varname">WRKDIR</code> contains a symlink. Since 2019Q2, the pkgsrc
8417: bootstrap program prevents installing pkgsrc in symlink-based
8418: directories. Existing pkgsrc installations are not checked for symlinks
8419: though.</p>
8420: <p>The "No such file or directory" error messages are a typical
8421: symptom of symlinks, and it's quite difficult to find out that this is
8422: the actual cause.</p>
8423: </div>
8424: <div class="sect3">
8425: <div class="titlepage"><div><div><h4 class="title">
8426: <a name="fixes.build.header.stale"></a>21.5.3.4. Stale working directories</h4></div></div></div>
8427: <p>When building a hierarchy of packages, it may happen that one
8428: package is built and then pkgsrc is updated. This situation can provoke
8429: various hard to diagnose build errors. To clean up the situation:</p>
8430: <pre class="programlisting">
8431: <code class="prompt">$</code> (cd ../../ && test -f mk/bsd.pkg.mk && rm -rf */*/work)
8432: </pre>
8433: <p>(The test for <code class="filename">bsd.pkg.mk</code> just prevents running
8434: this command in the wrong directory.)</p>
8435: <p>If you have set <code class="varname">WRKOBJDIR</code> in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, remove
8436: that directory as well.</p>
8437: </div>
8438: <div class="sect3">
8439: <div class="titlepage"><div><div><h4 class="title">
8440: <a name="fixes.build.header.misc"></a>21.5.3.5. Other possible reasons</h4></div></div></div>
8441: <p>On platforms other than BSD, third-party packages are installed in
8442: <code class="filename">/usr/include</code>, together with the base system. This
8443: means that pkgsrc cannot distinguish between headers provided by the base
8444: system (which it needs) and headers from third-party packages (which are
8445: often included in pkgsrc as well). This can lead to subtle version
8446: mismatches.</p>
8447: <p>In pkgsrc installations that have been active for several years, it
8448: may happen that some files are manually deleted. To exclude this unlikely
8449: reason, run <span class="command"><strong>pkg_admin check</strong></span>.</p>
8450: <p>It may help to run <span class="command"><strong>pkg_admin rebuild-tree</strong></span> to
8451: check/fix dependencies.</p>
8452: <p>If all of the above doesn't help, see <a class="xref" href="#help-user" title="Chapter 2. Getting help">Chapter 2, <i>Getting help</i></a>
8453: for contact information. Be prepared to describe what you have tried so
8454: far and what any error messages were.</p>
8455: </div>
1.172 rillig 8456: </div>
8457: <div class="sect2">
8458: <div class="titlepage"><div><div><h3 class="title">
8459: <a name="undefined-reference"></a>21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span>
1.23 wiz 8460: </h3></div></div></div>
1.1 dsieger 8461: <p>This error message often means that a package did not
8462: link to a shared library it needs. The following functions are
8463: known to cause this error message over and over.</p>
8464: <div class="informaltable">
1.106 tnn 8465: <a name="undefined-reference-functions"></a><table class="informaltable" border="1">
1.1 dsieger 8466: <colgroup>
8467: <col>
8468: <col>
8469: <col>
8470: </colgroup>
8471: <thead><tr>
8472: <th>Function</th>
8473: <th>Library</th>
8474: <th>Affected platforms</th>
8475: </tr></thead>
8476: <tbody>
8477: <tr>
8478: <td>accept, bind, connect</td>
8479: <td>-lsocket</td>
8480: <td>Solaris</td>
8481: </tr>
8482: <tr>
8483: <td>crypt</td>
8484: <td>-lcrypt</td>
8485: <td>DragonFly, NetBSD</td>
8486: </tr>
8487: <tr>
8488: <td>dlopen, dlsym</td>
8489: <td>-ldl</td>
8490: <td>Linux</td>
8491: </tr>
8492: <tr>
8493: <td>gethost*</td>
8494: <td>-lnsl</td>
8495: <td>Solaris</td>
8496: </tr>
8497: <tr>
8498: <td>inet_aton</td>
8499: <td>-lresolv</td>
8500: <td>Solaris</td>
8501: </tr>
8502: <tr>
8503: <td>nanosleep, sem_*, timer_*</td>
8504: <td>-lrt</td>
8505: <td>Solaris</td>
8506: </tr>
8507: <tr>
8508: <td>openpty</td>
8509: <td>-lutil</td>
8510: <td>Linux</td>
8511: </tr>
8512: </tbody>
8513: </table>
8514: </div>
8515: <p>To fix these linker errors, it is often sufficient to say
8516: <code class="literal">LIBS.<em class="replaceable"><code>OperatingSystem</code></em>+=
8517: -l<em class="replaceable"><code>foo</code></em></code> to the package
1.10 hubertf 8518: <code class="filename">Makefile</code> and then say <span class="command"><strong>bmake clean;
1.1 dsieger 8519: bmake</strong></span>.</p>
1.41 asau 8520: <div class="sect3">
1.1 dsieger 8521: <div class="titlepage"><div><div><h4 class="title">
1.172 rillig 8522: <a name="undefined-reference-sunpro"></a>21.5.4.1. Special issue: The SunPro compiler</h4></div></div></div>
1.1 dsieger 8523: <p>When you are using the SunPro compiler, there is another
8524: possibility. That compiler cannot handle the following code:</p>
8525: <pre class="programlisting">
8526: extern int extern_func(int);
8527:
8528: static inline int
8529: inline_func(int x)
8530: {
8531: return extern_func(x);
8532: }
8533:
8534: int main(void)
8535: {
8536: return 0;
8537: }
8538: </pre>
8539: <p>It generates the code for <code class="function">inline_func</code> even if
8540: that function is never used. This code then refers to
8541: <code class="function">extern_func</code>, which can usually not be resolved. To
8542: solve this problem you can try to tell the package to disable inlining
8543: of functions.</p>
8544: </div>
8545: </div>
1.41 asau 8546: <div class="sect2">
1.1 dsieger 8547: <div class="titlepage"><div><div><h3 class="title">
1.172 rillig 8548: <a name="out-of-memory"></a>21.5.5. Running out of memory</h3></div></div></div>
1.1 dsieger 8549: <p>Sometimes packages fail to build because the compiler runs
8550: into an operating system specific soft limit. With the
8551: <code class="varname">UNLIMIT_RESOURCES</code> variable pkgsrc can be told
1.94 wiz 8552: to unlimit the resources. Currently, the allowed values are any combination of
8553: <span class="quote">“<span class="quote">cputime</span>”</span>, <span class="quote">“<span class="quote">datasize</span>”</span>,
8554: <span class="quote">“<span class="quote">memorysize</span>”</span>, and <span class="quote">“<span class="quote">stacksize</span>”</span>.
1.1 dsieger 8555: Setting this variable is similar to running the shell builtin
1.10 hubertf 8556: <span class="command"><strong>ulimit</strong></span> command to raise the maximum data
1.1 dsieger 8557: segment size or maximum stack size of a process, respectively, to
8558: their hard limits.</p>
8559: </div>
8560: </div>
1.41 asau 8561: <div class="sect1">
1.1 dsieger 8562: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 8563: <a name="fixes.install"></a>21.6. The <span class="emphasis"><em>install</em></span> phase</h2></div></div></div>
1.41 asau 8564: <div class="sect2">
1.1 dsieger 8565: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8566: <a name="install-scripts"></a>21.6.1. Creating needed directories</h3></div></div></div>
1.10 hubertf 8567: <p>The BSD-compatible <span class="command"><strong>install</strong></span> supplied
1.1 dsieger 8568: with some operating systems cannot create more than one
8569: directory at a time. As such, you should call
8570: <code class="literal">${INSTALL_*_DIR}</code> like this:</p>
8571: <pre class="programlisting">
8572: ${INSTALL_DATA_DIR} ${PREFIX}/dir1
8573: ${INSTALL_DATA_DIR} ${PREFIX}/dir2
1.111 sevan 8574: </pre>
1.23 wiz 8575: <p>You can also just append <span class="quote">“<span class="quote"><code class="literal">dir1
8576: dir2</code></span>”</span> to the
1.1 dsieger 8577: <code class="varname">INSTALLATION_DIRS</code> variable, which will
8578: automatically do the right thing.</p>
8579: </div>
1.41 asau 8580: <div class="sect2">
1.1 dsieger 8581: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8582: <a name="where-to-install-documentation"></a>21.6.2. Where to install documentation</h3></div></div></div>
1.1 dsieger 8583: <p>In general, documentation should be installed into
8584: <code class="filename">${PREFIX}/share/doc/${PKGBASE}</code> or
8585: <code class="filename">${PREFIX}/share/doc/${PKGNAME}</code> (the latter
8586: includes the version number of the package).</p>
8587: <p>Many modern packages using GNU autoconf allow to set the
8588: directory where HTML documentation is installed with the
1.23 wiz 8589: <span class="quote">“<span class="quote">--with-html-dir</span>”</span> option. Sometimes using this flag
1.1 dsieger 8590: is needed because otherwise the documentation ends up in
8591: <code class="filename">${PREFIX}/share/doc/html</code> or other
8592: places.</p>
8593: <p>An exception to the above is that library API documentation
1.137 leot 8594: generated with the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/textproc/gtk-doc/README.html" target="_top"><code class="filename">textproc/gtk-doc</code></a> tools, for use by special
1.1 dsieger 8595: browsers (devhelp) should be left at their default location, which
8596: is <code class="filename">${PREFIX}/share/gtk-doc</code>. Such
8597: documentation can be recognized from files ending in
8598: <code class="filename">.devhelp</code> or <code class="filename">.devhelp2</code>.
8599: (It is also acceptable to install such files in
8600: <code class="filename">${PREFIX}/share/doc/${PKGBASE}</code> or
8601: <code class="filename">${PREFIX}/share/doc/${PKGNAME}</code>; the
8602: <code class="filename">.devhelp*</code> file must be directly in that
8603: directory then, no additional subdirectory level is allowed in
8604: this case. This is usually achieved by using
1.23 wiz 8605: <span class="quote">“<span class="quote">--with-html-dir=${PREFIX}/share/doc</span>”</span>.
1.1 dsieger 8606: <code class="filename">${PREFIX}/share/gtk-doc</code> is preferred
8607: though.)</p>
8608: </div>
1.41 asau 8609: <div class="sect2">
1.1 dsieger 8610: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8611: <a name="installing-score-files"></a>21.6.3. Installing highscore files</h3></div></div></div>
1.1 dsieger 8612: <p>Certain packages, most of them in the games category, install
8613: a score file that allows all users on the system to record their
8614: highscores. In order for this to work, the binaries need to be
8615: installed setgid and the score files owned by the appropriate
1.35 wiz 8616: group and/or owner (traditionally the "games" user/group). Set
8617: <code class="varname">USE_GAMESGROUP</code> to yes to support this. The
1.1 dsieger 8618: following variables, documented in more detail in
8619: <code class="filename">mk/defaults/mk.conf</code>, control this
1.35 wiz 8620: behaviour: <code class="varname">GAMEDATAMODE</code>,
8621: <code class="varname">GAMEDIRMODE</code>, <code class="varname">GAMES_GROUP</code>,
1.100 leot 8622: <code class="varname">GAMEMODE</code>, <code class="varname">GAME_USER</code>.
8623: Other useful variables are: <code class="varname">GAMEDIR_PERMS</code>,
8624: <code class="varname">GAMEDATA_PERMS</code> and
8625: <code class="varname">SETGID_GAMES_PERMS</code>.</p>
8626: <p>An example that illustrates some of the variables described above is
8627: <code class="filename">games/moon-buggy</code>. <code class="varname">OWN_DIRS_PERMS</code> is
8628: used to properly set directory permissions of the directory where the
8629: scorefile is saved, <code class="varname">REQD_FILES_PERMS</code> is used to create a
8630: dummy scorefile (<code class="filename">mbscore</code>) with the proper permissions
8631: and <code class="varname">SPECIAL_PERMS</code> is used to install setgid the game
8632: binary:</p>
8633: <pre class="programlisting">
1.112 rillig 8634: USE_GAMESGROUP= yes
1.100 leot 8635:
1.112 rillig 8636: BUILD_DEFS+= VARBASE
1.100 leot 8637:
1.112 rillig 8638: OWN_DIRS_PERMS+= ${VARBASE}/games/moon-buggy ${GAMEDIR_PERMS}
8639: REQD_FILES_PERMS+= /dev/null ${VARBASE}/games/moon-buggy/mbscore ${GAMEDATA_PERMS}
8640: SPECIAL_PERMS+= ${PREFIX}/bin/moon-buggy ${SETGID_GAMES_PERMS}
1.111 sevan 8641: </pre>
1.100 leot 8642: <p>Various <code class="varname">INSTALL_*</code> variables are also available:
8643: <code class="varname">INSTALL_GAME</code> to install setgid game binaries,
8644: <code class="varname">INSTALL_GAME_DIR</code> to install game directories that are
8645: needed to be accessed by setgid games and
8646: <code class="varname">INSTALL_GAME_DATA</code> to install scorefiles.</p>
1.14 jmcneill 8647: <p>A package should therefore never hard code file ownership or
1.100 leot 8648: access permissions but rely on <code class="varname">*_PERMS</code> as described above
8649: or alternatively on <code class="varname">INSTALL_GAME</code>,
8650: <code class="varname">INSTALL_GAME_DATA</code> and
8651: <code class="varname">INSTALL_GAME_DIR</code> to set these correctly.</p>
1.1 dsieger 8652: </div>
1.41 asau 8653: <div class="sect2">
1.1 dsieger 8654: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8655: <a name="destdir-support"></a>21.6.4. Adding DESTDIR support to packages</h3></div></div></div>
1.14 jmcneill 8656: <p><code class="varname">DESTDIR</code> support means that a package
8657: installs into a staging directory, not the final location of the
8658: files. Then a binary package is created which can be used for
8659: installation as usual. There are two ways: Either the package must
1.23 wiz 8660: install as root (<span class="quote">“<span class="quote">destdir</span>”</span>) or the package can
8661: install as non-root user (<span class="quote">“<span class="quote">user-destdir</span>”</span>).</p>
1.41 asau 8662: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 8663: <li class="listitem"><p><code class="varname">PKG_DESTDIR_SUPPORT</code> has to be
1.113 leot 8664: set to <span class="quote">“<span class="quote">destdir</span>”</span> or <span class="quote">“<span class="quote">user-destdir</span>”</span>.
8665: By default <code class="varname">PKG_DESTDIR_SUPPORT</code>
1.38 wiz 8666: is set to <span class="quote">“<span class="quote">user-destdir</span>”</span> to help catching more
8667: potential packaging problems. If bsd.prefs.mk is included in the Makefile,
1.14 jmcneill 8668: <code class="varname">PKG_DESTDIR_SUPPORT</code> needs to be set before
8669: the inclusion.</p></li>
1.23 wiz 8670: <li class="listitem"><p>All installation operations have to be prefixed with
1.4 rillig 8671: <code class="filename">${DESTDIR}</code>.</p></li>
1.23 wiz 8672: <li class="listitem"><p>automake gets this DESTDIR mostly right
1.4 rillig 8673: automatically. Many manual rules and pre/post-install often are
8674: incorrect; fix them.</p></li>
1.23 wiz 8675: <li class="listitem"><p>If files are installed with special owner/group
1.17 imil 8676: use <code class="varname">SPECIAL_PERMS</code>.</p></li>
1.23 wiz 8677: <li class="listitem"><p>In general, packages should support
1.4 rillig 8678: <code class="varname">UNPRIVILEGED</code> to be able to use
8679: DESTDIR.</p></li>
8680: </ul></div>
8681: </div>
1.41 asau 8682: <div class="sect2">
1.4 rillig 8683: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8684: <a name="hardcoded-paths"></a>21.6.5. Packages with hardcoded paths to other interpreters</h3></div></div></div>
1.1 dsieger 8685: <p>Your package may also contain scripts with hardcoded paths to
8686: other interpreters besides (or as well as) perl. To correct the
8687: full pathname to the script interpreter, you need to set the
8688: following definitions in your <code class="filename">Makefile</code> (we
1.10 hubertf 8689: shall use <span class="command"><strong>tclsh</strong></span> in this example):</p>
1.1 dsieger 8690: <pre class="programlisting">
8691: REPLACE_INTERPRETER+= tcl
8692: REPLACE.tcl.old= .*/bin/tclsh
8693: REPLACE.tcl.new= ${PREFIX}/bin/tclsh
8694: REPLACE_FILES.tcl= # list of tcl scripts which need to be fixed,
8695: # relative to ${WRKSRC}, just as in REPLACE_PERL
1.111 sevan 8696: </pre>
1.41 asau 8697: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 8698: <h3 class="title">Note</h3>
8699: <p>Before March 2006, these variables were called
8700: <code class="varname">_REPLACE.*</code> and
8701: <code class="varname">_REPLACE_FILES.*</code>.</p>
8702: </div>
8703: </div>
1.41 asau 8704: <div class="sect2">
1.1 dsieger 8705: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8706: <a name="perl-modules"></a>21.6.6. Packages installing perl modules</h3></div></div></div>
1.1 dsieger 8707: <p>Makefiles of packages providing perl5 modules should include
8708: the Makefile fragment
8709: <code class="filename">../../lang/perl5/module.mk</code>. It provides a
1.10 hubertf 8710: <span class="command"><strong>do-configure</strong></span> target for the standard perl
1.1 dsieger 8711: configuration for such modules as well as various hooks to tune
8712: this configuration. See comments in this file for
8713: details.</p>
8714: <p>Perl5 modules will install into different places depending
8715: on the version of perl used during the build process. To
8716: address this, pkgsrc will append lines to the
8717: <code class="filename">PLIST</code> corresponding to the files listed in
8718: the installed <code class="filename">.packlist</code> file generated by
8719: most perl5 modules. This is invoked by defining
8720: <code class="varname">PERL5_PACKLIST</code> to a space-separated list of
1.47 wiz 8721: packlist files relative to <code class="varname">PERL5_PACKLIST_DIR</code>
8722: (<code class="varname">PERL5_INSTALLVENDORARCH</code> by default),
8723: e.g.:</p>
1.1 dsieger 8724: <pre class="programlisting">
1.47 wiz 8725: PERL5_PACKLIST= auto/Pg/.packlist
1.111 sevan 8726: </pre>
1.47 wiz 8727: <p>The perl5 config variables
8728: <code class="varname">installarchlib</code>,
8729: <code class="varname">installscript</code>,
8730: <code class="varname">installvendorbin</code>,
8731: <code class="varname">installvendorscript</code>,
8732: <code class="varname">installvendorarch</code>,
8733: <code class="varname">installvendorlib</code>,
8734: <code class="varname">installvendorman1dir</code>, and
8735: <code class="varname">installvendorman3dir</code> represent those
8736: locations in which components of perl5 modules may be installed,
8737: provided as variable with uppercase and prefixed with
8738: <code class="varname">PERL5_</code>, e.g. <code class="varname">PERL5_INSTALLARCHLIB</code>
8739: and may be used by perl5 packages that don't have a packlist.
8740: These variables are also substituted for in the
8741: <code class="filename">PLIST</code> as uppercase prefixed with
8742: <code class="varname">PERL5_SUB_</code>.</p>
1.1 dsieger 8743: </div>
1.41 asau 8744: <div class="sect2">
1.1 dsieger 8745: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8746: <a name="faq.info-files"></a>21.6.7. Packages installing info files</h3></div></div></div>
1.1 dsieger 8747: <p>Some packages install info files or use the
1.23 wiz 8748: <span class="quote">“<span class="quote">makeinfo</span>”</span> or <span class="quote">“<span class="quote">install-info</span>”</span>
1.1 dsieger 8749: commands. <code class="varname">INFO_FILES</code> should be defined in
8750: the package Makefile so that <code class="filename">INSTALL</code> and
8751: <code class="filename">DEINSTALL</code> scripts will be generated to
8752: handle registration of the info files in the Info directory
1.23 wiz 8753: file. The <span class="quote">“<span class="quote">install-info</span>”</span> command used for the info
1.1 dsieger 8754: files registration is either provided by the system, or by a
8755: special purpose package automatically added as dependency if
8756: needed.</p>
8757: <p><code class="varname">PKGINFODIR</code> is the directory under
8758: <code class="filename">${PREFIX}</code> where info files are primarily
8759: located. <code class="varname">PKGINFODIR</code> defaults to
1.23 wiz 8760: <span class="quote">“<span class="quote">info</span>”</span> and can be overridden by the user.</p>
1.1 dsieger 8761: <p>The info files for the package should be listed in the
8762: package <code class="filename">PLIST</code>; however any split info files
8763: need not be listed.</p>
1.23 wiz 8764: <p>A package which needs the <span class="quote">“<span class="quote">makeinfo</span>”</span> command
8765: at build time must add <span class="quote">“<span class="quote">makeinfo</span>”</span> to
1.1 dsieger 8766: <code class="varname">USE_TOOLS</code> in its Makefile. If a minimum
1.23 wiz 8767: version of the <span class="quote">“<span class="quote">makeinfo</span>”</span> command is needed it
1.1 dsieger 8768: should be noted with the <code class="varname">TEXINFO_REQD</code>
8769: variable in the package <code class="filename">Makefile</code>. By
8770: default, a minimum version of 3.12 is required. If the system
1.10 hubertf 8771: does not provide a <span class="command"><strong>makeinfo</strong></span> command or if it
1.1 dsieger 8772: does not match the required minimum, a build dependency on the
1.137 leot 8773: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/gtexinfo/README.html" target="_top"><code class="filename">devel/gtexinfo</code></a> package will
1.1 dsieger 8774: be added automatically.</p>
8775: <p>The build and installation process of the software provided
8776: by the package should not use the
1.10 hubertf 8777: <span class="command"><strong>install-info</strong></span> command as the registration of
1.1 dsieger 8778: info files is the task of the package
8779: <code class="filename">INSTALL</code> script, and it must use the
1.10 hubertf 8780: appropriate <span class="command"><strong>makeinfo</strong></span> command.</p>
1.1 dsieger 8781: <p>To achieve this goal, the pkgsrc infrastructure creates
1.10 hubertf 8782: overriding scripts for the <span class="command"><strong>install-info</strong></span> and
8783: <span class="command"><strong>makeinfo</strong></span> commands in a directory listed early
1.1 dsieger 8784: in <code class="varname">PATH</code>.</p>
1.10 hubertf 8785: <p>The script overriding <span class="command"><strong>install-info</strong></span> has
1.1 dsieger 8786: no effect except the logging of a message. The script overriding
1.10 hubertf 8787: <span class="command"><strong>makeinfo</strong></span> logs a message and according to the
1.1 dsieger 8788: value of <code class="varname">TEXINFO_REQD</code> either runs the appropriate
1.10 hubertf 8789: <span class="command"><strong>makeinfo</strong></span> command or exit on error.</p>
1.1 dsieger 8790: </div>
1.41 asau 8791: <div class="sect2">
1.1 dsieger 8792: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8793: <a name="manpages"></a>21.6.8. Packages installing man pages</h3></div></div></div>
1.1 dsieger 8794: <p>All packages that install manual pages should install them
8795: into the same directory, so that there is one common place to look
8796: for them. In pkgsrc, this place is
8797: <code class="literal">${PREFIX}/${PKGMANDIR}</code>, and this expression
8798: should be used in packages. The default for
8799: <code class="varname">PKGMANDIR</code> is
1.23 wiz 8800: <span class="quote">“<span class="quote"><code class="filename">man</code></span>”</span>. Another often-used value
8801: is <span class="quote">“<span class="quote"><code class="filename">share/man</code></span>”</span>.</p>
1.41 asau 8802: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 8803: <h3 class="title">Note</h3>
8804: <p>The support for a custom <code class="varname">PKGMANDIR</code>
8805: is far from complete.</p>
8806: </div>
8807: <p>The <code class="filename">PLIST</code> files can just use
8808: <code class="filename">man/</code> as the top level directory for the man
8809: page file entries, and the pkgsrc framework will convert as
8810: needed. In all other places, the correct
8811: <code class="varname">PKGMANDIR</code> must be used.</p>
8812: <p>Packages that are
8813: configured with <code class="varname">GNU_CONFIGURE</code> set as
1.23 wiz 8814: <span class="quote">“<span class="quote">yes</span>”</span>, by default will use the
1.1 dsieger 8815: <code class="filename">./configure</code>
8816: --mandir switch to set where the man pages should be installed.
8817: The path is <code class="varname">GNU_CONFIGURE_MANDIR</code> which defaults
8818: to <code class="varname">${PREFIX}/${PKGMANDIR}</code>.</p>
8819: <p>Packages that use <code class="varname">GNU_CONFIGURE</code> but do not
8820: use --mandir, can set <code class="varname">CONFIGURE_HAS_MANDIR</code>
1.23 wiz 8821: to <span class="quote">“<span class="quote">no</span>”</span>.
1.1 dsieger 8822: Or if the <code class="filename">./configure</code> script uses
8823: a non-standard use of --mandir, you can set
8824: <code class="varname">GNU_CONFIGURE_MANDIR</code> as needed.</p>
1.154 rillig 8825: <p>See <a class="xref" href="#manpage-compression" title="15.5. Man page compression">Section 15.5, “Man page compression”</a> for
1.1 dsieger 8826: information on installation of compressed manual pages.</p>
8827: </div>
1.41 asau 8828: <div class="sect2">
1.1 dsieger 8829: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8830: <a name="gconf-data-files"></a>21.6.9. Packages installing GConf data files</h3></div></div></div>
1.1 dsieger 8831: <p>If a package installs <code class="filename">.schemas</code> or
1.7 rillig 8832: <code class="filename">.entries</code> files, used by GConf,
1.1 dsieger 8833: you need to take some extra steps to make sure they get registered
8834: in the database:</p>
1.23 wiz 8835: <div class="orderedlist"><ol class="orderedlist" type="1">
8836: <li class="listitem"><p>Include <code class="filename">../../devel/GConf/schemas.mk</code>
1.1 dsieger 8837: instead of its <code class="filename">buildlink3.mk</code> file. This
1.7 rillig 8838: takes care of rebuilding the GConf database at installation and
1.1 dsieger 8839: deinstallation time, and tells the package where to install
1.7 rillig 8840: GConf data files using some standard configure arguments. It
1.1 dsieger 8841: also disallows any access to the database directly from the
8842: package.</p></li>
1.23 wiz 8843: <li class="listitem"><p>Ensure that the package installs its
1.1 dsieger 8844: <code class="filename">.schemas</code> files under
8845: <code class="filename">${PREFIX}/share/gconf/schemas</code>. If they get
8846: installed under <code class="filename">${PREFIX}/etc</code>, you will
8847: need to manually patch the package.</p></li>
1.23 wiz 8848: <li class="listitem"><p>Check the PLIST and remove any entries under the etc/gconf
1.1 dsieger 8849: directory, as they will be handled automatically. See
1.154 rillig 8850: <a class="xref" href="#faq.conf" title="10.13. How do I change the location of configuration files?">Section 10.13, “How do I change the location of configuration files?”</a> for more information.</p></li>
1.23 wiz 8851: <li class="listitem"><p>Define the <code class="varname">GCONF_SCHEMAS</code> variable in
1.1 dsieger 8852: your <code class="filename">Makefile</code> with a list of all
8853: <code class="filename">.schemas</code> files installed by the package, if
8854: any. Names must not contain any directories in them.</p></li>
1.23 wiz 8855: <li class="listitem"><p>Define the <code class="varname">GCONF_ENTRIES</code> variable in
1.1 dsieger 8856: your <code class="filename">Makefile</code> with a
8857: list of all <code class="filename">.entries</code> files installed by the
8858: package, if any. Names must not contain any directories in
8859: them.</p></li>
8860: </ol></div>
8861: </div>
1.41 asau 8862: <div class="sect2">
1.1 dsieger 8863: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8864: <a name="scrollkeeper-data-files"></a>21.6.10. Packages installing scrollkeeper/rarian data files</h3></div></div></div>
1.1 dsieger 8865: <p>If a package installs <code class="filename">.omf</code> files, used by
1.18 snj 8866: scrollkeeper/rarian, you need to take some extra steps to make sure they
1.1 dsieger 8867: get registered in the database:</p>
1.23 wiz 8868: <div class="orderedlist"><ol class="orderedlist" type="1">
8869: <li class="listitem"><p>Include
1.18 snj 8870: <code class="filename">../../mk/omf-scrollkeeper.mk</code>
8871: instead of rarian's <code class="filename">buildlink3.mk</code> file. This
1.1 dsieger 8872: takes care of rebuilding the scrollkeeper database at
8873: installation and deinstallation time, and disallows any access
8874: to it directly from the package.</p></li>
1.23 wiz 8875: <li class="listitem"><p>Check the PLIST and remove any entries under the
1.1 dsieger 8876: <code class="filename">libdata/scrollkeeper</code> directory, as they
8877: will be handled automatically.</p></li>
1.23 wiz 8878: <li class="listitem"><p>Remove the <code class="filename">share/omf</code> directory from
1.18 snj 8879: the PLIST. It will be handled by rarian. (<span class="command"><strong>make
8880: print-PLIST</strong></span> does this automatically.)</p></li>
1.1 dsieger 8881: </ol></div>
8882: </div>
1.41 asau 8883: <div class="sect2">
1.1 dsieger 8884: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8885: <a name="x11-fonts"></a>21.6.11. Packages installing X11 fonts</h3></div></div></div>
1.1 dsieger 8886: <p>If a package installs font files, you will need to rebuild
8887: the fonts database in the directory where they get installed at
8888: installation and deinstallation time. This can be automatically
8889: done by using the pkginstall framework.</p>
8890: <p>You can list the directories where fonts are installed in the
8891: <code class="varname">FONTS_DIRS.<em class="replaceable"><code>type</code></em></code>
8892: variables, where <em class="replaceable"><code>type</code></em> can be one of
1.23 wiz 8893: <span class="quote">“<span class="quote">ttf</span>”</span>, <span class="quote">“<span class="quote">type1</span>”</span> or <span class="quote">“<span class="quote">x11</span>”</span>.
1.1 dsieger 8894: Also make sure that the database file
8895: <code class="filename">fonts.dir</code> is not listed in the PLIST.</p>
8896: <p>Note that you should not create new directories for fonts;
8897: instead use the standard ones to avoid that the user needs to
8898: manually configure his X server to find them.</p>
8899: </div>
1.41 asau 8900: <div class="sect2">
1.1 dsieger 8901: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8902: <a name="gtk2-modules"></a>21.6.12. Packages installing GTK2 modules</h3></div></div></div>
1.1 dsieger 8903: <p>If a package installs GTK2 immodules or loaders, you need to
8904: take some extra steps to get them registered in the GTK2 database
8905: properly:</p>
1.23 wiz 8906: <div class="orderedlist"><ol class="orderedlist" type="1">
8907: <li class="listitem"><p>Include
1.1 dsieger 8908: <code class="filename">../../x11/gtk2/modules.mk</code> instead of its
8909: <code class="filename">buildlink3.mk</code> file. This takes care of
8910: rebuilding the database at installation and deinstallation time.</p></li>
1.23 wiz 8911: <li class="listitem"><p>Set <code class="varname">GTK2_IMMODULES=YES</code> if
1.1 dsieger 8912: your package installs GTK2 immodules.</p></li>
1.23 wiz 8913: <li class="listitem"><p>Set <code class="varname">GTK2_LOADERS=YES</code> if your package installs
1.1 dsieger 8914: GTK2 loaders.</p></li>
1.23 wiz 8915: <li class="listitem">
1.1 dsieger 8916: <p>Patch the package to not touch any of the GTK2
8917: databases directly. These are:</p>
1.41 asau 8918: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 8919: <li class="listitem"><p><code class="filename">libdata/gtk-2.0/gdk-pixbuf.loaders</code></p></li>
8920: <li class="listitem"><p><code class="filename">libdata/gtk-2.0/gtk.immodules</code></p></li>
1.1 dsieger 8921: </ul></div>
8922: </li>
1.23 wiz 8923: <li class="listitem"><p>Check the <code class="filename">PLIST</code> and remove
1.1 dsieger 8924: any entries under the <code class="filename">libdata/gtk-2.0</code>
8925: directory, as they will be handled automatically.</p></li>
8926: </ol></div>
8927: </div>
1.41 asau 8928: <div class="sect2">
1.1 dsieger 8929: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8930: <a name="sgml-xml-data"></a>21.6.13. Packages installing SGML or XML data</h3></div></div></div>
1.1 dsieger 8931: <p>If a package installs SGML or XML data files that need to be
8932: registered in system-wide catalogs (like DTDs, sub-catalogs,
8933: etc.), you need to take some extra steps:</p>
1.23 wiz 8934: <div class="orderedlist"><ol class="orderedlist" type="1">
8935: <li class="listitem"><p>Include
1.1 dsieger 8936: <code class="filename">../../textproc/xmlcatmgr/catalogs.mk</code> in
8937: your <code class="filename">Makefile</code>, which takes care of
8938: registering those files in system-wide catalogs at
8939: installation and deinstallation time.</p></li>
1.23 wiz 8940: <li class="listitem"><p>Set <code class="varname">SGML_CATALOGS</code> to the full path of
1.1 dsieger 8941: any SGML catalogs installed by the package.</p></li>
1.23 wiz 8942: <li class="listitem"><p>Set <code class="varname">XML_CATALOGS</code> to the full path of
1.1 dsieger 8943: any XML catalogs installed by the package.</p></li>
1.23 wiz 8944: <li class="listitem"><p>Set <code class="varname">SGML_ENTRIES</code> to individual entries
1.1 dsieger 8945: to be added to the SGML catalog. These come in groups of
8946: three strings; see xmlcatmgr(1) for more information
8947: (specifically, arguments recognized by the 'add' action).
8948: Note that you will normally not use this variable.</p></li>
1.23 wiz 8949: <li class="listitem"><p>Set <code class="varname">XML_ENTRIES</code> to individual entries
1.1 dsieger 8950: to be added to the XML catalog. These come in groups of three
8951: strings; see xmlcatmgr(1) for more information (specifically,
8952: arguments recognized by the 'add' action). Note that you will
8953: normally not use this variable.</p></li>
8954: </ol></div>
8955: </div>
1.41 asau 8956: <div class="sect2">
1.1 dsieger 8957: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8958: <a name="mime-database"></a>21.6.14. Packages installing extensions to the MIME database</h3></div></div></div>
1.1 dsieger 8959: <p>If a package provides extensions to the MIME database by
8960: installing <code class="filename">.xml</code> files inside
8961: <code class="filename">${PREFIX}/share/mime/packages</code>, you
8962: need to take some extra steps to ensure that the database is kept
8963: consistent with respect to these new files:</p>
1.23 wiz 8964: <div class="orderedlist"><ol class="orderedlist" type="1">
8965: <li class="listitem"><p>Include
1.1 dsieger 8966: <code class="filename">../../databases/shared-mime-info/mimedb.mk</code>
8967: (avoid using the <code class="filename">buildlink3.mk</code> file from
8968: this same directory, which is reserved for inclusion from
8969: other <code class="filename">buildlink3.mk</code> files). It takes
8970: care of rebuilding the MIME database at installation and
8971: deinstallation time, and disallows any access to it directly
8972: from the package.</p></li>
1.23 wiz 8973: <li class="listitem"><p>Check the PLIST and remove any entries under the
1.1 dsieger 8974: <code class="filename">share/mime</code> directory,
8975: <span class="emphasis"><em>except</em></span> for files saved under
8976: <code class="filename">share/mime/packages</code>. The former are
8977: handled automatically by
8978: the update-mime-database program, but the latter are
8979: package-dependent and must be removed by the package that
8980: installed them in the first place.</p></li>
1.23 wiz 8981: <li class="listitem"><p>Remove any <code class="filename">share/mime/*</code> directories
1.1 dsieger 8982: from the PLIST. They will be handled by the shared-mime-info
8983: package.</p></li>
8984: </ol></div>
8985: </div>
1.41 asau 8986: <div class="sect2">
1.1 dsieger 8987: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8988: <a name="intltool"></a>21.6.15. Packages using intltool</h3></div></div></div>
1.1 dsieger 8989: <p>If a package uses intltool during its build, add
8990: <code class="literal">intltool</code> to the <code class="varname">USE_TOOLS</code>,
8991: which forces it to use the intltool package provided by pkgsrc,
8992: instead of the one bundled with the distribution file.</p>
8993: <p>This tracks intltool's build-time dependencies and uses the
8994: latest available version; this way, the package benefits of any
8995: bug fixes that may have appeared since it was released.</p>
8996: </div>
1.41 asau 8997: <div class="sect2">
1.1 dsieger 8998: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8999: <a name="startup-scripts"></a>21.6.16. Packages installing startup scripts</h3></div></div></div>
1.1 dsieger 9000: <p>If a package contains a rc.d script, it won't be copied into
9001: the startup directory by default, but you can enable it, by adding
9002: the option <code class="varname">PKG_RCD_SCRIPTS=YES</code> in
1.10 hubertf 9003: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. This option will copy the scripts
1.1 dsieger 9004: into <code class="filename">/etc/rc.d</code> when a package is installed, and
9005: it will automatically remove the scripts when the package is
9006: deinstalled.</p>
9007: </div>
1.41 asau 9008: <div class="sect2">
1.1 dsieger 9009: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9010: <a name="tex-packages"></a>21.6.17. Packages installing TeX modules</h3></div></div></div>
1.1 dsieger 9011: <p>If a package installs TeX packages into the texmf tree,
9012: the <code class="filename">ls-R</code> database of the tree needs to be
9013: updated.</p>
1.41 asau 9014: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 9015: <h3 class="title">Note</h3>
1.22 jakllsch 9016: <p>Except the main TeX packages such as kpathsea,
1.1 dsieger 9017: packages should install files
1.22 jakllsch 9018: into <code class="filename">${PREFIX}/share/texmf-dist</code>,
9019: not <code class="filename">${PREFIX}/share/texmf</code>.</p>
1.1 dsieger 9020: </div>
1.23 wiz 9021: <div class="orderedlist"><ol class="orderedlist" type="1">
9022: <li class="listitem"><p>Include
1.22 jakllsch 9023: <code class="filename">../../print/kpathsea/texmf.mk</code>. This
1.1 dsieger 9024: takes care of rebuilding the <code class="filename">ls-R</code>
9025: database at installation and deinstallation time.</p></li>
1.23 wiz 9026: <li class="listitem">
1.1 dsieger 9027: <p>If your package installs files into a texmf
9028: tree other than the one
1.22 jakllsch 9029: at <code class="filename">${PREFIX}/share/texmf-dist</code>,
9030: set <code class="varname">TEX_TEXMF_DIRS</code> to the list of all texmf
1.1 dsieger 9031: trees that need database update.</p>
9032: <p>If your package also installs font map files that need
1.10 hubertf 9033: to be registered using <span class="command"><strong>updmap</strong></span>,
1.29 dholland 9034: include <code class="filename">../../print/tex-tetex/map.mk</code> and
1.22 jakllsch 9035: set <code class="varname">TEX_MAP_FILES</code> and/or
9036: <code class="varname">TEX_MIXEDMAP_FILES</code> to the list of all
1.10 hubertf 9037: such font map files. Then <span class="command"><strong>updmap</strong></span> will
1.1 dsieger 9038: be run automatically at installation/deinstallation to
9039: enable/disable font map files for TeX output
9040: drivers.</p>
9041: </li>
1.23 wiz 9042: <li class="listitem"><p>Make sure that none of <code class="filename">ls-R</code>
1.1 dsieger 9043: databases are included in <code class="filename">PLIST</code>, as
1.29 dholland 9044: they will be removed only by the kpathsea package.</p></li>
1.1 dsieger 9045: </ol></div>
9046: </div>
1.41 asau 9047: <div class="sect2">
1.1 dsieger 9048: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9049: <a name="emulation-packages"></a>21.6.18. Packages supporting running binaries in
1.1 dsieger 9050: emulation</h3></div></div></div>
9051: <p>There are some packages that provide libraries and
9052: executables for running binaries from a one operating system
9053: on a different one (if the latter supports it). One example
9054: is running Linux binaries on NetBSD.</p>
1.137 leot 9055: <p>The <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/rpm2pkg/README.html" target="_top"><code class="filename">pkgtools/rpm2pkg</code></a>
1.1 dsieger 9056: helps in extracting and packaging Linux rpm packages.</p>
9057: <p>The <code class="varname">CHECK_SHLIBS</code> can be set to no to
1.10 hubertf 9058: avoid the <span class="command"><strong>check-shlibs</strong></span> target, which tests
1.1 dsieger 9059: if all libraries for each installed executable can be found by
9060: the dynamic linker. Since the standard dynamic linker is run,
9061: this fails for emulation packages, because the libraries used
9062: by the emulation are not in the standard directories.</p>
9063: </div>
1.41 asau 9064: <div class="sect2">
1.1 dsieger 9065: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9066: <a name="hicolor-theme"></a>21.6.19. Packages installing hicolor theme icons</h3></div></div></div>
1.1 dsieger 9067: <p>If a package installs images under the
9068: <code class="filename">share/icons/hicolor</code> and/or updates the
9069: <code class="filename">share/icons/hicolor/icon-theme.cache</code>
9070: database, you need to take some extra steps to make sure that the
9071: shared theme directory is handled appropriately and that the cache
9072: database is rebuilt:</p>
1.23 wiz 9073: <div class="orderedlist"><ol class="orderedlist" type="1">
9074: <li class="listitem"><p>Include
1.1 dsieger 9075: <code class="filename">../../graphics/hicolor-icon-theme/buildlink3.mk</code>.</p></li>
1.23 wiz 9076: <li class="listitem"><p>Check the <code class="filename">PLIST</code> and remove the
1.1 dsieger 9077: entry that refers to the theme cache.</p></li>
1.23 wiz 9078: <li class="listitem"><p>Ensure that the PLIST does not remove the shared icon
1.1 dsieger 9079: directories from the <code class="filename">share/icons/hicolor</code>
9080: hierarchy because they will be handled automatically.</p></li>
9081: </ol></div>
9082: <p>The best way to verify that the PLIST is correct with
9083: respect to the last two points is to regenerate it using
1.10 hubertf 9084: <span class="command"><strong>make print-PLIST</strong></span>.</p>
1.1 dsieger 9085: </div>
1.41 asau 9086: <div class="sect2">
1.1 dsieger 9087: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9088: <a name="desktop-files"></a>21.6.20. Packages installing desktop files</h3></div></div></div>
1.1 dsieger 9089: <p>If a package installs <code class="filename">.desktop</code> files
9090: under <code class="filename">share/applications</code> and these include
1.53 rodent 9091: MIME information (MimeType key), you need to take extra steps to
9092: ensure that they are registered into the MIME database:</p>
1.23 wiz 9093: <div class="orderedlist"><ol class="orderedlist" type="1">
9094: <li class="listitem"><p>Include
1.1 dsieger 9095: <code class="filename">../../sysutils/desktop-file-utils/desktopdb.mk</code>.</p></li>
1.23 wiz 9096: <li class="listitem"><p>Check the PLIST and remove the entry that refers to the
1.1 dsieger 9097: <code class="filename">share/applications/mimeinfo.cache</code> file.
9098: It will be handled automatically.</p></li>
9099: </ol></div>
9100: <p>The best way to verify that the PLIST is correct with
1.10 hubertf 9101: respect to the last point is to regenerate it using <span class="command"><strong>make
1.1 dsieger 9102: print-PLIST</strong></span>.</p>
9103: </div>
9104: </div>
1.41 asau 9105: <div class="sect1">
1.1 dsieger 9106: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9107: <a name="punting"></a>21.7. Marking packages as having problems</h2></div></div></div>
1.1 dsieger 9108: <p>In some cases one does not have the time to solve a problem
1.22 jakllsch 9109: immediately. In this case, one can plainly mark a package as broken. For
9110: this, one just sets the variable <code class="varname">BROKEN</code> to the
9111: reason why the package is broken (similar to the
1.162 rillig 9112: <code class="varname">PKG_FAIL_REASON</code> variable). A user trying to build
1.22 jakllsch 9113: the package will immediately be shown this message, and the build
9114: will not be even tried.</p>
9115: <p><code class="varname">BROKEN</code> packages are removed from pkgsrc in irregular
1.1 dsieger 9116: intervals.</p>
9117: </div>
9118: </div>
1.41 asau 9119: <div class="chapter">
1.1 dsieger 9120: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9121: <a name="debug"></a>Chapter 22. Debugging</h2></div></div></div>
1.1 dsieger 9122: <p>To check out all the gotchas when building a package, here are
9123: the steps that I do in order to get a package working. Please note
9124: this is basically the same as what was explained in the previous
9125: sections, only with some debugging aids.</p>
1.41 asau 9126: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9127: <li class="listitem"><p>Be sure to set <code class="varname">PKG_DEVELOPER=yes</code> in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p></li>
9128: <li class="listitem">
1.137 leot 9129: <p>Install <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a>,
1.1 dsieger 9130: create a directory for a new package, change into it, then run
1.10 hubertf 9131: <span class="command"><strong>url2pkg</strong></span>:</p>
1.1 dsieger 9132: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>mkdir /usr/pkgsrc/<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>examplepkg</code></em></code></strong>
9133: <code class="prompt">%</code> <strong class="userinput"><code>cd /usr/pkgsrc/<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>examplepkg</code></em></code></strong>
1.174 leot 9134: <code class="prompt">%</code> <strong class="userinput"><code>url2pkg https://www.example.com/path/to/distfile.tar.gz</code></strong></pre>
1.1 dsieger 9135: </li>
1.23 wiz 9136: <li class="listitem"><p>Edit the <code class="filename">Makefile</code> as requested.</p></li>
9137: <li class="listitem"><p>Fill in the <code class="filename">DESCR</code> file</p></li>
9138: <li class="listitem"><p>Run <span class="command"><strong>make configure</strong></span></p></li>
9139: <li class="listitem"><p>Add any dependencies glimpsed from documentation and the
1.1 dsieger 9140: configure step to the package's
9141: <code class="filename">Makefile</code>.</p></li>
1.23 wiz 9142: <li class="listitem">
1.1 dsieger 9143: <p>Make the package compile, doing multiple rounds of</p>
9144: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make</code></strong>
9145: <code class="prompt">%</code> <strong class="userinput"><code>pkgvi ${WRKSRC}/some/file/that/does/not/compile</code></strong>
9146: <code class="prompt">%</code> <strong class="userinput"><code>mkpatches</code></strong>
9147: <code class="prompt">%</code> <strong class="userinput"><code>patchdiff</code></strong>
9148: <code class="prompt">%</code> <strong class="userinput"><code>mv ${WRKDIR}/.newpatches/* patches</code></strong>
9149: <code class="prompt">%</code> <strong class="userinput"><code>make mps</code></strong>
9150: <code class="prompt">%</code> <strong class="userinput"><code>make clean</code></strong></pre>
9151: <p>Doing this step as non-root user will ensure that no files
9152: are modified that shouldn't be, especially during the build
1.10 hubertf 9153: phase. <span class="command"><strong>mkpatches</strong></span>,
9154: <span class="command"><strong>patchdiff</strong></span> and <span class="command"><strong>pkgvi</strong></span> are
1.137 leot 9155: from the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a>
1.1 dsieger 9156: package.</p>
9157: </li>
1.23 wiz 9158: <li class="listitem"><p>Look at the <code class="filename">Makefile</code>, fix if
1.154 rillig 9159: necessary; see <a class="xref" href="#components.Makefile" title="13.1. Makefile">Section 13.1, “<code class="filename">Makefile</code>”</a>.</p></li>
1.23 wiz 9160: <li class="listitem">
1.1 dsieger 9161: <p>Generate a <code class="filename">PLIST</code>:</p>
9162: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
9163: <code class="prompt">#</code> <strong class="userinput"><code>make print-PLIST >PLIST</code></strong>
9164: <code class="prompt">#</code> <strong class="userinput"><code>make deinstall</code></strong>
9165: <code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
9166: <code class="prompt">#</code> <strong class="userinput"><code>make deinstall</code></strong></pre>
9167: <p>You usually need to be <code class="username">root</code> to do
9168: this. Look if there are any files left:</p>
9169: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make print-PLIST</code></strong></pre>
9170: <p>If this reveals any files that are missing in
9171: <code class="filename">PLIST</code>, add them.</p>
9172: </li>
1.23 wiz 9173: <li class="listitem">
1.1 dsieger 9174: <p>Now that the <code class="filename">PLIST</code> is OK, install the
9175: package again and make a binary package:</p>
9176: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make reinstall</code></strong>
9177: <code class="prompt">#</code> <strong class="userinput"><code>make package</code></strong></pre>
9178: </li>
1.23 wiz 9179: <li class="listitem">
1.1 dsieger 9180: <p>Delete the installed package:</p>
9181: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>pkg_delete <em class="replaceable"><code>examplepkg</code></em></code></strong></pre>
9182: </li>
1.23 wiz 9183: <li class="listitem">
1.10 hubertf 9184: <p>Repeat the above <span class="command"><strong>make print-PLIST</strong></span>
1.1 dsieger 9185: command, which shouldn't find anything now:</p>
9186: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make print-PLIST</code></strong></pre>
9187: </li>
1.23 wiz 9188: <li class="listitem">
1.1 dsieger 9189: <p>Reinstall the binary package:</p>
9190: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>pkg_add .../<em class="replaceable"><code>examplepkg</code></em>.tgz</code></strong></pre>
9191: </li>
1.23 wiz 9192: <li class="listitem"><p>Play with it. Make sure everything works.</p></li>
9193: <li class="listitem">
1.137 leot 9194: <p>Run <span class="command"><strong>pkglint</strong></span> from <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>, and fix the problems it
1.1 dsieger 9195: reports:</p>
9196: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>pkglint</code></strong></pre>
9197: </li>
1.154 rillig 9198: <li class="listitem"><p>Submit (or commit, if you have cvs access); see <a class="xref" href="#submit" title="Chapter 23. Submitting and Committing">Chapter 23, <i>Submitting and Committing</i></a>.</p></li>
1.1 dsieger 9199: </ul></div>
9200: </div>
1.41 asau 9201: <div class="chapter">
1.1 dsieger 9202: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9203: <a name="submit"></a>Chapter 23. Submitting and Committing</h2></div></div></div>
1.1 dsieger 9204: <div class="toc">
9205: <p><b>Table of Contents</b></p>
1.100 leot 9206: <dl class="toc">
1.154 rillig 9207: <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt>
9208: <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt>
9209: <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt>
9210: <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt>
9211: <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt>
9212: <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt>
9213: <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt>
9214: <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt>
1.1 dsieger 9215: </dl>
9216: </div>
1.41 asau 9217: <div class="sect1">
1.1 dsieger 9218: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9219: <a name="submitting-binary-packages"></a>23.1. Submitting binary packages</h2></div></div></div>
1.1 dsieger 9220: <p>Our policy is that we accept binaries only from pkgsrc
9221: developers to guarantee that the packages don't contain any
9222: trojan horses etc. This is not to annoy anyone but rather to
9223: protect our users! You're still free to put up your home-made
9224: binary packages and tell the world where to get them. NetBSD
9225: developers doing bulk builds and wanting to upload them please
1.154 rillig 9226: see <a class="xref" href="#bulk" title="Chapter 8. Creating binary packages for everything in pkgsrc (bulk builds)">Chapter 8, <i>Creating binary packages for everything in pkgsrc (bulk
1.66 asau 9227: builds)</i></a>.</p>
1.1 dsieger 9228: </div>
1.41 asau 9229: <div class="sect1">
1.1 dsieger 9230: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9231: <a name="submitting-your-package"></a>23.2. Submitting source packages (for non-NetBSD-developers)</h2></div></div></div>
1.1 dsieger 9232: <p>First, check that your package is complete, compiles and
1.154 rillig 9233: runs well; see <a class="xref" href="#debug" title="Chapter 22. Debugging">Chapter 22, <i>Debugging</i></a> and the rest of this
1.174 leot 9234: document. Next, generate an uuencoded gzipped <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?tar+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">tar</span>(1)</span></a>
1.1 dsieger 9235: archive that contains all files that make up the package.
9236: Finally, send this package to the pkgsrc bug tracking system,
1.174 leot 9237: either with the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">send-pr</span>(1)</span></a> command, or if you don't have
1.1 dsieger 9238: that, go to the web page
1.174 leot 9239: <a class="ulink" href="https://www.NetBSD.org/support/send-pr.html" target="_top">https://www.NetBSD.org/support/send-pr.html</a>,
1.21 snj 9240: which contains some instructions and a link to a form where you
9241: can submit packages. The
1.137 leot 9242: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/gtk-send-pr/README.html" target="_top"><code class="filename">sysutils/gtk-send-pr</code></a> package is
1.21 snj 9243: also available as a substitute for either of the above two tools.
9244: </p>
1.1 dsieger 9245: <p>In the form of the problem report, the category should be
1.23 wiz 9246: <span class="quote">“<span class="quote">pkg</span>”</span>, the synopsis should include the package name
1.1 dsieger 9247: and version number, and the description field should contain a
9248: short description of your package (contents of the COMMENT
9249: variable or DESCR file are OK). The uuencoded package data should
1.23 wiz 9250: go into the <span class="quote">“<span class="quote">fix</span>”</span> field.</p>
1.1 dsieger 9251: <p>If you want to submit several packages, please send a
9252: separate PR for each one, it's easier for us to track things
9253: that way.</p>
9254: <p>Alternatively, you can also import new packages into
1.23 wiz 9255: pkgsrc-wip (<span class="quote">“<span class="quote">pkgsrc work-in-progress</span>”</span>); see the
1.174 leot 9256: homepage at <a class="ulink" href="https://pkgsrc.org/wip/" target="_top">https://pkgsrc.org/wip/</a>
1.1 dsieger 9257: for details.</p>
9258: </div>
1.41 asau 9259: <div class="sect1">
1.1 dsieger 9260: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9261: <a name="general-notes-for-changes"></a>23.3. General notes when adding, updating, or removing packages</h2></div></div></div>
1.1 dsieger 9262: <p>Please note all package additions, updates, moves, and
9263: removals in <code class="filename">pkgsrc/doc/CHANGES-<em class="replaceable"><code>YYYY</code></em></code>. It's very
9264: important to keep this file up to date and conforming to the
9265: existing format, because it will be used by scripts to
1.174 leot 9266: automatically update pages on <a class="ulink" href="https://www.NetBSD.org/" target="_top">www.NetBSD.org</a> and other
1.1 dsieger 9267: sites. Additionally, check the
9268: <code class="filename">pkgsrc/doc/TODO</code> file and remove the entry
9269: for the package you updated or removed, in case it was mentioned
9270: there.</p>
9271: <p>When the <code class="varname">PKGREVISION</code> of a package is
9272: bumped, the change should appear in
9273: <code class="filename">pkgsrc/doc/CHANGES-<em class="replaceable"><code>YYYY</code></em></code> if it is security
9274: related or otherwise relevant. Mass bumps that result from a
9275: dependency being updated should not be mentioned. In all other
9276: cases it's the developer's decision.</p>
9277: <p>There is a make target that helps in creating proper
1.10 hubertf 9278: <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code> entries: <span class="command"><strong>make
1.1 dsieger 9279: changes-entry</strong></span>. It uses the optional <code class="varname">CTYPE</code>
9280: and <code class="varname">NETBSD_LOGIN_NAME</code> variables. The general
9281: usage is to first make sure that your <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code>
9282: file is up-to-date (to avoid having to resolve conflicts later-on)
1.10 hubertf 9283: and then to <span class="command"><strong>cd</strong></span> to the package directory. For
9284: package updates, <span class="command"><strong>make changes-entry</strong></span> is enough.
1.1 dsieger 9285: For new packages, or package moves or removals, set the
9286: <code class="varname">CTYPE</code> variable on the command line to "Added",
9287: "Moved", or "Removed". You can set <code class="varname">NETBSD_LOGIN_NAME</code>
1.10 hubertf 9288: in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> if your local login name is
1.22 jakllsch 9289: not the same as your NetBSD login name. The target also automatically
9290: removes possibly existing entries for the package in the
9291: <code class="filename">TODO</code> file. Don't forget to commit
1.66 asau 9292: the changes, e.g. by using <span class="command"><strong>make commit-changes-entry</strong></span>!
1.22 jakllsch 9293: If you are not using a checkout directly from cvs.NetBSD.org, but e.g.
9294: a local copy of the repository, you can set USE_NETBSD_REPO=yes. This
9295: makes the cvs commands use the main repository.
9296: </p>
1.1 dsieger 9297: </div>
1.41 asau 9298: <div class="sect1">
1.1 dsieger 9299: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9300: <a name="commit-messages"></a>23.4. Commit Messages</h2></div></div></div>
1.130 wiz 9301: <p>For several years, there have been mirrors of pkgsrc in
9302: fossil, git, and hg. Standard practise when using these tools is to
9303: make the first line of a commit message function as a summary that
9304: can be read without the rest, such as is commonly done with "git log
9305: --oneline". For this reason, we have the following guidelines for
9306: pkgsrc commit messages:</p>
9307: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
9308: <li class="listitem"><p>Start the commit message with a line that explains the
1.131 wiz 9309: big picture in 65 characters or less. When a commit is for one
1.130 wiz 9310: package, include the name of the package. For updates, include the
9311: version to which it is updated.</p></li>
9312: <li class="listitem"><p>Leave the next line empty.</p></li>
9313: <li class="listitem"><p>Then come the details for the commit (changes in that
9314: package, reason for a change) and any relevant PRs. Wrap this
9315: section.</p></li>
9316: </ul></div>
9317: <p>Here is an example:
9318: </p>
9319: <pre class="programlisting">
9320: libxslt: update to 1.0.30
9321:
9322: Changes since 1.0.29:
9323: ...
9324: </pre>
9325: <p>
9326: </p>
9327: <p>Here is another example:
9328: </p>
9329: <pre class="programlisting">
9330: mk/bsd.pkg.mk: enable SSP by default on NetBSD
9331:
9332: (rationale)
9333: </pre>
9334: <p>
9335: </p>
9336: <p>Commit messages are final: no <span class="quote">“<span class="quote">cvs admin</span>”</span> is
9337: allowed on the pkgsrc repository to change commit messages.</p>
9338: </div>
9339: <div class="sect1">
9340: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9341: <a name="committing-importing"></a>23.5. Committing: Adding a package to CVS</h2></div></div></div>
1.1 dsieger 9342: <p>This section is only of interest for pkgsrc developers with write
1.33 wiz 9343: access to the pkgsrc repository.</p>
9344: <p>When the package is finished, <span class="quote">“<span class="quote">cvs add</span>”</span> the files.
9345: Start by adding the directory and then files in the directory. Don't
9346: forget to add the new package to the category's
9347: <code class="filename">Makefile</code>. Make sure you don't forget any files;
9348: you can check by running <span class="quote">“<span class="quote">cvs status</span>”</span>. An example:</p>
9349: <pre class="programlisting">
9350: <code class="prompt">$</code> cd .../pkgsrc/category
9351: <code class="prompt">$</code> cvs add pkgname
9352: <code class="prompt">$</code> cd pkgname
9353: <code class="prompt">$</code> cvs add DESCR Makefile PLIST distinfo buildlink3.mk patches
9354: <code class="prompt">$</code> cvs add patches/p*
9355: <code class="prompt">$</code> cvs status | less
1.34 wiz 9356: <code class="prompt">$</code> cvs commit
1.33 wiz 9357: <code class="prompt">$</code> cd ..
9358: <code class="prompt">$</code> vi Makefile # add SUBDIRS+=pkgname line
1.34 wiz 9359: <code class="prompt">$</code> cvs commit Makefile
1.66 asau 9360: <code class="prompt">$</code> cd pkgname
1.73 jnemeth 9361: <code class="prompt">$</code> make CTYPE=Added commit-changes-entry
1.33 wiz 9362: </pre>
1.1 dsieger 9363: <p>The commit message of the initial import should include part of the
9364: <code class="filename">DESCR</code> file, so people reading the mailing lists know
9365: what the package is/does.</p>
1.33 wiz 9366: <p>Also mention the new package in
9367: <code class="filename">pkgsrc/doc/CHANGES-20xx</code>.</p>
9368: <p>Previously, <span class="quote">“<span class="quote">cvs import</span>”</span> was suggested, but it was
9369: much easier to get wrong than <span class="quote">“<span class="quote">cvs add</span>”</span>.</p>
1.1 dsieger 9370: </div>
1.41 asau 9371: <div class="sect1">
1.1 dsieger 9372: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9373: <a name="updating-package"></a>23.6. Updating a package to a newer version</h2></div></div></div>
1.1 dsieger 9374: <p>Please always put a concise, appropriate and relevant summary of the
9375: changes between old and new versions into the commit log when updating
9376: a package. There are various reasons for this:</p>
1.41 asau 9377: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9378: <li class="listitem"><p>A URL is volatile, and can change over time. It may go away completely
1.1 dsieger 9379: or its information may be overwritten by newer information.</p></li>
1.23 wiz 9380: <li class="listitem"><p>Having the change information between old and new versions in our CVS
1.1 dsieger 9381: repository is very useful for people who use either cvs or anoncvs.</p></li>
1.23 wiz 9382: <li class="listitem"><p>Having the change information between old and new versions in our CVS
1.1 dsieger 9383: repository is very useful for people who read the pkgsrc-changes mailing
9384: list, so that they can make tactical decisions about when to upgrade
9385: the package.</p></li>
9386: </ul></div>
9387: <p>Please also recognize that, just because a new version of a package
9388: has been released, it should not automatically be upgraded in the CVS
9389: repository. We prefer to be conservative in the packages that are
9390: included in pkgsrc - development or beta packages are not really the
9391: best thing for most places in which pkgsrc is used. Please use your
9392: judgement about what should go into pkgsrc, and bear in mind that
9393: stability is to be preferred above new and possibly untested features.</p>
9394: </div>
1.41 asau 9395: <div class="sect1">
1.1 dsieger 9396: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9397: <a name="renaming-package"></a>23.7. Renaming a package in pkgsrc</h2></div></div></div>
1.20 snj 9398: <p>Renaming packages is not recommended.</p>
1.175 gutterid 9399: <p>When renaming packages, be sure to fix any references to the old name
1.20 snj 9400: in other Makefiles, options, buildlink files, etc.</p>
1.167 leot 9401: <p>
1.175 gutterid 9402: Also, when renaming a package, please add
1.167 leot 9403: the package name and version pattern(s) of the previous package
9404: to <code class="varname">SUPERSEDES</code>.
1.20 snj 9405: This may be repeated for multiple renames.
9406: The new package would be an exact replacement.
1.167 leot 9407: Example:
1.20 snj 9408: </p>
1.167 leot 9409: <pre class="programlisting">
9410: SUPERSEDES+= p5-IO-Compress-Zlib<2.017
9411: SUPERSEDES+= optcomp-[0-9]*
9412: </pre>
1.23 wiz 9413: <p>Note that <span class="quote">“<span class="quote">successor</span>”</span> in the
1.20 snj 9414: CHANGES-<em class="replaceable"><code>YYYY</code></em> file doesn't necessarily
9415: mean that it <span class="emphasis"><em>supersedes</em></span>, as that successor may
9416: not be an exact replacement but is a suggestion for the replaced
9417: functionality.</p>
9418: </div>
1.41 asau 9419: <div class="sect1">
1.20 snj 9420: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9421: <a name="moving-package"></a>23.8. Moving a package in pkgsrc</h2></div></div></div>
1.20 snj 9422: <p>It is preferred that packages are not renamed or moved, but if needed
9423: please follow these steps.
9424: </p>
1.23 wiz 9425: <div class="orderedlist"><ol class="orderedlist" type="1">
9426: <li class="listitem"><p>Make a copy of the directory somewhere else.</p></li>
9427: <li class="listitem">
1.1 dsieger 9428: <p>Remove all CVS dirs.</p>
9429: <p>Alternatively to the first two steps you can also do:</p>
9430: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cvs -d user@cvs.NetBSD.org:/cvsroot export -D today pkgsrc/category/package</code></strong></pre>
9431: <p>and use that for further work.</p>
9432: </li>
1.23 wiz 9433: <li class="listitem"><p>Fix <code class="varname">CATEGORIES</code> and any
9434: <code class="varname">DEPENDS</code> paths that just did <span class="quote">“<span class="quote">../package</span>”</span>
9435: instead of <span class="quote">“<span class="quote">../../category/package</span>”</span>.</p></li>
9436: <li class="listitem"><p>In the modified package's Makefile, consider setting
1.20 snj 9437: <code class="varname">PREV_PKGPATH</code> to the previous category/package
9438: pathname. The <code class="varname">PREV_PKGPATH</code> can be used by tools
9439: for doing an update using pkgsrc building; for example, it can
1.174 leot 9440: search the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_summary+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_summary</span>(5)</span></a> database for <code class="varname">PREV_PKGPATH</code>
1.20 snj 9441: (if no <code class="varname">SUPERSEDES</code>) and then use the corresponding
9442: new <code class="varname">PKGPATH</code> for that moved package. Note that
9443: it may have multiple matches, so the tool should also check on the
9444: <code class="varname">PKGBASE</code> too. The <code class="varname">PREV_PKGPATH</code>
9445: probably has no value unless <code class="varname">SUPERSEDES</code> is not
9446: set, i.e. <code class="varname">PKGBASE</code> stays the same. </p></li>
1.23 wiz 9447: <li class="listitem"><p><span class="command"><strong>cvs import</strong></span> the modified package in the new
1.1 dsieger 9448: place.</p></li>
1.23 wiz 9449: <li class="listitem">
1.1 dsieger 9450: <p>Check if any package depends on it:
9451: </p>
9452: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cd /usr/pkgsrc</code></strong>
9453: <code class="prompt">%</code> <strong class="userinput"><code>grep /package */*/Makefile* */*/buildlink*</code></strong></pre>
9454: </li>
1.23 wiz 9455: <li class="listitem"><p>Fix paths in packages from step 5 to point to new location.</p></li>
9456: <li class="listitem"><p><span class="command"><strong>cvs rm (-f)</strong></span> the package at the old location.</p></li>
9457: <li class="listitem"><p>Remove from <code class="filename">oldcategory/Makefile</code>.</p></li>
9458: <li class="listitem"><p>Add to <code class="filename">newcategory/Makefile</code>.</p></li>
9459: <li class="listitem">
1.1 dsieger 9460: <p>Commit the changed and removed files:</p>
9461: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile</code></strong></pre>
9462: <p>(and any packages from step 5, of course).</p>
9463: </li>
9464: </ol></div>
9465: </div>
9466: </div>
1.41 asau 9467: <div class="chapter">
1.1 dsieger 9468: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9469: <a name="devfaq"></a>Chapter 24. Frequently Asked Questions</h2></div></div></div>
1.1 dsieger 9470: <p>This section contains the answers to questions that may
9471: arise when you are writing a package. If you don't find your
9472: question answered here, first have a look in the other chapters,
9473: and if you still don't have the answer, ask on the
9474: <code class="literal">pkgsrc-users</code> mailing list.</p>
1.41 asau 9475: <div class="qandaset">
1.174 leot 9476: <a name="devfaq.qandaset"></a><dl>
1.154 rillig 9477: <dt>24.1. <a href="#devfaq.makeflags">What is the difference between
1.1 dsieger 9478: MAKEFLAGS, .MAKEFLAGS and
9479: MAKE_FLAGS?</a>
9480: </dt>
1.154 rillig 9481: <dt>24.2. <a href="#devfaq.make">What is the difference between
1.1 dsieger 9482: MAKE, GMAKE and
9483: MAKE_PROGRAM?</a>
9484: </dt>
1.154 rillig 9485: <dt>24.3. <a href="#devfaq.cc">What is the difference between
1.1 dsieger 9486: CC, PKG_CC and
9487: PKGSRC_COMPILER?</a>
9488: </dt>
1.154 rillig 9489: <dt>24.4. <a href="#devfaq.bl3flags">What is the difference between
1.1 dsieger 9490: BUILDLINK_LDFLAGS,
9491: BUILDLINK_LDADD and
9492: BUILDLINK_LIBS?</a>
9493: </dt>
1.154 rillig 9494: <dt>24.5. <a href="#devfaq.bl3prefix">Why does make show-var
1.1 dsieger 9495: VARNAME=BUILDLINK_PREFIX.foo
9496: say it's empty?</a>
9497: </dt>
1.154 rillig 9498: <dt>24.6. <a href="#devfaq.master_sites">What does
1.1 dsieger 9499: ${MASTER_SITE_SOURCEFORGE:=package/} mean? I
9500: don't understand the := inside
9501: it.</a>
9502: </dt>
1.154 rillig 9503: <dt>24.7. <a href="#devfaq.mailinglists">Which mailing lists are there for package
1.1 dsieger 9504: developers?</a>
9505: </dt>
1.154 rillig 9506: <dt>24.8. <a href="#devfaq.documentation">Where is the pkgsrc
1.1 dsieger 9507: documentation?</a>
9508: </dt>
1.174 leot 9509: <dt>24.9. <a href="#devfaq.too-much-time">I have a little time to kill.
9510: What shall I do?</a>
1.1 dsieger 9511: </dt>
9512: </dl>
1.41 asau 9513: <table border="0" style="width: 100%;">
9514: <colgroup>
1.1 dsieger 9515: <col align="left" width="1%">
1.23 wiz 9516: <col>
1.41 asau 9517: </colgroup>
1.1 dsieger 9518: <tbody>
1.41 asau 9519: <tr class="question">
1.1 dsieger 9520: <td align="left" valign="top">
1.174 leot 9521: <a name="devfaq.makeflags"></a><a name="devfaq.makeflags.q"></a><p><b>24.1.</b></p>
1.1 dsieger 9522: </td>
9523: <td align="left" valign="top"><p>What is the difference between
9524: <code class="varname">MAKEFLAGS</code>, <code class="varname">.MAKEFLAGS</code> and
9525: <code class="varname">MAKE_FLAGS</code>?</p></td>
9526: </tr>
9527: <tr class="answer">
9528: <td align="left" valign="top"></td>
9529: <td align="left" valign="top"><p><code class="varname">MAKEFLAGS</code> are the flags passed
1.174 leot 9530: to the pkgsrc-internal invocations of <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>, while
1.1 dsieger 9531: <code class="varname">MAKE_FLAGS</code> are the flags that are passed to
9532: the <code class="varname">MAKE_PROGRAM</code> when building the
9533: package. [FIXME: What is .MAKEFLAGS for?]</p></td>
9534: </tr>
1.41 asau 9535: <tr class="question">
1.1 dsieger 9536: <td align="left" valign="top">
1.174 leot 9537: <a name="devfaq.make"></a><a name="devfaq.make.q"></a><p><b>24.2.</b></p>
1.1 dsieger 9538: </td>
9539: <td align="left" valign="top"><p>What is the difference between
9540: <code class="varname">MAKE</code>, <code class="varname">GMAKE</code> and
9541: <code class="varname">MAKE_PROGRAM</code>?</p></td>
9542: </tr>
9543: <tr class="answer">
9544: <td align="left" valign="top"></td>
9545: <td align="left" valign="top"><p><code class="varname">MAKE</code> is the path to the
1.174 leot 9546: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> program that is used in the pkgsrc
1.1 dsieger 9547: infrastructure. <code class="varname">GMAKE</code> is the path to GNU
9548: Make, but you need to say <code class="varname">USE_TOOLS+=gmake</code> to
9549: use that. <code class="varname">MAKE_PROGRAM</code> is the path to the
9550: Make program that is used for building the
9551: package.</p></td>
9552: </tr>
1.41 asau 9553: <tr class="question">
1.1 dsieger 9554: <td align="left" valign="top">
1.174 leot 9555: <a name="devfaq.cc"></a><a name="devfaq.cc.q"></a><p><b>24.3.</b></p>
1.1 dsieger 9556: </td>
9557: <td align="left" valign="top"><p>What is the difference between
9558: <code class="varname">CC</code>, <code class="varname">PKG_CC</code> and
9559: <code class="varname">PKGSRC_COMPILER</code>?</p></td>
9560: </tr>
9561: <tr class="answer">
9562: <td align="left" valign="top"></td>
9563: <td align="left" valign="top"><p><code class="varname">CC</code> is the path to the real C
9564: compiler, which can be configured by the pkgsrc user.
9565: <code class="varname">PKG_CC</code> is the path to the compiler wrapper.
9566: <code class="varname">PKGSRC_COMPILER</code> is <span class="emphasis"><em>not</em></span> a
9567: path to a compiler, but the type of compiler that should be
9568: used. See <code class="filename">mk/compiler.mk</code> for more
9569: information about the latter variable.</p></td>
9570: </tr>
1.41 asau 9571: <tr class="question">
1.1 dsieger 9572: <td align="left" valign="top">
1.174 leot 9573: <a name="devfaq.bl3flags"></a><a name="devfaq.bl3flags.q"></a><p><b>24.4.</b></p>
1.1 dsieger 9574: </td>
9575: <td align="left" valign="top"><p>What is the difference between
9576: <code class="varname">BUILDLINK_LDFLAGS</code>,
9577: <code class="varname">BUILDLINK_LDADD</code> and
9578: <code class="varname">BUILDLINK_LIBS</code>?</p></td>
9579: </tr>
9580: <tr class="answer">
9581: <td align="left" valign="top"></td>
9582: <td align="left" valign="top"><p>[FIXME]</p></td>
9583: </tr>
1.41 asau 9584: <tr class="question">
1.1 dsieger 9585: <td align="left" valign="top">
1.174 leot 9586: <a name="devfaq.bl3prefix"></a><a name="devfaq.bl3prefix.q"></a><p><b>24.5.</b></p>
1.1 dsieger 9587: </td>
1.10 hubertf 9588: <td align="left" valign="top"><p>Why does <span class="command"><strong>make show-var
1.1 dsieger 9589: VARNAME=BUILDLINK_PREFIX.<em class="replaceable"><code>foo</code></em></strong></span>
9590: say it's empty?</p></td>
9591: </tr>
9592: <tr class="answer">
9593: <td align="left" valign="top"></td>
9594: <td align="left" valign="top"><p>For optimization reasons, some variables are only
1.23 wiz 9595: available in the <span class="quote">“<span class="quote">wrapper</span>”</span> phase and later. To
9596: <span class="quote">“<span class="quote">simulate</span>”</span> the wrapper phase, append
1.10 hubertf 9597: <span class="command"><strong>PKG_PHASE=wrapper</strong></span> to the above
1.1 dsieger 9598: command.</p></td>
9599: </tr>
1.41 asau 9600: <tr class="question">
1.1 dsieger 9601: <td align="left" valign="top">
1.174 leot 9602: <a name="devfaq.master_sites"></a><a name="devfaq.master_sites.q"></a><p><b>24.6.</b></p>
1.1 dsieger 9603: </td>
9604: <td align="left" valign="top"><p>What does
1.108 rillig 9605: <code class="code">${MASTER_SITE_SOURCEFORGE:=package/}</code> mean? I
9606: don't understand the <code class="code">:=</code> inside
1.1 dsieger 9607: it.</p></td>
9608: </tr>
9609: <tr class="answer">
9610: <td align="left" valign="top"></td>
1.108 rillig 9611: <td align="left" valign="top"><p>The <code class="code">:=</code> is not really an
9612: assignment operator, although it looks like it.
1.1 dsieger 9613: Instead, it is a degenerate form of
1.108 rillig 9614: <code class="code">${LIST:<em class="replaceable"><code>old_string</code></em>=<em class="replaceable"><code>new_string</code></em>}</code>,
1.174 leot 9615: which is documented in the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man page and which is
1.108 rillig 9616: commonly used in the form <code class="code">${SRCS:.c=.o}</code>. In the
1.1 dsieger 9617: case of <code class="varname">MASTER_SITE_*</code>,
9618: <em class="replaceable"><code>old_string</code></em> is the empty string and
9619: <em class="replaceable"><code>new_string</code></em> is
1.108 rillig 9620: <code class="code">package/</code>. That's where the
9621: <code class="code">:</code> and the <code class="code">=</code> fall
1.1 dsieger 9622: together.</p></td>
9623: </tr>
1.41 asau 9624: <tr class="question">
1.1 dsieger 9625: <td align="left" valign="top">
1.174 leot 9626: <a name="devfaq.mailinglists"></a><a name="devfaq.mailinglists.q"></a><p><b>24.7.</b></p>
1.1 dsieger 9627: </td>
9628: <td align="left" valign="top"><p>Which mailing lists are there for package
9629: developers?</p></td>
9630: </tr>
9631: <tr class="answer">
9632: <td align="left" valign="top"></td>
1.41 asau 9633: <td align="left" valign="top"><div class="variablelist"><dl class="variablelist">
1.174 leot 9634: <dt><span class="term"><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#tech-pkg" target="_top">tech-pkg</a></span></dt>
1.1 dsieger 9635: <dd><p>This is a list for technical discussions related
9636: to pkgsrc development, e.g. soliciting feedback for changes to
9637: pkgsrc infrastructure, proposed new features, questions related
9638: to porting pkgsrc to a new platform, advice for maintaining a
9639: package, patches that affect many packages, help requests moved
9640: from pkgsrc-users when an infrastructure bug is found,
9641: etc.</p></dd>
1.174 leot 9642: <dt><span class="term"><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#pkgsrc-bugs" target="_top">pkgsrc-bugs</a></span></dt>
1.1 dsieger 9643: <dd><p>All bug reports in category "pkg" sent with
1.174 leot 9644: <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">send-pr</span>(1)</span></a> appear here. Please do not report your bugs here
1.1 dsieger 9645: directly; use one of the other mailing
9646: lists.</p></dd>
9647: </dl></div></td>
9648: </tr>
1.41 asau 9649: <tr class="question">
1.1 dsieger 9650: <td align="left" valign="top">
1.174 leot 9651: <a name="devfaq.documentation"></a><a name="devfaq.documentation.q"></a><p><b>24.8.</b></p>
1.1 dsieger 9652: </td>
9653: <td align="left" valign="top"><p>Where is the pkgsrc
9654: documentation?</p></td>
9655: </tr>
9656: <tr class="answer">
9657: <td align="left" valign="top"></td>
9658: <td align="left" valign="top">
9659: <p>There are many places where you can find
9660: documentation about pkgsrc:</p>
1.41 asau 9661: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9662: <li class="listitem"><p>The pkgsrc guide (this document) is a collection
1.1 dsieger 9663: of chapters that explain large parts of pkgsrc, but some
9664: chapters tend to be outdated. Which ones they are is hard to
9665: say.</p></li>
1.174 leot 9666: <li class="listitem"><p>On the mailing list archives (see <a class="ulink" href="https://mail-index.NetBSD.org/" target="_top">https://mail-index.NetBSD.org/</a>), you can find discussions
1.1 dsieger 9667: about certain features, announcements of new parts of the pkgsrc
9668: infrastructure and sometimes even announcements that a certain
9669: feature has been marked as obsolete. The benefit here is that
9670: each message has a date appended to it.</p></li>
1.23 wiz 9671: <li class="listitem"><p>Many of the files in the
1.1 dsieger 9672: <code class="filename">mk/</code> directory start with a comment that
9673: describes the purpose of the file and how it can be used by the
9674: pkgsrc user and package authors. An easy way to find this
1.10 hubertf 9675: documentation is to run <span class="command"><strong>bmake
1.1 dsieger 9676: help</strong></span>.</p></li>
1.23 wiz 9677: <li class="listitem"><p>The CVS log messages are a rich source of
1.1 dsieger 9678: information, but they tend to be highly abbreviated, especially
9679: for actions that occur often. Some contain a detailed
9680: description of what has changed, but they are geared towards the
9681: other pkgsrc developers, not towards an average pkgsrc user.
9682: They also only document <span class="emphasis"><em>changes</em></span>, so if you
9683: don't know what has been before, these messages may not be worth
9684: too much to you.</p></li>
1.23 wiz 9685: <li class="listitem"><p>Some parts of pkgsrc are only <span class="quote">“<span class="quote">implicitly
9686: documented</span>”</span>, that is the documentation exists only in the
1.1 dsieger 9687: mind of the developer who wrote the code. To get this
1.10 hubertf 9688: information, use the <span class="command"><strong>cvs annotate</strong></span> command
1.1 dsieger 9689: to see who has written it and ask on the
9690: <code class="literal">tech-pkg</code> mailing list, so that others can
9691: find your questions later (see above). To be sure that the
9692: developer in charge reads the mail, you may CC him or
9693: her.</p></li>
9694: </ul></div>
9695: </td>
9696: </tr>
1.41 asau 9697: <tr class="question">
1.1 dsieger 9698: <td align="left" valign="top">
1.174 leot 9699: <a name="devfaq.too-much-time"></a><a name="devfaq.too-much-time.q"></a><p><b>24.9.</b></p>
1.1 dsieger 9700: </td>
1.174 leot 9701: <td align="left" valign="top"><p>I have a little time to kill.
9702: What shall I do?</p></td>
1.1 dsieger 9703: </tr>
9704: <tr class="answer">
9705: <td align="left" valign="top"></td>
9706: <td align="left" valign="top">
9707: <p>This is not really an FAQ yet, but here's the answer
9708: anyway.</p>
1.41 asau 9709: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9710: <li class="listitem"><p>Run <span class="command"><strong>pkg_chk -N</strong></span> (from the
1.137 leot 9711: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_chk/README.html" target="_top"><code class="filename">pkgtools/pkg_chk</code></a> package). It
1.1 dsieger 9712: will tell you about newer versions of installed packages that are
9713: available, but not yet updated in pkgsrc.</p></li>
1.23 wiz 9714: <li class="listitem"><p>Browse <code class="filename">pkgsrc/doc/TODO</code>
1.14 jmcneill 9715: — it contains a list of suggested new packages and a list of
1.1 dsieger 9716: cleanups and enhancements for pkgsrc that would be nice to
9717: have.</p></li>
1.23 wiz 9718: <li class="listitem"><p>Review packages for which review was requested on
1.174 leot 9719: the <a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#tech-pkg" target="_top">tech-pkg</a>
1.1 dsieger 9720: mailing list.</p></li>
9721: </ul></div>
9722: </td>
9723: </tr>
9724: </tbody>
9725: </table>
9726: </div>
9727: </div>
1.41 asau 9728: <div class="chapter">
1.1 dsieger 9729: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9730: <a name="gnome"></a>Chapter 25. GNOME packaging and porting</h2></div></div></div>
1.1 dsieger 9731: <div class="toc">
9732: <p><b>Table of Contents</b></p>
1.100 leot 9733: <dl class="toc">
1.154 rillig 9734: <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt>
9735: <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt>
9736: <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt>
9737: <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt>
1.1 dsieger 9738: </dl>
9739: </div>
1.174 leot 9740: <p>Quoting <a class="ulink" href="https://www.gnome.org/" target="_top">GNOME's web
1.1 dsieger 9741: site</a>:</p>
9742: <div class="blockquote"><blockquote class="blockquote"><p>The GNOME project provides two things: The GNOME desktop
9743: environment, an intuitive and attractive desktop for users, and the
9744: GNOME development platform, an extensive framework for building
9745: applications that integrate into the rest of the desktop.</p></blockquote></div>
9746: <p>pkgsrc provides a seamless way to automatically build and install
9747: a complete GNOME environment <span class="emphasis"><em>under many different
9748: platforms</em></span>. We can say with confidence that pkgsrc is one of
9749: the most advanced build and packaging systems for GNOME due to its
9750: included technologies buildlink3, the wrappers and tools framework and
9751: automatic configuration file management. Lots of efforts are put into
9752: achieving a completely clean deinstallation of installed software
9753: components.</p>
1.174 leot 9754: <p>Given that pkgsrc is <a class="ulink" href="https://www.NetBSD.org/" target="_top">NetBSD</a>'s official packaging system,
1.1 dsieger 9755: the above also means that great efforts are put into making GNOME work
1.174 leot 9756: under this operating system. Recently, <a class="ulink" href="https://www.dragonflybsd.org/" target="_top">DragonFly BSD</a> also adopted
1.1 dsieger 9757: pkgsrc as its preferred packaging system, contributing lots of
9758: portability fixes to make GNOME build and install under it.</p>
9759: <p>This chapter is aimed at pkgsrc developers and other people
9760: interested in helping our GNOME porting and packaging efforts. It
9761: provides instructions on how to manage the existing packages and some
9762: important information regarding their internals.</p>
1.41 asau 9763: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 9764: <h3 class="title">We need your help!</h3>
9765: <p>Should you have some spare cycles to devote to NetBSD, pkgsrc
9766: and GNOME and are willing to learn new exciting stuff, please jump
1.174 leot 9767: straight to the <a class="ulink" href="https://www.NetBSD.org/contrib/projects.html#gnome" target="_top">pending
1.1 dsieger 9768: work</a> list! There is still a long way to go to get a
9769: fully-functional GNOME desktop under NetBSD and we need your help to
9770: achieve it!</p>
9771: </div>
1.41 asau 9772: <div class="sect1">
1.1 dsieger 9773: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9774: <a name="meta-packages"></a>25.1. Meta packages</h2></div></div></div>
1.1 dsieger 9775: <p>pkgsrc includes three GNOME-related meta packages:</p>
1.41 asau 9776: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 9777: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome-base/README.html" target="_top"><code class="filename">meta-pkgs/gnome-base</code></a>: Provides
1.1 dsieger 9778: the core GNOME desktop environment. It only includes the necessary
9779: bits to get it to boot correctly, although it may lack important
9780: functionality for daily operation. The idea behind this package is
9781: to let end users build their own configurations on top of this one,
9782: first installing this meta package to achieve a functional setup and
9783: then adding individual applications.</p></li>
1.137 leot 9784: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome/README.html" target="_top"><code class="filename">meta-pkgs/gnome</code></a>: Provides a
1.1 dsieger 9785: complete installation of the GNOME platform and desktop as defined
9786: by the GNOME project; this is based on the components distributed in
9787: the <code class="filename">platform/x.y/x.y.z/sources</code> and
9788: <code class="filename">desktop/x.y/x.y.z/sources</code> directories of the
9789: official FTP server. Developer-only tools found in those
9790: directories are not installed unless required by some other
9791: component to work properly. Similarly, packages from the bindings
9792: set (<code class="filename">bindings/x.y/x.y.z/sources</code>) are not pulled
9793: in unless required as a dependency for an end-user component. This
1.137 leot 9794: package "extends" <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome-base/README.html" target="_top"><code class="filename">meta-pkgs/gnome-base</code></a>.</p></li>
9795: <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome-devel/README.html" target="_top"><code class="filename">meta-pkgs/gnome-devel</code></a>:
1.1 dsieger 9796: Installs all the tools required to build a GNOME component when
9797: fetched from the CVS repository. These are required to let the
1.10 hubertf 9798: <span class="command"><strong>autogen.sh</strong></span> scripts work appropriately.</p></li>
1.1 dsieger 9799: </ul></div>
9800: <p>In all these packages, the <code class="varname">DEPENDS</code> lines are
9801: sorted in a way that eases updates: a package may depend on other
9802: packages listed before it but not on any listed after it. It is very
9803: important to keep this order to ease updates so... <span class="emphasis"><em>do not
9804: change it to alphabetical sorting!</em></span></p>
9805: </div>
1.41 asau 9806: <div class="sect1">
1.1 dsieger 9807: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9808: <a name="new-package"></a>25.2. Packaging a GNOME application</h2></div></div></div>
1.1 dsieger 9809: <p>Almost all GNOME applications are written in C and use a common
9810: set of tools as their build system. Things get different with the new
9811: bindings to other languages (such as Python), but the following will
9812: give you a general idea on the minimum required tools:</p>
1.41 asau 9813: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9814: <li class="listitem">
1.1 dsieger 9815: <p>Almost all GNOME applications use the GNU Autotools as their
9816: build system. As a general rule you will need to tell this to your
9817: package:</p>
9818: <pre class="programlisting">
9819: GNU_CONFIGURE=yes
9820: USE_LIBTOOL=yes
9821: USE_TOOLS+=gmake
9822: </pre>
9823: </li>
1.23 wiz 9824: <li class="listitem">
1.1 dsieger 9825: <p>If the package uses pkg-config to detect dependencies, add this
9826: tool to the list of required utilities:</p>
1.111 sevan 9827: <pre class="programlisting">
9828: USE_TOOLS+=pkg-config
9829: </pre>
1.137 leot 9830: <p>Also use <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/verifypc/README.html" target="_top"><code class="filename">pkgtools/verifypc</code></a> at
1.1 dsieger 9831: the end of the build process to ensure that you did not miss to
9832: specify any dependency in your package and that the version
9833: requirements are all correct.</p>
9834: </li>
1.23 wiz 9835: <li class="listitem"><p>If the package uses intltool, be sure to add
1.1 dsieger 9836: <code class="literal">intltool</code> to the <code class="varname">USE_TOOLS</code>
9837: to handle dependencies and to force the package to use the latest
9838: available version.</p></li>
1.23 wiz 9839: <li class="listitem">
1.1 dsieger 9840: <p>If the package uses gtk-doc (a documentation generation
9841: utility), do <span class="emphasis"><em>not</em></span> add a dependency on it. The
9842: tool is rather big and the distfile should come with pregenerated
9843: documentation anyway; if it does not, it is a bug that you ought to
9844: report. For such packages you should disable gtk-doc (unless it is
9845: the default):</p>
1.111 sevan 9846: <pre class="programlisting">
9847: CONFIGURE_ARGS+=--disable-gtk-doc
9848: </pre>
1.1 dsieger 9849: <p>The default location of installed HTML files
9850: (<code class="filename">share/gtk-doc/<package-name></code>) is correct
9851: and should not be changed unless the package insists on installing
9852: them somewhere else. Otherwise programs as
1.10 hubertf 9853: <span class="command"><strong>devhelp</strong></span> will not be able to open them. You can
1.1 dsieger 9854: do that with an entry similar to:</p>
1.111 sevan 9855: <pre class="programlisting">
9856: CONFIGURE_ARGS+=--with-html-dir=${PREFIX}/share/gtk-doc/...
9857: </pre>
1.1 dsieger 9858: </li>
9859: </ul></div>
9860: <p>GNOME uses multiple <span class="emphasis"><em>shared</em></span> directories and
9861: files under the installation prefix to maintain databases. In this
9862: context, shared means that those exact same directories and files are
9863: used among several different packages, leading to conflicts in the
9864: <code class="filename">PLIST</code>. pkgsrc currently includes functionality to
9865: handle the most common cases, so you have to forget about using
9866: <code class="literal">@unexec ${RMDIR}</code> lines in your file lists and
9867: omitting shared files from them. If you find yourself doing those,
9868: <span class="emphasis"><em>your package is most likely incorrect</em></span>.</p>
9869: <p>The following table lists the common situations that result in
9870: using shared directories or files. For each of them, the appropriate
9871: solution is given. After applying the solution be sure to
9872: <span class="emphasis"><em>regenerate the package's file list</em></span> with
1.10 hubertf 9873: <span class="command"><strong>make print-PLIST</strong></span> and ensure it is correct.</p>
1.1 dsieger 9874: <div class="table">
1.154 rillig 9875: <a name="plist-handling"></a><p class="title"><b>Table 25.1. PLIST handling for GNOME packages</b></p>
1.106 tnn 9876: <div class="table-contents"><table class="table" summary="PLIST handling for GNOME packages" border="1">
1.1 dsieger 9877: <colgroup>
9878: <col>
9879: <col>
9880: </colgroup>
9881: <thead><tr>
9882: <th>If the package...</th>
9883: <th>Then...</th>
9884: </tr></thead>
9885: <tbody>
9886: <tr>
9887: <td>Installs OMF files under <code class="filename">share/omf</code>.</td>
1.154 rillig 9888: <td>See <a class="xref" href="#scrollkeeper-data-files" title="21.6.10. Packages installing scrollkeeper/rarian data files">Section 21.6.10, “Packages installing scrollkeeper/rarian data files”</a>.</td>
1.1 dsieger 9889: </tr>
9890: <tr>
9891: <td>Installs icons under the
9892: <code class="filename">share/icons/hicolor</code> hierarchy or updates
9893: <code class="filename">share/icons/hicolor/icon-theme.cache</code>.</td>
1.154 rillig 9894: <td>See <a class="xref" href="#hicolor-theme" title="21.6.19. Packages installing hicolor theme icons">Section 21.6.19, “Packages installing hicolor theme icons”</a>.</td>
1.1 dsieger 9895: </tr>
9896: <tr>
9897: <td>Installs files under
9898: <code class="filename">share/mime/packages</code>.</td>
1.154 rillig 9899: <td>See <a class="xref" href="#mime-database" title="21.6.14. Packages installing extensions to the MIME database">Section 21.6.14, “Packages installing extensions to the MIME database”</a>.</td>
1.1 dsieger 9900: </tr>
9901: <tr>
9902: <td>Installs <code class="filename">.desktop</code> files under
9903: <code class="filename">share/applications</code> and these include MIME
9904: information.</td>
1.154 rillig 9905: <td>See <a class="xref" href="#desktop-files" title="21.6.20. Packages installing desktop files">Section 21.6.20, “Packages installing desktop files”</a>.</td>
1.1 dsieger 9906: </tr>
9907: </tbody>
9908: </table></div>
9909: </div>
9910: <br class="table-break">
9911: </div>
1.41 asau 9912: <div class="sect1">
1.1 dsieger 9913: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9914: <a name="full-update"></a>25.3. Updating GNOME to a newer version</h2></div></div></div>
1.1 dsieger 9915: <p>When seeing GNOME as a whole, there are two kinds of
9916: updates:</p>
1.41 asau 9917: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 9918: <dt><span class="term">Major update</span></dt>
9919: <dd>
9920: <p>Given that there is still a very long way for GNOME 3 (if it
9921: ever appears), we consider a major update one that goes from a
9922: <code class="literal">2.X</code> version to a <code class="literal">2.Y</code> one,
9923: where <code class="literal">Y</code> is even and greater than
9924: <code class="literal">X</code>. These are hard to achieve because they
9925: introduce lots of changes in the components' code and almost all
9926: GNOME distfiles are updated to newer versions. Some of them can
9927: even break API and ABI compatibility with the previous major
9928: version series. As a result, the update needs to be done all at
9929: once to minimize breakage.</p>
9930: <p>A major update typically consists of around 80 package
9931: updates and the addition of some new ones.</p>
9932: </dd>
9933: <dt><span class="term">Minor update</span></dt>
9934: <dd>
9935: <p>We consider a minor update one that goes from a
9936: <code class="literal">2.A.X</code> version to a <code class="literal">2.A.Y</code>
9937: one where <code class="literal">Y</code> is greater than
9938: <code class="literal">X</code>. These are easy to achieve because they do
9939: not update all GNOME components, can be done in an incremental way
9940: and do not break API nor ABI compatibility.</p>
9941: <p>A minor update typically consists of around 50 package
9942: updates, although the numbers here may vary a lot.</p>
9943: </dd>
9944: </dl></div>
9945: <p>In order to update the GNOME components in pkgsrc to a new stable
9946: release (either major or minor), the following steps should be
9947: followed:</p>
1.23 wiz 9948: <div class="orderedlist"><ol class="orderedlist" type="1">
9949: <li class="listitem">
1.1 dsieger 9950: <p>Get a list of all the tarballs that form the new release by
9951: using the following commands. These will leave the full list of the
1.18 snj 9952: components' distfiles into the <code class="filename">list.txt</code>
1.1 dsieger 9953: file:</p>
9954: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>echo ls "*.tar.bz2" | \
9955: ftp -V ftp://ftp.gnome.org/pub/gnome/platform/x.y/x.y.z/sources/ | \
9956: awk '{ print $9 }' >list.txt</code></strong>
9957: <code class="prompt">%</code> <strong class="userinput"><code>echo ls "*.tar.bz2" | \
9958: ftp -V ftp://ftp.gnome.org/pub/gnome/desktop/x.y/x.y.z/sources/ | \
9959: awk '{ print $9 }' >>list.txt</code></strong></pre>
9960: </li>
1.23 wiz 9961: <li class="listitem"><p>Open each meta package's <code class="filename">Makefile</code> and
1.1 dsieger 9962: bump their version to the release you are updating them to. The
9963: three meta packages should be always consistent with versioning.
9964: Obviously remove any <code class="varname">PKGREVISION</code>s that might be
9965: in them.</p></li>
1.23 wiz 9966: <li class="listitem">
1.1 dsieger 9967: <p>For each meta package, update all its
9968: <code class="varname">DEPENDS</code> lines to match the latest versions as
9969: shown by the above commands. Do <span class="emphasis"><em>not</em></span> list any
9970: newer version (even if found in the FTP) because the meta packages
9971: are supposed to list the exact versions that form a specific GNOME
9972: release. Exceptions are permitted here if a newer version solves a
9973: serious issue in the overall desktop experience; these typically
9974: come in the form of a revision bump in pkgsrc, not in newer versions
9975: from the developers.</p>
9976: <p>Packages not listed in the <code class="filename">list.txt</code> file
9977: should be updated to the latest version available (if found in
9978: pkgsrc). This is the case, for example, of the dependencies on the
1.137 leot 9979: GNU Autotools in the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome-devel/README.html" target="_top"><code class="filename">meta-pkgs/gnome-devel</code></a> meta package.</p>
1.1 dsieger 9980: </li>
1.23 wiz 9981: <li class="listitem">
1.1 dsieger 9982: <p>Generate a patch from the modified meta packages and extract the
9983: list of "new" lines. This will provide you an outline on what
9984: packages need to be updated in pkgsrc and in what order:</p>
9985: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cvs diff -u gnome-devel gnome-base gnome | grep '^+D' >todo.txt</code></strong></pre>
9986: </li>
1.23 wiz 9987: <li class="listitem"><p>For major desktop updates it is recommended to zap all your
1.1 dsieger 9988: installed packages and start over from scratch at this point.</p></li>
1.23 wiz 9989: <li class="listitem"><p>Now comes the longest step by far: iterate over the contents
1.1 dsieger 9990: of <code class="filename">todo.txt</code> and update the packages listed in
9991: it in order. For major desktop updates none of these should be
9992: committed until the entire set is completed because there are chances
9993: of breaking not-yet-updated packages.</p></li>
1.23 wiz 9994: <li class="listitem"><p>Once the packages are up to date and working, commit them to
1.1 dsieger 9995: the tree one by one with appropriate log messages. At the end,
9996: commit the three meta package updates and all the corresponding
9997: changes to the <code class="filename">doc/CHANGES-<YEAR></code> and
9998: <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/pkgsrc/doc/TODO?rev=HEAD&content-type=text/x-cvsweb-markup" target="_top"><code class="filename">pkgsrc/doc/TODO</code></a> files.</p></li>
9999: </ol></div>
10000: </div>
1.41 asau 10001: <div class="sect1">
1.1 dsieger 10002: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10003: <a name="patching"></a>25.4. Patching guidelines</h2></div></div></div>
1.1 dsieger 10004: <p>GNOME is a very big component in pkgsrc which approaches 100
10005: packages. Please, it is very important that you always, always,
10006: <span class="strong"><strong>always</strong></span> feed back any portability
1.154 rillig 10007: fixes you do to a GNOME package to the mainstream developers (see <a class="xref" href="#components.patches.feedback" title="13.3.5. Feedback to the author">Section 13.3.5, “Feedback to the author”</a>). This is the only way to get
1.1 dsieger 10008: their attention on portability issues and to ensure that future versions
10009: can be built out-of-the box on NetBSD. The less custom patches in
10010: pkgsrc, the easier further updates are. Those developers in charge of
10011: issuing major GNOME updates will be grateful if you do that.</p>
1.174 leot 10012: <p>The most common places to report bugs are the <a class="ulink" href="https://bugzilla.gnome.org/" target="_top">GNOME's Bugzilla</a> and the <a class="ulink" href="https://bugzilla.freedesktop.org/" target="_top">freedesktop.org's
1.1 dsieger 10013: Bugzilla</a>. Not all components use these to track bugs, but most
10014: of them do. Do not be short on your reports: always provide detailed
10015: explanations of the current failure, how it can be improved to achieve
10016: maximum portability and, if at all possible, provide a patch against CVS
10017: head. The more verbose you are, the higher chances of your patch being
10018: accepted.</p>
10019: <p>Also, please avoid using preprocessor magic to fix portability
10020: issues. While the FreeBSD GNOME people are doing a great job in porting
10021: GNOME to their operating system, the official GNOME sources are now
10022: plagued by conditionals that check for <code class="varname">__FreeBSD__</code>
10023: and similar macros. This hurts portability. Please see our patching
1.154 rillig 10024: guidelines (<a class="xref" href="#components.patches.guidelines" title="13.3.4. Patching guidelines">Section 13.3.4, “Patching guidelines”</a>) for more
1.1 dsieger 10025: details.</p>
10026: </div>
10027: </div>
10028: </div>
1.41 asau 10029: <div class="part">
1.1 dsieger 10030: <div class="titlepage"><div><div><h1 class="title">
10031: <a name="infrastructure"></a>Part III. The pkgsrc infrastructure internals</h1></div></div></div>
1.41 asau 10032: <div class="partintro">
1.1 dsieger 10033: <div></div>
10034: <p>This part of the guide deals with everything
10035: from the infrastructure that is behind the interfaces described
10036: in the developer's guide. A casual package maintainer should not
10037: need anything from this part.</p>
10038: <div class="toc">
10039: <p><b>Table of Contents</b></p>
1.100 leot 10040: <dl class="toc">
1.154 rillig 10041: <dt><span class="chapter"><a href="#infr.design">26. Design of the pkgsrc infrastructure</a></span></dt>
1.1 dsieger 10042: <dd><dl>
1.154 rillig 10043: <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt>
10044: <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt>
10045: <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt>
1.1 dsieger 10046: <dd><dl>
1.154 rillig 10047: <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt>
10048: <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt>
1.1 dsieger 10049: </dl></dd>
1.154 rillig 10050: <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt>
10051: <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt>
1.1 dsieger 10052: <dd><dl>
1.154 rillig 10053: <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt>
10054: <dt><span class="sect2"><a href="#infr.design.intf.action">26.5.2. Actions taken on behalf of parameters</a></span></dt>
1.1 dsieger 10055: </dl></dd>
1.154 rillig 10056: <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt>
1.1 dsieger 10057: <dd><dl>
1.154 rillig 10058: <dt><span class="sect2"><a href="#infr.order.prefs">26.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt>
10059: <dt><span class="sect2"><a href="#infr.order.pkg">26.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt>
1.1 dsieger 10060: </dl></dd>
10061: </dl></dd>
1.154 rillig 10062: <dt><span class="chapter"><a href="#regression">27. Regression tests</a></span></dt>
1.1 dsieger 10063: <dd><dl>
1.154 rillig 10064: <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt>
10065: <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt>
1.1 dsieger 10066: <dd><dl>
1.154 rillig 10067: <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt>
10068: <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt>
1.1 dsieger 10069: </dl></dd>
10070: </dl></dd>
1.154 rillig 10071: <dt><span class="chapter"><a href="#porting">28. Porting pkgsrc</a></span></dt>
10072: <dd><dl><dt><span class="sect1"><a href="#porting.opsys">28.1. Porting pkgsrc to a new operating system</a></span></dt></dl></dd>
1.1 dsieger 10073: </dl>
10074: </div>
10075: </div>
1.41 asau 10076: <div class="chapter">
1.1 dsieger 10077: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 10078: <a name="infr.design"></a>Chapter 26. Design of the pkgsrc infrastructure</h2></div></div></div>
1.1 dsieger 10079: <div class="toc">
10080: <p><b>Table of Contents</b></p>
1.100 leot 10081: <dl class="toc">
1.154 rillig 10082: <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt>
10083: <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt>
10084: <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt>
1.1 dsieger 10085: <dd><dl>
1.154 rillig 10086: <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt>
10087: <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt>
1.1 dsieger 10088: </dl></dd>
1.154 rillig 10089: <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt>
10090: <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt>
1.1 dsieger 10091: <dd><dl>
1.154 rillig 10092: <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt>
10093: <dt><span class="sect2"><a href="#infr.design.intf.action">26.5.2. Actions taken on behalf of parameters</a></span></dt>
1.1 dsieger 10094: </dl></dd>
1.154 rillig 10095: <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt>
1.1 dsieger 10096: <dd><dl>
1.154 rillig 10097: <dt><span class="sect2"><a href="#infr.order.prefs">26.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt>
10098: <dt><span class="sect2"><a href="#infr.order.pkg">26.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt>
1.1 dsieger 10099: </dl></dd>
10100: </dl>
10101: </div>
10102: <p>The pkgsrc infrastructure consists of many small Makefile
10103: fragments. Each such fragment needs a properly specified
10104: interface. This chapter explains how such an interface looks
10105: like.</p>
1.41 asau 10106: <div class="sect1">
1.1 dsieger 10107: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10108: <a name="infr.vardef"></a>26.1. The meaning of variable definitions</h2></div></div></div>
1.1 dsieger 10109: <p>Whenever a variable is defined in the pkgsrc
10110: infrastructure, the location and the way of definition provide
10111: much information about the intended use of that variable.
10112: Additionally, more documentation may be found in a header
10113: comment or in this pkgsrc guide.</p>
10114: <p>A special file is
10115: <code class="filename">mk/defaults/mk.conf</code>, which lists all
10116: variables that are intended to be user-defined. They are either
10117: defined using the <code class="literal">?=</code> operator or they are
10118: left undefined because defining them to anything would
1.23 wiz 10119: effectively mean <span class="quote">“<span class="quote">yes</span>”</span>. All these variables may be
1.1 dsieger 10120: overridden by the pkgsrc user in the <code class="varname">MAKECONF</code>
10121: file.</p>
10122: <p>Outside this file, the following conventions apply:
10123: Variables that are defined using the <code class="literal">?=</code>
10124: operator may be overridden by a package.</p>
10125: <p>Variables that are defined using the <code class="literal">=</code>
10126: operator may be used read-only at run-time.</p>
10127: <p>Variables whose name starts with an underscore must not be
10128: accessed outside the pkgsrc infrastructure at all. They may
10129: change without further notice.</p>
1.41 asau 10130: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 10131: <h3 class="title">Note</h3>
10132: <p>These conventions are currently not applied
10133: consistently to the complete pkgsrc
10134: infrastructure.</p>
10135: </div>
10136: </div>
1.41 asau 10137: <div class="sect1">
1.1 dsieger 10138: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10139: <a name="infr.vardef.problems"></a>26.2. Avoiding problems before they arise</h2></div></div></div>
1.1 dsieger 10140: <p>All variables that contain lists of things should default
10141: to being empty. Two examples that do not follow this rule are
10142: <code class="varname">USE_LANGUAGES</code> and
10143: <code class="varname">DISTFILES</code>. These variables cannot simply be
10144: modified using the <code class="literal">+=</code> operator in package
10145: <code class="filename">Makefile</code>s (or other files included by
10146: them), since there is no guarantee whether the variable is
10147: already set or not, and what its value is. In the case of
1.23 wiz 10148: <code class="varname">DISTFILES</code>, the packages <span class="quote">“<span class="quote">know</span>”</span>
1.1 dsieger 10149: the default value and just define it as in the following
10150: example.</p>
10151: <pre class="programlisting">
10152: DISTFILES= ${DISTNAME}${EXTRACT_SUFX} additional-files.tar.gz
10153: </pre>
10154: <p>Because of the selection of this default value, the same
10155: value appears in many package Makefiles. Similarly for
10156: <code class="varname">USE_LANGUAGES</code>, but in this case the default
1.23 wiz 10157: value (<span class="quote">“<span class="quote"><code class="literal">c</code></span>”</span>) is so short that it
1.1 dsieger 10158: doesn't stand out. Nevertheless it is mentioned in many
10159: files.</p>
10160: </div>
1.41 asau 10161: <div class="sect1">
1.1 dsieger 10162: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10163: <a name="infr.var"></a>26.3. Variable evaluation</h2></div></div></div>
1.41 asau 10164: <div class="sect2">
1.1 dsieger 10165: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10166: <a name="infr.var.load"></a>26.3.1. At load time</h3></div></div></div>
1.1 dsieger 10167: <p>Variable evaluation takes place either at load time or at
10168: runtime, depending on the context in which they occur. The
10169: contexts where variables are evaluated at load time are:</p>
1.41 asau 10170: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 10171: <li class="listitem"><p>The right hand side of the <code class="literal">:=</code>
1.1 dsieger 10172: and <code class="literal">!=</code> operators,</p></li>
1.23 wiz 10173: <li class="listitem"><p>Make directives like <code class="literal">.if</code> or
1.1 dsieger 10174: <code class="literal">.for</code>,</p></li>
1.23 wiz 10175: <li class="listitem"><p>Dependency lines.</p></li>
1.1 dsieger 10176: </ul></div>
10177: <p>A special exception are references to the iteration
10178: variables of <code class="literal">.for</code> loops, which are expanded
10179: inline, no matter in which context they appear.</p>
10180: <p>As the values of variables may change during load time,
10181: care must be taken not to evaluate them by accident. Typical
10182: examples for variables that should not be evaluated at load time
10183: are <code class="varname">DEPENDS</code> and
10184: <code class="varname">CONFIGURE_ARGS</code>. To make the effect more
10185: clear, here is an example:</p>
10186: <pre class="programlisting">
10187: CONFIGURE_ARGS= # none
10188: CFLAGS= -O
10189: CONFIGURE_ARGS+= CFLAGS=${CFLAGS:Q}
10190:
10191: CONFIGURE_ARGS:= ${CONFIGURE_ARGS}
10192:
10193: CFLAGS+= -Wall
1.111 sevan 10194: </pre>
1.1 dsieger 10195: <p>This code shows how the use of the <code class="literal">:=</code>
10196: operator can quickly lead to unexpected results. The first
10197: paragraph is fairly common code. The second paragraph evaluates
10198: the <code class="varname">CONFIGURE_ARGS</code> variable, which results in
10199: <code class="literal">CFLAGS=-O</code>. In the third paragraph, the
10200: <code class="literal">-Wall</code> is appended to the
10201: <code class="varname">CFLAGS</code>, but this addition will not appear in
10202: <code class="varname">CONFIGURE_ARGS</code>. In actual code, the three
10203: paragraphs from above typically occur in completely unrelated
10204: files.</p>
10205: </div>
1.41 asau 10206: <div class="sect2">
1.1 dsieger 10207: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10208: <a name="infr.var.run"></a>26.3.2. At runtime</h3></div></div></div>
1.1 dsieger 10209: <p>After all the files have been loaded, the values of the
10210: variables cannot be changed anymore. Variables that are used in
10211: the shell commands are expanded at this point.</p>
10212: </div>
10213: </div>
1.41 asau 10214: <div class="sect1">
1.1 dsieger 10215: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10216: <a name="infr.varspec"></a>26.4. How can variables be specified?</h2></div></div></div>
1.1 dsieger 10217: <p>There are many ways in which the definition and use of a
1.108 rillig 10218: variable can be restricted in order to detect bugs and violations
10219: of the (mostly unwritten) policies. A package can be checked with
10220: <code class="literal">pkglint -Wall</code> to see whether it meets these
10221: rules.</p>
1.1 dsieger 10222: </div>
1.41 asau 10223: <div class="sect1">
1.1 dsieger 10224: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10225: <a name="infr.design.intf"></a>26.5. Designing interfaces for Makefile fragments</h2></div></div></div>
1.1 dsieger 10226: <p>Most of the <code class="filename">.mk</code> files fall into one
10227: of the following classes. Cases where a file falls into more
10228: than one class should be avoided as it often leads to subtle
10229: bugs.</p>
1.41 asau 10230: <div class="sect2">
1.1 dsieger 10231: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10232: <a name="infr.design.intf.proc"></a>26.5.1. Procedures with parameters</h3></div></div></div>
1.1 dsieger 10233: <p>In a traditional imperative programming language some of
10234: the <code class="filename">.mk</code> files could be described as
1.14 jmcneill 10235: procedures. They take some input parameters and—after
10236: inclusion—provide a result in output parameters. Since all
1.1 dsieger 10237: variables in <code class="filename">Makefile</code>s have global scope
10238: care must be taken not to use parameter names that have already
10239: another meaning. For example, <code class="varname">PKGNAME</code> is a
10240: bad choice for a parameter name.</p>
10241: <p>Procedures are completely evaluated at preprocessing time.
10242: That is, when calling a procedure all input parameters must be
10243: completely resolvable. For example,
10244: <code class="varname">CONFIGURE_ARGS</code> should never be an input
10245: parameter since it is very likely that further text will be
10246: added after calling the procedure, which would effectively apply
10247: the procedure to only a part of the variable. Also, references
1.108 rillig 10248: to other variables will be modified after calling the
1.1 dsieger 10249: procedure.</p>
10250: <p>A procedure can declare its output parameters either as
10251: suitable for use in preprocessing directives or as only
10252: available at runtime. The latter alternative is for variables
10253: that contain references to other runtime variables.</p>
10254: <p>Procedures shall be written such that it is possible to
10255: call the procedure more than once. That is, the file must not
10256: contain multiple-inclusion guards.</p>
10257: <p>Examples for procedures are
10258: <code class="filename">mk/bsd.options.mk</code> and
10259: <code class="filename">mk/buildlink3/bsd.builtin.mk</code>. To express
10260: that the parameters are evaluated at load time, they should be
10261: assigned using the <code class="literal">:=</code> operator, which should
10262: be used only for this purpose.</p>
10263: </div>
1.41 asau 10264: <div class="sect2">
1.1 dsieger 10265: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10266: <a name="infr.design.intf.action"></a>26.5.2. Actions taken on behalf of parameters</h3></div></div></div>
1.1 dsieger 10267: <p>Action files take some input parameters and may define
10268: runtime variables. They shall not define loadtime variables.
10269: There are action files that are included implicitly by the
10270: pkgsrc infrastructure, while other must be included
10271: explicitly.</p>
10272: <p>An example for action files is
10273: <code class="filename">mk/subst.mk</code>.</p>
10274: </div>
10275: </div>
1.41 asau 10276: <div class="sect1">
1.1 dsieger 10277: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10278: <a name="infr.order"></a>26.6. The order in which files are loaded</h2></div></div></div>
1.1 dsieger 10279: <p>Package <code class="filename">Makefile</code>s usually consist of
10280: a set of variable definitions, and include the file
10281: <code class="filename">../../mk/bsd.pkg.mk</code> in the very last line.
10282: Before that, they may also include various other
10283: <code class="filename">*.mk</code> files if they need to query the
10284: availability of certain features like the type of compiler or
10285: the X11 implementation. Due to the heavy use of preprocessor
10286: directives like <code class="literal">.if</code> and
10287: <code class="literal">.for</code>, the order in which the files are loaded
10288: matters.</p>
10289: <p>This section describes at which point the various files
10290: are loaded and gives reasons for that order.</p>
1.41 asau 10291: <div class="sect2">
1.1 dsieger 10292: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10293: <a name="infr.order.prefs"></a>26.6.1. The order in <code class="filename">bsd.prefs.mk</code>
1.1 dsieger 10294: </h3></div></div></div>
10295: <p>The very first action in <code class="filename">bsd.prefs.mk</code>
10296: is to define some essential variables like
10297: <code class="varname">OPSYS</code>, <code class="varname">OS_VERSION</code> and
10298: <code class="varname">MACHINE_ARCH</code>.</p>
10299: <p>Then, the user settings are loaded from the file specified
1.10 hubertf 10300: in <code class="varname">MAKECONF</code>, which is usually <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.
1.4 rillig 10301: After that, those variables
1.1 dsieger 10302: that have not been overridden by the user are loaded from
10303: <code class="filename">mk/defaults/mk.conf</code>.</p>
10304: <p>After the user settings, the system settings and platform
10305: settings are loaded, which may override the user
10306: settings.</p>
10307: <p>Then, the tool definitions are loaded. The tool wrappers
10308: are not yet in effect. This only happens when building a
10309: package, so the proper variables must be used instead of the
10310: direct tool names.</p>
10311: <p>As the last steps, some essential variables from the
10312: wrapper and the package system flavor are loaded, as well as the
10313: variables that have been cached in earlier phases of a package
10314: build.</p>
10315: </div>
1.41 asau 10316: <div class="sect2">
1.1 dsieger 10317: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10318: <a name="infr.order.pkg"></a>26.6.2. The order in <code class="filename">bsd.pkg.mk</code>
1.1 dsieger 10319: </h3></div></div></div>
10320: <p>First, <code class="filename">bsd.prefs.mk</code> is loaded.</p>
10321: <p>Then, the various <code class="filename">*-vars.mk</code> files are
10322: loaded, which fill default values for those variables that have
10323: not been defined by the package. These variables may later
10324: be used even in unrelated files.</p>
10325: <p>Then, the file <code class="filename">bsd.pkg.error.mk</code>
10326: provides the target <code class="literal">error-check</code> that is added
10327: as a special dependency to all other targets that use
10328: <code class="varname">DELAYED_ERROR_MSG</code> or
10329: <code class="varname">DELAYED_WARNING_MSG</code>.</p>
10330: <p>Then, the package-specific hacks from
10331: <code class="filename">hacks.mk</code> are included.</p>
10332: <p>Then, various other files follow. Most of them don't have
10333: any dependencies on what they need to have included before or
10334: after them, though some do.</p>
10335: <p>The code to check <code class="varname">PKG_FAIL_REASON</code> and
10336: <code class="varname">PKG_SKIP_REASON</code> is then executed, which
10337: restricts the use of these variables to all the files that have
10338: been included before. Appearances in later files will be
10339: silently ignored.</p>
10340: <p>Then, the files for the main targets are included, in the
10341: order of later execution, though the actual order should not
10342: matter.</p>
10343: <p>At last, some more files are included that don't set any
10344: interesting variables but rather just define make targets to be
10345: executed.</p>
10346: </div>
10347: </div>
10348: </div>
1.41 asau 10349: <div class="chapter">
1.1 dsieger 10350: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 10351: <a name="regression"></a>Chapter 27. Regression tests</h2></div></div></div>
1.1 dsieger 10352: <div class="toc">
10353: <p><b>Table of Contents</b></p>
1.100 leot 10354: <dl class="toc">
1.154 rillig 10355: <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt>
10356: <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt>
1.1 dsieger 10357: <dd><dl>
1.154 rillig 10358: <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt>
10359: <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt>
1.1 dsieger 10360: </dl></dd>
10361: </dl>
10362: </div>
10363: <p>The pkgsrc infrastructure consists of a large codebase,
10364: and there are many corners where every little bit of a file is
10365: well thought out, making pkgsrc likely to fail as soon as
10366: anything is changed near those parts. To prevent most changes
10367: from breaking anything, a suite of regression tests should go
10368: along with every important part of the pkgsrc infrastructure.
10369: This chapter describes how regression tests work in pkgsrc and
10370: how you can add new tests.</p>
1.41 asau 10371: <div class="sect1">
1.1 dsieger 10372: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10373: <a name="regression.run"></a>27.1. Running the regression tests</h2></div></div></div>
1.137 leot 10374: <p>You first need to install the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_regress/README.html" target="_top"><code class="filename">pkgtools/pkg_regress</code></a> package, which
1.10 hubertf 10375: provides the <span class="command"><strong>pkg_regress</strong></span> command. Then you
1.1 dsieger 10376: can simply run that command, which will run all tests in the
1.168 rillig 10377: <code class="filename">regress/</code> directory.</p>
1.1 dsieger 10378: </div>
1.41 asau 10379: <div class="sect1">
1.1 dsieger 10380: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10381: <a name="regression.new"></a>27.2. Adding a new regression test</h2></div></div></div>
1.168 rillig 10382: <p>Every directory in the <code class="filename">regress/</code>
10383: directory that contains a file called <code class="filename">spec</code>
1.1 dsieger 10384: is considered a regression test. This file is a shell program
1.10 hubertf 10385: that is included by the <span class="command"><strong>pkg_regress</strong></span> command.
1.1 dsieger 10386: The following functions can be overridden to suit your
10387: needs.</p>
1.41 asau 10388: <div class="sect2">
1.1 dsieger 10389: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10390: <a name="regression.fun.override"></a>27.2.1. Overridable functions</h3></div></div></div>
1.108 rillig 10391: <p>These functions do not take any parameters. Although they
10392: are called in <span class="quote">“<span class="quote">set -e</span>”</span> mode, they don't stop at the
1.174 leot 10393: first failing command. See <a class="ulink" href="https://stackoverflow.com/q/4072984" target="_top">this Stack Overflow
1.108 rillig 10394: question</a> for details.</p>
1.41 asau 10395: <div class="variablelist"><dl class="variablelist">
1.108 rillig 10396: <dt><span class="term"><code class="varname">do_setup</code></span></dt>
1.1 dsieger 10397: <dd><p>This function prepares the environment for the
10398: test. By default it does nothing.</p></dd>
1.108 rillig 10399: <dt><span class="term"><code class="varname">do_test</code></span></dt>
10400: <dd>
10401: <p>This function runs the actual test. By default,
1.1 dsieger 10402: it calls <code class="varname">TEST_MAKE</code> with the arguments
10403: <code class="varname">MAKEARGS_TEST</code> and writes its output including
10404: error messages into the file
1.108 rillig 10405: <code class="varname">TEST_OUTFILE</code>.</p>
10406: <p>When defining this function, make sure that all output that
10407: needs to be checked is written to the correct output file.
10408: Example:</p>
10409: <pre class="programlisting">
10410: do_test() {
1.112 rillig 10411: echo "Example output"
1.108 rillig 10412: } 1>$TEST_OUTFILE 2>&1
10413: </pre>
10414: </dd>
10415: <dt><span class="term"><code class="varname">check_result</code></span></dt>
10416: <dd>
10417: <p>This function is run after the test and is
1.1 dsieger 10418: typically used to compare the actual output from the one that is
10419: expected. It can make use of the various helper functions from
1.108 rillig 10420: the next section. Example:</p>
10421: <pre class="programlisting">
10422: check_result() {
1.112 rillig 10423: exit_status 0
10424: output_require "Example"
10425: output_require "^[[:alpha:]+[[:space:]][[:alpha:]]{6}$"
10426: output_prohibit "no such file or directory"
1.168 rillig 10427: regress_fail "expected $expected but got $actual for input $input"
1.108 rillig 10428: }
10429: </pre>
10430: </dd>
10431: <dt><span class="term"><code class="varname">do_cleanup</code></span></dt>
1.1 dsieger 10432: <dd><p>This function cleans everything up after the
10433: test has been run. By default it does nothing.</p></dd>
10434: </dl></div>
10435: </div>
1.41 asau 10436: <div class="sect2">
1.1 dsieger 10437: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10438: <a name="regression.fun.helper"></a>27.2.2. Helper functions</h3></div></div></div>
1.41 asau 10439: <div class="variablelist"><dl class="variablelist">
1.168 rillig 10440: <dt><span class="term"><code class="varname">regress_fail <em class="replaceable"><code>message...</code></em></code></span></dt>
10441: <dd><p>This function makes the test fail with the given error message.</p></dd>
1.108 rillig 10442: <dt><span class="term"><code class="varname">exit_status expected</code></span></dt>
1.1 dsieger 10443: <dd><p>This function compares the exitcode of the
1.108 rillig 10444: <span class="command"><strong>do_test</strong></span> function with its first parameter.
1.1 dsieger 10445: If they differ, the test will fail.</p></dd>
1.108 rillig 10446: <dt><span class="term"><code class="varname">output_require regex...</code></span></dt>
10447: <dd>
10448: <p>This function checks for each of its parameters
10449: if the output from <span class="command"><strong>do_test</strong></span> matches the
1.1 dsieger 10450: extended regular expression. If it does not, the test will
1.108 rillig 10451: fail. Example:</p>
10452: <pre class="programlisting">
10453: output_require "looks fine"
10454: output_require "^[[:alpha:]+[[:space:]][[:alpha:]]{6}$"
10455: </pre>
10456: </dd>
1.177 leot 10457: <dt><span class="term"><code class="varname">output_prohibit regex...</code></span></dt>
1.1 dsieger 10458: <dd><p>This function checks for each of its parameters
1.10 hubertf 10459: if the output from <span class="command"><strong>do_test()</strong></span> does
1.1 dsieger 10460: <span class="emphasis"><em>not</em></span> match the extended regular expression.
10461: If any of the regular expressions matches, the test will
10462: fail.</p></dd>
10463: </dl></div>
10464: </div>
10465: </div>
10466: </div>
1.41 asau 10467: <div class="chapter">
1.1 dsieger 10468: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 10469: <a name="porting"></a>Chapter 28. Porting pkgsrc</h2></div></div></div>
1.1 dsieger 10470: <div class="toc">
10471: <p><b>Table of Contents</b></p>
1.154 rillig 10472: <dl class="toc"><dt><span class="sect1"><a href="#porting.opsys">28.1. Porting pkgsrc to a new operating system</a></span></dt></dl>
1.1 dsieger 10473: </div>
10474: <p>The pkgsrc system has already been ported to many
10475: operating systems, hardware architectures and compilers. This
10476: chapter explains the necessary steps to make pkgsrc even more
10477: portable.</p>
1.41 asau 10478: <div class="sect1">
1.1 dsieger 10479: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10480: <a name="porting.opsys"></a>28.1. Porting pkgsrc to a new operating system</h2></div></div></div>
1.1 dsieger 10481: <p>To port pkgsrc to a new operating system (called
10482: <code class="literal">MyOS</code> in this example), you need to touch the
10483: following files:</p>
1.41 asau 10484: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 10485: <dt><span class="term"><code class="filename">pkgtools/bootstrap-mk-files/files/mods/<em class="replaceable"><code>MyOS</code></em>.sys.mk</code></span></dt>
10486: <dd><p>This file contains some basic definitions, for
10487: example the name of the C
10488: compiler.</p></dd>
10489: <dt><span class="term"><code class="filename">mk/bsd.prefs.mk</code></span></dt>
10490: <dd><p>Insert code that defines the variables
10491: <code class="varname">OPSYS</code>, <code class="varname">OS_VERSION</code>,
10492: <code class="varname">LOWER_OS_VERSION</code>,
10493: <code class="varname">LOWER_VENDOR</code>,
10494: <code class="varname">MACHINE_ARCH</code>, <code class="varname">OBJECT_FMT</code>,
10495: <code class="varname">APPEND_ELF</code>, and the other variables that
10496: appear in this file.</p></dd>
10497: <dt><span class="term"><code class="filename">mk/platform/<em class="replaceable"><code>MyOS</code></em>.mk</code></span></dt>
10498: <dd><p>This file contains the platform-specific
10499: definitions that are used by pkgsrc. Start by copying one of the
10500: other files and edit it to your
10501: needs.</p></dd>
10502: <dt><span class="term"><code class="filename">mk/tools/tools.<em class="replaceable"><code>MyOS</code></em>.mk</code></span></dt>
10503: <dd><p>This file defines the paths to all the tools
10504: that are needed by one or the other package in pkgsrc, as well
10505: as by pkgsrc itself. Find out where these tools are on your
10506: platform and add them.</p></dd>
10507: </dl></div>
10508: <p>Now, you should be able to build some basic packages, like
1.137 leot 10509: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/lang/perl5/README.html" target="_top"><code class="filename">lang/perl5</code></a>, <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/bash/README.html" target="_top"><code class="filename">shells/bash</code></a>.</p>
1.1 dsieger 10510: </div>
10511: </div>
10512: </div>
1.41 asau 10513: <div class="appendix">
10514: <div class="titlepage"><div><div><h1 class="title">
10515: <a name="examples"></a>Appendix A. A simple example package: bison</h1></div></div></div>
1.1 dsieger 10516: <div class="toc">
10517: <p><b>Table of Contents</b></p>
1.100 leot 10518: <dl class="toc">
1.1 dsieger 10519: <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt>
10520: <dd><dl>
10521: <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt>
10522: <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt>
10523: <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt>
1.172 rillig 10524: <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with pkglint</a></span></dt>
1.1 dsieger 10525: </dl></dd>
10526: <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt>
10527: </dl>
10528: </div>
10529: <p>We checked to find a piece of software that wasn't in the packages
10530: collection, and picked GNU bison. Quite why someone would want to have
1.10 hubertf 10531: <span class="command"><strong>bison</strong></span> when Berkeley <span class="command"><strong>yacc</strong></span> is already
1.1 dsieger 10532: present in the tree is beyond us, but it's useful for the purposes of
10533: this exercise.</p>
1.41 asau 10534: <div class="sect1">
1.1 dsieger 10535: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10536: <a name="example-files"></a>A.1. files</h2></div></div></div>
1.41 asau 10537: <div class="sect2">
1.1 dsieger 10538: <div class="titlepage"><div><div><h3 class="title">
10539: <a name="example-Makefile"></a>A.1.1. Makefile</h3></div></div></div>
10540: <pre class="programlisting">
10541: # $NetBSD$
10542: #
10543:
10544: DISTNAME= bison-1.25
10545: CATEGORIES= devel
1.171 rillig 10546: MASTER_SITES= ${MASTER_SITE_GNU:=bison/}
1.1 dsieger 10547:
1.29 dholland 10548: MAINTAINER= pkgsrc-users@NetBSD.org
1.174 leot 10549: HOMEPAGE= https://www.gnu.org/software/bison/bison.html
1.1 dsieger 10550: COMMENT= GNU yacc clone
10551:
10552: GNU_CONFIGURE= yes
1.46 wiz 10553: INFO_FILES= yes
1.1 dsieger 10554:
10555: .include "../../mk/bsd.pkg.mk"
10556: </pre>
10557: </div>
1.41 asau 10558: <div class="sect2">
1.1 dsieger 10559: <div class="titlepage"><div><div><h3 class="title">
10560: <a name="example-descr"></a>A.1.2. DESCR</h3></div></div></div>
10561: <pre class="programlisting">
10562: GNU version of yacc. Can make re-entrant parsers, and numerous other
1.174 leot 10563: improvements. Why you would want this when Berkeley <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?yacc+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">yacc</span>(1)</span></a> is part
1.1 dsieger 10564: of the NetBSD source tree is beyond me.
10565: </pre>
10566: </div>
1.41 asau 10567: <div class="sect2">
1.1 dsieger 10568: <div class="titlepage"><div><div><h3 class="title">
10569: <a name="example-plist"></a>A.1.3. PLIST</h3></div></div></div>
10570: <pre class="programlisting">
10571: @comment $NetBSD$
10572: bin/bison
10573: man/man1/bison.1.gz
10574: share/bison.simple
10575: share/bison.hairy
10576: </pre>
10577: </div>
1.41 asau 10578: <div class="sect2">
1.1 dsieger 10579: <div class="titlepage"><div><div><h3 class="title">
1.172 rillig 10580: <a name="checking-package-with-pkglint"></a>A.1.4. Checking a package with pkglint</h3></div></div></div>
1.1 dsieger 10581: <p>The NetBSD package system comes with
1.137 leot 10582: <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>
1.1 dsieger 10583: which helps to check the contents of these
10584: files. After installation it is quite easy to use, just change to the
1.171 rillig 10585: directory of the package you wish to examine and run
1.10 hubertf 10586: <span class="command"><strong>pkglint</strong></span>:</p>
1.1 dsieger 10587: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pkglint</code></strong>
1.171 rillig 10588: ERROR: Makefile: Each package must define its LICENSE.
10589: WARN: Makefile:9: HOMEPAGE should migrate from http to https.
10590: NOTE: PLIST:3: The .gz extension is unnecessary for manual pages.
10591: WARN: PLIST:5: "share/bison.hairy" should be sorted before "share/bison.simple".
10592: 1 error, 2 warnings and 1 note found.
10593: (Run "pkglint -e" to show explanations.)
10594: (Run "pkglint -fs" to show what can be fixed automatically.)
1.172 rillig 10595: (Run "pkglint -F" to automatically fix some issues.)</pre>
1.1 dsieger 10596: <p>Depending on the supplied command line arguments (see pkglint(1)),
1.170 rillig 10597: more checks will be performed. Use e.g. <span class="command"><strong>pkglint
1.1 dsieger 10598: -Wall</strong></span> for a very thorough check.</p>
10599: </div>
10600: </div>
1.41 asau 10601: <div class="sect1">
1.1 dsieger 10602: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10603: <a name="steps-for-b-i-p"></a>A.2. Steps for building, installing, packaging</h2></div></div></div>
10604: <p>Create the directory where the package lives,
10605: plus any auxiliary directories:</p>
10606: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cd /usr/pkgsrc/lang</code></strong>
10607: <code class="prompt">#</code> <strong class="userinput"><code>mkdir bison</code></strong>
10608: <code class="prompt">#</code> <strong class="userinput"><code>cd bison</code></strong>
10609: <code class="prompt">#</code> <strong class="userinput"><code>mkdir patches</code></strong></pre>
10610: <p>Create <code class="filename">Makefile</code>, <code class="filename">DESCR</code> and
1.154 rillig 10611: <code class="filename">PLIST</code> (see <a class="xref" href="#components" title="Chapter 13. Package components - files, directories and contents">Chapter 13, <i>Package components - files, directories and contents</i></a>)
1.1 dsieger 10612: then continue with fetching the distfile:</p>
10613: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make fetch</code></strong>
10614: >> bison-1.25.tar.gz doesn't seem to exist on this system.
10615: >> Attempting to fetch from ftp://prep.ai.mit.edu/pub/gnu//.
10616: Requesting ftp://prep.ai.mit.edu/pub/gnu//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
10617: ftp: Error retrieving file: 500 Internal error
10618:
10619: >> Attempting to fetch from ftp://wuarchive.wustl.edu/systems/gnu//.
10620: Requesting ftp://wuarchive.wustl.edu/systems/gnu//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
10621: ftp: Error retrieving file: 500 Internal error
10622:
10623: >> Attempting to fetch from ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//.
10624: Requesting ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
10625: Successfully retrieved file.</pre>
10626: <p>Generate the checksum of the distfile into
10627: <code class="filename">distinfo</code>:</p>
10628: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make makedistinfo</code></strong></pre>
10629: <p>Now compile:</p>
10630: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make</code></strong>
10631: >> Checksum OK for bison-1.25.tar.gz.
10632: ===> Extracting for bison-1.25
10633: ===> Patching for bison-1.25
10634: ===> Ignoring empty patch directory
10635: ===> Configuring for bison-1.25
10636: creating cache ./config.cache
10637: checking for gcc... cc
10638: checking whether we are using GNU C... yes
10639: checking for a BSD compatible install... /usr/bin/install -c -o bin -g bin
10640: checking how to run the C preprocessor... cc -E
10641: checking for minix/config.h... no
10642: checking for POSIXized ISC... no
10643: checking whether cross-compiling... no
10644: checking for ANSI C header files... yes
10645: checking for string.h... yes
10646: checking for stdlib.h... yes
10647: checking for memory.h... yes
10648: checking for working const... yes
10649: checking for working alloca.h... no
10650: checking for alloca... yes
10651: checking for strerror... yes
10652: updating cache ./config.cache
10653: creating ./config.status
10654: creating Makefile
10655: ===> Building for bison-1.25
10656: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g LR0.c
10657: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g allocate.c
10658: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g closure.c
10659: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g conflicts.c
10660: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g derives.c
10661: cc -c -DXPFILE=\"/usr/pkg/share/bison.simple\" -DXPFILE1=\"/usr/pkg/share/bison.hairy\" -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -g ./files.c
10662: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g getargs.c
10663: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g gram.c
10664: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g lalr.c
10665: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g lex.c
10666: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g main.c
10667: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g nullable.c
10668: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g output.c
10669: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g print.c
10670: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g reader.c
10671: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g reduce.c
10672: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g symtab.c
10673: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g warshall.c
10674: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g version.c
10675: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g getopt.c
10676: cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g getopt1.c
10677: cc -g -o bison LR0.o allocate.o closure.o conflicts.o derives.o files.o getargs.o gram.o lalr.o lex.o main.o nullable.o output.o print.o reader.o reduce.o symtab.o warshall.o version.o getopt.o getopt1.o
10678: ./files.c:240: warning: mktemp() possibly used unsafely, consider using mkstemp()
10679: rm -f bison.s1
10680: sed -e "/^#line/ s|bison|/usr/pkg/share/bison|" < ./bison.simple > bison.s1</pre>
10681: <p>Everything seems OK, so install the files:</p>
10682: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
10683: >> Checksum OK for bison-1.25.tar.gz.
10684: ===> Installing for bison-1.25
10685: sh ./mkinstalldirs /usr/pkg/bin /usr/pkg/share /usr/pkg/info /usr/pkg/man/man1
10686: rm -f /usr/pkg/bin/bison
10687: cd /usr/pkg/share; rm -f bison.simple bison.hairy
10688: rm -f /usr/pkg/man/man1/bison.1 /usr/pkg/info/bison.info*
10689: install -c -o bin -g bin -m 555 bison /usr/pkg/bin/bison
10690: /usr/bin/install -c -o bin -g bin -m 644 bison.s1 /usr/pkg/share/bison.simple
10691: /usr/bin/install -c -o bin -g bin -m 644 ./bison.hairy /usr/pkg/share/bison.hairy
10692: cd .; for f in bison.info*; do /usr/bin/install -c -o bin -g bin -m 644 $f /usr/pkg/info/$f; done
10693: /usr/bin/install -c -o bin -g bin -m 644 ./bison.1 /usr/pkg/man/man1/bison.1
10694: ===> Registering installation for bison-1.25</pre>
10695: <p>You can now use bison, and also - if you decide so - remove it with
1.10 hubertf 10696: <span class="command"><strong>pkg_delete bison</strong></span>. Should you decide that you want a
1.1 dsieger 10697: binary package, do this now:</p>
10698: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make package</code></strong>
10699: >> Checksum OK for bison-1.25.tar.gz.
10700: ===> Building package for bison-1.25
10701: Creating package bison-1.25.tgz
10702: Registering depends:.
10703: Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz'</pre>
10704: <p>Now that you don't need the source and object files
10705: any more, clean up:</p>
10706: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make clean</code></strong>
10707: ===> Cleaning for bison-1.25</pre>
10708: </div>
10709: </div>
1.41 asau 10710: <div class="appendix">
10711: <div class="titlepage"><div><div><h1 class="title">
10712: <a name="logs"></a>Appendix B. Build logs</h1></div></div></div>
1.1 dsieger 10713: <div class="toc">
10714: <p><b>Table of Contents</b></p>
1.100 leot 10715: <dl class="toc">
1.1 dsieger 10716: <dt><span class="sect1"><a href="#logs.building">B.1. Building figlet</a></span></dt>
10717: <dt><span class="sect1"><a href="#logs.package">B.2. Packaging figlet</a></span></dt>
10718: </dl>
10719: </div>
1.41 asau 10720: <div class="sect1">
1.1 dsieger 10721: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10722: <a name="logs.building"></a>B.1. Building figlet</h2></div></div></div>
10723: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make</code></strong>
10724: ===> Checking for vulnerabilities in figlet-2.2.1nb2
10725: => figlet221.tar.gz doesn't seem to exist on this system.
10726: => Attempting to fetch figlet221.tar.gz from ftp://ftp.figlet.org/pub/figlet/program/unix/.
10727: => [172219 bytes]
10728: Connected to ftp.plig.net.
10729: 220 ftp.plig.org NcFTPd Server (licensed copy) ready.
10730: 331 Guest login ok, send your complete e-mail address as password.
10731: 230-You are user #5 of 500 simultaneous users allowed.
10732: 230-
10733: 230- ___ _ _ _
10734: 230- | _| |_ ___ ___| |_|___ ___ ___ ___
10735: 230- | _| _| . |_| . | | | . |_| . | _| . |
10736: 230- |_| |_| | _|_| _|_|_|_ |_|___|_| |_ |
10737: 230- |_| |_| |___| |___|
10738: 230-
10739: 230-** Welcome to ftp.plig.org **
10740: 230-
10741: 230-Please note that all transfers from this FTP site are logged. If you
10742: 230-do not like this, please disconnect now.
10743: 230-
1.18 snj 10744: 230-This archive is available via
1.1 dsieger 10745: 230-
10746: 230-HTTP: http://ftp.plig.org/
10747: 230-FTP: ftp://ftp.plig.org/ (max 500 connections)
10748: 230-RSYNC: rsync://ftp.plig.org/ (max 30 connections)
10749: 230-
10750: 230-Please email comments, bug reports and requests for packages to be
10751: 230-mirrored to ftp-admin@plig.org.
10752: 230-
10753: 230-
10754: 230 Logged in anonymously.
10755: Remote system type is UNIX.
10756: Using binary mode to transfer files.
10757: 200 Type okay.
10758: 250 "/pub" is new cwd.
10759: 250-"/pub/figlet" is new cwd.
10760: 250-
10761: 250-Welcome to the figlet archive at ftp.figlet.org
10762: 250-
10763: 250- ftp://ftp.figlet.org/pub/figlet/
10764: 250-
10765: 250-The official FIGlet web page is:
10766: 250- http://www.figlet.org/
10767: 250-
10768: 250-If you have questions, please mailto:info@figlet.org. If you want to
10769: 250-contribute a font or something else, you can email us.
10770: 250
10771: 250 "/pub/figlet/program" is new cwd.
10772: 250 "/pub/figlet/program/unix" is new cwd.
10773: local: figlet221.tar.gz remote: figlet221.tar.gz
10774: 502 Unimplemented command.
10775: 227 Entering Passive Mode (195,40,6,41,246,104)
10776: 150 Data connection accepted from 84.128.86.72:65131; transfer starting for figlet221.tar.gz (172219 bytes).
10777: 38% |************** | 65800 64.16 KB/s 00:01 ETA
10778: 226 Transfer completed.
10779: 172219 bytes received in 00:02 (75.99 KB/s)
10780: 221 Goodbye.
10781: => Checksum OK for figlet221.tar.gz.
10782: ===> Extracting for figlet-2.2.1nb2
10783: ===> Required installed package ccache-[0-9]*: ccache-2.3nb1 found
10784: ===> Patching for figlet-2.2.1nb2
10785: ===> Applying pkgsrc patches for figlet-2.2.1nb2
10786: ===> Overriding tools for figlet-2.2.1nb2
10787: ===> Creating toolchain wrappers for figlet-2.2.1nb2
10788: ===> Configuring for figlet-2.2.1nb2
10789: ===> Building for figlet-2.2.1nb2
10790: gcc -O2 -DDEFAULTFONTDIR=\"/usr/pkg/share/figlet\" -DDEFAULTFONTFILE=\"standard.flf\" figlet.c zipio.c crc.c inflate.c -o figlet
10791: chmod a+x figlet
10792: gcc -O2 -o chkfont chkfont.c
10793: => Unwrapping files-to-be-installed.
10794: <code class="prompt">#</code>
10795: <code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
10796: ===> Checking for vulnerabilities in figlet-2.2.1nb2
10797: ===> Installing for figlet-2.2.1nb2
10798: install -d -o root -g wheel -m 755 /usr/pkg/bin
10799: install -d -o root -g wheel -m 755 /usr/pkg/man/man6
10800: mkdir -p /usr/pkg/share/figlet
10801: cp figlet /usr/pkg/bin
10802: cp chkfont /usr/pkg/bin
10803: chmod 555 figlist showfigfonts
10804: cp figlist /usr/pkg/bin
10805: cp showfigfonts /usr/pkg/bin
10806: cp fonts/*.flf /usr/pkg/share/figlet
10807: cp fonts/*.flc /usr/pkg/share/figlet
10808: cp figlet.6 /usr/pkg/man/man6
10809: ===> Registering installation for figlet-2.2.1nb2
10810: <code class="prompt">#</code></pre>
10811: </div>
1.41 asau 10812: <div class="sect1">
1.1 dsieger 10813: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10814: <a name="logs.package"></a>B.2. Packaging figlet</h2></div></div></div>
10815: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make package</code></strong>
10816: ===> Checking for vulnerabilities in figlet-2.2.1nb2
10817: ===> Packaging figlet-2.2.1nb2
10818: ===> Building binary package for figlet-2.2.1nb2
10819: Creating package /home/cvs/pkgsrc/packages/i386/All/figlet-2.2.1nb2.tgz
10820: Using SrcDir value of /usr/pkg
10821: Registering depends:.
10822: <code class="prompt">#</code></pre>
10823: </div>
10824: </div>
1.41 asau 10825: <div class="appendix">
10826: <div class="titlepage"><div><div><h1 class="title">
10827: <a name="ftp-layout"></a>Appendix C. Directory layout of the pkgsrc FTP server</h1></div></div></div>
1.1 dsieger 10828: <div class="toc">
10829: <p><b>Table of Contents</b></p>
1.100 leot 10830: <dl class="toc">
1.23 wiz 10831: <dt><span class="sect1"><a href="#ftp-distfiles">C.1. <code class="filename">distfiles</code>: The distributed source files</a></span></dt>
10832: <dt><span class="sect1"><a href="#ftp-misc">C.2. <code class="filename">misc</code>: Miscellaneous things</a></span></dt>
10833: <dt><span class="sect1"><a href="#ftp-packages">C.3. <code class="filename">packages</code>: Binary packages</a></span></dt>
10834: <dt><span class="sect1"><a href="#ftp-reports">C.4. <code class="filename">reports</code>: Bulk build reports</a></span></dt>
10835: <dt><span class="sect1"><a href="#ftp-source">C.5. <code class="filename">current</code>,
1.148 leot 10836: <code class="filename">stable</code>,
1.23 wiz 10837: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>:
1.1 dsieger 10838: source packages</a></span></dt>
10839: </dl>
10840: </div>
10841: <p>As in other big projects, the directory layout of pkgsrc
10842: is quite complex for newbies. This chapter explains where you
10843: find things on the FTP server. The base directory on
1.10 hubertf 10844: <code class="filename">ftp.NetBSD.org</code> is <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/" target="_top"><code class="filename">/pub/pkgsrc/</code></a>.
1.1 dsieger 10845: On other servers it may be different, but inside this directory,
10846: everything should look the same, no matter on which server you
10847: are. This directory contains some subdirectories, which are
10848: explained below.</p>
1.41 asau 10849: <div class="sect1">
1.1 dsieger 10850: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 10851: <a name="ftp-distfiles"></a>C.1. <code class="filename">distfiles</code>: The distributed source files</h2></div></div></div>
1.1 dsieger 10852: <p>The directory <code class="filename">distfiles</code> contains lots
10853: of archive files from all pkgsrc packages, which are mirrored
10854: here. The subdirectories are called after their package names
10855: and are used when the distributed files have names that don't
10856: explicitly contain a version number or are otherwise too generic
10857: (for example <code class="filename">release.tar.gz</code>).</p>
10858: </div>
1.41 asau 10859: <div class="sect1">
1.1 dsieger 10860: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 10861: <a name="ftp-misc"></a>C.2. <code class="filename">misc</code>: Miscellaneous things</h2></div></div></div>
1.1 dsieger 10862: <p>This directory contains things that individual pkgsrc
10863: developers find worth publishing.</p>
10864: </div>
1.41 asau 10865: <div class="sect1">
1.1 dsieger 10866: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 10867: <a name="ftp-packages"></a>C.3. <code class="filename">packages</code>: Binary packages</h2></div></div></div>
1.3 rillig 10868: <p>This directory contains binary packages for the various
10869: platforms that are supported by pkgsrc.
10870: Each subdirectory is of the form <em class="replaceable"><code>OPSYS</code></em>/<em class="replaceable"><code>ARCH</code></em>/<em class="replaceable"><code>OSVERSION_TAG</code></em>. The meaning of these variables is:</p>
1.41 asau 10871: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 10872: <li class="listitem"><p><code class="varname">OPSYS</code> is the name of the
1.9 rillig 10873: operating system for which the packages have been built. The
1.10 hubertf 10874: name is taken from the output of the <span class="command"><strong>uname</strong></span>
1.9 rillig 10875: command, so it may differ from the one you are used to
10876: hear.</p></li>
1.23 wiz 10877: <li class="listitem"><p><code class="varname">ARCH</code> is the hardware
1.8 rillig 10878: architecture of the platform for which the packages have been
1.10 hubertf 10879: built. It also includes the <code class="varname">ABI</code> (Application
10880: Binary Interface) for platforms that have several of
10881: them.</p></li>
1.23 wiz 10882: <li class="listitem"><p><code class="varname">OSVERSION</code> is the version of
1.8 rillig 10883: the operating system. For version numbers that change often (for
10884: example NetBSD-current), the often-changing part should be
10885: replaced with an <code class="literal">x</code>, for example
10886: <code class="literal">4.99.x</code>.</p></li>
1.23 wiz 10887: <li class="listitem"><p><code class="varname">TAG</code> is either
1.22 jakllsch 10888: <code class="literal">20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>
1.8 rillig 10889: for a stable branch, or <code class="literal">head</code> for packages
10890: built from the HEAD branch. The latter should only be used when
10891: the packages are updated on a regular basis. Otherwise the date
10892: from checking out pkgsrc should be appended, for example
10893: <code class="literal">head_20071015</code>.</p></li>
1.3 rillig 10894: </ul></div>
10895: <p>The rationale for exactly this scheme is that the pkgsrc users looking for binary packages
10896: can quickly click through the directories on the
10897: server and find the best binary packages for their machines. Since they
10898: usually know the operating system and the hardware architecture, OPSYS
10899: and ARCH are placed first. After these choices, they can select the
10900: best combination of OSVERSION and TAG together, since it is usually the
10901: case that packages stay compatible between different version of the
10902: operating system.</p>
10903: <p>In each of these directories, there is a
10904: whole binary packages collection for a specific platform. It has a directory called
1.1 dsieger 10905: <code class="filename">All</code> which contains all binary packages.
10906: Besides that, there are various category directories that
10907: contain symbolic links to the real binary packages.</p>
10908: </div>
1.41 asau 10909: <div class="sect1">
1.1 dsieger 10910: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 10911: <a name="ftp-reports"></a>C.4. <code class="filename">reports</code>: Bulk build reports</h2></div></div></div>
1.8 rillig 10912: <p>Here are the reports from bulk builds, for those who want
10913: to fix packages that didn't build on some of the platforms. The
1.23 wiz 10914: structure of subdirectories should look like the one in <a class="xref" href="#ftp-packages" title="C.3. packages: Binary packages">Section C.3, “<code class="filename">packages</code>: Binary packages”</a>.</p>
1.8 rillig 10915: </div>
1.41 asau 10916: <div class="sect1">
1.8 rillig 10917: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 10918: <a name="ftp-source"></a>C.5. <code class="filename">current</code>,
1.148 leot 10919: <code class="filename">stable</code>,
1.22 jakllsch 10920: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>:
1.1 dsieger 10921: source packages</h2></div></div></div>
1.23 wiz 10922: <p>These directories contain the <span class="quote">“<span class="quote">real</span>”</span> pkgsrc,
1.1 dsieger 10923: that is the files that define how to create binary packages from
10924: source archives.</p>
1.149 leot 10925: <p>Each of the <code class="filename">current</code>,
10926: <code class="filename">stable</code> and
10927: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>
10928: directories share the same structure. They each contain a
10929: <code class="filename">pkgsrc</code> directory and
10930: <code class="filename">pkgsrc.tar.{bz,gz,xz}</code> file.</p>
1.1 dsieger 10931: <p>The directory <code class="filename">pkgsrc</code> contains a
10932: snapshot of the CVS repository, which is updated regularly. The
1.149 leot 10933: file <code class="filename">pkgsrc.tar.{bz,gz,xz}</code> contains the same
10934: as the directory, ready to be downloaded as a whole.</p>
10935: <p>The <code class="filename">current</code> directory contains files
10936: related to the HEAD branch of the CVS repository.
10937: In this directory there is an additional file called
10938: <code class="filename">pkgsrc-readmes.tar.{bz,gz,xz}</code> that contains
10939: all pkgsrc <code class="filename">README</code>s with information about
10940: categories and packages.
10941: </p>
10942: <p>The <code class="filename">stable</code> directory is a symlink to
10943: the latest
10944: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>.
10945: </p>
10946: <p>The
10947: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>.
10948: directories contain files related to the
10949: <code class="filename">-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>
10950: stable branch of the CVS repository. In these directories there is
10951: an additional file called
10952: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em>.tar.{bz,gz,xz}</code>,
1.1 dsieger 10953: which contains the state of pkgsrc when it was branched.</p>
10954: </div>
10955: </div>
1.41 asau 10956: <div class="appendix">
10957: <div class="titlepage"><div><div><h1 class="title">
1.154 rillig 10958: <a name="help-topics"></a>Appendix D. Help topics</h1></div></div></div>
10959: <p>
10960: The following list contains all help topics that are available
10961: when running <span class="command"><strong>bmake help topic=:index</strong></span>.
10962: </p>
1.156 leot 10963: <table border="0" summary="Simple list" class="simplelist">
10964: <tr>
10965: <td>#!</td>
10966: <td>-lintl</td>
10967: </tr>
10968: <tr>
10969: <td>64bit</td>
10970: <td>ABI</td>
10971: </tr>
10972: <tr>
10973: <td>ACCEPTABLE_LICENSES</td>
10974: <td>ACROREAD_FONTPATH</td>
10975: </tr>
10976: <tr>
10977: <td>ADDITIONAL</td>
10978: <td>AFAIK</td>
10979: </tr>
10980: <tr>
10981: <td>AIX</td>
10982: <td>ALLOW_VULNERABLE_PACKAGES</td>
10983: </tr>
10984: <tr>
10985: <td>ALL_ENV</td>
1.177 leot 10986: <td>ALSA_PC</td>
10987: </tr>
10988: <tr>
1.175 gutterid 10989: <td>ALTERNATIVES_SRC</td>
1.177 leot 10990: <td>AMANDA_TMP</td>
1.161 leot 10991: </tr>
10992: <tr>
1.175 gutterid 10993: <td>AMANDA_USER</td>
1.177 leot 10994: <td>AMANDA_VAR</td>
1.159 rillig 10995: </tr>
10996: <tr>
1.175 gutterid 10997: <td>APACHE_GROUP</td>
1.177 leot 10998: <td>APACHE_MODULE_NAME</td>
1.156 leot 10999: </tr>
11000: <tr>
1.175 gutterid 11001: <td>APACHE_MODULE_SRC</td>
1.177 leot 11002: <td>APACHE_MODULE_SRCDIR</td>
1.156 leot 11003: </tr>
11004: <tr>
1.175 gutterid 11005: <td>APACHE_PKG_PREFIX</td>
1.177 leot 11006: <td>APACHE_SUEXEC_CONFIGURE_ARGS</td>
1.156 leot 11007: </tr>
11008: <tr>
1.175 gutterid 11009: <td>APACHE_SUEXEC_DOCROOT</td>
1.177 leot 11010: <td>APACHE_USER</td>
1.156 leot 11011: </tr>
11012: <tr>
1.175 gutterid 11013: <td>APPEND_ABI</td>
1.177 leot 11014: <td>APPEND_ELF</td>
1.156 leot 11015: </tr>
11016: <tr>
1.175 gutterid 11017: <td>ARLA_CACHE</td>
1.177 leot 11018: <td>AUDIT_PACKAGES_FLAGS</td>
1.156 leot 11019: </tr>
11020: <tr>
1.175 gutterid 11021: <td>AUTOCONF_REQD</td>
1.177 leot 11022: <td>AUTOMAKE_OVERRIDE</td>
1.156 leot 11023: </tr>
11024: <tr>
1.175 gutterid 11025: <td>AUTOMAKE_REQD</td>
1.177 leot 11026: <td>AUTO_MKDIRS</td>
1.156 leot 11027: </tr>
11028: <tr>
1.175 gutterid 11029: <td>BDB185_DEFAULT</td>
1.177 leot 11030: <td>BDBBASE</td>
1.156 leot 11031: </tr>
11032: <tr>
1.175 gutterid 11033: <td>BDB_ACCEPTED</td>
1.177 leot 11034: <td>BDB_DEFAULT</td>
1.156 leot 11035: </tr>
11036: <tr>
1.175 gutterid 11037: <td>BDB_LIBS</td>
1.177 leot 11038: <td>BDB_TYPE</td>
1.156 leot 11039: </tr>
11040: <tr>
1.175 gutterid 11041: <td>BIND_DIR</td>
1.177 leot 11042: <td>BIND_GROUP</td>
1.156 leot 11043: </tr>
11044: <tr>
1.175 gutterid 11045: <td>BIND_USER</td>
1.177 leot 11046: <td>BINPKG_SITES</td>
1.156 leot 11047: </tr>
11048: <tr>
1.175 gutterid 11049: <td>BIN_INSTALL_FLAGS</td>
1.177 leot 11050: <td>BISON_PKGDATADIR</td>
11051: </tr>
11052: <tr>
11053: <td>BLAS_ACCEPTED</td>
11054: <td>BLAS_LIBS</td>
1.156 leot 11055: </tr>
11056: <tr>
1.177 leot 11057: <td>BLAS_TYPE</td>
1.156 leot 11058: <td>BOOTSTRAP_DEPENDS</td>
11059: </tr>
11060: <tr>
11061: <td>BOOTSTRAP_SETUPTOOLS</td>
11062: <td>BROKEN</td>
11063: </tr>
11064: <tr>
11065: <td>BROKEN_EXCEPT_ON_PLATFORM</td>
11066: <td>BROKEN_ON_PLATFORM</td>
11067: </tr>
11068: <tr>
11069: <td>BSDSRCDIR</td>
11070: <td>BSDXSRCDIR</td>
11071: </tr>
11072: <tr>
11073: <td>BSD_MAKE_ENV</td>
11074: <td>BUILDLINK_AUTO_DIRS</td>
11075: </tr>
11076: <tr>
11077: <td>BUILDLINK_AUTO_VARS</td>
11078: <td>BUILDLINK_CFLAGS</td>
11079: </tr>
11080: <tr>
11081: <td>BUILDLINK_CONTENTS_FILTER</td>
11082: <td>BUILDLINK_CPPFLAGS</td>
11083: </tr>
11084: <tr>
11085: <td>BUILDLINK_DEPMETHOD</td>
11086: <td>BUILDLINK_FILES</td>
11087: </tr>
11088: <tr>
11089: <td>BUILDLINK_FILES_CMD</td>
11090: <td>BUILDLINK_FNAME_TRANSFORM</td>
11091: </tr>
11092: <tr>
11093: <td>BUILDLINK_LDFLAGS</td>
11094: <td>BUILDLINK_LIBS</td>
11095: </tr>
11096: <tr>
11097: <td>BUILDLINK_OPSYS_SUPPORT_PTHREAD</td>
11098: <td>BUILDLINK_PKGNAME</td>
11099: </tr>
11100: <tr>
11101: <td>BUILDLINK_PREFIX</td>
11102: <td>BUILDLINK_RPATHDIRS</td>
11103: </tr>
11104: <tr>
11105: <td>BUILDLINK_TREE</td>
11106: <td>BUILD_DEFS</td>
11107: </tr>
11108: <tr>
11109: <td>BUILD_DEFS_EFFECTS</td>
11110: <td>BUILD_DEPENDS</td>
11111: </tr>
11112: <tr>
11113: <td>BUILD_DIRS</td>
11114: <td>BUILD_ENV_SHELL</td>
11115: </tr>
11116: <tr>
11117: <td>BUILD_MAKE_CMD</td>
11118: <td>BUILD_MAKE_FLAGS</td>
11119: </tr>
11120: <tr>
11121: <td>BUILD_TARGET</td>
11122: <td>BUILTIN_FIND_FILES</td>
11123: </tr>
11124: <tr>
11125: <td>BUILTIN_FIND_FILES_VAR</td>
11126: <td>BUILTIN_FIND_GREP</td>
11127: </tr>
11128: <tr>
11129: <td>BUILTIN_FIND_HEADERS</td>
11130: <td>BUILTIN_FIND_HEADERS_VAR</td>
11131: </tr>
11132: <tr>
11133: <td>BUILTIN_PKG</td>
11134: <td>BUILTIN_TEST_CURSES_DEFINES</td>
11135: </tr>
11136: <tr>
11137: <td>BUILTIN_TEST_CURSES_FUNCS</td>
11138: <td>BUILTIN_VERSION_SCRIPT</td>
11139: </tr>
11140: <tr>
11141: <td>BUILTIN_X11_TYPE</td>
11142: <td>BUILTIN_X11_VERSION</td>
11143: </tr>
11144: <tr>
11145: <td>CACTI_GROUP</td>
11146: <td>CACTI_USER</td>
11147: </tr>
11148: <tr>
11149: <td>CANNA_GROUP</td>
11150: <td>CANNA_USER</td>
11151: </tr>
11152: <tr>
11153: <td>CAT</td>
11154: <td>CCACHE_BASE</td>
11155: </tr>
11156: <tr>
11157: <td>CCACHE_DIR</td>
11158: <td>CCACHE_LOGFILE</td>
11159: </tr>
11160: <tr>
11161: <td>CC_VERSION</td>
11162: <td>CC_VERSION_STRING</td>
11163: </tr>
11164: <tr>
11165: <td>CDRECORD_CONF</td>
11166: <td>CDROM_PKG_URL_DIR</td>
11167: </tr>
11168: <tr>
11169: <td>CDROM_PKG_URL_HOST</td>
1.177 leot 11170: <td>CHECKOUT_DATE</td>
11171: </tr>
11172: <tr>
1.175 gutterid 11173: <td>CHECK_FAKEHOME</td>
1.177 leot 11174: <td>CHECK_FILES</td>
1.161 leot 11175: </tr>
11176: <tr>
1.175 gutterid 11177: <td>CHECK_FILES_SKIP</td>
1.177 leot 11178: <td>CHECK_FILES_STRICT</td>
1.159 rillig 11179: </tr>
11180: <tr>
1.175 gutterid 11181: <td>CHECK_HEADERS</td>
1.177 leot 11182: <td>CHECK_HEADERS_SKIP</td>
1.156 leot 11183: </tr>
11184: <tr>
1.175 gutterid 11185: <td>CHECK_INTERPRETER</td>
1.177 leot 11186: <td>CHECK_INTERPRETER_SKIP</td>
1.156 leot 11187: </tr>
11188: <tr>
1.175 gutterid 11189: <td>CHECK_PERMS</td>
1.177 leot 11190: <td>CHECK_PERMS_AUTOFIX</td>
1.156 leot 11191: </tr>
11192: <tr>
1.175 gutterid 11193: <td>CHECK_PERMS_SKIP</td>
1.177 leot 11194: <td>CHECK_PORTABILITY</td>
1.156 leot 11195: </tr>
11196: <tr>
1.177 leot 11197: <td>CHECK_PORTABILITY_EXPERIMENTAL</td>
1.175 gutterid 11198: <td>CHECK_PORTABILITY_SKIP</td>
1.156 leot 11199: </tr>
11200: <tr>
1.161 leot 11201: <td>CHECK_RELRO</td>
1.175 gutterid 11202: <td>CHECK_RELRO_SKIP</td>
1.156 leot 11203: </tr>
11204: <tr>
1.161 leot 11205: <td>CHECK_RELRO_SUPPORTED</td>
1.175 gutterid 11206: <td>CHECK_SHLIBS</td>
1.156 leot 11207: </tr>
11208: <tr>
1.161 leot 11209: <td>CHECK_SHLIBS_BLACKLIST</td>
1.175 gutterid 11210: <td>CHECK_SHLIBS_SKIP</td>
1.156 leot 11211: </tr>
11212: <tr>
1.161 leot 11213: <td>CHECK_SHLIBS_SUPPORTED</td>
1.175 gutterid 11214: <td>CHECK_SSP</td>
1.156 leot 11215: </tr>
11216: <tr>
1.161 leot 11217: <td>CHECK_SSP_SKIP</td>
1.175 gutterid 11218: <td>CHECK_SSP_SUPPORTED</td>
1.156 leot 11219: </tr>
11220: <tr>
1.161 leot 11221: <td>CHECK_STRIPPED</td>
1.175 gutterid 11222: <td>CHECK_STRIPPED_SKIP</td>
1.156 leot 11223: </tr>
11224: <tr>
1.161 leot 11225: <td>CHECK_WRKREF</td>
1.175 gutterid 11226: <td>CHECK_WRKREF_EXTRA_DIRS</td>
1.156 leot 11227: </tr>
11228: <tr>
1.161 leot 11229: <td>CHECK_WRKREF_SKIP</td>
1.175 gutterid 11230: <td>CLAMAV_DBDIR</td>
1.156 leot 11231: </tr>
11232: <tr>
1.161 leot 11233: <td>CLAMAV_GROUP</td>
1.175 gutterid 11234: <td>CLAMAV_USER</td>
1.156 leot 11235: </tr>
11236: <tr>
1.161 leot 11237: <td>CLANGBASE</td>
1.175 gutterid 11238: <td>CLEANDEPENDS</td>
1.156 leot 11239: </tr>
11240: <tr>
1.161 leot 11241: <td>CMAKE_DEPENDENCIES_REWRITE</td>
1.175 gutterid 11242: <td>CMAKE_INSTALL_PREFIX</td>
1.156 leot 11243: </tr>
11244: <tr>
1.161 leot 11245: <td>CMAKE_MODULE_PATH_OVERRIDE</td>
1.175 gutterid 11246: <td>CMAKE_PKGSRC_BUILD_FLAGS</td>
1.156 leot 11247: </tr>
11248: <tr>
1.161 leot 11249: <td>CMAKE_PREFIX_PATH</td>
1.156 leot 11250: <td>CMAKE_USE_GNU_INSTALL_DIRS</td>
11251: </tr>
11252: <tr>
1.177 leot 11253: <td>COMMON_LISP_DOCFILES</td>
11254: <td>COMMON_LISP_EXAMPLES</td>
11255: </tr>
11256: <tr>
11257: <td>COMMON_LISP_EXTRAFILES</td>
11258: <td>COMMON_LISP_PACKAGES</td>
11259: </tr>
11260: <tr>
11261: <td>COMMON_LISP_SYSTEM</td>
1.156 leot 11262: <td>COMPILER_RPATH_FLAG</td>
1.177 leot 11263: </tr>
11264: <tr>
1.156 leot 11265: <td>COMPILER_USE_SYMLINKS</td>
1.177 leot 11266: <td>CONFIGURE_ARGS</td>
1.156 leot 11267: </tr>
11268: <tr>
11269: <td>CONFIGURE_DIRS</td>
1.177 leot 11270: <td>CONFIGURE_ENV</td>
1.156 leot 11271: </tr>
11272: <tr>
1.172 rillig 11273: <td>CONFIGURE_ENV_SHELL</td>
1.177 leot 11274: <td>CONFIGURE_HAS_INFODIR</td>
1.156 leot 11275: </tr>
11276: <tr>
11277: <td>CONFIGURE_HAS_MANDIR</td>
1.177 leot 11278: <td>CONFIGURE_SCRIPT</td>
1.156 leot 11279: </tr>
11280: <tr>
11281: <td>CONFIG_SHELL</td>
1.177 leot 11282: <td>CONFIG_SHELL_FLAGS</td>
1.156 leot 11283: </tr>
11284: <tr>
11285: <td>CONF_FILES</td>
1.177 leot 11286: <td>CONF_FILES_MODE</td>
1.156 leot 11287: </tr>
11288: <tr>
11289: <td>CONF_FILES_PERMS</td>
1.177 leot 11290: <td>CONSERVER_DEFAULTHOST</td>
1.156 leot 11291: </tr>
11292: <tr>
11293: <td>CONSERVER_DEFAULTPORT</td>
1.177 leot 11294: <td>CP</td>
1.156 leot 11295: </tr>
11296: <tr>
11297: <td>CPP</td>
1.177 leot 11298: <td>CPP_PRECOMP_FLAGS</td>
1.156 leot 11299: </tr>
11300: <tr>
11301: <td>CREATE_WRKDIR_SYMLINK</td>
1.177 leot 11302: <td>CROSSBASE</td>
1.156 leot 11303: </tr>
11304: <tr>
11305: <td>CTFCONVERT</td>
1.177 leot 11306: <td>CTF_FILES_SKIP</td>
1.156 leot 11307: </tr>
11308: <tr>
11309: <td>CTF_SUPPORTED</td>
1.177 leot 11310: <td>CTYPE</td>
1.156 leot 11311: </tr>
11312: <tr>
11313: <td>CUPS_GROUP</td>
1.177 leot 11314: <td>CUPS_SYSTEM_GROUPS</td>
1.156 leot 11315: </tr>
11316: <tr>
11317: <td>CUPS_USER</td>
1.177 leot 11318: <td>CURSES_DEFAULT</td>
1.156 leot 11319: </tr>
11320: <tr>
11321: <td>CURSES_TYPE</td>
1.177 leot 11322: <td>CVS_EXTRACTDIR</td>
11323: </tr>
11324: <tr>
11325: <td>CVS_MODULE</td>
11326: <td>CVS_PROJECT</td>
11327: </tr>
11328: <tr>
11329: <td>CVS_REPOSITORIES</td>
11330: <td>CVS_ROOT</td>
11331: </tr>
11332: <tr>
11333: <td>CVS_ROOT_GNU</td>
11334: <td>CVS_ROOT_NONGNU</td>
11335: </tr>
11336: <tr>
11337: <td>CVS_ROOT_SOURCEFORGE</td>
11338: <td>CVS_TAG</td>
1.161 leot 11339: </tr>
11340: <tr>
1.160 brook 11341: <td>CXX</td>
1.175 gutterid 11342: <td>CYRUS_GROUP</td>
1.159 rillig 11343: </tr>
11344: <tr>
1.160 brook 11345: <td>CYRUS_IDLE</td>
1.175 gutterid 11346: <td>CYRUS_USER</td>
1.156 leot 11347: </tr>
11348: <tr>
1.160 brook 11349: <td>DAEMONTOOLS_GROUP</td>
1.175 gutterid 11350: <td>DAEMONTOOLS_LOG_USER</td>
1.156 leot 11351: </tr>
11352: <tr>
1.160 brook 11353: <td>DBUS_GROUP</td>
1.175 gutterid 11354: <td>DBUS_USER</td>
1.156 leot 11355: </tr>
11356: <tr>
1.160 brook 11357: <td>DEFANG_GROUP</td>
1.175 gutterid 11358: <td>DEFANG_USER</td>
1.156 leot 11359: </tr>
11360: <tr>
1.160 brook 11361: <td>DEFAULT_ACCEPTABLE_LICENSES</td>
1.175 gutterid 11362: <td>DEFAULT_DISTFILES</td>
1.156 leot 11363: </tr>
11364: <tr>
1.160 brook 11365: <td>DEFAULT_IRC_SERVER</td>
1.175 gutterid 11366: <td>DEFAULT_SERIAL_DEVICE</td>
1.156 leot 11367: </tr>
11368: <tr>
1.160 brook 11369: <td>DEF_UMASK</td>
1.175 gutterid 11370: <td>DEINSTALLDEPENDS</td>
1.156 leot 11371: </tr>
11372: <tr>
1.160 brook 11373: <td>DEINSTALL_SRC</td>
1.175 gutterid 11374: <td>DEINSTALL_TEMPLATES</td>
1.156 leot 11375: </tr>
11376: <tr>
1.160 brook 11377: <td>DELAYED_ERROR_MSG</td>
1.175 gutterid 11378: <td>DELAYED_WARNING_MSG</td>
1.156 leot 11379: </tr>
11380: <tr>
1.160 brook 11381: <td>DEPENDS</td>
1.175 gutterid 11382: <td>DEPENDS_TARGET</td>
1.156 leot 11383: </tr>
11384: <tr>
1.160 brook 11385: <td>DEPENDS_TYPE</td>
1.175 gutterid 11386: <td>DESTDIR</td>
1.156 leot 11387: </tr>
11388: <tr>
1.160 brook 11389: <td>DESTDIR_VARNAME</td>
1.175 gutterid 11390: <td>DIALER_GROUP</td>
1.156 leot 11391: </tr>
11392: <tr>
1.160 brook 11393: <td>DIGEST_REQD</td>
1.175 gutterid 11394: <td>DISTDIR</td>
1.156 leot 11395: </tr>
11396: <tr>
1.160 brook 11397: <td>DISTFILES</td>
1.175 gutterid 11398: <td>DISTINFO_FILE</td>
1.156 leot 11399: </tr>
11400: <tr>
1.160 brook 11401: <td>DISTNAME</td>
1.175 gutterid 11402: <td>DIST_PATH</td>
1.156 leot 11403: </tr>
11404: <tr>
1.160 brook 11405: <td>DIST_SUBDIR</td>
1.175 gutterid 11406: <td>DJBDNS_AXFR_USER</td>
1.156 leot 11407: </tr>
11408: <tr>
1.160 brook 11409: <td>DJBDNS_CACHE_USER</td>
1.175 gutterid 11410: <td>DJBDNS_DJBDNS_GROUP</td>
1.156 leot 11411: </tr>
11412: <tr>
1.160 brook 11413: <td>DJBDNS_LOG_USER</td>
1.175 gutterid 11414: <td>DJBDNS_RBL_USER</td>
1.156 leot 11415: </tr>
11416: <tr>
1.160 brook 11417: <td>DJBDNS_TINY_USER</td>
1.175 gutterid 11418: <td>DLOPEN_REQUIRE_PTHREADS</td>
1.156 leot 11419: </tr>
11420: <tr>
1.160 brook 11421: <td>DL_AUTO_VARS</td>
1.175 gutterid 11422: <td>DL_CFLAGS</td>
1.156 leot 11423: </tr>
11424: <tr>
1.160 brook 11425: <td>DL_LDFLAGS</td>
1.175 gutterid 11426: <td>DL_LIBS</td>
1.156 leot 11427: </tr>
11428: <tr>
1.160 brook 11429: <td>DNS</td>
1.175 gutterid 11430: <td>DOWNLOADED_DISTFILE</td>
1.156 leot 11431: </tr>
11432: <tr>
1.160 brook 11433: <td>DT_LAYOUT</td>
1.175 gutterid 11434: <td>DYNAMIC_SITES_CMD</td>
1.156 leot 11435: </tr>
11436: <tr>
1.160 brook 11437: <td>DYNAMIC_SITES_SCRIPT</td>
1.175 gutterid 11438: <td>ECHO</td>
1.156 leot 11439: </tr>
11440: <tr>
1.160 brook 11441: <td>ECHO_N</td>
1.175 gutterid 11442: <td>ELK_GUI</td>
1.156 leot 11443: </tr>
11444: <tr>
1.160 brook 11445: <td>EMACS_TYPE</td>
1.175 gutterid 11446: <td>EMULDIR</td>
1.156 leot 11447: </tr>
11448: <tr>
1.160 brook 11449: <td>EMULSUBDIR</td>
1.175 gutterid 11450: <td>EMULSUBDIRSLASH</td>
1.156 leot 11451: </tr>
11452: <tr>
1.160 brook 11453: <td>EMUL_ARCH</td>
1.175 gutterid 11454: <td>EMUL_DISTRO</td>
1.156 leot 11455: </tr>
11456: <tr>
1.160 brook 11457: <td>EMUL_EXEC_FMT</td>
1.175 gutterid 11458: <td>EMUL_IS_NATIVE</td>
1.156 leot 11459: </tr>
11460: <tr>
1.160 brook 11461: <td>EMUL_MODULES</td>
1.175 gutterid 11462: <td>EMUL_OPSYS</td>
1.156 leot 11463: </tr>
11464: <tr>
1.160 brook 11465: <td>EMUL_PKG_FMT</td>
1.175 gutterid 11466: <td>EMUL_PLATFORM</td>
1.156 leot 11467: </tr>
11468: <tr>
1.160 brook 11469: <td>EMUL_PLATFORMS</td>
1.175 gutterid 11470: <td>EMUL_PREFER</td>
1.156 leot 11471: </tr>
11472: <tr>
1.160 brook 11473: <td>EMUL_REQD</td>
1.175 gutterid 11474: <td>EMUL_TYPE</td>
1.156 leot 11475: </tr>
11476: <tr>
1.160 brook 11477: <td>ERROR_MSG</td>
1.175 gutterid 11478: <td>EXIM_GROUP</td>
1.156 leot 11479: </tr>
11480: <tr>
1.160 brook 11481: <td>EXIM_USER</td>
1.175 gutterid 11482: <td>EXPORT_SYMBOLS_LDFLAGS</td>
1.156 leot 11483: </tr>
11484: <tr>
1.160 brook 11485: <td>EXTRACTOR</td>
1.175 gutterid 11486: <td>EXTRACT_CMD</td>
1.156 leot 11487: </tr>
11488: <tr>
1.160 brook 11489: <td>EXTRACT_CMD_DEFAULT</td>
1.175 gutterid 11490: <td>EXTRACT_DIR</td>
1.156 leot 11491: </tr>
11492: <tr>
1.160 brook 11493: <td>EXTRACT_ELEMENTS</td>
1.175 gutterid 11494: <td>EXTRACT_ENV</td>
1.156 leot 11495: </tr>
11496: <tr>
1.160 brook 11497: <td>EXTRACT_ONLY</td>
1.175 gutterid 11498: <td>EXTRACT_OPTS</td>
1.156 leot 11499: </tr>
11500: <tr>
1.160 brook 11501: <td>EXTRACT_SUFX</td>
1.175 gutterid 11502: <td>EXTRACT_USING</td>
1.156 leot 11503: </tr>
11504: <tr>
1.177 leot 11505: <td>FAIL</td>
1.160 brook 11506: <td>FAILOVER_FETCH</td>
1.177 leot 11507: </tr>
11508: <tr>
1.175 gutterid 11509: <td>FAIL_MSG</td>
1.177 leot 11510: <td>FAKE_NCURSES</td>
1.156 leot 11511: </tr>
11512: <tr>
1.175 gutterid 11513: <td>FAM</td>
1.177 leot 11514: <td>FAM_ACCEPTED</td>
1.156 leot 11515: </tr>
11516: <tr>
1.175 gutterid 11517: <td>FAM_DEFAULT</td>
1.177 leot 11518: <td>FAM_SERVER</td>
1.156 leot 11519: </tr>
11520: <tr>
1.175 gutterid 11521: <td>FCPATH</td>
1.177 leot 11522: <td>FEATURE_CPPFLAGS</td>
1.156 leot 11523: </tr>
11524: <tr>
1.175 gutterid 11525: <td>FEATURE_LDFLAGS</td>
1.177 leot 11526: <td>FEATURE_LIBS</td>
1.156 leot 11527: </tr>
11528: <tr>
1.175 gutterid 11529: <td>FETCH_AFTER_ARGS</td>
1.177 leot 11530: <td>FETCH_BEFORE_ARGS</td>
1.156 leot 11531: </tr>
11532: <tr>
1.175 gutterid 11533: <td>FETCH_CMD</td>
1.177 leot 11534: <td>FETCH_OUTPUT_ARGS</td>
1.156 leot 11535: </tr>
11536: <tr>
1.175 gutterid 11537: <td>FETCH_PROXY</td>
1.177 leot 11538: <td>FETCH_RESUME_ARGS</td>
1.156 leot 11539: </tr>
11540: <tr>
1.175 gutterid 11541: <td>FETCH_USING</td>
1.177 leot 11542: <td>FILES_SUBST</td>
1.156 leot 11543: </tr>
11544: <tr>
1.175 gutterid 11545: <td>FILES_SUBST_SED</td>
1.177 leot 11546: <td>FIX_SYSTEM_HEADERS</td>
1.156 leot 11547: </tr>
11548: <tr>
1.175 gutterid 11549: <td>FLUXBOX_USE_GNOME</td>
1.177 leot 11550: <td>FLUXBOX_USE_KDE</td>
1.156 leot 11551: </tr>
11552: <tr>
1.175 gutterid 11553: <td>FLUXBOX_USE_XFT</td>
1.177 leot 11554: <td>FLUXBOX_USE_XINERAMA</td>
1.156 leot 11555: </tr>
11556: <tr>
1.177 leot 11557: <td>FONTDIR</td>
1.156 leot 11558: <td>FONTS_DIRS</td>
11559: </tr>
11560: <tr>
1.172 rillig 11561: <td>FONTS_VERBOSE</td>
1.156 leot 11562: <td>FOO_HACKS_MK</td>
1.161 leot 11563: </tr>
11564: <tr>
1.177 leot 11565: <td>FOSSIL_EXTRACTDIR</td>
11566: <td>FOSSIL_REPO</td>
11567: </tr>
11568: <tr>
11569: <td>FOSSIL_REPOSITORIES</td>
11570: <td>FOSSIL_VERSION</td>
11571: </tr>
11572: <tr>
1.172 rillig 11573: <td>FOX_USE_XUNICODE</td>
1.156 leot 11574: <td>FREEWNN_GROUP</td>
11575: </tr>
11576: <tr>
1.172 rillig 11577: <td>FREEWNN_USER</td>
1.156 leot 11578: <td>FTP_PKG_URL_DIR</td>
11579: </tr>
11580: <tr>
1.172 rillig 11581: <td>FTP_PKG_URL_HOST</td>
1.156 leot 11582: <td>GAMEDATAMODE</td>
11583: </tr>
11584: <tr>
1.172 rillig 11585: <td>GAMEDATA_PERMS</td>
1.156 leot 11586: <td>GAMEDIRMODE</td>
11587: </tr>
11588: <tr>
1.172 rillig 11589: <td>GAMEDIR_PERMS</td>
1.156 leot 11590: <td>GAMEGRP</td>
11591: </tr>
11592: <tr>
1.172 rillig 11593: <td>GAMEMODE</td>
1.156 leot 11594: <td>GAMEOWN</td>
11595: </tr>
11596: <tr>
1.172 rillig 11597: <td>GAMES_GROUP</td>
1.156 leot 11598: <td>GAMES_USER</td>
11599: </tr>
11600: <tr>
1.172 rillig 11601: <td>GCC</td>
1.156 leot 11602: <td>GCCBASE</td>
11603: </tr>
11604: <tr>
1.172 rillig 11605: <td>GCC_REQD</td>
1.156 leot 11606: <td>GCC_VERSION_SUFFIX</td>
11607: </tr>
11608: <tr>
1.172 rillig 11609: <td>GEM_BUILD</td>
1.156 leot 11610: <td>GEM_CLEANBUILD</td>
11611: </tr>
11612: <tr>
1.172 rillig 11613: <td>GEM_CLEANBUILD_EXTENSIONS</td>
1.156 leot 11614: <td>GEM_DOCDIR</td>
11615: </tr>
11616: <tr>
1.172 rillig 11617: <td>GEM_EXTSDIR</td>
1.156 leot 11618: <td>GEM_HOME</td>
11619: </tr>
11620: <tr>
1.177 leot 11621: <td>GEM_KEEPBUILD</td>
1.172 rillig 11622: <td>GEM_LIBDIR</td>
1.177 leot 11623: </tr>
11624: <tr>
1.156 leot 11625: <td>GEM_NAME</td>
1.177 leot 11626: <td>GEM_PATH</td>
1.156 leot 11627: </tr>
11628: <tr>
11629: <td>GEM_SPECFILE</td>
1.177 leot 11630: <td>GENERATE_PLIST</td>
1.156 leot 11631: </tr>
11632: <tr>
11633: <td>GHOSTSCRIPT_REQD</td>
1.177 leot 11634: <td>GITHUB_PROJECT</td>
1.156 leot 11635: </tr>
11636: <tr>
11637: <td>GITHUB_RELEASE</td>
1.177 leot 11638: <td>GITHUB_TAG</td>
1.156 leot 11639: </tr>
11640: <tr>
11641: <td>GITHUB_TYPE</td>
1.177 leot 11642: <td>GITLAB_PROJECT</td>
11643: </tr>
11644: <tr>
11645: <td>GITLAB_TAG</td>
11646: <td>GITLAB_TYPE</td>
11647: </tr>
11648: <tr>
11649: <td>GIT_BRANCH</td>
11650: <td>GIT_ENV</td>
1.161 leot 11651: </tr>
11652: <tr>
1.177 leot 11653: <td>GIT_EXTRACTDIR</td>
11654: <td>GIT_REPO</td>
11655: </tr>
11656: <tr>
11657: <td>GIT_REPOSITORIES</td>
11658: <td>GIT_REVISION</td>
11659: </tr>
11660: <tr>
11661: <td>GIT_TAG</td>
1.160 brook 11662: <td>GNU</td>
1.177 leot 11663: </tr>
11664: <tr>
1.175 gutterid 11665: <td>GNU_CONFIGURE</td>
1.177 leot 11666: <td>GNU_CONFIGURE_INFODIR</td>
1.159 rillig 11667: </tr>
11668: <tr>
1.175 gutterid 11669: <td>GNU_CONFIGURE_MANDIR</td>
1.178 ! rillig 11670: <td>GNU_CONFIGURE_QUIET</td>
1.156 leot 11671: </tr>
11672: <tr>
1.178 ! rillig 11673: <td>GNU_CONFIGURE_STRICT</td>
1.175 gutterid 11674: <td>GODEP_REDIRECTS</td>
1.156 leot 11675: </tr>
11676: <tr>
1.178 ! rillig 11677: <td>GO_BUILD_PATTERN</td>
1.175 gutterid 11678: <td>GO_DEPS</td>
1.156 leot 11679: </tr>
11680: <tr>
1.178 ! rillig 11681: <td>GO_DIST_BASE</td>
1.175 gutterid 11682: <td>GO_MODULE_FILES</td>
1.156 leot 11683: </tr>
11684: <tr>
1.178 ! rillig 11685: <td>GO_SRCPATH</td>
1.161 leot 11686: <td>GO_VERSION_DEFAULT</td>
1.156 leot 11687: </tr>
11688: <tr>
1.178 ! rillig 11689: <td>GROUP_SPECIFIC_PKGS</td>
1.159 rillig 11690: <td>GRUB_NETWORK_CARDS</td>
1.156 leot 11691: </tr>
11692: <tr>
1.178 ! rillig 11693: <td>GRUB_PRESET_COMMAND</td>
1.159 rillig 11694: <td>GRUB_SCAN_ARGS</td>
1.156 leot 11695: </tr>
11696: <tr>
1.178 ! rillig 11697: <td>GZIP</td>
1.159 rillig 11698: <td>HASKELL_COMPILER</td>
1.156 leot 11699: </tr>
11700: <tr>
1.178 ! rillig 11701: <td>HASKELL_ENABLE_HADDOCK_DOCUMENTATION</td>
1.159 rillig 11702: <td>HASKELL_ENABLE_LIBRARY_PROFILING</td>
1.156 leot 11703: </tr>
11704: <tr>
1.178 ! rillig 11705: <td>HASKELL_ENABLE_SHARED_LIBRARY</td>
1.169 rillig 11706: <td>HASKELL_OPTIMIZATION_LEVEL</td>
1.156 leot 11707: </tr>
11708: <tr>
1.178 ! rillig 11709: <td>HAS_CONFIGURE</td>
1.169 rillig 11710: <td>HEADER_TEMPLATES</td>
1.177 leot 11711: </tr>
11712: <tr>
1.178 ! rillig 11713: <td>HG_REPO</td>
1.177 leot 11714: <td>HG_REPOSITORIES</td>
1.161 leot 11715: </tr>
11716: <tr>
1.178 ! rillig 11717: <td>HG_TAG</td>
1.169 rillig 11718: <td>HOST_PKGTOOLS_ARGS</td>
1.156 leot 11719: </tr>
11720: <tr>
1.178 ! rillig 11721: <td>HOST_SPECIFIC_PKGS</td>
1.169 rillig 11722: <td>HOWL_GROUP</td>
1.156 leot 11723: </tr>
11724: <tr>
1.178 ! rillig 11725: <td>HOWL_USER</td>
1.169 rillig 11726: <td>ICCBASE</td>
1.156 leot 11727: </tr>
11728: <tr>
1.178 ! rillig 11729: <td>ICECAST_CHROOTDIR</td>
1.169 rillig 11730: <td>ICON_THEMES</td>
1.156 leot 11731: </tr>
11732: <tr>
1.178 ! rillig 11733: <td>IDOBASE</td>
1.169 rillig 11734: <td>IGNORE_CCACHE</td>
1.156 leot 11735: </tr>
11736: <tr>
1.178 ! rillig 11737: <td>IGNORE_INFO_DIRS</td>
1.169 rillig 11738: <td>IGNORE_INTERACTIVE_FETCH</td>
1.156 leot 11739: </tr>
11740: <tr>
1.178 ! rillig 11741: <td>IMAKE</td>
1.169 rillig 11742: <td>IMAKEOPTS</td>
1.156 leot 11743: </tr>
11744: <tr>
1.178 ! rillig 11745: <td>IMAKE_MAKE</td>
1.169 rillig 11746: <td>IMAKE_MANINSTALL</td>
1.156 leot 11747: </tr>
11748: <tr>
1.178 ! rillig 11749: <td>IMAP_UW_CCLIENT_MBOX_FMT</td>
1.169 rillig 11750: <td>IMDICTDIR</td>
1.156 leot 11751: </tr>
11752: <tr>
1.178 ! rillig 11753: <td>INCOMPAT_CURSES</td>
1.169 rillig 11754: <td>INFO_DIR</td>
1.156 leot 11755: </tr>
11756: <tr>
1.178 ! rillig 11757: <td>INFO_FILES</td>
1.169 rillig 11758: <td>INFO_FILES_VERBOSE</td>
1.156 leot 11759: </tr>
11760: <tr>
1.178 ! rillig 11761: <td>INFO_MSG</td>
1.169 rillig 11762: <td>INIT_SYSTEM</td>
1.156 leot 11763: </tr>
11764: <tr>
1.178 ! rillig 11765: <td>INN_DATA_DIR</td>
1.169 rillig 11766: <td>INN_GROUP</td>
1.156 leot 11767: </tr>
11768: <tr>
1.178 ! rillig 11769: <td>INN_USER</td>
1.169 rillig 11770: <td>INSTALLATION_DIRS</td>
1.172 rillig 11771: </tr>
11772: <tr>
1.178 ! rillig 11773: <td>INSTALLATION_DIRS_FROM_PLIST</td>
1.172 rillig 11774: <td>INSTALL_ENV</td>
1.156 leot 11775: </tr>
11776: <tr>
1.178 ! rillig 11777: <td>INSTALL_SH_OVERRIDE</td>
1.172 rillig 11778: <td>INSTALL_SRC</td>
1.156 leot 11779: </tr>
11780: <tr>
1.178 ! rillig 11781: <td>INSTALL_TEMPLATES</td>
1.172 rillig 11782: <td>INSTALL_UNSTRIPPED</td>
1.156 leot 11783: </tr>
11784: <tr>
1.178 ! rillig 11785: <td>IRCD_HYBRID_IRC_GROUP</td>
1.172 rillig 11786: <td>IRCD_HYBRID_IRC_USER</td>
1.156 leot 11787: </tr>
11788: <tr>
1.178 ! rillig 11789: <td>IRCD_HYBRID_MAXCONN</td>
1.172 rillig 11790: <td>IRCD_HYBRID_NICLEN</td>
1.156 leot 11791: </tr>
11792: <tr>
1.178 ! rillig 11793: <td>IRCD_HYBRID_SYSLOG_EVENTS</td>
1.172 rillig 11794: <td>IRCD_HYBRID_SYSLOG_FACILITY</td>
1.156 leot 11795: </tr>
11796: <tr>
1.178 ! rillig 11797: <td>IRCD_HYBRID_TOPICLEN</td>
1.172 rillig 11798: <td>IRIX</td>
1.156 leot 11799: </tr>
11800: <tr>
1.178 ! rillig 11801: <td>IRRD_USE_PGP</td>
1.172 rillig 11802: <td>JABBERD_GROUP</td>
1.156 leot 11803: </tr>
11804: <tr>
1.178 ! rillig 11805: <td>JABBERD_LOGDIR</td>
1.172 rillig 11806: <td>JABBERD_PIDDIR</td>
1.156 leot 11807: </tr>
11808: <tr>
1.178 ! rillig 11809: <td>JABBERD_SPOOLDIR</td>
1.172 rillig 11810: <td>JABBERD_USER</td>
1.156 leot 11811: </tr>
11812: <tr>
1.178 ! rillig 11813: <td>JAKARTA_HOME</td>
1.177 leot 11814: <td>JAVA_APP_PATH</td>
11815: </tr>
11816: <tr>
1.178 ! rillig 11817: <td>JAVA_APP_TARGETS</td>
1.172 rillig 11818: <td>JAVA_BINPREFIX</td>
1.161 leot 11819: </tr>
11820: <tr>
1.178 ! rillig 11821: <td>JAVA_CLASSPATH</td>
1.172 rillig 11822: <td>JAVA_HOME</td>
1.156 leot 11823: </tr>
11824: <tr>
1.178 ! rillig 11825: <td>JAVA_LD_LIBRARY_PATH</td>
1.172 rillig 11826: <td>JAVA_NAME</td>
1.156 leot 11827: </tr>
11828: <tr>
1.178 ! rillig 11829: <td>JAVA_UNLIMIT</td>
1.172 rillig 11830: <td>JAVA_WRAPPERS</td>
1.156 leot 11831: </tr>
11832: <tr>
1.178 ! rillig 11833: <td>JPEG_ACCEPTED</td>
1.172 rillig 11834: <td>JPEG_DEFAULT</td>
1.156 leot 11835: </tr>
11836: <tr>
1.178 ! rillig 11837: <td>KERBEROS</td>
1.172 rillig 11838: <td>KERMIT_SUID_UUCP</td>
1.156 leot 11839: </tr>
11840: <tr>
1.178 ! rillig 11841: <td>KJS_USE_PCRE</td>
1.172 rillig 11842: <td>KNEWS_DOMAIN_FILE</td>
1.156 leot 11843: </tr>
11844: <tr>
1.178 ! rillig 11845: <td>KNEWS_DOMAIN_NAME</td>
1.172 rillig 11846: <td>KRB5_ACCEPTED</td>
1.156 leot 11847: </tr>
11848: <tr>
1.178 ! rillig 11849: <td>KRB5_DEFAULT</td>
1.172 rillig 11850: <td>LANGUAGES</td>
1.177 leot 11851: </tr>
11852: <tr>
1.178 ! rillig 11853: <td>LAPACK_LIBS</td>
1.172 rillig 11854: <td>LATEX2HTML_ICONPATH</td>
1.156 leot 11855: </tr>
11856: <tr>
1.178 ! rillig 11857: <td>LDCONFIG_ADD_CMD</td>
1.172 rillig 11858: <td>LDCONFIG_REMOVE_CMD</td>
1.156 leot 11859: </tr>
11860: <tr>
1.178 ! rillig 11861: <td>LEAFNODE_DATA_DIR</td>
1.172 rillig 11862: <td>LEAFNODE_GROUP</td>
1.156 leot 11863: </tr>
11864: <tr>
1.178 ! rillig 11865: <td>LEAFNODE_USER</td>
1.172 rillig 11866: <td>LIBDVDCSS_HOMEPAGE</td>
1.156 leot 11867: </tr>
11868: <tr>
1.178 ! rillig 11869: <td>LIBDVDCSS_MASTER_SITES</td>
1.172 rillig 11870: <td>LIBRSVG_TYPE</td>
1.157 leot 11871: </tr>
11872: <tr>
1.178 ! rillig 11873: <td>LIBTOOL</td>
1.172 rillig 11874: <td>LIBTOOLIZE_PLIST</td>
1.156 leot 11875: </tr>
11876: <tr>
1.178 ! rillig 11877: <td>LIBTOOL_M4_OVERRIDE</td>
1.172 rillig 11878: <td>LIBUSB_TYPE</td>
1.156 leot 11879: </tr>
11880: <tr>
1.178 ! rillig 11881: <td>LICENSE</td>
1.172 rillig 11882: <td>LINKER_RPATH_FLAG</td>
1.177 leot 11883: </tr>
11884: <tr>
1.178 ! rillig 11885: <td>LINK_RPATH_FLAG</td>
1.177 leot 11886: <td>LINUX_BASE_NODEPS</td>
1.156 leot 11887: </tr>
11888: <tr>
1.178 ! rillig 11889: <td>LINUX_BASE_PREFERRED</td>
1.177 leot 11890: <td>LINUX_BASE_REQUIRED</td>
1.161 leot 11891: </tr>
11892: <tr>
1.178 ! rillig 11893: <td>LINUX_LOCALES</td>
1.172 rillig 11894: <td>LOCALBASE</td>
1.156 leot 11895: </tr>
11896: <tr>
1.178 ! rillig 11897: <td>LOCALBASE_LOCKTYPE</td>
1.172 rillig 11898: <td>LOCALPATCHES</td>
1.156 leot 11899: </tr>
11900: <tr>
1.178 ! rillig 11901: <td>LOVE_DATA</td>
1.172 rillig 11902: <td>LOVE_GAME</td>
1.156 leot 11903: </tr>
11904: <tr>
1.178 ! rillig 11905: <td>LOVE_VERSION</td>
1.172 rillig 11906: <td>LP64PLATFORMS</td>
1.156 leot 11907: </tr>
11908: <tr>
1.178 ! rillig 11909: <td>MACHINE_PLATFORM</td>
1.172 rillig 11910: <td>MAILAGENT_DOMAIN</td>
1.156 leot 11911: </tr>
11912: <tr>
1.178 ! rillig 11913: <td>MAILAGENT_EMAIL</td>
1.172 rillig 11914: <td>MAILAGENT_FQDN</td>
1.156 leot 11915: </tr>
11916: <tr>
1.178 ! rillig 11917: <td>MAILAGENT_ORGANIZATION</td>
1.172 rillig 11918: <td>MAJORDOMO_HOMEDIR</td>
1.159 rillig 11919: </tr>
11920: <tr>
1.178 ! rillig 11921: <td>MAJOR_OS_VERSION</td>
1.177 leot 11922: <td>MAKEINFO_ARGS</td>
1.156 leot 11923: </tr>
11924: <tr>
1.178 ! rillig 11925: <td>MAKE_DIRS</td>
1.177 leot 11926: <td>MAKE_DIRS_PERMS</td>
1.156 leot 11927: </tr>
11928: <tr>
1.178 ! rillig 11929: <td>MAKE_ENV</td>
1.177 leot 11930: <td>MAKE_FILE</td>
1.156 leot 11931: </tr>
11932: <tr>
1.178 ! rillig 11933: <td>MAKE_FLAGS</td>
1.177 leot 11934: <td>MAKE_JOBS</td>
1.156 leot 11935: </tr>
11936: <tr>
1.178 ! rillig 11937: <td>MAKE_JOBS_SAFE</td>
1.177 leot 11938: <td>MAKE_PROGRAM</td>
1.156 leot 11939: </tr>
11940: <tr>
1.178 ! rillig 11941: <td>MANINSTALL</td>
1.177 leot 11942: <td>MANZ</td>
1.156 leot 11943: </tr>
11944: <tr>
1.178 ! rillig 11945: <td>MASTER_SITES</td>
1.177 leot 11946: <td>MASTER_SITE_BACKUP</td>
1.156 leot 11947: </tr>
11948: <tr>
1.178 ! rillig 11949: <td>MASTER_SITE_LOCAL</td>
1.159 rillig 11950: <td>MASTER_SITE_MOZILLA</td>
1.156 leot 11951: </tr>
11952: <tr>
1.178 ! rillig 11953: <td>MASTER_SITE_OVERRIDE</td>
1.172 rillig 11954: <td>MASTER_SITE_PERL_CPAN</td>
1.156 leot 11955: </tr>
11956: <tr>
1.178 ! rillig 11957: <td>MASTER_SORT</td>
1.159 rillig 11958: <td>MASTER_SORT_RANDOM</td>
1.156 leot 11959: </tr>
11960: <tr>
1.178 ! rillig 11961: <td>MASTER_SORT_REGEX</td>
1.159 rillig 11962: <td>MECAB_CHARSET</td>
1.156 leot 11963: </tr>
11964: <tr>
1.178 ! rillig 11965: <td>MEDIATOMB_GROUP</td>
1.159 rillig 11966: <td>MEDIATOMB_USER</td>
1.156 leot 11967: </tr>
11968: <tr>
1.178 ! rillig 11969: <td>MIPSPROBASE</td>
1.159 rillig 11970: <td>MIREDO_GROUP</td>
1.156 leot 11971: </tr>
11972: <tr>
1.178 ! rillig 11973: <td>MIREDO_USER</td>
1.159 rillig 11974: <td>MISSING_FEATURES</td>
1.156 leot 11975: </tr>
11976: <tr>
1.178 ! rillig 11977: <td>MKDIR</td>
1.159 rillig 11978: <td>MLDONKEY_GROUP</td>
1.156 leot 11979: </tr>
11980: <tr>
1.178 ! rillig 11981: <td>MLDONKEY_HOME</td>
1.159 rillig 11982: <td>MLDONKEY_USER</td>
1.156 leot 11983: </tr>
11984: <tr>
1.178 ! rillig 11985: <td>MONOTONE_GROUP</td>
1.159 rillig 11986: <td>MONOTONE_USER</td>
1.156 leot 11987: </tr>
11988: <tr>
1.178 ! rillig 11989: <td>MOTIFBASE</td>
1.159 rillig 11990: <td>MOTIF_TYPE</td>
1.156 leot 11991: </tr>
11992: <tr>
1.178 ! rillig 11993: <td>MOTIF_TYPE_DEFAULT</td>
1.159 rillig 11994: <td>MPI_TYPE</td>
1.156 leot 11995: </tr>
11996: <tr>
1.178 ! rillig 11997: <td>MSGFMT_STRIP_MSGCTXT</td>
1.159 rillig 11998: <td>MSGFMT_STRIP_MSGID_PLURAL</td>
1.156 leot 11999: </tr>
12000: <tr>
1.178 ! rillig 12001: <td>MTOOLS_ENABLE_FLOPPYD</td>
1.159 rillig 12002: <td>MUST</td>
1.156 leot 12003: </tr>
12004: <tr>
1.178 ! rillig 12005: <td>MV</td>
1.159 rillig 12006: <td>MYSQL_CHARSET</td>
1.156 leot 12007: </tr>
12008: <tr>
1.178 ! rillig 12009: <td>MYSQL_DATADIR</td>
1.159 rillig 12010: <td>MYSQL_EXTRA_CHARSET</td>
1.156 leot 12011: </tr>
12012: <tr>
1.178 ! rillig 12013: <td>MYSQL_GROUP</td>
1.159 rillig 12014: <td>MYSQL_PKGSRCDIR</td>
1.156 leot 12015: </tr>
12016: <tr>
1.178 ! rillig 12017: <td>MYSQL_USER</td>
1.159 rillig 12018: <td>MYSQL_VERSIONS_ACCEPTED</td>
1.156 leot 12019: </tr>
12020: <tr>
1.178 ! rillig 12021: <td>MYSQL_VERSION_DEFAULT</td>
1.159 rillig 12022: <td>NAGIOSCMD_GROUP</td>
1.156 leot 12023: </tr>
12024: <tr>
1.178 ! rillig 12025: <td>NAGIOSDIR</td>
1.159 rillig 12026: <td>NAGIOS_GROUP</td>
1.156 leot 12027: </tr>
12028: <tr>
1.178 ! rillig 12029: <td>NAGIOS_USER</td>
1.159 rillig 12030: <td>NATIVE_APPEND_ABI</td>
1.156 leot 12031: </tr>
12032: <tr>
1.178 ! rillig 12033: <td>NATIVE_APPEND_ELF</td>
1.159 rillig 12034: <td>NATIVE_EXEC_FMT</td>
1.156 leot 12035: </tr>
12036: <tr>
1.178 ! rillig 12037: <td>NATIVE_MACHINE_PLATFORM</td>
1.159 rillig 12038: <td>NATIVE_OBJECT_FMT</td>
1.156 leot 12039: </tr>
12040: <tr>
1.178 ! rillig 12041: <td>NBPAX_PROGRAM_PREFIX</td>
1.159 rillig 12042: <td>NETBSD_LOGIN_NAME</td>
1.178 ! rillig 12043: </tr>
! 12044: <tr>
1.172 rillig 12045: <td>NMH_EDITOR</td>
1.178 ! rillig 12046: <td>NMH_MTA</td>
1.156 leot 12047: </tr>
12048: <tr>
1.172 rillig 12049: <td>NMH_PAGER</td>
1.178 ! rillig 12050: <td>NOLOGIN</td>
1.156 leot 12051: </tr>
12052: <tr>
1.177 leot 12053: <td>NOTE</td>
1.178 ! rillig 12054: <td>NOT_FOR_PLATFORM</td>
1.156 leot 12055: </tr>
12056: <tr>
1.177 leot 12057: <td>NOT_PAX_ASLR_SAFE</td>
1.178 ! rillig 12058: <td>NOT_PAX_MPROTECT_SAFE</td>
1.156 leot 12059: </tr>
12060: <tr>
1.177 leot 12061: <td>NO_BUILD</td>
1.178 ! rillig 12062: <td>NO_CHECKSUM</td>
1.156 leot 12063: </tr>
12064: <tr>
1.177 leot 12065: <td>NO_CONFIGURE</td>
1.178 ! rillig 12066: <td>NO_SKIP</td>
1.156 leot 12067: </tr>
12068: <tr>
1.177 leot 12069: <td>NS_PREFERRED</td>
1.178 ! rillig 12070: <td>NULLMAILER_GROUP</td>
1.156 leot 12071: </tr>
12072: <tr>
1.177 leot 12073: <td>NULLMAILER_USER</td>
1.178 ! rillig 12074: <td>OASIS</td>
1.156 leot 12075: </tr>
12076: <tr>
1.177 leot 12077: <td>OASIS_BUILD_ARGS</td>
1.178 ! rillig 12078: <td>OBJHOSTNAME</td>
1.156 leot 12079: </tr>
12080: <tr>
1.177 leot 12081: <td>OBJMACHINE</td>
1.178 ! rillig 12082: <td>OCAML_FINDLIB_DIRS</td>
1.156 leot 12083: </tr>
12084: <tr>
1.177 leot 12085: <td>OCAML_FINDLIB_REGISTER</td>
1.178 ! rillig 12086: <td>OCAML_FINDLIB_REGISTER_VERBOSE</td>
1.156 leot 12087: </tr>
12088: <tr>
1.177 leot 12089: <td>OCAML_SITELIBDIR</td>
1.178 ! rillig 12090: <td>OCAML_TOPKG_DOCDIR</td>
1.156 leot 12091: </tr>
12092: <tr>
1.177 leot 12093: <td>OCAML_USE_DUNE</td>
1.178 ! rillig 12094: <td>OCAML_USE_FINDLIB</td>
1.156 leot 12095: </tr>
12096: <tr>
1.177 leot 12097: <td>OCAML_USE_JBUILDER</td>
1.178 ! rillig 12098: <td>OCAML_USE_OASIS</td>
1.156 leot 12099: </tr>
12100: <tr>
1.177 leot 12101: <td>OCAML_USE_OASIS_DYNRUN</td>
1.178 ! rillig 12102: <td>OCAML_USE_OPAM</td>
1.156 leot 12103: </tr>
12104: <tr>
1.177 leot 12105: <td>OCAML_USE_OPT_COMPILER</td>
1.178 ! rillig 12106: <td>OCAML_USE_TOPKG</td>
1.156 leot 12107: </tr>
12108: <tr>
1.177 leot 12109: <td>OMF</td>
1.178 ! rillig 12110: <td>ONLY_FOR_COMPILER</td>
1.156 leot 12111: </tr>
12112: <tr>
1.177 leot 12113: <td>ONLY_FOR_PLATFORM</td>
1.178 ! rillig 12114: <td>OPENSSH_CHROOT</td>
1.156 leot 12115: </tr>
12116: <tr>
1.177 leot 12117: <td>OPENSSH_GROUP</td>
1.178 ! rillig 12118: <td>OPENSSH_USER</td>
1.156 leot 12119: </tr>
12120: <tr>
1.177 leot 12121: <td>OPSYS</td>
1.178 ! rillig 12122: <td>OPSYS_EMULDIR</td>
1.156 leot 12123: </tr>
12124: <tr>
1.177 leot 12125: <td>OSS_TYPE</td>
1.178 ! rillig 12126: <td>OSX</td>
1.156 leot 12127: </tr>
12128: <tr>
1.177 leot 12129: <td>OSX_TOLERATE_SDK_SKEW</td>
1.178 ! rillig 12130: <td>OS_HAVE_ALSA</td>
1.177 leot 12131: </tr>
12132: <tr>
12133: <td>OS_HAVE_RCD</td>
1.178 ! rillig 12134: <td>OS_VARIANT</td>
1.156 leot 12135: </tr>
12136: <tr>
1.177 leot 12137: <td>OS_VERSION</td>
1.178 ! rillig 12138: <td>OTF_FONTS_DIR</td>
1.159 rillig 12139: </tr>
12140: <tr>
1.177 leot 12141: <td>OVERRIDE_DIRDEPTH</td>
1.178 ! rillig 12142: <td>OVERRIDE_GEMSPEC</td>
1.156 leot 12143: </tr>
12144: <tr>
1.177 leot 12145: <td>OVERRIDE_GNU_CONFIG_SCRIPTS</td>
1.178 ! rillig 12146: <td>OVERRIDE_ROCKSPEC</td>
1.156 leot 12147: </tr>
12148: <tr>
1.175 gutterid 12149: <td>OWN_DIRS</td>
1.178 ! rillig 12150: <td>OWN_DIRS_PERMS</td>
1.161 leot 12151: </tr>
12152: <tr>
1.175 gutterid 12153: <td>P4GROUP</td>
1.178 ! rillig 12154: <td>P4PORT</td>
1.156 leot 12155: </tr>
12156: <tr>
1.175 gutterid 12157: <td>P4ROOT</td>
1.178 ! rillig 12158: <td>P4USER</td>
1.156 leot 12159: </tr>
12160: <tr>
1.175 gutterid 12161: <td>PACKAGES</td>
1.178 ! rillig 12162: <td>PALMOS_DEFAULT_SDK</td>
1.156 leot 12163: </tr>
12164: <tr>
1.175 gutterid 12165: <td>PAMBASE</td>
1.178 ! rillig 12166: <td>PAM_DEFAULT</td>
1.156 leot 12167: </tr>
12168: <tr>
1.175 gutterid 12169: <td>PAPERSIZE</td>
1.178 ! rillig 12170: <td>PASSIVE_FETCH</td>
1.156 leot 12171: </tr>
12172: <tr>
1.175 gutterid 12173: <td>PATCHDIR</td>
1.178 ! rillig 12174: <td>PATCHFILES</td>
1.156 leot 12175: </tr>
12176: <tr>
1.175 gutterid 12177: <td>PATCH_ARGS</td>
1.178 ! rillig 12178: <td>PATCH_DEBUG</td>
1.156 leot 12179: </tr>
12180: <tr>
1.175 gutterid 12181: <td>PATCH_DIST_ARGS</td>
1.178 ! rillig 12182: <td>PATCH_DIST_CAT</td>
1.169 rillig 12183: </tr>
12184: <tr>
1.175 gutterid 12185: <td>PATCH_DIST_STRIP</td>
1.178 ! rillig 12186: <td>PATCH_FUZZ_FACTOR</td>
1.156 leot 12187: </tr>
12188: <tr>
1.175 gutterid 12189: <td>PATCH_STRIP</td>
1.178 ! rillig 12190: <td>PATH</td>
1.156 leot 12191: </tr>
12192: <tr>
1.169 rillig 12193: <td>PCCBASE</td>
1.178 ! rillig 12194: <td>PEAR</td>
1.156 leot 12195: </tr>
12196: <tr>
1.177 leot 12197: <td>PEAR_CHANNEL</td>
1.178 ! rillig 12198: <td>PEAR_CHANNEL_ALIAS</td>
1.177 leot 12199: </tr>
12200: <tr>
12201: <td>PEAR_CHANNEL_VERSION</td>
1.178 ! rillig 12202: <td>PEAR_CMD</td>
1.177 leot 12203: </tr>
12204: <tr>
1.175 gutterid 12205: <td>PEAR_LIB</td>
1.178 ! rillig 12206: <td>PEAR_PACKAGE_XML</td>
1.161 leot 12207: </tr>
12208: <tr>
1.175 gutterid 12209: <td>PERL5</td>
1.178 ! rillig 12210: <td>PERL5_CONFIGURE</td>
1.161 leot 12211: </tr>
12212: <tr>
1.175 gutterid 12213: <td>PERL5_CONFIGURE_DIRS</td>
1.178 ! rillig 12214: <td>PERL5_LDFLAGS</td>
1.156 leot 12215: </tr>
12216: <tr>
1.175 gutterid 12217: <td>PERL5_LICENSE</td>
1.178 ! rillig 12218: <td>PERL5_MODULE_TYPE</td>
1.156 leot 12219: </tr>
12220: <tr>
1.175 gutterid 12221: <td>PERL5_PACKLIST</td>
1.178 ! rillig 12222: <td>PERL5_PACKLIST_DIR</td>
1.156 leot 12223: </tr>
12224: <tr>
1.175 gutterid 12225: <td>PERL5_PERLBASE</td>
1.178 ! rillig 12226: <td>PERL5_SITEBASE</td>
1.156 leot 12227: </tr>
12228: <tr>
1.175 gutterid 12229: <td>PERL5_USE_PACKLIST</td>
1.178 ! rillig 12230: <td>PERL5_VENDORBASE</td>
1.156 leot 12231: </tr>
12232: <tr>
1.175 gutterid 12233: <td>PFCTL</td>
1.178 ! rillig 12234: <td>PFVAR_H</td>
1.156 leot 12235: </tr>
12236: <tr>
1.175 gutterid 12237: <td>PF_VERSION</td>
1.178 ! rillig 12238: <td>PGGROUP</td>
1.156 leot 12239: </tr>
12240: <tr>
1.175 gutterid 12241: <td>PGHOME</td>
1.178 ! rillig 12242: <td>PGPKGSRCDIR</td>
1.156 leot 12243: </tr>
12244: <tr>
1.175 gutterid 12245: <td>PGSQL_TYPE</td>
1.178 ! rillig 12246: <td>PGSQL_VERSIONS_ACCEPTED</td>
1.156 leot 12247: </tr>
12248: <tr>
1.175 gutterid 12249: <td>PGSQL_VERSION_DEFAULT</td>
1.178 ! rillig 12250: <td>PGUSER</td>
1.156 leot 12251: </tr>
12252: <tr>
1.175 gutterid 12253: <td>PG_LIB_EXT</td>
1.178 ! rillig 12254: <td>PHP</td>
1.156 leot 12255: </tr>
12256: <tr>
1.175 gutterid 12257: <td>PHPCOMMON_MK</td>
1.178 ! rillig 12258: <td>PHPPKGSRCDIR</td>
1.156 leot 12259: </tr>
12260: <tr>
1.175 gutterid 12261: <td>PHP_BASE_VERS</td>
1.178 ! rillig 12262: <td>PHP_CHECK_INSTALLED</td>
1.156 leot 12263: </tr>
12264: <tr>
1.175 gutterid 12265: <td>PHP_EXTENSION_DIR</td>
1.178 ! rillig 12266: <td>PHP_INITIAL_TEENY</td>
1.156 leot 12267: </tr>
12268: <tr>
1.175 gutterid 12269: <td>PHP_PKG_PREFIX</td>
1.178 ! rillig 12270: <td>PHP_VERSION</td>
1.156 leot 12271: </tr>
12272: <tr>
1.175 gutterid 12273: <td>PHP_VERSIONS_ACCEPTED</td>
1.178 ! rillig 12274: <td>PHP_VERSIONS_INCOMPATIBLE</td>
1.156 leot 12275: </tr>
12276: <tr>
1.175 gutterid 12277: <td>PHP_VERSION_DEFAULT</td>
1.178 ! rillig 12278: <td>PHP_VERSION_REQD</td>
1.156 leot 12279: </tr>
12280: <tr>
1.175 gutterid 12281: <td>PILRC_USE_GTK</td>
1.178 ! rillig 12282: <td>PKGCONFIG_BASE</td>
1.156 leot 12283: </tr>
12284: <tr>
1.175 gutterid 12285: <td>PKGCONFIG_FILE</td>
1.178 ! rillig 12286: <td>PKGCONFIG_OVERRIDE</td>
1.156 leot 12287: </tr>
12288: <tr>
1.175 gutterid 12289: <td>PKGCONFIG_OVERRIDE_STAGE</td>
1.178 ! rillig 12290: <td>PKGDIR</td>
1.156 leot 12291: </tr>
12292: <tr>
1.175 gutterid 12293: <td>PKGGNUDIR</td>
1.178 ! rillig 12294: <td>PKGINFODIR</td>
1.156 leot 12295: </tr>
12296: <tr>
1.175 gutterid 12297: <td>PKGLOCALEDIR</td>
1.178 ! rillig 12298: <td>PKGMANDIR</td>
1.156 leot 12299: </tr>
12300: <tr>
1.175 gutterid 12301: <td>PKGNAME</td>
1.178 ! rillig 12302: <td>PKGNAME_REQD</td>
1.156 leot 12303: </tr>
12304: <tr>
1.175 gutterid 12305: <td>PKGPATH</td>
1.178 ! rillig 12306: <td>PKGREVISION</td>
1.156 leot 12307: </tr>
12308: <tr>
1.177 leot 12309: <td>PKGSRC_BLAS_TYPES</td>
1.178 ! rillig 12310: <td>PKGSRC_CHANGES</td>
1.177 leot 12311: </tr>
12312: <tr>
12313: <td>PKGSRC_COMPILER</td>
1.178 ! rillig 12314: <td>PKGSRC_KEEP_BIN_PKGS</td>
1.156 leot 12315: </tr>
12316: <tr>
1.177 leot 12317: <td>PKGSRC_LOCKTYPE</td>
1.178 ! rillig 12318: <td>PKGSRC_MAKE_ENV</td>
1.159 rillig 12319: </tr>
12320: <tr>
1.177 leot 12321: <td>PKGSRC_MESSAGE_RECIPIENTS</td>
1.178 ! rillig 12322: <td>PKGSRC_MKPIE</td>
1.156 leot 12323: </tr>
12324: <tr>
1.177 leot 12325: <td>PKGSRC_MKREPRO</td>
1.178 ! rillig 12326: <td>PKGSRC_RUN_TEST</td>
1.156 leot 12327: </tr>
12328: <tr>
1.177 leot 12329: <td>PKGSRC_SETENV</td>
1.178 ! rillig 12330: <td>PKGSRC_SLEEPSECS</td>
1.156 leot 12331: </tr>
12332: <tr>
1.177 leot 12333: <td>PKGSRC_TODO</td>
1.178 ! rillig 12334: <td>PKGSRC_USE_CTF</td>
1.156 leot 12335: </tr>
12336: <tr>
1.177 leot 12337: <td>PKGSRC_USE_FORTIFY</td>
1.178 ! rillig 12338: <td>PKGSRC_USE_RELRO</td>
1.156 leot 12339: </tr>
12340: <tr>
1.177 leot 12341: <td>PKGSRC_USE_SSP</td>
1.178 ! rillig 12342: <td>PKGSRC_USE_STACK_CHECK</td>
1.156 leot 12343: </tr>
12344: <tr>
1.177 leot 12345: <td>PKGTASKS_DATAFILE</td>
1.178 ! rillig 12346: <td>PKGTOOLS_ARGS</td>
1.156 leot 12347: </tr>
12348: <tr>
1.177 leot 12349: <td>PKGTOOLS_ENV</td>
1.178 ! rillig 12350: <td>PKG_ALTERNATIVES</td>
1.156 leot 12351: </tr>
12352: <tr>
1.177 leot 12353: <td>PKG_APACHE</td>
1.178 ! rillig 12354: <td>PKG_APACHE_ACCEPTED</td>
1.156 leot 12355: </tr>
12356: <tr>
1.177 leot 12357: <td>PKG_APACHE_DEFAULT</td>
1.178 ! rillig 12358: <td>PKG_BEST_EXISTS</td>
1.156 leot 12359: </tr>
12360: <tr>
1.177 leot 12361: <td>PKG_BUILD_OPTIONS</td>
1.178 ! rillig 12362: <td>PKG_COMPRESSION</td>
1.156 leot 12363: </tr>
12364: <tr>
1.177 leot 12365: <td>PKG_CONFIG</td>
1.178 ! rillig 12366: <td>PKG_CONFIG_PERMS</td>
1.156 leot 12367: </tr>
12368: <tr>
1.177 leot 12369: <td>PKG_CREATE_USERGROUP</td>
1.178 ! rillig 12370: <td>PKG_DB_TMPDIR</td>
1.156 leot 12371: </tr>
12372: <tr>
1.177 leot 12373: <td>PKG_DEBUG_LEVEL</td>
1.178 ! rillig 12374: <td>PKG_DEFAULT_OPTIONS</td>
1.156 leot 12375: </tr>
12376: <tr>
1.177 leot 12377: <td>PKG_DESTDIR_SUPPORT</td>
1.178 ! rillig 12378: <td>PKG_DEVELOPER</td>
1.156 leot 12379: </tr>
12380: <tr>
1.177 leot 12381: <td>PKG_DISABLED_OPTIONS</td>
1.178 ! rillig 12382: <td>PKG_FATAL_ERRORS</td>
1.156 leot 12383: </tr>
12384: <tr>
1.177 leot 12385: <td>PKG_FC</td>
1.178 ! rillig 12386: <td>PKG_FILELIST_CMD</td>
1.156 leot 12387: </tr>
12388: <tr>
1.177 leot 12389: <td>PKG_GECOS</td>
1.178 ! rillig 12390: <td>PKG_GID</td>
1.156 leot 12391: </tr>
12392: <tr>
1.177 leot 12393: <td>PKG_GROUPS</td>
1.178 ! rillig 12394: <td>PKG_GROUPS_VARS</td>
1.156 leot 12395: </tr>
12396: <tr>
1.177 leot 12397: <td>PKG_HOME</td>
1.178 ! rillig 12398: <td>PKG_INIT_SCRIPTS</td>
1.156 leot 12399: </tr>
12400: <tr>
1.177 leot 12401: <td>PKG_JAVA_HOME</td>
1.178 ! rillig 12402: <td>PKG_JVM</td>
1.156 leot 12403: </tr>
12404: <tr>
1.177 leot 12405: <td>PKG_JVMS_ACCEPTED</td>
1.178 ! rillig 12406: <td>PKG_JVM_DEFAULT</td>
1.156 leot 12407: </tr>
12408: <tr>
1.177 leot 12409: <td>PKG_LEGACY_OPTIONS</td>
1.178 ! rillig 12410: <td>PKG_LIBTOOL</td>
1.156 leot 12411: </tr>
12412: <tr>
1.177 leot 12413: <td>PKG_OPTIONS</td>
1.178 ! rillig 12414: <td>PKG_OPTIONS_DEPRECATED_WARNINGS</td>
1.156 leot 12415: </tr>
12416: <tr>
1.177 leot 12417: <td>PKG_OPTIONS_LEGACY_OPTS</td>
1.178 ! rillig 12418: <td>PKG_OPTIONS_LEGACY_VARS</td>
1.156 leot 12419: </tr>
12420: <tr>
1.177 leot 12421: <td>PKG_OPTIONS_NONEMPTY_SETS</td>
1.178 ! rillig 12422: <td>PKG_OPTIONS_OPTIONAL_GROUPS</td>
1.156 leot 12423: </tr>
12424: <tr>
1.177 leot 12425: <td>PKG_OPTIONS_REQUIRED_GROUPS</td>
1.178 ! rillig 12426: <td>PKG_OPTIONS_VAR</td>
1.156 leot 12427: </tr>
12428: <tr>
1.177 leot 12429: <td>PKG_PHP</td>
1.178 ! rillig 12430: <td>PKG_PHP_MAJOR_VERS</td>
1.156 leot 12431: </tr>
12432: <tr>
1.177 leot 12433: <td>PKG_PHP_VERSION</td>
1.178 ! rillig 12434: <td>PKG_RCD_SCRIPTS</td>
1.156 leot 12435: </tr>
12436: <tr>
1.177 leot 12437: <td>PKG_REFCOUNT_DBDIR</td>
1.178 ! rillig 12438: <td>PKG_REGISTER_SHELLS</td>
1.156 leot 12439: </tr>
12440: <tr>
1.177 leot 12441: <td>PKG_RESUME_TRANSFERS</td>
1.178 ! rillig 12442: <td>PKG_SHELL</td>
1.156 leot 12443: </tr>
12444: <tr>
1.177 leot 12445: <td>PKG_SUGGESTED_OPTIONS</td>
1.178 ! rillig 12446: <td>PKG_SUPPORTED_OPTIONS</td>
1.156 leot 12447: </tr>
12448: <tr>
1.177 leot 12449: <td>PKG_SYSCONFBASE</td>
1.178 ! rillig 12450: <td>PKG_SYSCONFBASEDIR</td>
1.156 leot 12451: </tr>
12452: <tr>
1.177 leot 12453: <td>PKG_SYSCONFDIR</td>
1.178 ! rillig 12454: <td>PKG_SYSCONFDIR_PERMS</td>
1.156 leot 12455: </tr>
12456: <tr>
1.177 leot 12457: <td>PKG_SYSCONFSUBDIR</td>
1.178 ! rillig 12458: <td>PKG_SYSCONFVAR</td>
1.156 leot 12459: </tr>
12460: <tr>
1.177 leot 12461: <td>PKG_TOOLS_BIN</td>
1.178 ! rillig 12462: <td>PKG_UID</td>
1.156 leot 12463: </tr>
12464: <tr>
1.177 leot 12465: <td>PKG_UPDATE_FONTS_DB</td>
1.178 ! rillig 12466: <td>PKG_USERS</td>
1.156 leot 12467: </tr>
12468: <tr>
1.177 leot 12469: <td>PKG_USERS_VARS</td>
1.178 ! rillig 12470: <td>PKG_VERBOSE</td>
1.156 leot 12471: </tr>
12472: <tr>
1.177 leot 12473: <td>PLIST</td>
1.178 ! rillig 12474: <td>PLIST_AWK</td>
1.156 leot 12475: </tr>
12476: <tr>
1.177 leot 12477: <td>PLIST_AWK_ENV</td>
1.178 ! rillig 12478: <td>PLIST_SRC</td>
1.156 leot 12479: </tr>
12480: <tr>
1.177 leot 12481: <td>PLIST_SUBST</td>
1.178 ! rillig 12482: <td>PLIST_TYPE</td>
1.156 leot 12483: </tr>
12484: <tr>
1.177 leot 12485: <td>PLIST_VARS</td>
1.178 ! rillig 12486: <td>POPTOP_USE_MPPE</td>
1.156 leot 12487: </tr>
12488: <tr>
1.177 leot 12489: <td>POSSIBLE_GFORTRAN_VERSION</td>
1.178 ! rillig 12490: <td>POST_FETCH_HOOK</td>
1.156 leot 12491: </tr>
12492: <tr>
1.177 leot 12493: <td>PREFER</td>
1.178 ! rillig 12494: <td>PREFER_NATIVE</td>
1.156 leot 12495: </tr>
12496: <tr>
1.177 leot 12497: <td>PREFER_NATIVE_PTHREADS</td>
1.178 ! rillig 12498: <td>PREFER_PKGSRC</td>
1.156 leot 12499: </tr>
12500: <tr>
1.177 leot 12501: <td>PREFIX</td>
1.178 ! rillig 12502: <td>PREPEND_PATH</td>
1.156 leot 12503: </tr>
12504: <tr>
1.177 leot 12505: <td>PRE_ROOT_CMD</td>
1.178 ! rillig 12506: <td>PRIVILEGED_STAGES</td>
1.156 leot 12507: </tr>
12508: <tr>
1.177 leot 12509: <td>PS</td>
1.178 ! rillig 12510: <td>PTHREAD_AUTO_VARS</td>
1.156 leot 12511: </tr>
12512: <tr>
1.177 leot 12513: <td>PTHREAD_CFLAGS</td>
1.178 ! rillig 12514: <td>PTHREAD_LDFLAGS</td>
1.156 leot 12515: </tr>
12516: <tr>
1.177 leot 12517: <td>PTHREAD_LIBS</td>
1.178 ! rillig 12518: <td>PTHREAD_OPTS</td>
1.156 leot 12519: </tr>
12520: <tr>
1.177 leot 12521: <td>PTHREAD_TYPE</td>
1.178 ! rillig 12522: <td>PVM_SSH</td>
1.156 leot 12523: </tr>
12524: <tr>
1.177 leot 12525: <td>PYPKGPREFIX</td>
1.178 ! rillig 12526: <td>PYTHON_FOR_BUILD_ONLY</td>
1.156 leot 12527: </tr>
12528: <tr>
1.177 leot 12529: <td>PYTHON_SELF_CONFLICT</td>
1.178 ! rillig 12530: <td>PYTHON_VERSIONED_DEPENDENCIES</td>
1.156 leot 12531: </tr>
12532: <tr>
1.177 leot 12533: <td>PYTHON_VERSIONS_ACCEPTED</td>
1.178 ! rillig 12534: <td>PYTHON_VERSIONS_INCOMPATIBLE</td>
1.156 leot 12535: </tr>
12536: <tr>
1.177 leot 12537: <td>PYTHON_VERSION_DEFAULT</td>
1.178 ! rillig 12538: <td>PYTHON_VERSION_REQD</td>
1.156 leot 12539: </tr>
12540: <tr>
1.177 leot 12541: <td>PYVERSSUFFIX</td>
1.178 ! rillig 12542: <td>PY_NO_EGG</td>
1.156 leot 12543: </tr>
12544: <tr>
1.177 leot 12545: <td>QMAILDIR</td>
1.178 ! rillig 12546: <td>QMAIL_ALIAS_USER</td>
1.156 leot 12547: </tr>
12548: <tr>
1.177 leot 12549: <td>QMAIL_DAEMON_USER</td>
1.178 ! rillig 12550: <td>QMAIL_LOG_USER</td>
1.156 leot 12551: </tr>
12552: <tr>
1.177 leot 12553: <td>QMAIL_NOFILES_GROUP</td>
1.178 ! rillig 12554: <td>QMAIL_PASSWD_USER</td>
1.156 leot 12555: </tr>
12556: <tr>
1.177 leot 12557: <td>QMAIL_QMAIL_GROUP</td>
1.178 ! rillig 12558: <td>QMAIL_QUEUE_DIR</td>
1.156 leot 12559: </tr>
12560: <tr>
1.177 leot 12561: <td>QMAIL_QUEUE_EXTRA</td>
1.178 ! rillig 12562: <td>QMAIL_QUEUE_USER</td>
1.156 leot 12563: </tr>
12564: <tr>
1.177 leot 12565: <td>QMAIL_REMOTE_USER</td>
1.178 ! rillig 12566: <td>QMAIL_ROOT_USER</td>
1.156 leot 12567: </tr>
12568: <tr>
1.177 leot 12569: <td>QMAIL_SEND_USER</td>
1.178 ! rillig 12570: <td>QPOPPER_FAC</td>
1.156 leot 12571: </tr>
12572: <tr>
1.177 leot 12573: <td>QPOPPER_SPOOL_DIR</td>
1.178 ! rillig 12574: <td>QPOPPER_USER</td>
1.156 leot 12575: </tr>
12576: <tr>
1.177 leot 12577: <td>RAKE_NAME</td>
1.178 ! rillig 12578: <td>RASMOL_DEPTH</td>
1.156 leot 12579: </tr>
12580: <tr>
1.177 leot 12581: <td>RCD_DIR</td>
1.178 ! rillig 12582: <td>RCD_ORDER</td>
1.156 leot 12583: </tr>
12584: <tr>
1.174 leot 12585: <td>RCD_SCRIPTS</td>
1.178 ! rillig 12586: <td>RCD_SCRIPTS_DIR</td>
1.177 leot 12587: </tr>
12588: <tr>
12589: <td>RCD_SCRIPTS_EXAMPLEDIR</td>
1.178 ! rillig 12590: <td>RCD_SCRIPTS_MODE</td>
1.159 rillig 12591: </tr>
12592: <tr>
1.177 leot 12593: <td>RCD_SCRIPTS_SHELL</td>
1.178 ! rillig 12594: <td>RCD_SCRIPT_SRC</td>
1.156 leot 12595: </tr>
12596: <tr>
1.177 leot 12597: <td>RCD_SUBR</td>
1.178 ! rillig 12598: <td>RDOC</td>
1.156 leot 12599: </tr>
12600: <tr>
1.175 gutterid 12601: <td>READLINE_DEFAULT</td>
1.178 ! rillig 12602: <td>READLINE_TYPE</td>
1.161 leot 12603: </tr>
12604: <tr>
1.175 gutterid 12605: <td>REAL_ROOT_GROUP</td>
1.178 ! rillig 12606: <td>REAL_ROOT_USER</td>
1.156 leot 12607: </tr>
12608: <tr>
1.175 gutterid 12609: <td>RECURSIVE_MAKE</td>
1.178 ! rillig 12610: <td>RELAY_CTRL_DIR</td>
1.156 leot 12611: </tr>
12612: <tr>
1.175 gutterid 12613: <td>REPLACE_AWK</td>
1.178 ! rillig 12614: <td>REPLACE_BASH</td>
1.156 leot 12615: </tr>
12616: <tr>
1.175 gutterid 12617: <td>REPLACE_CSH</td>
1.178 ! rillig 12618: <td>REPLACE_KSH</td>
1.156 leot 12619: </tr>
12620: <tr>
1.175 gutterid 12621: <td>REPLACE_PERL</td>
1.178 ! rillig 12622: <td>REPLACE_PERL6</td>
1.156 leot 12623: </tr>
12624: <tr>
1.175 gutterid 12625: <td>REPLACE_PHP</td>
1.178 ! rillig 12626: <td>REPLACE_PYTHON</td>
1.156 leot 12627: </tr>
12628: <tr>
1.175 gutterid 12629: <td>REPLACE_RUBY</td>
1.178 ! rillig 12630: <td>REPLACE_RUBY_DIRS</td>
1.166 leot 12631: </tr>
12632: <tr>
1.175 gutterid 12633: <td>REPLACE_RUBY_PAT</td>
1.178 ! rillig 12634: <td>REPLACE_SH</td>
1.156 leot 12635: </tr>
12636: <tr>
1.175 gutterid 12637: <td>REPLACE_TEXLUA</td>
1.178 ! rillig 12638: <td>REQD_DIRS</td>
1.156 leot 12639: </tr>
12640: <tr>
1.175 gutterid 12641: <td>REQD_DIRS_PERMS</td>
1.178 ! rillig 12642: <td>REQD_FILES</td>
1.156 leot 12643: </tr>
12644: <tr>
1.175 gutterid 12645: <td>REQD_FILES_MODE</td>
1.178 ! rillig 12646: <td>REQD_FILES_PERMS</td>
1.156 leot 12647: </tr>
12648: <tr>
1.175 gutterid 12649: <td>RESOLV_AUTO_VARS</td>
1.178 ! rillig 12650: <td>RESOLV_LDFLAGS</td>
1.156 leot 12651: </tr>
12652: <tr>
1.175 gutterid 12653: <td>RESOLV_LIBS</td>
1.178 ! rillig 12654: <td>RM</td>
1.156 leot 12655: </tr>
12656: <tr>
1.177 leot 12657: <td>ROCKSPEC_NAME</td>
1.178 ! rillig 12658: <td>ROCKSPEC_SPECFILE</td>
1.177 leot 12659: </tr>
12660: <tr>
1.175 gutterid 12661: <td>ROOT_CMD</td>
1.178 ! rillig 12662: <td>ROOT_GROUP</td>
1.156 leot 12663: </tr>
12664: <tr>
1.175 gutterid 12665: <td>ROOT_USER</td>
1.178 ! rillig 12666: <td>RPCGEN</td>
1.156 leot 12667: </tr>
12668: <tr>
1.175 gutterid 12669: <td>RPM</td>
1.178 ! rillig 12670: <td>RPM2PKG_PLIST</td>
1.156 leot 12671: </tr>
12672: <tr>
1.175 gutterid 12673: <td>RPM2PKG_PREFIX</td>
1.178 ! rillig 12674: <td>RPM2PKG_STAGE</td>
1.156 leot 12675: </tr>
12676: <tr>
1.175 gutterid 12677: <td>RPM2PKG_STRIP</td>
1.178 ! rillig 12678: <td>RPM2PKG_SUBPREFIX</td>
1.156 leot 12679: </tr>
12680: <tr>
1.175 gutterid 12681: <td>RPMFILES</td>
1.178 ! rillig 12682: <td>RPMIGNOREPATH</td>
1.156 leot 12683: </tr>
12684: <tr>
1.175 gutterid 12685: <td>RPM_DB_PREFIX</td>
1.178 ! rillig 12686: <td>RSSH_CVS_PATH</td>
1.156 leot 12687: </tr>
12688: <tr>
1.175 gutterid 12689: <td>RSSH_RDIST_PATH</td>
1.178 ! rillig 12690: <td>RSSH_RSYNC_PATH</td>
1.156 leot 12691: </tr>
12692: <tr>
1.175 gutterid 12693: <td>RSSH_SCP_PATH</td>
1.178 ! rillig 12694: <td>RSSH_SFTP_SERVER_PATH</td>
1.156 leot 12695: </tr>
12696: <tr>
1.175 gutterid 12697: <td>RUBY</td>
1.178 ! rillig 12698: <td>RUBYGEM</td>
1.156 leot 12699: </tr>
12700: <tr>
1.175 gutterid 12701: <td>RUBYGEM_NAME</td>
1.178 ! rillig 12702: <td>RUBYGEM_OPTIONS</td>
1.156 leot 12703: </tr>
12704: <tr>
1.175 gutterid 12705: <td>RUBY_ABI_VERSION</td>
1.178 ! rillig 12706: <td>RUBY_ARCH</td>
1.156 leot 12707: </tr>
12708: <tr>
1.175 gutterid 12709: <td>RUBY_ARCHINC</td>
1.178 ! rillig 12710: <td>RUBY_ARCHLIB</td>
1.156 leot 12711: </tr>
12712: <tr>
1.175 gutterid 12713: <td>RUBY_BASE</td>
1.178 ! rillig 12714: <td>RUBY_BASERIDIR</td>
1.156 leot 12715: </tr>
12716: <tr>
1.175 gutterid 12717: <td>RUBY_BUILD_DOCUMENT</td>
1.178 ! rillig 12718: <td>RUBY_DLEXT</td>
1.156 leot 12719: </tr>
12720: <tr>
1.175 gutterid 12721: <td>RUBY_DOC</td>
1.178 ! rillig 12722: <td>RUBY_DYNAMIC_DIRS</td>
1.156 leot 12723: </tr>
12724: <tr>
1.175 gutterid 12725: <td>RUBY_EG</td>
1.178 ! rillig 12726: <td>RUBY_ENCODING_ARG</td>
1.156 leot 12727: </tr>
12728: <tr>
1.175 gutterid 12729: <td>RUBY_EXTCONF</td>
1.178 ! rillig 12730: <td>RUBY_EXTCONF_CHECK</td>
1.156 leot 12731: </tr>
12732: <tr>
1.175 gutterid 12733: <td>RUBY_EXTCONF_DEBUG</td>
1.178 ! rillig 12734: <td>RUBY_EXTCONF_MAKEFILE</td>
1.156 leot 12735: </tr>
12736: <tr>
1.175 gutterid 12737: <td>RUBY_GEM_BASE</td>
1.178 ! rillig 12738: <td>RUBY_INC</td>
1.156 leot 12739: </tr>
12740: <tr>
1.175 gutterid 12741: <td>RUBY_LIB</td>
1.178 ! rillig 12742: <td>RUBY_LIB_BASE</td>
1.156 leot 12743: </tr>
12744: <tr>
1.175 gutterid 12745: <td>RUBY_NAME</td>
1.178 ! rillig 12746: <td>RUBY_NOVERSION</td>
1.156 leot 12747: </tr>
12748: <tr>
1.175 gutterid 12749: <td>RUBY_PKGPREFIX</td>
1.178 ! rillig 12750: <td>RUBY_RAILS</td>
1.156 leot 12751: </tr>
12752: <tr>
1.175 gutterid 12753: <td>RUBY_RAILS51_VERSION</td>
1.178 ! rillig 12754: <td>RUBY_RAILS52_VERSION</td>
1.156 leot 12755: </tr>
12756: <tr>
1.175 gutterid 12757: <td>RUBY_RAILS60_VERSION</td>
1.178 ! rillig 12758: <td>RUBY_RAILS_ACCEPTED</td>
1.156 leot 12759: </tr>
12760: <tr>
1.175 gutterid 12761: <td>RUBY_RAILS_DEFAULT</td>
1.178 ! rillig 12762: <td>RUBY_RAILS_REQD</td>
1.174 leot 12763: </tr>
12764: <tr>
1.175 gutterid 12765: <td>RUBY_RAILS_STRICT_DEP</td>
1.178 ! rillig 12766: <td>RUBY_RIDIR</td>
1.156 leot 12767: </tr>
12768: <tr>
1.175 gutterid 12769: <td>RUBY_SETUP</td>
1.178 ! rillig 12770: <td>RUBY_SHLIB</td>
1.156 leot 12771: </tr>
12772: <tr>
1.175 gutterid 12773: <td>RUBY_SHLIBALIAS</td>
1.178 ! rillig 12774: <td>RUBY_SHLIBVER</td>
1.156 leot 12775: </tr>
12776: <tr>
1.175 gutterid 12777: <td>RUBY_SIMPLE_INSTALL</td>
1.178 ! rillig 12778: <td>RUBY_SITEARCHLIB</td>
1.156 leot 12779: </tr>
12780: <tr>
1.175 gutterid 12781: <td>RUBY_SITELIB</td>
1.178 ! rillig 12782: <td>RUBY_SITELIB_BASE</td>
1.156 leot 12783: </tr>
12784: <tr>
1.175 gutterid 12785: <td>RUBY_SITERIDIR</td>
1.178 ! rillig 12786: <td>RUBY_SLEXT</td>
1.156 leot 12787: </tr>
12788: <tr>
1.175 gutterid 12789: <td>RUBY_SRCDIR</td>
1.178 ! rillig 12790: <td>RUBY_STATICLIB</td>
1.156 leot 12791: </tr>
12792: <tr>
1.175 gutterid 12793: <td>RUBY_SUFFIX</td>
1.178 ! rillig 12794: <td>RUBY_SYSRIDIR</td>
1.156 leot 12795: </tr>
12796: <tr>
1.175 gutterid 12797: <td>RUBY_USE_PTHREAD</td>
1.178 ! rillig 12798: <td>RUBY_VENDORARCHLIB</td>
1.156 leot 12799: </tr>
12800: <tr>
1.175 gutterid 12801: <td>RUBY_VENDORLIB</td>
1.178 ! rillig 12802: <td>RUBY_VENDORLIB_BASE</td>
1.156 leot 12803: </tr>
12804: <tr>
1.175 gutterid 12805: <td>RUBY_VER</td>
1.178 ! rillig 12806: <td>RUBY_VERSION</td>
1.156 leot 12807: </tr>
12808: <tr>
1.175 gutterid 12809: <td>RUBY_VERSIONS_ACCEPTED</td>
1.178 ! rillig 12810: <td>RUBY_VERSIONS_INCOMPATIBLE</td>
1.156 leot 12811: </tr>
12812: <tr>
1.175 gutterid 12813: <td>RUBY_VERSION_DEFAULT</td>
1.178 ! rillig 12814: <td>RUBY_VERSION_REQD</td>
1.156 leot 12815: </tr>
12816: <tr>
1.175 gutterid 12817: <td>RUBY_VER_DIR</td>
1.178 ! rillig 12818: <td>RUN</td>
1.156 leot 12819: </tr>
12820: <tr>
1.175 gutterid 12821: <td>RUN_LDCONFIG</td>
1.178 ! rillig 12822: <td>SAWFISH_THEMES</td>
1.156 leot 12823: </tr>
12824: <tr>
1.175 gutterid 12825: <td>SCO</td>
1.178 ! rillig 12826: <td>SCREWS_GROUP</td>
1.156 leot 12827: </tr>
12828: <tr>
1.175 gutterid 12829: <td>SCREWS_USER</td>
1.178 ! rillig 12830: <td>SCRIPTS_ENV</td>
1.156 leot 12831: </tr>
12832: <tr>
1.175 gutterid 12833: <td>SCROLLKEEPER_DATADIR</td>
1.178 ! rillig 12834: <td>SCROLLKEEPER_REBUILDDB</td>
1.156 leot 12835: </tr>
12836: <tr>
1.175 gutterid 12837: <td>SCROLLKEEPER_UPDATEDB</td>
1.178 ! rillig 12838: <td>SDIST_PAWD</td>
1.156 leot 12839: </tr>
12840: <tr>
1.175 gutterid 12841: <td>SERIAL_DEVICES</td>
1.178 ! rillig 12842: <td>SETGIDGAME</td>
1.156 leot 12843: </tr>
12844: <tr>
1.175 gutterid 12845: <td>SETGID_GAMES_PERMS</td>
1.178 ! rillig 12846: <td>SETUID_ROOT_PERMS</td>
1.156 leot 12847: </tr>
12848: <tr>
1.175 gutterid 12849: <td>SH</td>
1.178 ! rillig 12850: <td>SHLIB</td>
1.156 leot 12851: </tr>
12852: <tr>
1.177 leot 12853: <td>SHORTNAME</td>
1.178 ! rillig 12854: <td>SIGN_PACKAGES</td>
1.177 leot 12855: </tr>
12856: <tr>
12857: <td>SILC_CLIENT_WITH_PERL</td>
1.178 ! rillig 12858: <td>SITE_SPECIFIC_PKGS</td>
1.156 leot 12859: </tr>
12860: <tr>
1.177 leot 12861: <td>SKIP_DEPENDS</td>
1.178 ! rillig 12862: <td>SMF_INSTANCES</td>
1.156 leot 12863: </tr>
12864: <tr>
1.177 leot 12865: <td>SMF_MANIFEST</td>
1.178 ! rillig 12866: <td>SMF_METHODS</td>
1.159 rillig 12867: </tr>
12868: <tr>
1.177 leot 12869: <td>SMF_METHOD_SHELL</td>
1.178 ! rillig 12870: <td>SMF_METHOD_SRC</td>
1.156 leot 12871: </tr>
12872: <tr>
1.177 leot 12873: <td>SMF_NAME</td>
1.178 ! rillig 12874: <td>SMF_PREFIX</td>
1.156 leot 12875: </tr>
12876: <tr>
1.177 leot 12877: <td>SMF_SRCDIR</td>
1.178 ! rillig 12878: <td>SNIPROXY_GROUP</td>
1.156 leot 12879: </tr>
12880: <tr>
1.177 leot 12881: <td>SNIPROXY_USER</td>
1.178 ! rillig 12882: <td>SOURCE_BUFFSIZE</td>
1.156 leot 12883: </tr>
12884: <tr>
1.177 leot 12885: <td>SPECIAL_PERMS</td>
1.178 ! rillig 12886: <td>SPECIFIC_PKGS</td>
1.156 leot 12887: </tr>
12888: <tr>
1.177 leot 12889: <td>SSH_SUID</td>
1.178 ! rillig 12890: <td>SSP_SUPPORTED</td>
1.156 leot 12891: </tr>
12892: <tr>
1.177 leot 12893: <td>SSYNC_PAWD</td>
1.178 ! rillig 12894: <td>STEP_MSG</td>
1.156 leot 12895: </tr>
12896: <tr>
1.177 leot 12897: <td>STRIP</td>
1.178 ! rillig 12898: <td>STRIP_DBG</td>
1.156 leot 12899: </tr>
12900: <tr>
1.177 leot 12901: <td>STRIP_DEBUG</td>
1.178 ! rillig 12902: <td>STRIP_DEBUG_SUPPORTED</td>
1.156 leot 12903: </tr>
12904: <tr>
1.177 leot 12905: <td>STRIP_FILES_SKIP</td>
1.178 ! rillig 12906: <td>SU</td>
1.156 leot 12907: </tr>
12908: <tr>
1.177 leot 12909: <td>SUBDIR</td>
1.178 ! rillig 12910: <td>SUBST</td>
1.156 leot 12911: </tr>
12912: <tr>
1.177 leot 12913: <td>SUBST_CLASSES</td>
1.178 ! rillig 12914: <td>SUBST_FILES</td>
1.174 leot 12915: </tr>
12916: <tr>
1.177 leot 12917: <td>SUBST_FILTER_CMD</td>
1.178 ! rillig 12918: <td>SUBST_MESSAGE</td>
1.156 leot 12919: </tr>
12920: <tr>
1.177 leot 12921: <td>SUBST_NOOP_OK</td>
1.178 ! rillig 12922: <td>SUBST_SED</td>
1.156 leot 12923: </tr>
12924: <tr>
1.177 leot 12925: <td>SUBST_SHOW_DIFF</td>
1.178 ! rillig 12926: <td>SUBST_SKIP_TEXT_CHECK</td>
1.156 leot 12927: </tr>
12928: <tr>
1.177 leot 12929: <td>SUBST_STAGE</td>
1.178 ! rillig 12930: <td>SUBST_VARS</td>
1.156 leot 12931: </tr>
12932: <tr>
1.177 leot 12933: <td>SUNWSPROBASE</td>
1.178 ! rillig 12934: <td>SUSE_PREFER</td>
1.156 leot 12935: </tr>
12936: <tr>
1.177 leot 12937: <td>SU_CMD</td>
1.178 ! rillig 12938: <td>SVN_EXTRACTDIR</td>
1.177 leot 12939: </tr>
12940: <tr>
12941: <td>SVN_REPO</td>
1.178 ! rillig 12942: <td>SVN_REPOSITORIES</td>
1.177 leot 12943: </tr>
12944: <tr>
12945: <td>SVN_REVISION</td>
1.178 ! rillig 12946: <td>TERMCAP_TYPE</td>
1.156 leot 12947: </tr>
12948: <tr>
1.177 leot 12949: <td>TERMINFO_DEFAULT</td>
1.178 ! rillig 12950: <td>TERMINFO_TYPE</td>
1.161 leot 12951: </tr>
12952: <tr>
1.177 leot 12953: <td>TEST</td>
1.178 ! rillig 12954: <td>TEST_DEPENDS</td>
1.159 rillig 12955: </tr>
12956: <tr>
1.177 leot 12957: <td>TEST_DIRS</td>
1.178 ! rillig 12958: <td>TEST_ENV</td>
1.156 leot 12959: </tr>
12960: <tr>
1.177 leot 12961: <td>TEST_ENV_SHELL</td>
1.178 ! rillig 12962: <td>TEST_MAKE_CMD</td>
1.156 leot 12963: </tr>
12964: <tr>
1.177 leot 12965: <td>TEST_MAKE_FLAGS</td>
1.178 ! rillig 12966: <td>TEST_TARGET</td>
1.156 leot 12967: </tr>
12968: <tr>
1.177 leot 12969: <td>TEXLIVE_IGNORE_PATTERNS</td>
1.178 ! rillig 12970: <td>TEXLIVE_REV</td>
1.156 leot 12971: </tr>
12972: <tr>
1.177 leot 12973: <td>TEXLIVE_UNVERSIONED</td>
1.178 ! rillig 12974: <td>TEXMFSITE</td>
1.156 leot 12975: </tr>
12976: <tr>
1.177 leot 12977: <td>TEX_FORMATS</td>
1.178 ! rillig 12978: <td>TEX_HYPHEN_DAT</td>
1.156 leot 12979: </tr>
12980: <tr>
1.177 leot 12981: <td>TEX_HYPHEN_DEF</td>
1.178 ! rillig 12982: <td>TEX_TEXMF_DIRS</td>
1.156 leot 12983: </tr>
12984: <tr>
1.177 leot 12985: <td>THTTPD_LOG_FACILITY</td>
1.178 ! rillig 12986: <td>TO</td>
1.156 leot 12987: </tr>
12988: <tr>
1.177 leot 12989: <td>TOOLS_ALIASES</td>
1.178 ! rillig 12990: <td>TOOLS_ALWAYS_WRAP</td>
1.156 leot 12991: </tr>
12992: <tr>
1.169 rillig 12993: <td>TOOLS_ARGS</td>
1.177 leot 12994: <td>TOOLS_BROKEN</td>
1.156 leot 12995: </tr>
12996: <tr>
1.169 rillig 12997: <td>TOOLS_CMD</td>
1.177 leot 12998: <td>TOOLS_CREATE</td>
1.156 leot 12999: </tr>
13000: <tr>
1.169 rillig 13001: <td>TOOLS_DIR</td>
1.177 leot 13002: <td>TOOLS_FAIL</td>
1.156 leot 13003: </tr>
13004: <tr>
1.169 rillig 13005: <td>TOOLS_GNU_MISSING</td>
1.177 leot 13006: <td>TOOLS_LDCONFIG</td>
1.156 leot 13007: </tr>
13008: <tr>
1.169 rillig 13009: <td>TOOLS_NOOP</td>
1.177 leot 13010: <td>TOOLS_PATH</td>
1.156 leot 13011: </tr>
13012: <tr>
1.169 rillig 13013: <td>TOOLS_SCRIPT</td>
1.177 leot 13014: <td>TOOL_DEPENDS</td>
1.156 leot 13015: </tr>
13016: <tr>
1.177 leot 13017: <td>TTF_FONTDIR</td>
1.175 gutterid 13018: <td>TTF_FONTS_DIR</td>
1.161 leot 13019: </tr>
13020: <tr>
1.169 rillig 13021: <td>TYPE</td>
1.175 gutterid 13022: <td>UAC_REQD_EXECS</td>
1.156 leot 13023: </tr>
13024: <tr>
1.169 rillig 13025: <td>UCSPI_SSL_GROUP</td>
1.175 gutterid 13026: <td>UCSPI_SSL_USER</td>
1.156 leot 13027: </tr>
13028: <tr>
1.169 rillig 13029: <td>UNLIMIT_RESOURCES</td>
1.175 gutterid 13030: <td>UNPRIVILEGED</td>
1.156 leot 13031: </tr>
13032: <tr>
1.169 rillig 13033: <td>UNPRIVILEGED_GROUP</td>
1.175 gutterid 13034: <td>UNPRIVILEGED_GROUPS</td>
1.156 leot 13035: </tr>
13036: <tr>
1.169 rillig 13037: <td>UNPRIVILEGED_USER</td>
1.175 gutterid 13038: <td>UNWRAP_FILES</td>
1.156 leot 13039: </tr>
13040: <tr>
1.169 rillig 13041: <td>UNWRAP_PATTERNS</td>
1.175 gutterid 13042: <td>UPDATE_GEMSPEC</td>
1.156 leot 13043: </tr>
13044: <tr>
1.169 rillig 13045: <td>UPDATE_TARGET</td>
1.175 gutterid 13046: <td>URI</td>
1.156 leot 13047: </tr>
13048: <tr>
1.175 gutterid 13049: <td>USERGROUP_PHASE</td>
1.177 leot 13050: <td>USERPPP_GROUP</td>
1.156 leot 13051: </tr>
13052: <tr>
1.175 gutterid 13053: <td>USER_SPECIFIC_PKGS</td>
1.177 leot 13054: <td>USE_ABI_DEPENDS</td>
1.156 leot 13055: </tr>
13056: <tr>
1.175 gutterid 13057: <td>USE_APR</td>
1.177 leot 13058: <td>USE_BSD_MAKEFILE</td>
1.156 leot 13059: </tr>
13060: <tr>
1.175 gutterid 13061: <td>USE_BUILTIN</td>
1.177 leot 13062: <td>USE_CROSS_COMPILE</td>
1.156 leot 13063: </tr>
13064: <tr>
1.175 gutterid 13065: <td>USE_CURSES</td>
1.177 leot 13066: <td>USE_CWRAPPERS</td>
1.156 leot 13067: </tr>
13068: <tr>
1.175 gutterid 13069: <td>USE_DB185</td>
1.177 leot 13070: <td>USE_FEATURES</td>
1.156 leot 13071: </tr>
13072: <tr>
1.175 gutterid 13073: <td>USE_GAMESGROUP</td>
1.177 leot 13074: <td>USE_GCC_RUNTIME</td>
1.156 leot 13075: </tr>
13076: <tr>
1.175 gutterid 13077: <td>USE_IMAKE</td>
1.177 leot 13078: <td>USE_JAVA</td>
1.156 leot 13079: </tr>
13080: <tr>
1.175 gutterid 13081: <td>USE_JAVA2</td>
1.177 leot 13082: <td>USE_LANGUAGES</td>
1.156 leot 13083: </tr>
13084: <tr>
1.175 gutterid 13085: <td>USE_LIBTOOL</td>
1.177 leot 13086: <td>USE_NATIVE_GCC</td>
1.156 leot 13087: </tr>
13088: <tr>
1.175 gutterid 13089: <td>USE_NETBSD_REPO</td>
1.177 leot 13090: <td>USE_PKGSRC_GCC</td>
1.156 leot 13091: </tr>
13092: <tr>
1.175 gutterid 13093: <td>USE_PKGSRC_GCC_RUNTIME</td>
1.177 leot 13094: <td>USE_PKGTASKS</td>
1.156 leot 13095: </tr>
13096: <tr>
1.175 gutterid 13097: <td>USE_PKG_ADMIN_DIGEST</td>
1.177 leot 13098: <td>USE_RUBY_EXTCONF</td>
1.156 leot 13099: </tr>
13100: <tr>
1.175 gutterid 13101: <td>USE_RUBY_INSTALL</td>
1.177 leot 13102: <td>USE_RUBY_SETUP</td>
1.156 leot 13103: </tr>
13104: <tr>
1.175 gutterid 13105: <td>USE_RUBY_SETUP_PKG</td>
1.177 leot 13106: <td>USE_TOOLS</td>
1.156 leot 13107: </tr>
13108: <tr>
1.175 gutterid 13109: <td>UUCP_GROUP</td>
1.177 leot 13110: <td>UUCP_USER</td>
1.156 leot 13111: </tr>
13112: <tr>
1.175 gutterid 13113: <td>VARBASE</td>
1.177 leot 13114: <td>VARNAME</td>
1.156 leot 13115: </tr>
13116: <tr>
1.175 gutterid 13117: <td>VIM_EXTRA_OPTS</td>
1.177 leot 13118: <td>WARNING_MSG</td>
1.156 leot 13119: </tr>
13120: <tr>
1.175 gutterid 13121: <td>WCALC_CGIDIR</td>
1.177 leot 13122: <td>WCALC_CGIPATH</td>
1.156 leot 13123: </tr>
13124: <tr>
1.175 gutterid 13125: <td>WCALC_HTMLDIR</td>
1.177 leot 13126: <td>WCALC_HTMLPATH</td>
1.156 leot 13127: </tr>
13128: <tr>
1.175 gutterid 13129: <td>WDM_MANAGERS</td>
1.177 leot 13130: <td>WRAPPER_REORDER_CMDS</td>
1.156 leot 13131: </tr>
13132: <tr>
1.175 gutterid 13133: <td>WRKDIR</td>
1.177 leot 13134: <td>WRKDIR_BASENAME</td>
1.156 leot 13135: </tr>
13136: <tr>
1.175 gutterid 13137: <td>WRKDIR_LOCKTYPE</td>
1.177 leot 13138: <td>WRKLOG</td>
1.156 leot 13139: </tr>
13140: <tr>
1.175 gutterid 13141: <td>WRKOBJDIR</td>
1.177 leot 13142: <td>WRKSRC</td>
1.156 leot 13143: </tr>
13144: <tr>
1.175 gutterid 13145: <td>X10_PORT</td>
1.177 leot 13146: <td>X11</td>
1.156 leot 13147: </tr>
13148: <tr>
1.175 gutterid 13149: <td>X11BASE</td>
1.177 leot 13150: <td>X11_PKGSRCDIR</td>
1.156 leot 13151: </tr>
13152: <tr>
1.175 gutterid 13153: <td>X11_TYPE</td>
1.177 leot 13154: <td>X509_CERTIFICATE</td>
1.156 leot 13155: </tr>
13156: <tr>
1.175 gutterid 13157: <td>X509_KEY</td>
1.177 leot 13158: <td>XAW_TYPE</td>
1.156 leot 13159: </tr>
13160: <tr>
1.175 gutterid 13161: <td>XLOCK_DEFAULT_MODE</td>
1.177 leot 13162: <td>XMKMF_FLAGS</td>
1.156 leot 13163: </tr>
13164: <tr>
1.172 rillig 13165: <td>XXX</td>
1.177 leot 13166: <td>XXXX</td>
1.156 leot 13167: </tr>
13168: <tr>
1.172 rillig 13169: <td>YES</td>
1.177 leot 13170: <td>ZSH_STATIC</td>
1.159 rillig 13171: </tr>
13172: <tr>
1.174 leot 13173: <td>__stdc__</td>
1.177 leot 13174: <td>_vargroups</td>
1.156 leot 13175: </tr>
13176: <tr>
1.174 leot 13177: <td>accept</td>
1.177 leot 13178: <td>acquire-localbase-lock</td>
1.174 leot 13179: </tr>
13180: <tr>
13181: <td>acquire-lock</td>
1.177 leot 13182: <td>add</td>
1.156 leot 13183: </tr>
13184: <tr>
1.174 leot 13185: <td>administrator</td>
1.177 leot 13186: <td>alloca</td>
1.156 leot 13187: </tr>
13188: <tr>
1.159 rillig 13189: <td>alternatives</td>
1.177 leot 13190: <td>aslr</td>
1.174 leot 13191: </tr>
13192: <tr>
13193: <td>asprintf</td>
1.177 leot 13194: <td>atlas</td>
1.156 leot 13195: </tr>
13196: <tr>
1.174 leot 13197: <td>autoconf</td>
1.175 gutterid 13198: <td>automake</td>
1.161 leot 13199: </tr>
13200: <tr>
1.174 leot 13201: <td>autoreconf</td>
1.175 gutterid 13202: <td>awk</td>
1.156 leot 13203: </tr>
13204: <tr>
1.174 leot 13205: <td>bash</td>
1.175 gutterid 13206: <td>big-endian</td>
1.156 leot 13207: </tr>
13208: <tr>
1.174 leot 13209: <td>bin-install</td>
1.175 gutterid 13210: <td>bind</td>
1.156 leot 13211: </tr>
13212: <tr>
1.172 rillig 13213: <td>binpkg-list</td>
1.177 leot 13214: <td>blas</td>
13215: </tr>
13216: <tr>
1.172 rillig 13217: <td>bootstrap-depends</td>
1.177 leot 13218: <td>broken</td>
1.159 rillig 13219: </tr>
13220: <tr>
1.172 rillig 13221: <td>broken_on_platform</td>
1.177 leot 13222: <td>bsd</td>
1.156 leot 13223: </tr>
13224: <tr>
1.174 leot 13225: <td>bsd.prog.mk</td>
1.177 leot 13226: <td>build</td>
1.174 leot 13227: </tr>
13228: <tr>
1.172 rillig 13229: <td>build-env</td>
1.177 leot 13230: <td>buildlink-directories</td>
1.156 leot 13231: </tr>
13232: <tr>
1.172 rillig 13233: <td>buildlink-oss-soundcard-h</td>
1.177 leot 13234: <td>c</td>
1.156 leot 13235: </tr>
13236: <tr>
1.172 rillig 13237: <td>c++</td>
1.177 leot 13238: <td>ccache</td>
1.156 leot 13239: </tr>
13240: <tr>
1.172 rillig 13241: <td>cce</td>
1.177 leot 13242: <td>cdefs</td>
1.156 leot 13243: </tr>
13244: <tr>
1.174 leot 13245: <td>ceil</td>
1.177 leot 13246: <td>changes</td>
1.174 leot 13247: </tr>
13248: <tr>
13249: <td>changes-entry</td>
1.177 leot 13250: <td>changes-entry-noupdate</td>
1.156 leot 13251: </tr>
13252: <tr>
1.174 leot 13253: <td>check</td>
1.177 leot 13254: <td>check-clean</td>
1.156 leot 13255: </tr>
13256: <tr>
1.174 leot 13257: <td>check-files</td>
1.177 leot 13258: <td>check-files-clean</td>
1.156 leot 13259: </tr>
13260: <tr>
1.174 leot 13261: <td>check-vulnerable</td>
1.177 leot 13262: <td>checksum</td>
1.156 leot 13263: </tr>
13264: <tr>
1.174 leot 13265: <td>checksum-phase</td>
1.177 leot 13266: <td>clean</td>
1.156 leot 13267: </tr>
13268: <tr>
1.174 leot 13269: <td>clean-depends</td>
1.177 leot 13270: <td>cleandir</td>
1.156 leot 13271: </tr>
13272: <tr>
1.174 leot 13273: <td>commit</td>
1.177 leot 13274: <td>commit-changes-entry</td>
1.156 leot 13275: </tr>
13276: <tr>
1.174 leot 13277: <td>compact</td>
1.177 leot 13278: <td>compiler</td>
1.156 leot 13279: </tr>
13280: <tr>
1.174 leot 13281: <td>conf</td>
1.177 leot 13282: <td>config.guess</td>
1.156 leot 13283: </tr>
13284: <tr>
1.174 leot 13285: <td>config.sub</td>
1.177 leot 13286: <td>configuration</td>
1.156 leot 13287: </tr>
13288: <tr>
1.174 leot 13289: <td>configure</td>
1.177 leot 13290: <td>configure-env</td>
1.156 leot 13291: </tr>
13292: <tr>
1.174 leot 13293: <td>configure-help</td>
1.177 leot 13294: <td>configure_args</td>
1.156 leot 13295: </tr>
13296: <tr>
1.174 leot 13297: <td>connect</td>
1.177 leot 13298: <td>cos</td>
1.156 leot 13299: </tr>
13300: <tr>
1.166 leot 13301: <td>cputime</td>
1.177 leot 13302: <td>create-usergroup</td>
1.174 leot 13303: </tr>
13304: <tr>
13305: <td>csh</td>
1.177 leot 13306: <td>ctf</td>
1.156 leot 13307: </tr>
13308: <tr>
1.177 leot 13309: <td>cvs</td>
1.175 gutterid 13310: <td>debug</td>
1.161 leot 13311: </tr>
13312: <tr>
1.174 leot 13313: <td>declaration</td>
1.175 gutterid 13314: <td>declare</td>
1.156 leot 13315: </tr>
13316: <tr>
1.174 leot 13317: <td>defined</td>
1.175 gutterid 13318: <td>depend</td>
1.156 leot 13319: </tr>
13320: <tr>
1.174 leot 13321: <td>dependencies</td>
1.175 gutterid 13322: <td>depends</td>
1.156 leot 13323: </tr>
13324: <tr>
1.174 leot 13325: <td>depends-checksum</td>
1.175 gutterid 13326: <td>depends-fetch</td>
1.156 leot 13327: </tr>
13328: <tr>
1.174 leot 13329: <td>deps</td>
1.175 gutterid 13330: <td>describe</td>
1.156 leot 13331: </tr>
13332: <tr>
1.174 leot 13333: <td>destdir</td>
1.175 gutterid 13334: <td>disable</td>
1.156 leot 13335: </tr>
13336: <tr>
1.174 leot 13337: <td>distclean</td>
1.175 gutterid 13338: <td>distinfo</td>
1.162 rillig 13339: </tr>
13340: <tr>
1.174 leot 13341: <td>dl</td>
1.175 gutterid 13342: <td>dlopen</td>
1.156 leot 13343: </tr>
13344: <tr>
1.174 leot 13345: <td>do-build</td>
1.175 gutterid 13346: <td>do-buildlink</td>
1.156 leot 13347: </tr>
13348: <tr>
1.174 leot 13349: <td>do-clean</td>
1.175 gutterid 13350: <td>do-configure</td>
1.156 leot 13351: </tr>
13352: <tr>
1.174 leot 13353: <td>do-configure-post-hook</td>
1.175 gutterid 13354: <td>do-extract</td>
1.170 rillig 13355: </tr>
13356: <tr>
1.174 leot 13357: <td>do-fetch</td>
1.177 leot 13358: <td>do-install</td>
13359: </tr>
13360: <tr>
1.174 leot 13361: <td>emul</td>
1.177 leot 13362: <td>emul-distinfo</td>
1.174 leot 13363: </tr>
13364: <tr>
13365: <td>emul-fetch</td>
1.177 leot 13366: <td>emulation</td>
1.156 leot 13367: </tr>
13368: <tr>
1.174 leot 13369: <td>emulator</td>
1.177 leot 13370: <td>enable</td>
1.159 rillig 13371: </tr>
13372: <tr>
1.174 leot 13373: <td>endian</td>
1.177 leot 13374: <td>endif</td>
1.156 leot 13375: </tr>
13376: <tr>
1.170 rillig 13377: <td>enomem</td>
1.175 gutterid 13378: <td>err</td>
1.156 leot 13379: </tr>
13380: <tr>
1.170 rillig 13381: <td>errx</td>
1.175 gutterid 13382: <td>etc</td>
1.156 leot 13383: </tr>
13384: <tr>
1.174 leot 13385: <td>exp</td>
1.175 gutterid 13386: <td>extract-rpm</td>
1.174 leot 13387: </tr>
13388: <tr>
13389: <td>fabs</td>
1.175 gutterid 13390: <td>feature</td>
1.156 leot 13391: </tr>
13392: <tr>
1.159 rillig 13393: <td>features</td>
1.175 gutterid 13394: <td>fetch</td>
1.156 leot 13395: </tr>
13396: <tr>
1.159 rillig 13397: <td>fetch-list</td>
1.175 gutterid 13398: <td>follows</td>
1.156 leot 13399: </tr>
13400: <tr>
1.159 rillig 13401: <td>forbids</td>
1.175 gutterid 13402: <td>form</td>
1.156 leot 13403: </tr>
13404: <tr>
1.159 rillig 13405: <td>format</td>
1.175 gutterid 13406: <td>fortify</td>
1.156 leot 13407: </tr>
13408: <tr>
1.159 rillig 13409: <td>fortify_source</td>
1.177 leot 13410: <td>fossil</td>
13411: </tr>
13412: <tr>
1.157 leot 13413: <td>friend</td>
1.177 leot 13414: <td>fts</td>
1.156 leot 13415: </tr>
13416: <tr>
1.170 rillig 13417: <td>fts_close</td>
1.177 leot 13418: <td>fts_open</td>
1.156 leot 13419: </tr>
13420: <tr>
1.170 rillig 13421: <td>fts_read</td>
1.177 leot 13422: <td>fts_set</td>
1.156 leot 13423: </tr>
13424: <tr>
1.174 leot 13425: <td>gcc</td>
1.177 leot 13426: <td>gethostbyaddr</td>
1.174 leot 13427: </tr>
13428: <tr>
13429: <td>gethostbyname</td>
1.177 leot 13430: <td>gethostbyname2</td>
1.156 leot 13431: </tr>
13432: <tr>
1.170 rillig 13433: <td>getopt_long</td>
1.177 leot 13434: <td>getprogname</td>
1.156 leot 13435: </tr>
13436: <tr>
1.174 leot 13437: <td>getservbyname</td>
1.177 leot 13438: <td>getservbyport</td>
1.174 leot 13439: </tr>
13440: <tr>
13441: <td>getservent</td>
1.177 leot 13442: <td>gettext</td>
1.174 leot 13443: </tr>
13444: <tr>
1.177 leot 13445: <td>git</td>
1.175 gutterid 13446: <td>github</td>
1.156 leot 13447: </tr>
13448: <tr>
1.177 leot 13449: <td>gitlab</td>
1.174 leot 13450: <td>glob</td>
1.177 leot 13451: </tr>
13452: <tr>
1.175 gutterid 13453: <td>gnu</td>
1.177 leot 13454: <td>gnu_configure_strict</td>
1.159 rillig 13455: </tr>
13456: <tr>
1.175 gutterid 13457: <td>go</td>
1.177 leot 13458: <td>go-deps</td>
1.156 leot 13459: </tr>
13460: <tr>
1.175 gutterid 13461: <td>golang</td>
1.177 leot 13462: <td>guess-license</td>
1.156 leot 13463: </tr>
13464: <tr>
1.175 gutterid 13465: <td>hashbang</td>
1.177 leot 13466: <td>heimdal</td>
1.156 leot 13467: </tr>
13468: <tr>
1.170 rillig 13469: <td>help</td>
1.177 leot 13470: <td>hg</td>
1.156 leot 13471: </tr>
13472: <tr>
1.170 rillig 13473: <td>imake</td>
1.174 leot 13474: <td>increment</td>
1.161 leot 13475: </tr>
13476: <tr>
1.174 leot 13477: <td>inet_aton</td>
1.170 rillig 13478: <td>interp</td>
1.156 leot 13479: </tr>
13480: <tr>
1.157 leot 13481: <td>interpreter</td>
1.170 rillig 13482: <td>intl</td>
1.156 leot 13483: </tr>
13484: <tr>
1.157 leot 13485: <td>iso</td>
1.170 rillig 13486: <td>kerberos</td>
1.156 leot 13487: </tr>
13488: <tr>
1.157 leot 13489: <td>krb</td>
1.170 rillig 13490: <td>krb5</td>
1.156 leot 13491: </tr>
13492: <tr>
1.157 leot 13493: <td>ksh</td>
1.177 leot 13494: <td>lapack</td>
13495: </tr>
13496: <tr>
1.175 gutterid 13497: <td>latex</td>
1.177 leot 13498: <td>libintl_bindtextdomain</td>
1.156 leot 13499: </tr>
13500: <tr>
1.175 gutterid 13501: <td>libintl_gettext</td>
1.177 leot 13502: <td>libintl_textdomain</td>
1.174 leot 13503: </tr>
13504: <tr>
1.175 gutterid 13505: <td>libnbcompat</td>
1.177 leot 13506: <td>libs</td>
1.159 rillig 13507: </tr>
13508: <tr>
1.175 gutterid 13509: <td>libtool</td>
1.177 leot 13510: <td>licence</td>
1.156 leot 13511: </tr>
13512: <tr>
1.175 gutterid 13513: <td>license</td>
1.177 leot 13514: <td>lintl</td>
1.156 leot 13515: </tr>
13516: <tr>
1.175 gutterid 13517: <td>little-endian</td>
1.177 leot 13518: <td>lock</td>
1.156 leot 13519: </tr>
13520: <tr>
1.175 gutterid 13521: <td>locking</td>
1.177 leot 13522: <td>lvalue</td>
1.156 leot 13523: </tr>
13524: <tr>
1.175 gutterid 13525: <td>make</td>
1.177 leot 13526: <td>makesum</td>
1.156 leot 13527: </tr>
13528: <tr>
1.174 leot 13529: <td>memory</td>
1.177 leot 13530: <td>mercurial</td>
1.161 leot 13531: </tr>
13532: <tr>
1.174 leot 13533: <td>meta</td>
1.158 brook 13534: <td>meta-package</td>
1.156 leot 13535: </tr>
13536: <tr>
1.174 leot 13537: <td>meta_package</td>
1.158 brook 13538: <td>mit-krb5</td>
1.156 leot 13539: </tr>
13540: <tr>
1.174 leot 13541: <td>mk.conf</td>
1.177 leot 13542: <td>mkl</td>
13543: </tr>
13544: <tr>
1.175 gutterid 13545: <td>mount</td>
1.177 leot 13546: <td>mprotect</td>
1.159 rillig 13547: </tr>
13548: <tr>
1.175 gutterid 13549: <td>mremap</td>
1.177 leot 13550: <td>nb</td>
1.156 leot 13551: </tr>
13552: <tr>
1.175 gutterid 13553: <td>nbcompat</td>
1.177 leot 13554: <td>obstack</td>
1.156 leot 13555: </tr>
13556: <tr>
1.175 gutterid 13557: <td>obstack_ptr_grow</td>
1.177 leot 13558: <td>occurs</td>
1.156 leot 13559: </tr>
13560: <tr>
1.159 rillig 13561: <td>only</td>
1.177 leot 13562: <td>openblas</td>
1.161 leot 13563: </tr>
13564: <tr>
1.158 brook 13565: <td>options</td>
1.170 rillig 13566: <td>options.mk</td>
1.156 leot 13567: </tr>
13568: <tr>
1.158 brook 13569: <td>order</td>
1.170 rillig 13570: <td>override</td>
1.156 leot 13571: </tr>
13572: <tr>
1.158 brook 13573: <td>override-intltool</td>
1.170 rillig 13574: <td>override-message-intltool</td>
1.156 leot 13575: </tr>
13576: <tr>
1.158 brook 13577: <td>package</td>
1.170 rillig 13578: <td>parallel</td>
1.156 leot 13579: </tr>
13580: <tr>
1.170 rillig 13581: <td>path</td>
1.174 leot 13582: <td>pax</td>
1.156 leot 13583: </tr>
13584: <tr>
1.170 rillig 13585: <td>paxctl</td>
1.174 leot 13586: <td>pbulk-index</td>
1.156 leot 13587: </tr>
13588: <tr>
1.170 rillig 13589: <td>pc</td>
1.174 leot 13590: <td>perl</td>
1.156 leot 13591: </tr>
13592: <tr>
1.170 rillig 13593: <td>perl5</td>
1.174 leot 13594: <td>perms</td>
1.156 leot 13595: </tr>
13596: <tr>
1.170 rillig 13597: <td>php</td>
1.174 leot 13598: <td>pkg-build-options</td>
1.156 leot 13599: </tr>
13600: <tr>
1.170 rillig 13601: <td>pkg-config</td>
1.174 leot 13602: <td>pkg_build_options</td>
1.156 leot 13603: </tr>
13604: <tr>
1.170 rillig 13605: <td>platform</td>
1.174 leot 13606: <td>plist</td>
1.156 leot 13607: </tr>
13608: <tr>
1.170 rillig 13609: <td>post-extract</td>
1.174 leot 13610: <td>post-fetch</td>
1.156 leot 13611: </tr>
13612: <tr>
1.170 rillig 13613: <td>post-wrapper</td>
1.174 leot 13614: <td>pre-build-checks-hook</td>
1.156 leot 13615: </tr>
13616: <tr>
1.158 brook 13617: <td>pre-configure</td>
1.174 leot 13618: <td>pre-configure-checks-hook</td>
13619: </tr>
13620: <tr>
1.170 rillig 13621: <td>pre-extract</td>
1.174 leot 13622: <td>pre-fetch</td>
1.156 leot 13623: </tr>
13624: <tr>
1.170 rillig 13625: <td>print-go-deps</td>
1.174 leot 13626: <td>print-plist</td>
1.156 leot 13627: </tr>
13628: <tr>
1.170 rillig 13629: <td>print-summary-data</td>
1.174 leot 13630: <td>privileged-install-hook</td>
1.156 leot 13631: </tr>
13632: <tr>
1.170 rillig 13633: <td>pypi</td>
1.174 leot 13634: <td>python</td>
1.156 leot 13635: </tr>
13636: <tr>
1.170 rillig 13637: <td>readme-all</td>
1.174 leot 13638: <td>recv</td>
1.156 leot 13639: </tr>
13640: <tr>
1.174 leot 13641: <td>recvfrom</td>
1.158 brook 13642: <td>regcomp</td>
1.174 leot 13643: </tr>
13644: <tr>
13645: <td>release-localbase-lock</td>
13646: <td>release-lock</td>
13647: </tr>
13648: <tr>
1.170 rillig 13649: <td>relro</td>
1.174 leot 13650: <td>rename</td>
1.156 leot 13651: </tr>
13652: <tr>
1.170 rillig 13653: <td>reorder</td>
1.174 leot 13654: <td>replace</td>
1.156 leot 13655: </tr>
13656: <tr>
1.170 rillig 13657: <td>replace_interpreter</td>
1.174 leot 13658: <td>reproducible</td>
1.156 leot 13659: </tr>
13660: <tr>
1.170 rillig 13661: <td>resolv</td>
1.174 leot 13662: <td>root</td>
1.156 leot 13663: </tr>
13664: <tr>
1.170 rillig 13665: <td>ruby</td>
1.174 leot 13666: <td>send</td>
13667: </tr>
13668: <tr>
13669: <td>sendfile</td>
13670: <td>sendto</td>
1.156 leot 13671: </tr>
13672: <tr>
1.158 brook 13673: <td>setenv</td>
1.170 rillig 13674: <td>setgid</td>
1.156 leot 13675: </tr>
13676: <tr>
1.158 brook 13677: <td>setprogname</td>
1.170 rillig 13678: <td>setuid</td>
1.156 leot 13679: </tr>
13680: <tr>
1.158 brook 13681: <td>sh</td>
1.170 rillig 13682: <td>show</td>
1.156 leot 13683: </tr>
13684: <tr>
1.158 brook 13685: <td>show-all</td>
1.170 rillig 13686: <td>show-build-defs</td>
1.156 leot 13687: </tr>
13688: <tr>
1.158 brook 13689: <td>show-depends</td>
1.170 rillig 13690: <td>show-deps</td>
1.156 leot 13691: </tr>
13692: <tr>
1.158 brook 13693: <td>show-distfiles</td>
1.170 rillig 13694: <td>show-downlevel</td>
1.156 leot 13695: </tr>
13696: <tr>
1.158 brook 13697: <td>show-subdir-var</td>
1.170 rillig 13698: <td>show-tools</td>
1.156 leot 13699: </tr>
13700: <tr>
1.158 brook 13701: <td>show-var</td>
1.170 rillig 13702: <td>show-vars</td>
1.156 leot 13703: </tr>
13704: <tr>
1.158 brook 13705: <td>snprintf</td>
1.174 leot 13706: <td>socket</td>
13707: </tr>
13708: <tr>
1.170 rillig 13709: <td>ssp</td>
1.174 leot 13710: <td>st_mode</td>
1.156 leot 13711: </tr>
13712: <tr>
1.170 rillig 13713: <td>stage-install</td>
1.174 leot 13714: <td>strcasestr</td>
1.156 leot 13715: </tr>
13716: <tr>
1.162 rillig 13717: <td>strict</td>
1.170 rillig 13718: <td>strip</td>
1.162 rillig 13719: </tr>
13720: <tr>
1.174 leot 13721: <td>strndup</td>
1.161 leot 13722: <td>strnlen</td>
1.156 leot 13723: </tr>
13724: <tr>
1.174 leot 13725: <td>strsep</td>
1.161 leot 13726: <td>subst</td>
1.174 leot 13727: </tr>
13728: <tr>
13729: <td>substitutions</td>
1.177 leot 13730: <td>subversion</td>
13731: </tr>
13732: <tr>
1.175 gutterid 13733: <td>sun</td>
1.177 leot 13734: <td>sunpro</td>
1.156 leot 13735: </tr>
13736: <tr>
13737: <td>sunwspro</td>
1.177 leot 13738: <td>svn</td>
1.156 leot 13739: </tr>
13740: <tr>
1.161 leot 13741: <td>symlink</td>
1.170 rillig 13742: <td>test</td>
1.161 leot 13743: </tr>
13744: <tr>
1.174 leot 13745: <td>test-env</td>
1.157 leot 13746: <td>tex</td>
1.156 leot 13747: </tr>
13748: <tr>
1.174 leot 13749: <td>texlive</td>
1.157 leot 13750: <td>tmp</td>
1.156 leot 13751: </tr>
13752: <tr>
1.174 leot 13753: <td>tool</td>
1.157 leot 13754: <td>tools</td>
1.156 leot 13755: </tr>
13756: <tr>
1.174 leot 13757: <td>tools-libtool-m4-override</td>
1.157 leot 13758: <td>type</td>
1.156 leot 13759: </tr>
13760: <tr>
1.174 leot 13761: <td>ulimit</td>
1.157 leot 13762: <td>undefined</td>
1.156 leot 13763: </tr>
13764: <tr>
1.174 leot 13765: <td>undo-replace</td>
1.157 leot 13766: <td>unlimit</td>
1.156 leot 13767: </tr>
13768: <tr>
1.174 leot 13769: <td>unprivileged</td>
1.157 leot 13770: <td>unprivileged-install-hook</td>
1.156 leot 13771: </tr>
13772: <tr>
1.174 leot 13773: <td>unstripped</td>
1.157 leot 13774: <td>update</td>
1.156 leot 13775: </tr>
13776: <tr>
1.174 leot 13777: <td>upload</td>
1.157 leot 13778: <td>upload-distfiles</td>
1.156 leot 13779: </tr>
13780: <tr>
1.157 leot 13781: <td>use_tools</td>
1.170 rillig 13782: <td>user</td>
1.156 leot 13783: </tr>
13784: <tr>
1.157 leot 13785: <td>utimes</td>
1.170 rillig 13786: <td>vasprintf</td>
1.156 leot 13787: </tr>
13788: <tr>
1.157 leot 13789: <td>verbose</td>
1.170 rillig 13790: <td>vsnprintf</td>
1.156 leot 13791: </tr>
13792: <tr>
1.157 leot 13793: <td>warn</td>
1.170 rillig 13794: <td>warning</td>
1.156 leot 13795: </tr>
13796: <tr>
1.157 leot 13797: <td>warnings</td>
1.170 rillig 13798: <td>warnx</td>
1.156 leot 13799: </tr>
13800: <tr>
1.174 leot 13801: <td>wattr_off</td>
13802: <td>wattr_on</td>
1.156 leot 13803: </tr>
13804: <tr>
1.174 leot 13805: <td>work</td>
1.157 leot 13806: <td>wrapper</td>
1.156 leot 13807: </tr>
13808: <tr>
1.174 leot 13809: <td>wrkdir</td>
1.170 rillig 13810: <td> </td>
1.156 leot 13811: </tr>
13812: </table>
1.154 rillig 13813: </div>
13814: <div class="appendix">
13815: <div class="titlepage"><div><div><h1 class="title">
13816: <a name="editing"></a>Appendix E. Editing guidelines for the pkgsrc guide</h1></div></div></div>
1.1 dsieger 13817: <div class="toc">
13818: <p><b>Table of Contents</b></p>
1.100 leot 13819: <dl class="toc">
1.154 rillig 13820: <dt><span class="sect1"><a href="#targets">E.1. Make targets</a></span></dt>
13821: <dt><span class="sect1"><a href="#procedure">E.2. Procedure</a></span></dt>
1.1 dsieger 13822: </dl>
13823: </div>
13824: <p>This section contains information on editing the pkgsrc
13825: guide itself.</p>
1.41 asau 13826: <div class="sect1">
1.1 dsieger 13827: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 13828: <a name="targets"></a>E.1. Make targets</h2></div></div></div>
1.1 dsieger 13829: <p>The pkgsrc guide's source code is stored in
13830: <code class="filename">pkgsrc/doc/guide/files</code>, and several files
13831: are created from it:</p>
1.41 asau 13832: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 13833: <li class="listitem"><p><code class="filename">pkgsrc/doc/pkgsrc.txt</code></p></li>
13834: <li class="listitem"><p><code class="filename">pkgsrc/doc/pkgsrc.html</code></p></li>
1.174 leot 13835: <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/docs/pkgsrc/" target="_top">https://www.NetBSD.org/docs/pkgsrc/</a></p></li>
13836: <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/docs/pkgsrc/pkgsrc.pdf" target="_top">https://www.NetBSD.org/docs/pkgsrc/pkgsrc.pdf</a>:
1.1 dsieger 13837: The PDF version of the pkgsrc guide.</p></li>
1.174 leot 13838: <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/docs/pkgsrc/pkgsrc.ps" target="_top">https://www.NetBSD.org/docs/pkgsrc/pkgsrc.ps</a>:
1.1 dsieger 13839: PostScript version of the pkgsrc guide.</p></li>
13840: </ul></div>
13841: </div>
1.41 asau 13842: <div class="sect1">
1.1 dsieger 13843: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 13844: <a name="procedure"></a>E.2. Procedure</h2></div></div></div>
1.1 dsieger 13845: <p>The procedure to edit the pkgsrc guide is:</p>
1.23 wiz 13846: <div class="procedure"><ol class="procedure" type="1">
1.41 asau 13847: <li class="step"><p>Make sure you have the packages needed to
1.1 dsieger 13848: regenerate the pkgsrc guide (and other XML-based NetBSD
1.45 obache 13849: documentation) installed. These are automatically installed when
1.137 leot 13850: you install the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/pkgsrc-guide-tools/README.html" target="_top"><code class="filename">meta-pkgs/pkgsrc-guide-tools</code></a> package.</p></li>
1.41 asau 13851: <li class="step"><p>Run <span class="command"><strong>cd doc/guide</strong></span> to get to the
1.1 dsieger 13852: right directory. All further steps will take place
13853: here.</p></li>
1.41 asau 13854: <li class="step"><p>Edit the XML file(s) in
1.1 dsieger 13855: <code class="filename">files/</code>.</p></li>
1.41 asau 13856: <li class="step"><p>Run <span class="command"><strong>bmake</strong></span> to check the pkgsrc
1.1 dsieger 13857: guide for valid XML and to build the final output files. If you
13858: get any errors at this stage, you can just edit the files, as
13859: there are only symbolic links in the working directory, pointing
13860: to the files in <code class="filename">files/</code>.</p></li>
1.41 asau 13861: <li class="step"><p><span class="command"><strong>(cd files && cvs
1.1 dsieger 13862: commit)</strong></span></p></li>
1.41 asau 13863: <li class="step"><p>Run <span class="command"><strong>bmake clean && bmake</strong></span> to
1.1 dsieger 13864: regenerate the output files with the proper RCS
13865: Ids.</p></li>
1.41 asau 13866: <li class="step">
1.10 hubertf 13867: <p>Run <span class="command"><strong>bmake regen</strong></span> to install and
1.1 dsieger 13868: commit the files in both <code class="filename">pkgsrc/doc</code> and
13869: <code class="filename">htdocs</code>.</p>
1.41 asau 13870: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 13871: <h3 class="title">Note</h3>
13872: <p>If you have added, removed or renamed some chapters,
1.10 hubertf 13873: you need to synchronize them using <span class="command"><strong>cvs add</strong></span> or
13874: <span class="command"><strong>cvs delete</strong></span> in the htdocs
1.1 dsieger 13875: directory.</p>
13876: </div>
13877: </li>
13878: </ol></div>
13879: </div>
13880: </div>
13881: </div></body>
13882: </html>
CVSweb <webmaster@jp.NetBSD.org>