Annotation of htdocs/docs/pkgsrc/pkgsrc.html, revision 1.183
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>
1.180 rillig 124: <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a bulk build</a></span></dt>
1.154 rillig 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>
1.179 rillig 129: <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt>
130: <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt>
1.181 rillig 131: <dt><span class="sect2"><a href="#bulk.var.builderr">8.4.3. Force compiler options only in the build phase</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>
1.178 rillig 139: </dl></dd>
140: <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
141: <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
1.154 rillig 142: </dl></dd>
143: <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt>
144: <dd><dl>
145: <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
146: <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt>
147: </dl></dd>
148: <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt>
149: <dd><dl>
150: <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
151: <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
152: <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
153: <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
154: <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>
155: <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
156: <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
157: <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>
158: <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
159: <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 160: /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
1.154 rillig 161: <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>
162: <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt>
163: <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
164: <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
165: <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
166: <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
167: <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 168: </dl></dd>
169: </dl></dd>
170: <dt><span class="part"><a href="#developers-guide">II. The pkgsrc developer's guide</a></span></dt>
171: <dd><dl>
1.154 rillig 172: <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt>
173: <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt>
1.1 dsieger 174: <dd><dl>
1.154 rillig 175: <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt>
1.1 dsieger 176: <dd><dl>
1.154 rillig 177: <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt>
178: <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt>
1.160 brook 179: <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt>
180: <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt>
1.1 dsieger 181: </dl></dd>
1.154 rillig 182: <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt>
183: <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 184: </dl></dd>
1.154 rillig 185: <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt>
1.6 rillig 186: <dd><dl>
1.154 rillig 187: <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt>
188: <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt>
189: <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt>
1.6 rillig 190: <dd><dl>
1.154 rillig 191: <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt>
192: <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt>
193: <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt>
194: <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt>
195: <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt>
1.6 rillig 196: </dl></dd>
1.154 rillig 197: <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt>
198: <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt>
1.6 rillig 199: <dd><dl>
1.154 rillig 200: <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt>
201: <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt>
202: <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt>
1.6 rillig 203: </dl></dd>
1.154 rillig 204: <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt>
205: <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt>
1.6 rillig 206: </dl></dd>
1.154 rillig 207: <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt>
1.6 rillig 208: <dd><dl>
1.154 rillig 209: <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt>
210: <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt>
211: <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd>
212: <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt>
1.6 rillig 213: <dd><dl>
1.154 rillig 214: <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt>
215: <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt>
216: <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>
217: <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt>
1.6 rillig 218: </dl></dd>
219: </dl></dd>
1.154 rillig 220: <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt>
1.6 rillig 221: <dd><dl>
1.154 rillig 222: <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt>
223: <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
224: <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>
225: <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt>
226: <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt>
227: <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
228: <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt>
229: <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt>
230: <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt>
1.6 rillig 231: </dl></dd>
1.154 rillig 232: <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt>
1.6 rillig 233: <dd><dl>
1.154 rillig 234: <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt>
235: <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 236: <dd><dl>
1.154 rillig 237: <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt>
238: <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating
1.26 wiz 239: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
240: and
241: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
242: in <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.6 rillig 243: </dl></dd>
1.154 rillig 244: <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 245: <dd><dl>
1.154 rillig 246: <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>
247: <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 248: </dl></dd>
249: </dl></dd>
1.154 rillig 250: <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt>
1.6 rillig 251: <dd><dl>
1.154 rillig 252: <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt>
253: <dd><dl>
254: <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt>
255: <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt>
256: </dl></dd>
257: <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt>
258: <dd><dl>
259: <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt>
260: <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt>
261: <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt>
262: <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt>
263: </dl></dd>
264: <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt>
265: <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>
266: <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt>
267: <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt>
268: <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd>
269: <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt>
270: <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>
271: </dl></dd>
272: <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt>
273: <dd><dl>
274: <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt>
275: <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>
276: <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt>
277: <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt>
278: </dl></dd>
279: <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt>
280: <dd><dl>
281: <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt>
282: <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt>
283: <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt>
284: <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt>
285: <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
286: <dd><dl>
287: <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt>
288: <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt>
289: </dl></dd>
290: <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt>
291: <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt>
292: <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt>
293: <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt>
294: <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt>
295: <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
296: <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
297: <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt>
298: <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
299: <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt>
300: <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt>
301: <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt>
302: </dl></dd>
303: <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt>
304: <dd><dl>
305: <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt>
306: <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt>
307: <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt>
308: </dl></dd>
309: <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt>
310: <dd><dl>
311: <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt>
312: <dd><dl>
313: <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>
314: <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt>
315: <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt>
316: <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt>
317: <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt>
318: <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt>
319: <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt>
320: <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt>
321: <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt>
322: <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt>
323: <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt>
324: </dl></dd>
325: <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
326: <dd><dl>
327: <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt>
328: <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>
329: <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt>
330: </dl></dd>
331: <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
332: <dd><dl>
333: <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt>
334: <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt>
335: <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt>
336: </dl></dd>
337: <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt>
338: <dd><dl>
339: <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt>
340: <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt>
341: <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt>
342: <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt>
343: <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt>
344: </dl></dd>
345: <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
346: <dd><dl>
347: <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt>
348: <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt>
1.172 rillig 349: <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt>
350: <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>
351: <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt>
1.154 rillig 352: </dl></dd>
353: <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
354: <dd><dl>
355: <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt>
356: <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt>
357: <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt>
358: <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt>
359: <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt>
360: <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt>
361: <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt>
362: <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt>
363: <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt>
364: <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt>
365: <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt>
366: <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt>
367: <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt>
368: <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt>
369: <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt>
370: <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt>
371: <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt>
372: <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in
1.1 dsieger 373: emulation</a></span></dt>
1.154 rillig 374: <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt>
375: <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt>
1.1 dsieger 376: </dl></dd>
1.154 rillig 377: <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt>
1.1 dsieger 378: </dl></dd>
1.154 rillig 379: <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt>
380: <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt>
1.1 dsieger 381: <dd><dl>
1.154 rillig 382: <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt>
383: <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt>
384: <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt>
385: <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt>
386: <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt>
387: <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt>
388: <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt>
389: <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt>
390: </dl></dd>
391: <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt>
392: <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt>
393: <dd><dl>
394: <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt>
395: <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt>
396: <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt>
397: <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt>
1.1 dsieger 398: </dl></dd>
399: </dl></dd>
400: <dt><span class="part"><a href="#infrastructure">III. The pkgsrc infrastructure internals</a></span></dt>
401: <dd><dl>
1.154 rillig 402: <dt><span class="chapter"><a href="#infr.design">26. Design of the pkgsrc infrastructure</a></span></dt>
1.1 dsieger 403: <dd><dl>
1.154 rillig 404: <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt>
405: <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt>
406: <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt>
1.1 dsieger 407: <dd><dl>
1.154 rillig 408: <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt>
409: <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt>
1.1 dsieger 410: </dl></dd>
1.154 rillig 411: <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt>
412: <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt>
1.1 dsieger 413: <dd><dl>
1.154 rillig 414: <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt>
415: <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 416: </dl></dd>
1.154 rillig 417: <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt>
1.1 dsieger 418: <dd><dl>
1.154 rillig 419: <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>
420: <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 421: </dl></dd>
422: </dl></dd>
1.154 rillig 423: <dt><span class="chapter"><a href="#regression">27. Regression tests</a></span></dt>
1.1 dsieger 424: <dd><dl>
1.154 rillig 425: <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt>
426: <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt>
1.1 dsieger 427: <dd><dl>
1.154 rillig 428: <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt>
429: <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt>
1.1 dsieger 430: </dl></dd>
431: </dl></dd>
1.154 rillig 432: <dt><span class="chapter"><a href="#porting">28. Porting pkgsrc</a></span></dt>
433: <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 434: </dl></dd>
435: <dt><span class="appendix"><a href="#examples">A. A simple example package: bison</a></span></dt>
436: <dd><dl>
437: <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt>
438: <dd><dl>
439: <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt>
440: <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt>
441: <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt>
1.172 rillig 442: <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with pkglint</a></span></dt>
1.1 dsieger 443: </dl></dd>
444: <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt>
445: </dl></dd>
446: <dt><span class="appendix"><a href="#logs">B. Build logs</a></span></dt>
447: <dd><dl>
448: <dt><span class="sect1"><a href="#logs.building">B.1. Building figlet</a></span></dt>
449: <dt><span class="sect1"><a href="#logs.package">B.2. Packaging figlet</a></span></dt>
450: </dl></dd>
451: <dt><span class="appendix"><a href="#ftp-layout">C. Directory layout of the pkgsrc FTP server</a></span></dt>
452: <dd><dl>
1.23 wiz 453: <dt><span class="sect1"><a href="#ftp-distfiles">C.1. <code class="filename">distfiles</code>: The distributed source files</a></span></dt>
454: <dt><span class="sect1"><a href="#ftp-misc">C.2. <code class="filename">misc</code>: Miscellaneous things</a></span></dt>
455: <dt><span class="sect1"><a href="#ftp-packages">C.3. <code class="filename">packages</code>: Binary packages</a></span></dt>
456: <dt><span class="sect1"><a href="#ftp-reports">C.4. <code class="filename">reports</code>: Bulk build reports</a></span></dt>
457: <dt><span class="sect1"><a href="#ftp-source">C.5. <code class="filename">current</code>,
1.148 leot 458: <code class="filename">stable</code>,
1.23 wiz 459: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>:
1.1 dsieger 460: source packages</a></span></dt>
461: </dl></dd>
1.154 rillig 462: <dt><span class="appendix"><a href="#help-topics">D. Help topics</a></span></dt>
463: <dt><span class="appendix"><a href="#editing">E. Editing guidelines for the pkgsrc guide</a></span></dt>
1.1 dsieger 464: <dd><dl>
1.154 rillig 465: <dt><span class="sect1"><a href="#targets">E.1. Make targets</a></span></dt>
466: <dt><span class="sect1"><a href="#procedure">E.2. Procedure</a></span></dt>
1.1 dsieger 467: </dl></dd>
468: </dl>
469: </div>
470: <div class="list-of-tables">
471: <p><b>List of Tables</b></p>
472: <dl>
473: <dt>1.1. <a href="#supported-platforms">Platforms supported by pkgsrc</a>
474: </dt>
1.154 rillig 475: <dt>13.1. <a href="#patch-examples">Patching examples</a>
1.1 dsieger 476: </dt>
1.154 rillig 477: <dt>25.1. <a href="#plist-handling">PLIST handling for GNOME packages</a>
1.1 dsieger 478: </dt>
479: </dl>
480: </div>
1.41 asau 481: <div class="chapter">
482: <div class="titlepage"><div><div><h1 class="title">
483: <a name="introduction"></a>Chapter 1. What is pkgsrc?</h1></div></div></div>
1.1 dsieger 484: <div class="toc">
485: <p><b>Table of Contents</b></p>
1.100 leot 486: <dl class="toc">
1.1 dsieger 487: <dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt>
488: <dd><dl>
489: <dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt>
490: <dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt>
491: </dl></dd>
492: <dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt>
493: <dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt>
494: <dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd>
495: <dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt>
496: </dl>
497: </div>
1.41 asau 498: <div class="sect1">
1.1 dsieger 499: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
500: <a name="introduction-section"></a>1.1. Introduction</h2></div></div></div>
501: <p>There is a lot of software freely available for Unix-based
502: systems, which is usually available in form of the source code. Before
503: such software can be used, it needs to be configured to the local
504: system, compiled and installed, and this is exactly what The NetBSD
505: Packages Collection (pkgsrc) does. pkgsrc also has some basic commands
506: to handle binary packages, so that not every user has to build the
507: packages for himself, which is a time-costly task.</p>
508: <p>pkgsrc currently contains several thousand packages,
509: including:</p>
1.41 asau 510: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 511: <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 512: web server</p></li>
1.137 leot 513: <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 514: web browser</p></li>
1.137 leot 515: <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 516: Desktop Environment</p></li>
1.137 leot 517: <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 518: Desktop Environment</p></li>
519: </ul></div>
1.108 rillig 520: <p>… just to name a few.</p>
1.1 dsieger 521: <p>pkgsrc has built-in support for handling varying dependencies,
522: such as pthreads and X11, and extended features such as IPv6 support on
523: a range of platforms.</p>
1.41 asau 524: <div class="sect2">
1.1 dsieger 525: <div class="titlepage"><div><div><h3 class="title">
526: <a name="why-pkgsrc"></a>1.1.1. Why pkgsrc?</h3></div></div></div>
527: <p>
528: pkgsrc provides the following key features:
529: </p>
1.41 asau 530: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 531: <li class="listitem"><p>Easy building of software from source as well as the creation
1.1 dsieger 532: and installation of binary packages. The source and latest
533: patches are retrieved from a master or mirror download site, checksum
534: verified, then built on your system. Support for binary-only
535: distributions is available for both native platforms and NetBSD
536: emulated platforms.</p></li>
1.23 wiz 537: <li class="listitem"><p>All packages are installed in a consistent directory tree,
1.1 dsieger 538: including binaries, libraries, man pages and other
539: documentation.</p></li>
1.104 sevan 540: <li class="listitem"><p>Tracking of package dependencies automatically, including when
541: performing updates, to ensure required packages are installed. The
542: configuration files of various packages are handled automatically during
543: updates, so local changes are preserved.</p></li>
1.23 wiz 544: <li class="listitem"><p>Like NetBSD, pkgsrc is designed with portability in mind and
1.1 dsieger 545: consists of highly portable code. This allows the greatest speed of
1.25 spz 546: development when porting to a new platform. This portability also
1.1 dsieger 547: ensures that pkgsrc is <span class="emphasis"><em>consistent across all
548: platforms</em></span>.</p></li>
1.23 wiz 549: <li class="listitem"><p>The installation prefix, acceptable software licenses,
1.1 dsieger 550: international encryption requirements and build-time options for a
551: large number of packages are all set in a simple, central
552: configuration file.</p></li>
1.23 wiz 553: <li class="listitem"><p>The entire source (not including the distribution files) is
1.1 dsieger 554: freely available under a BSD license, so you may extend and adapt
555: pkgsrc to your needs. Support for local packages and patches is
556: available right out of the box, so you can configure it specifically
557: for your environment.</p></li>
558: </ul></div>
559: <p>The following principles are basic to pkgsrc:</p>
1.41 asau 560: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 561: <li class="listitem"><p><span class="quote">“<span class="quote">It should only work if it's right.</span>”</span>
1.14 jmcneill 562: — That means, if a package contains bugs, it's better to find
1.1 dsieger 563: them and to complain about them rather than to just install the package
564: and hope that it works. There are numerous checks in pkgsrc that try to
1.175 gutterid 565: 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 566: of shell scripts), and post-installation checks (installed files,
567: references to shared libraries, script interpreters).</p></li>
1.23 wiz 568: <li class="listitem"><p><span class="quote">“<span class="quote">If it works, it should work everywhere</span>”</span>
1.14 jmcneill 569: — Like NetBSD has been ported to many hardware architectures,
1.1 dsieger 570: pkgsrc has been ported to many operating systems. Care is taken that
571: packages behave the same on all platforms.</p></li>
572: </ul></div>
573: </div>
1.41 asau 574: <div class="sect2">
1.1 dsieger 575: <div class="titlepage"><div><div><h3 class="title">
576: <a name="intro.platforms"></a>1.1.2. Supported platforms</h3></div></div></div>
577: <p>pkgsrc consists of both a source distribution and a binary
578: distribution for these operating systems. After retrieving the required
579: source or binaries, you can be up and running with pkgsrc in just
580: minutes!</p>
581: <p>pkgsrc was derived from FreeBSD's ports system, and
582: initially developed for NetBSD only. Since then, pkgsrc has
583: grown a lot, and now supports the following platforms:</p>
584: <div class="table">
585: <a name="supported-platforms"></a><p class="title"><b>Table 1.1. Platforms supported by pkgsrc</b></p>
1.106 tnn 586: <div class="table-contents"><table class="table" summary="Platforms supported by pkgsrc" border="1">
1.1 dsieger 587: <colgroup>
588: <col>
589: <col>
1.92 sevan 590: <col>
1.1 dsieger 591: </colgroup>
592: <thead><tr>
593: <th>Platform</th>
594: <th>Date Support Added</th>
1.92 sevan 595: <th>Notes</th>
1.1 dsieger 596: </tr></thead>
597: <tbody>
598: <tr>
1.174 leot 599: <td><a class="ulink" href="https://www.NetBSD.org/" target="_top">NetBSD</a></td>
1.1 dsieger 600: <td align="center">Aug 1997</td>
1.92 sevan 601: <td class="auto-generated"> </td>
1.1 dsieger 602: </tr>
603: <tr>
1.10 hubertf 604: <td><a class="ulink" href="http://wwws.sun.com/software/solaris/" target="_top">Solaris</a></td>
1.1 dsieger 605: <td align="center">Mar 1999</td>
1.151 sevan 606: <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 607: </tr>
608: <tr>
1.174 leot 609: <td><a class="ulink" href="https://www.kernel.org/" target="_top">Linux</a></td>
1.1 dsieger 610: <td align="center">Jun 1999</td>
1.151 sevan 611: <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 612: </tr>
613: <tr>
614: <td>
1.118 sevan 615: <a class="ulink" href="https://developer.apple.com/macos/" target="_top">Darwin / Mac OS X / OS X / macOS</a>
1.1 dsieger 616: </td>
617: <td align="center">Oct 2001</td>
1.151 sevan 618: <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 619: </tr>
620: <tr>
1.174 leot 621: <td><a class="ulink" href="https://www.freebsd.org/" target="_top">FreeBSD</a></td>
1.1 dsieger 622: <td align="center">Nov 2002</td>
1.151 sevan 623: <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 624: </tr>
625: <tr>
1.174 leot 626: <td><a class="ulink" href="https://www.openbsd.org/" target="_top">OpenBSD</a></td>
1.1 dsieger 627: <td align="center">Nov 2002</td>
1.151 sevan 628: <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 629: </tr>
630: <tr>
1.174 leot 631: <td><a class="ulink" href="https://www.sgi.com/software/irix/" target="_top">IRIX</a></td>
1.1 dsieger 632: <td align="center">Dec 2002</td>
1.92 sevan 633: <td>
1.151 sevan 634: <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX" target="_top">README.IRIX</a>
635: <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 636: </td>
1.1 dsieger 637: </tr>
638: <tr>
639: <td>BSD/OS</td>
640: <td align="center">Dec 2003</td>
1.92 sevan 641: <td class="auto-generated"> </td>
1.1 dsieger 642: </tr>
643: <tr>
1.174 leot 644: <td><a class="ulink" href="https://www-1.ibm.com/servers/aix/" target="_top">AIX</a></td>
1.1 dsieger 645: <td align="center">Dec 2003</td>
1.151 sevan 646: <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 647: </tr>
648: <tr>
649: <td>
1.174 leot 650: <a class="ulink" href="https://www.microsoft.com/windows/sfu/" target="_top">Interix</a>
1.1 dsieger 651: (Microsoft Windows Services for Unix)
652: </td>
653: <td align="center">Mar 2004</td>
1.151 sevan 654: <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 655: </tr>
656: <tr>
1.174 leot 657: <td><a class="ulink" href="https://www.dragonflybsd.org/" target="_top">DragonFlyBSD</a></td>
1.1 dsieger 658: <td align="center">Oct 2004</td>
1.92 sevan 659: <td class="auto-generated"> </td>
1.1 dsieger 660: </tr>
661: <tr>
1.10 hubertf 662: <td><a class="ulink" href="http://www.tru64.org/" target="_top">OSF/1</a></td>
1.1 dsieger 663: <td align="center">Nov 2004</td>
1.151 sevan 664: <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 665: </tr>
666: <tr>
1.174 leot 667: <td><a class="ulink" href="https://www.hp.com/products1/unix/" target="_top">HP-UX</a></td>
1.1 dsieger 668: <td align="center">Apr 2007</td>
1.151 sevan 669: <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 670: </tr>
1.23 wiz 671: <tr>
1.174 leot 672: <td><a class="ulink" href="https://www.haiku-os.org/" target="_top">Haiku</a></td>
1.23 wiz 673: <td align="center">Sep 2010</td>
1.151 sevan 674: <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 675: </tr>
1.45 obache 676: <tr>
1.174 leot 677: <td><a class="ulink" href="https://www.mirbsd.org/" target="_top">MirBSD</a></td>
1.57 bsiegert 678: <td align="center">Jan 2011</td>
1.92 sevan 679: <td class="auto-generated"> </td>
1.45 obache 680: </tr>
681: <tr>
1.174 leot 682: <td><a class="ulink" href="https://www.minix3.org/" target="_top">Minix3</a></td>
1.45 obache 683: <td align="center">Nov 2011</td>
1.151 sevan 684: <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 685: </tr>
686: <tr>
1.174 leot 687: <td><a class="ulink" href="https://cygwin.com/" target="_top">Cygwin</a></td>
1.45 obache 688: <td align="center">Mar 2013</td>
1.151 sevan 689: <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 690: </tr>
1.58 ryoon 691: <tr>
1.174 leot 692: <td><a class="ulink" href="https://www.debian.org/ports/kfreebsd-gnu/" target="_top">GNU/kFreeBSD</a></td>
1.58 ryoon 693: <td align="center">Jul 2013</td>
1.151 sevan 694: <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 695: </tr>
1.104 sevan 696: <tr>
1.174 leot 697: <td><a class="ulink" href="https://www.bitrig.org/" target="_top">Bitrig</a></td>
1.104 sevan 698: <td align="center">Jun 2014</td>
1.151 sevan 699: <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 700: </tr>
1.1 dsieger 701: </tbody>
702: </table></div>
703: </div>
704: <br class="table-break">
705: </div>
706: </div>
1.41 asau 707: <div class="sect1">
1.1 dsieger 708: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
709: <a name="overview"></a>1.2. Overview</h2></div></div></div>
710: <p>This document is divided into three parts. The first,
1.10 hubertf 711: <a class="link" href="#users-guide" title="Part I. The pkgsrc user's guide">The pkgsrc user's guide</a>,
1.1 dsieger 712: describes how one can use one of the packages in the Package
713: Collection, either by installing a precompiled binary package,
714: or by building one's own copy using the NetBSD package system.
1.10 hubertf 715: 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 716: package so it can be easily built by other NetBSD users without
717: knowing about the package's building details. The third part,
1.10 hubertf 718: <a class="link" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">The pkgsrc infrastructure internals</a>
1.1 dsieger 719: is intended for those who want to understand how pkgsrc is
720: implemented.</p>
721: <p>This document is available in various formats:
1.10 hubertf 722: <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 723: </div>
1.41 asau 724: <div class="sect1">
1.1 dsieger 725: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
726: <a name="terminology"></a>1.3. Terminology</h2></div></div></div>
1.23 wiz 727: <p>There has been a lot of talk about <span class="quote">“<span class="quote">ports</span>”</span>,
728: <span class="quote">“<span class="quote">packages</span>”</span>, etc. so far. Here is a description of all the
1.1 dsieger 729: terminology used within this document.</p>
1.41 asau 730: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 731: <dt><span class="term">Package</span></dt>
732: <dd><p>A set of files and building instructions
733: that describe what's necessary
734: to build a certain piece of software using
735: pkgsrc. Packages are traditionally stored under
1.123 wiz 736: <code class="filename">/usr/pkgsrc</code>,
737: but may be stored in any location,
738: referred to as <code class="varname">PKGSRCDIR</code>.</p></dd>
1.1 dsieger 739: <dt><span class="term">The NetBSD package system</span></dt>
1.23 wiz 740: <dd><p>This is the former name of <span class="quote">“<span class="quote">pkgsrc</span>”</span>. It
1.1 dsieger 741: is part of the NetBSD operating system and can be bootstrapped
742: to run on non-NetBSD operating systems as well. It handles
743: building (compiling), installing, and removing of
744: packages.</p></dd>
745: <dt><span class="term">Distfile</span></dt>
746: <dd><p>This term describes the file or files that are
747: provided by the author of the piece of software to
748: distribute his work. All the changes necessary to build on
749: NetBSD are reflected in the corresponding package. Usually
750: the distfile is in the form of a compressed tar-archive,
751: but other types are possible, too. Distfiles are usually
752: stored below
753: <code class="filename">/usr/pkgsrc/distfiles</code>.</p></dd>
754: <dt><span class="term">Port</span></dt>
755: <dd><p>This is the term used by FreeBSD and OpenBSD people
756: for what we call a package.
1.23 wiz 757: In NetBSD terminology, <span class="quote">“<span class="quote">port</span>”</span> refers to a different
1.1 dsieger 758: architecture.</p></dd>
759: <dt><span class="term">Precompiled/binary package</span></dt>
760: <dd>
761: <p>A set of binaries built with pkgsrc from a distfile
762: and stuffed together in a single <code class="filename">.tgz</code>
763: file so it can be installed on machines of the same
764: machine architecture without the need to
765: recompile. Packages are usually generated in
766: <code class="filename">/usr/pkgsrc/packages</code>; there is also
1.25 spz 767: an archive on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/" target="_top">ftp.NetBSD.org</a>.</p>
1.23 wiz 768: <p>Sometimes, this is referred to by the term <span class="quote">“<span class="quote">package</span>”</span> too,
1.1 dsieger 769: especially in the context of precompiled packages.</p>
770: </dd>
771: <dt><span class="term">Program</span></dt>
772: <dd><p>The piece of software to be installed which will be
773: constructed from all the files in the distfile by the
774: actions defined in the corresponding package.</p></dd>
775: </dl></div>
1.41 asau 776: <div class="sect2">
1.1 dsieger 777: <div class="titlepage"><div><div><h3 class="title">
778: <a name="term.roles"></a>1.3.1. Roles involved in pkgsrc</h3></div></div></div>
1.41 asau 779: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 780: <dt><span class="term">pkgsrc users</span></dt>
781: <dd>
782: <p>The
783: pkgsrc users are people who use the packages provided by pkgsrc.
784: Typically they are system administrators. The people using the
1.23 wiz 785: software that is inside the packages (maybe called <span class="quote">“<span class="quote">end
786: users</span>”</span>) are not covered by the pkgsrc guide.</p>
1.1 dsieger 787: <p>There are two kinds of pkgsrc users: Some only want to
788: install pre-built binary packages. Others build the pkgsrc
789: packages from source, either for installing them directly or for
1.10 hubertf 790: 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 791: documentation.</p>
792: </dd>
793: <dt><span class="term">package maintainers</span></dt>
794: <dd><p>A
1.10 hubertf 795: 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 796: <dt><span class="term">infrastructure developers</span></dt>
797: <dd><p>These people are involved in all those files
798: that live in the <code class="filename">mk/</code> directory and below.
1.10 hubertf 799: 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 800: too.</p></dd>
801: </dl></div>
802: </div>
803: </div>
1.41 asau 804: <div class="sect1">
1.1 dsieger 805: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
806: <a name="typography"></a>1.4. Typography</h2></div></div></div>
807: <p>When giving examples for commands, shell prompts are used to
808: show if the command should/can be issued as root, or if
1.23 wiz 809: <span class="quote">“<span class="quote">normal</span>”</span> user privileges are sufficient. We use a
1.115 sevan 810: <code class="prompt">#</code> for root's shell prompt, a <code class="prompt">%</code> for users'
811: shell prompt, assuming they use the C-shell or tcsh and a <code class="prompt">$</code> for
812: bourne shell and derivatives.</p>
1.1 dsieger 813: </div>
814: </div>
1.41 asau 815: <div class="part">
1.1 dsieger 816: <div class="titlepage"><div><div><h1 class="title">
817: <a name="users-guide"></a>Part I. The pkgsrc user's guide</h1></div></div></div>
818: <div class="toc">
819: <p><b>Table of Contents</b></p>
1.100 leot 820: <dl class="toc">
1.154 rillig 821: <dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt>
822: <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 823: <dd><dl>
1.154 rillig 824: <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt>
1.1 dsieger 825: <dd><dl>
1.154 rillig 826: <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt>
827: <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt>
1.1 dsieger 828: </dl></dd>
1.154 rillig 829: <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt>
1.1 dsieger 830: <dd><dl>
1.154 rillig 831: <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt>
832: <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt>
1.1 dsieger 833: </dl></dd>
834: </dl></dd>
1.154 rillig 835: <dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt>
1.1 dsieger 836: <dd><dl>
1.154 rillig 837: <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt>
838: <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt>
1.1 dsieger 839: </dl></dd>
1.154 rillig 840: <dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt>
1.1 dsieger 841: <dd><dl>
1.154 rillig 842: <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt>
1.1 dsieger 843: <dd><dl>
1.154 rillig 844: <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt>
845: <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt>
846: <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt>
847: <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt>
848: <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt>
849: <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>
850: <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt>
1.1 dsieger 851: </dl></dd>
1.154 rillig 852: <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt>
1.1 dsieger 853: <dd><dl>
1.154 rillig 854: <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt>
855: <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt>
856: <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 857: </dl></dd>
858: </dl></dd>
1.154 rillig 859: <dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt>
1.1 dsieger 860: <dd><dl>
1.154 rillig 861: <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt>
862: <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt>
863: <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt>
864: <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt>
1.1 dsieger 865: <dd><dl>
1.154 rillig 866: <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt>
867: <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt>
868: <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 869: </dl></dd>
1.154 rillig 870: <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt>
871: <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt>
1.1 dsieger 872: </dl></dd>
1.154 rillig 873: <dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt>
1.1 dsieger 874: <dd><dl>
1.154 rillig 875: <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt>
876: <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 877: </dl></dd>
1.154 rillig 878: <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk
1.6 rillig 879: builds)</a></span></dt>
1.1 dsieger 880: <dd><dl>
1.154 rillig 881: <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt>
1.180 rillig 882: <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a bulk build</a></span></dt>
1.154 rillig 883: <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd>
884: <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt>
1.178 rillig 885: <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt>
886: <dd><dl>
1.179 rillig 887: <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt>
888: <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt>
1.181 rillig 889: <dt><span class="sect2"><a href="#bulk.var.builderr">8.4.3. Force compiler options only in the build phase</a></span></dt>
890: <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt>
891: <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt>
892: <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt>
893: <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt>
894: <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt>
895: <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt>
896: <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt>
1.178 rillig 897: </dl></dd>
898: <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
899: <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
1.154 rillig 900: </dl></dd>
901: <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt>
902: <dd><dl>
903: <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
904: <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt>
905: </dl></dd>
906: <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt>
907: <dd><dl>
908: <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
909: <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
910: <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
911: <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
912: <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>
913: <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
914: <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
915: <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>
916: <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
917: <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 918: /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
1.154 rillig 919: <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>
920: <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt>
921: <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
922: <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
923: <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
924: <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
925: <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 926: </dl></dd>
927: </dl>
928: </div>
1.41 asau 929: <div class="chapter">
1.1 dsieger 930: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 931: <a name="help-user"></a>Chapter 2. Getting help</h2></div></div></div>
932: <p>
933: To get help when using pkgsrc, the definitive source is this
934: document, the pkgsrc guide. If you don't find anything here,
935: there are alternatives:
936: </p>
937: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
938: <li class="listitem">
939: <p>
940: The built-in pkgsrc help, which is available after bootstrapping
941: pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get
942: help for any topic, such as a variable name like
943: <code class="varname">BUILD_DEFS</code>, a make target like
944: <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like
945: <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p>
946: <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>
947: </li>
948: <li class="listitem"><p>
1.163 rillig 949: To see the value of a single variable, run <span class="command"><strong>bmake
950: show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>.
951: </p></li>
952: <li class="listitem"><p>
953: To see the values of the most common variables, run
954: <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by
955: topic. To see the variables for a single topic, run
956: <span class="command"><strong>bmake
957: show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example
958: <span class="command"><strong>bmake show-all-fetch</strong></span>.
959: </p></li>
960: <li class="listitem"><p>
1.154 rillig 961: The pkgsrc-users mailing list, to which
962: <a class="ulink" href="https://www.NetBSD.org/mailinglists/#pkgsrc-users" target="_top">you
963: can subscribe</a> and then <a class="ulink" href="mailto:pkgsrc-users@NetBSD.org" target="_top">ask your
964: questions</a>.</p></li>
965: <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible
966: <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a>
967: or by using a specialized chat program such as
968: <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>.
969: Pick any user name and join the channel #pkgsrc.</p></li>
970: </ul></div>
971: </div>
972: <div class="chapter">
973: <div class="titlepage"><div><div><h2 class="title">
974: <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 975: <div class="toc">
976: <p><b>Table of Contents</b></p>
1.100 leot 977: <dl class="toc">
1.154 rillig 978: <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt>
1.1 dsieger 979: <dd><dl>
1.154 rillig 980: <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt>
981: <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt>
1.1 dsieger 982: </dl></dd>
1.154 rillig 983: <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt>
1.1 dsieger 984: <dd><dl>
1.154 rillig 985: <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt>
986: <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt>
1.1 dsieger 987: </dl></dd>
988: </dl>
989: </div>
990: <p>Before you download and extract the files, you need to decide
991: where you want to extract them. When using pkgsrc as root user, pkgsrc
992: is usually installed in <code class="filename">/usr/pkgsrc</code>. You are though
993: free to install the sources and binary packages wherever you want in
994: your filesystem, provided that the pathname does not contain white-space
995: or other characters that are interpreted specially by the shell and some
996: other programs. A safe bet is to use only letters, digits, underscores
997: and dashes.</p>
1.41 asau 998: <div class="sect1">
1.1 dsieger 999: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1000: <a name="getting-first"></a>3.1. Getting pkgsrc for the first time</h2></div></div></div>
1.1 dsieger 1001: <p>Before you download any pkgsrc files, you should decide
1002: whether you want the <span class="emphasis"><em>current</em></span> branch or the
1003: <span class="emphasis"><em>stable</em></span> branch. The latter is forked on a
1004: quarterly basis from the current branch and only gets modified
1005: for security updates. The names of the stable branches are built
1006: from the year and the quarter, for example
1.174 leot 1007: <code class="literal">2020Q1</code>.</p>
1.1 dsieger 1008: <p>The second step is to decide <span class="emphasis"><em>how</em></span> you
1.23 wiz 1009: want to download pkgsrc. You can get it as a tar file or via CVS.
1010: Both ways are described here.</p>
1.51 asau 1011: <p>Note that tar archive contains CVS working copy.
1012: Thus you can switch to using CVS at any later time.</p>
1.41 asau 1013: <div class="sect2">
1.1 dsieger 1014: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1015: <a name="getting-via-tar"></a>3.1.1. As tar archive</h3></div></div></div>
1.1 dsieger 1016: <p>The primary download location for all pkgsrc files is
1.151 sevan 1017: <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/" target="_top">https://cdn.NetBSD.org/pub/pkgsrc/</a> or
1.51 asau 1018: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/</a>
1019: (it points to the same location).
1020: There are a number of subdirectories for different purposes,
1021: 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>
1022: <p>The tar archive for the current branch is in the directory
1.151 sevan 1023: <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 1024: It is autogenerated weekly.</p>
1.51 asau 1025: <p>To save download time we provide bzip2- and
1026: xz-compressed archives which are published at
1.151 sevan 1027: <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 1028: and
1.151 sevan 1029: <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 1030: respectively.
1031: </p>
1032: <p>You can fetch the same files using FTP.</p>
1.174 leot 1033: <p>The tar file for the stable branch 2020Q1 is in the
1034: 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 1035: <p>To download the latest pkgsrc stable tarball, run:</p>
1.12 weinem 1036: <pre class="screen">
1.174 leot 1037: <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 1038: <p>If you prefer, you can also fetch it using "wget", "curl",
1.51 asau 1039: or your web browser.</p>
1.12 weinem 1040: <p>Then, extract it with:</p>
1.78 snj 1041: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>tar -xzf pkgsrc.tar.gz -C /usr</code></strong></pre>
1.12 weinem 1042: <p>This will create the directory <code class="filename">pkgsrc/</code>
1043: in <code class="filename">/usr/</code> and all the package source will be
1044: stored under <code class="filename">/usr/pkgsrc/</code>.</p>
1045: <p>To download pkgsrc-current, run:</p>
1046: <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 1047: </div>
1.41 asau 1048: <div class="sect2">
1.1 dsieger 1049: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1050: <a name="getting-via-cvs"></a>3.1.2. Via anonymous CVS</h3></div></div></div>
1.23 wiz 1051: <p>To fetch a specific pkgsrc stable branch, run:</p>
1.174 leot 1052: <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 1053: </pre>
1054: <p>This will create the directory <code class="filename">pkgsrc/</code>
1055: in your <code class="filename">/usr/</code> directory and all the package source
1056: will be stored under <code class="filename">/usr/pkgsrc/</code>.</p>
1057: <p>To fetch the pkgsrc current branch, run:</p>
1.39 wiz 1058: <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 1059: </pre>
1.174 leot 1060: <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 1061: <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 1062: <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 1063: </pre>
1064: <p>Refer to documentation on your command shell how to set CVS_RSH=ssh permanently.
1065: For Bourne shells, you can set it in your <code class="filename">.profile</code>
1066: or better globally in <code class="filename">/etc/profile</code>:</p>
1067: <pre class="programlisting">
1068: # set CVS remote shell command
1069: CVS_RSH=ssh
1070: export CVS_RSH
1071: </pre>
1072: <p>By default, CVS doesn't do things like most people would expect it to do.
1073: But there is a way to convince CVS, by creating a file called <code class="filename">.cvsrc</code>
1074: in your home directory and saving the following lines to it.
1075: This file will save you lots of headache and some bug reports, so we strongly recommend it.
1076: You can find an explanation of this file in the CVS documentation.</p>
1.2 rillig 1077: <pre class="programlisting">
1078: # recommended CVS configuration file from the pkgsrc guide
1.155 sevan 1079: cvs -q
1.2 rillig 1080: checkout -P
1.4 rillig 1081: update -dP
1082: diff -upN
1.2 rillig 1083: rdiff -u
1.23 wiz 1084: release -d
1.2 rillig 1085: </pre>
1.1 dsieger 1086: </div>
1087: </div>
1.41 asau 1088: <div class="sect1">
1.1 dsieger 1089: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1090: <a name="uptodate"></a>3.2. Keeping pkgsrc up-to-date</h2></div></div></div>
1.1 dsieger 1091: <p>The preferred way to keep pkgsrc up-to-date is via CVS
1092: (which also works if you have first installed it via a tar
1093: file). It saves bandwidth and hard disk activity, compared to
1094: downloading the tar file again.</p>
1.41 asau 1095: <div class="sect2">
1.1 dsieger 1096: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1097: <a name="uptodate-tar"></a>3.2.1. Via tar files</h3></div></div></div>
1.41 asau 1098: <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 1099: <h3 class="title">Warning</h3>
1100: <p>When updating from a tar file, you first need to
1101: completely remove the old pkgsrc directory. Otherwise those
1102: files that have been removed from pkgsrc in the mean time will
1103: not be removed on your local disk, resulting in inconsistencies.
1104: When removing the old files, any changes that you have done to
1105: the pkgsrc files will be lost after updating. Therefore updating
1106: via CVS is strongly recommended.</p>
1107: </div>
1108: <p>Note that by default the distfiles and the binary packages
1109: are saved in the pkgsrc tree, so don't forget to rescue them
1.78 snj 1110: before updating. You can also configure pkgsrc to store distfiles
1111: and packages in directories outside the pkgsrc tree by setting the
1.1 dsieger 1112: <code class="varname">DISTDIR</code> and <code class="varname">PACKAGES</code>
1.154 rillig 1113: 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 1114: <p>To update pkgsrc from a tar file, download the tar file as
1115: explained above. Then, make sure that you have not made any
1116: changes to the files in the pkgsrc directory. Remove the pkgsrc
1117: directory and extract the new tar file. Done.</p>
1118: </div>
1.41 asau 1119: <div class="sect2">
1.1 dsieger 1120: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1121: <a name="uptodate-cvs"></a>3.2.2. Via CVS</h3></div></div></div>
1.25 spz 1122: <p>To update pkgsrc via CVS, change to the <code class="filename">pkgsrc</code> directory and run cvs:</p>
1123: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && cvs update -dP</code></strong>
1124: </pre>
1125: <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>
1126: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && env CVS_RSH=ssh cvs up -dP</code></strong>
1127: </pre>
1.41 asau 1128: <div class="sect3">
1.1 dsieger 1129: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 1130: <a name="uptodate-cvs-switch"></a>3.2.2.1. Switching between different pkgsrc branches</h4></div></div></div>
1.1 dsieger 1131: <p>When updating pkgsrc, the CVS program keeps track of the
1132: branch you selected. But if you, for whatever reason, want to
1133: switch from the stable branch to the current one, you can do it
1.23 wiz 1134: by adding the option <span class="quote">“<span class="quote">-A</span>”</span> after the
1135: <span class="quote">“<span class="quote">update</span>”</span> keyword. To switch from the current branch
1.1 dsieger 1136: back to the stable branch, add the
1.174 leot 1137: <span class="quote">“<span class="quote">-rpkgsrc-2020Q1</span>”</span> option.</p>
1.1 dsieger 1138: </div>
1.41 asau 1139: <div class="sect3">
1.1 dsieger 1140: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 1141: <a name="uptodate-cvs-changes"></a>3.2.2.2. What happens to my changes when updating?</h4></div></div></div>
1.1 dsieger 1142: <p>When you update pkgsrc, the CVS program will only touch
1143: those files that are registered in the CVS repository. That
1144: means that any packages that you created on your own will stay
1145: unmodified. If you change files that are managed by CVS, later
1146: updates will try to merge your changes with those that have been
1147: done by others. See the CVS manual, chapter
1.23 wiz 1148: <span class="quote">“<span class="quote">update</span>”</span> for details.</p>
1.1 dsieger 1149: </div>
1150: </div>
1151: </div>
1152: </div>
1.41 asau 1153: <div class="chapter">
1.1 dsieger 1154: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 1155: <a name="platforms"></a>Chapter 4. Using pkgsrc on systems other than NetBSD</h2></div></div></div>
1.1 dsieger 1156: <div class="toc">
1157: <p><b>Table of Contents</b></p>
1.100 leot 1158: <dl class="toc">
1.154 rillig 1159: <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt>
1160: <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt>
1.1 dsieger 1161: </dl>
1162: </div>
1.41 asau 1163: <div class="sect1">
1.1 dsieger 1164: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1165: <a name="binarydist"></a>4.1. Binary distribution</h2></div></div></div>
1166: <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 1167: </div>
1.41 asau 1168: <div class="sect1">
1.1 dsieger 1169: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1170: <a name="bootstrapping-pkgsrc"></a>4.2. Bootstrapping pkgsrc</h2></div></div></div>
1.43 asau 1171: <p>pkgsrc can be bootstrapped for use in two different modes:
1172: privileged and unprivileged one. In unprivileged mode in contrast
1.44 asau 1173: to privileged one all programs are installed under one particular user
1.43 asau 1174: and cannot utilise privileged operations (packages don't create
1175: special users and all special file permissions like setuid are ignored).
1176: </p>
1.1 dsieger 1177: <p>Installing the bootstrap kit from source should be as simple as:</p>
1178: <pre class="screen">
1.60 asau 1179: <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 1180: <code class="prompt">#</code> <strong class="userinput"><code>cd pkgsrc/bootstrap</code></strong>
1181: <code class="prompt">#</code> <strong class="userinput"><code>./bootstrap</code></strong>
1182: </pre>
1.43 asau 1183: <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>
1184: <p>By default, in privileged mode pkgsrc uses
1185: <code class="filename">/usr/pkg</code> for <span class="emphasis"><em>prefix</em></span>
1186: where programs will be installed in,
1.118 sevan 1187: and <code class="filename">/usr/pkg/pkgdb</code> for the package database
1.43 asau 1188: directory where pkgsrc will do its internal bookkeeping,
1189: <code class="filename">/var</code> is used as <span class="emphasis"><em>varbase</em></span>,
1190: where packages install their persistent data.
1191: In unprivileged mode pkgsrc uses
1192: <code class="filename">~/pkg</code> for <span class="emphasis"><em>prefix</em></span>,
1.118 sevan 1193: <code class="filename">~/pkg/pkgdb</code> for the package database,
1.43 asau 1194: and <code class="filename">~/pkg/var</code> for <span class="emphasis"><em>varbase</em></span>.
1195: </p>
1196: <p>You can change default layout using command-line arguments.
1197: Run <span class="quote">“<span class="quote">./bootstrap --help</span>”</span> to get details.
1198: </p>
1.41 asau 1199: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 1200: <h3 class="title">Note</h3>
1.10 hubertf 1201: <p>The bootstrap installs a <span class="command"><strong>bmake</strong></span> tool.
1202: Use this <span class="command"><strong>bmake</strong></span> when building via pkgsrc.
1203: For examples in this guide, use <span class="command"><strong>bmake</strong></span>
1.23 wiz 1204: instead of <span class="quote">“<span class="quote">make</span>”</span>.</p>
1.1 dsieger 1205: </div>
1.43 asau 1206: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1207: <h3 class="title">Note</h3>
1208: <p>It is possible to bootstrap multiple instances of pkgsrc
1209: using non-intersecting directories. Use <span class="command"><strong>bmake</strong></span>
1210: corresponding to the installation you're working with to build
1211: and install packages.
1212: </p>
1213: </div>
1.1 dsieger 1214: </div>
1215: </div>
1.41 asau 1216: <div class="chapter">
1.1 dsieger 1217: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 1218: <a name="using"></a>Chapter 5. Using pkgsrc</h2></div></div></div>
1.1 dsieger 1219: <div class="toc">
1220: <p><b>Table of Contents</b></p>
1.100 leot 1221: <dl class="toc">
1.154 rillig 1222: <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt>
1.1 dsieger 1223: <dd><dl>
1.154 rillig 1224: <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt>
1225: <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt>
1226: <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt>
1227: <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt>
1228: <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt>
1229: <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>
1230: <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt>
1231: </dl></dd>
1232: <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt>
1233: <dd><dl>
1234: <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt>
1235: <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt>
1236: <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 1237: </dl></dd>
1238: </dl>
1239: </div>
1240: <p>Basically, there are two ways of using pkgsrc. The first
1241: is to only install the package tools and to use binary packages
1.23 wiz 1242: that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span>
1243: in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span>
1.1 dsieger 1244: of pkgsrc, too. Then you are able to build your own packages,
1245: and you can still use binary packages from someone else.</p>
1.41 asau 1246: <div class="sect1">
1.1 dsieger 1247: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 1248: <a name="using-pkg"></a>5.1. Using binary packages</h2></div></div></div>
1.179 rillig 1249: <p>On the <a class="ulink" href="http://cdn.NetBSD.org/" target="_top">cdn.NetBSD.org</a>
1.151 sevan 1250: site and mirrors, there are collections of binary packages,
1.9 rillig 1251: ready to be installed. These binary packages have been built using the
1252: default settings for the directories, that is:</p>
1.41 asau 1253: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 1254: <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>
1255: <li class="listitem"><p><code class="filename">/usr/pkg/etc</code> for configuration files,</p></li>
1256: <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 1257: </ul></div>
1258: <p>If you cannot use these directories for whatever reasons (maybe
1259: because you're not root), you cannot use these binary packages, but
1.154 rillig 1260: 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 1261: <div class="sect2">
1.1 dsieger 1262: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1263: <a name="finding-binary-packages"></a>5.1.1. Finding binary packages</h3></div></div></div>
1.5 weinem 1264: <p>To install binary packages, you first need to know from where
1265: to get them. The first place where you should look is on the main
1.179 rillig 1266:
1267: pkgsrc FTP server in the directory <a class="ulink" href="http://cdn.NetBSD.org/pub/pkgsrc/packages/" target="_top"><code class="filename">/pub/pkgsrc/packages</code></a>.</p>
1.5 weinem 1268: <p>This directory contains binary packages for multiple
1269: platforms. First, select your operating system. (Ignore the
1270: directories with version numbers attached to it, they just exist for
1271: legacy reasons.) Then, select your hardware architecture, and in the
1.23 wiz 1272: third step, the OS version and the <span class="quote">“<span class="quote">version</span>”</span> of pkgsrc.</p>
1.9 rillig 1273: <p>In this directory, you often find a file called
1274: <code class="filename">bootstrap.tar.gz</code> which contains the package
1275: management tools. If the file is missing, it is likely that your
1276: operating system already provides those tools. Download the file and
1277: extract it in the <code class="filename">/</code> directory. It will create
1278: the directories <code class="filename">/usr/pkg</code> (containing the tools
1.118 sevan 1279: for managing binary packages and the database of installed packages).</p>
1.1 dsieger 1280: </div>
1.41 asau 1281: <div class="sect2">
1.1 dsieger 1282: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1283: <a name="installing-binary-packages"></a>5.1.2. Installing binary packages</h3></div></div></div>
1.9 rillig 1284: <p>In the directory from the last section, there is a
1.85 wiz 1285: subdirectory called <code class="filename">All/</code>, which contains all the
1.9 rillig 1286: binary packages that are available for the platform, excluding those
1287: that may not be distributed via FTP or CDROM (depending on which
1.23 wiz 1288: medium you are using).</p>
1.9 rillig 1289: <p>To install packages directly from an FTP or HTTP server, run
1290: the following commands in a Bourne-compatible shell (be sure to
1.10 hubertf 1291: <span class="command"><strong>su</strong></span> to root first):</p>
1.9 rillig 1292: <pre class="screen">
1293: <code class="prompt">#</code> <strong class="userinput"><code>PATH="/usr/pkg/sbin:$PATH"</code></strong>
1.179 rillig 1294:
1295: <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages"</code></strong>
1.169 rillig 1296: <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 1297: <code class="prompt">#</code> <strong class="userinput"><code>export PATH PKG_PATH</code></strong>
1298: </pre>
1299: <p>Instead of URLs, you can also use local paths, for example if
1300: you are installing from a set of CDROMs, DVDs or an NFS-mounted
1301: repository. If you want to install packages from multiple sources,
1302: you can separate them by a semicolon in
1303: <code class="varname">PKG_PATH</code>.</p>
1304: <p>After these preparations, installing a package is very
1305: easy:</p>
1306: <pre class="screen">
1.118 sevan 1307: <code class="prompt">#</code> <strong class="userinput"><code>pkg_add libreoffice</code></strong>
1308: <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap24-php71-*</code></strong>
1.9 rillig 1309: </pre>
1.1 dsieger 1310: <p>Note that any prerequisite packages needed to run the
1311: package in question will be installed, too, assuming they are
1312: present where you install from.</p>
1.23 wiz 1313: <p>Adding packages might install vulnerable packages.
1314: Thus you should run <span class="command"><strong>pkg_admin audit</strong></span>
1.14 jmcneill 1315: regularly, especially after installing new packages, and verify
1316: that the vulnerabilities are acceptable for your configuration.</p>
1.1 dsieger 1317: <p>After you've installed packages, be sure to have
1318: <code class="filename">/usr/pkg/bin</code> and <code class="filename">/usr/pkg/sbin</code> in your
1319: <code class="varname">PATH</code> so you can actually start the just
1320: installed program.</p>
1321: </div>
1.41 asau 1322: <div class="sect2">
1.1 dsieger 1323: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1324: <a name="using.pkg_delete"></a>5.1.3. Deinstalling packages</h3></div></div></div>
1.1 dsieger 1325: <p>To deinstall a package, it does not matter whether it was
1326: installed from source code or from a binary package. The
1.10 hubertf 1327: <span class="command"><strong>pkg_delete</strong></span> command does not know it anyway.
1328: To delete a package, you can just run <span class="command"><strong>pkg_delete
1.1 dsieger 1329: <em class="replaceable"><code>package-name</code></em></strong></span>. The package
1330: name can be given with or without version number. Wildcards can
1331: also be used to deinstall a set of packages, for example
1332: <code class="literal">*emacs*</code>. Be sure to include them in quotes,
1333: so that the shell does not expand them before
1334: <code class="literal">pkg_delete</code> sees them.</p>
1335: <p>The <code class="option">-r</code> option is very powerful: it
1336: removes all the packages that require the package in question
1337: and then removes the package itself. For example:
1338:
1339: </p>
1340: <pre class="screen">
1341: <code class="prompt">#</code> <strong class="userinput"><code>pkg_delete -r jpeg</code></strong>
1342: </pre>
1343: <p>
1344:
1345: will remove jpeg and all the packages that used it; this allows
1346: upgrading the jpeg package.</p>
1347: </div>
1.41 asau 1348: <div class="sect2">
1.1 dsieger 1349: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1350: <a name="using.pkg_info"></a>5.1.4. Getting information about installed packages</h3></div></div></div>
1.10 hubertf 1351: <p>The <span class="command"><strong>pkg_info</strong></span> shows information about
1.1 dsieger 1352: installed packages or binary package files.</p>
1353: </div>
1.41 asau 1354: <div class="sect2">
1.1 dsieger 1355: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 1356: <a name="vulnerabilities"></a>5.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div>
1.1 dsieger 1357: <p>
1.164 leot 1358: The pkgsrc Security Team and Packages Groups maintain a list of
1.1 dsieger 1359: known security vulnerabilities to packages which are (or have been)
1360: included in pkgsrc. The list is available from the NetBSD
1.179 rillig 1361:
1362: FTP site at <a class="ulink" href="http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a>.
1.1 dsieger 1363: </p>
1364: <p>
1.22 jakllsch 1365: Through <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>,
1.1 dsieger 1366: this list can be downloaded
1367: automatically, and a security audit of all packages installed on a system
1368: can take place.
1369: </p>
1370: <p>
1.22 jakllsch 1371: There are two components to auditing. The first
1372: step, <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>,
1373: is for downloading
1.1 dsieger 1374: the list of vulnerabilities from the NetBSD FTP site. The second
1.22 jakllsch 1375: step, <span class="command"><strong>pkg_admin audit</strong></span>, checks to see if any of your
1.1 dsieger 1376: installed packages are vulnerable. If a package is vulnerable, you
1377: will see output similar to the following:
1378: </p>
1379: <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see
1.174 leot 1380: https://www.samba.org/samba/whatsnew/macroexploit.html</pre>
1.1 dsieger 1381: <p>
1.22 jakllsch 1382: You may wish to have the
1.179 rillig 1383:
1384: <a class="ulink" href="http://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>
1.180 rillig 2091: <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a bulk build</a></span></dt>
1.154 rillig 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>
1.179 rillig 2096: <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt>
2097: <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt>
1.181 rillig 2098: <dt><span class="sect2"><a href="#bulk.var.builderr">8.4.3. Force compiler options only in the build phase</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>
1.178 rillig 2106: </dl></dd>
2107: <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
2108: <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
1.6 rillig 2109: </dl>
2110: </div>
1.175 gutterid 2111: <p>For a number of reasons, you may want to build binary packages
2112: for a large selected set of packages in pkgsrc, or even for all pkgsrc packages.
1.71 wiz 2113: For instance, when you have multiple machines that should run the same software,
2114: it is wasted time if they all build their packages themselves from source.
2115: Or you may want to build a list of packages you want and check them before
1.175 gutterid 2116: deploying onto production systems.
1.71 wiz 2117: There is a way of getting a set of binary packages:
1.175 gutterid 2118: the bulk build system, or pbulk ("p" stands for "parallel").
1.112 rillig 2119: This chapter describes how to set it up.</p>
1.41 asau 2120: <div class="sect1">
1.6 rillig 2121: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2122: <a name="bulk.pre"></a>8.1. Preparations</h2></div></div></div>
1.71 wiz 2123: <p>First of all, you have to decide whether you build all packages
2124: or a limited set of them. Full bulk builds usually consume a lot more resources,
2125: both space and time, than builds for some practical sets of packages.
1.175 gutterid 2126: A number of particularly heavy packages exist that are not actually
2127: interesting to a wide audience. (The approximate resource consumption for a
2128: 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>.)
2129: For limited bulk builds you need to make a list of packages you want to build.
1.112 rillig 2130: Note that all their dependencies will be built, so you don't need to track them manually.
1.71 wiz 2131: </p>
2132: <p>During bulk builds various packages are installed and deinstalled
2133: in <code class="filename">/usr/pkg</code> (or whatever <code class="filename">LOCALBASE</code> is),
2134: so make sure that you don't need any package during the builds.
1.112 rillig 2135: Essentially, you should provide a fresh system, either a chroot environment
1.71 wiz 2136: or something even more restrictive, depending on what the operating system provides,
2137: or dedicate the whole physical machine.
2138: As a useful side effect this makes sure that bulk builds cannot
2139: break anything in your system. There have been numerous cases where
1.6 rillig 2140: certain packages tried to install files outside the
2141: <code class="filename">LOCALBASE</code> or wanted to edit some files in
1.71 wiz 2142: <code class="filename">/etc</code>.
2143: </p>
1.6 rillig 2144: </div>
1.41 asau 2145: <div class="sect1">
1.6 rillig 2146: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.180 rillig 2147: <a name="bulk.pbulk"></a>8.2. Running a bulk build</h2></div></div></div>
2148: <p>Running a bulk build works roughly as follows:</p>
1.41 asau 2149: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2150: <li class="listitem"><p>First, build the pbulk infrastructure in a fresh pkgsrc location.</p></li>
2151: <li class="listitem"><p>Then, build each of the packages from a clean installation directory using the infrastructure.</p></li>
1.15 rillig 2152: </ul></div>
1.41 asau 2153: <div class="sect2">
1.15 rillig 2154: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 2155: <a name="bulk.pbulk.conf"></a>8.2.1. Configuration</h3></div></div></div>
1.112 rillig 2156: <p>To simplify configuration, we provide the helper script <code class="filename">mk/pbulk/pbulk.sh</code>.</p>
1.68 asau 2157: <p>In order to use it, prepare a clear system (real one, chroot environment, jail, zone, virtual machine).
2158: Configure network access to fetch distribution files.
1.112 rillig 2159: Create a user with name "pbulk".</p>
1.68 asau 2160: <p>Fetch and extract pkgsrc. Use a command like one of these:</p>
2161: <pre class="screen">
1.151 sevan 2162: <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>
2163: <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 2164: <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 2165: </pre>
2166: <p>Or any other way that fits (e.g., curl, wget).</p>
2167: <p>Deploy and configure pbulk tools, e.g.:</p>
2168: <pre class="screen">
1.118 sevan 2169: <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 2170: <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>
2171: <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -nlc mk.conf.frag # native, apply settings, configure for limited build</code></strong>
2172: </pre>
2173: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
2174: <h3 class="title">Note</h3>
2175: <p><code class="filename">mk.conf.frag</code> is a fragment of
2176: <code class="filename">mk.conf</code> that contains settings you want to
2177: apply to packages you build. For instance,</p>
2178: <pre class="programlisting">
1.112 rillig 2179: PKG_DEVELOPER= yes # perform more checks
2180: X11_TYPE= modular # use pkgsrc X11
2181: SKIP_LICENSE_CHECK= yes # accept all licences (useful
2182: # when building all packages)
1.68 asau 2183: </pre>
2184: </div>
2185: <p>If configured for limited list, replace the list in <code class="filename">/usr/pbulk/etc/pbulk.list</code>
1.112 rillig 2186: with your list of packages, one per line without empty lines or comments. E.g.:</p>
1.68 asau 2187: <pre class="programlisting">
2188: www/firefox
2189: mail/thunderbird
2190: misc/libreoffice4
2191: </pre>
1.69 asau 2192: <p>At this point you can also review configuration in <code class="filename">/usr/pbulk/etc</code>
2193: and make final amendments, if wanted.</p>
1.68 asau 2194: <p>Start it:</p>
2195: <pre class="screen">
2196: <code class="prompt">#</code> <strong class="userinput"><code>/usr/pbulk/bin/bulkbuild</code></strong>
2197: </pre>
2198: <p>After it finishes, you'll have <code class="filename">/mnt</code> filled with distribution files, binary packages, and reports,
2199: plain text summary in <code class="filename">/mnt/bulklog/meta/report.txt</code>
2200: </p>
2201: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
2202: <h3 class="title">Note</h3>
2203: <p>The <code class="filename">pbulk.sh</code> script does not cover all possible use cases.
2204: While being ready to run, it serves as a good starting point to understand and build more complex setups.
2205: The script is kept small enough for better understanding.</p>
2206: </div>
2207: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
2208: <h3 class="title">Note</h3>
2209: <p>The <code class="filename">pbulk.sh</code> script supports running
2210: unprivileged bulk build and helps configuring distributed bulk builds.</p>
2211: </div>
1.6 rillig 2212: </div>
2213: </div>
1.41 asau 2214: <div class="sect1">
1.6 rillig 2215: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2216: <a name="bulk.req"></a>8.3. Requirements of a full bulk build</h2></div></div></div>
1.71 wiz 2217: <p>A complete bulk build requires lots of disk space. Some of the
2218: disk space can be read-only, some other must be writable. Some can be on
2219: remote filesystems (such as NFS) and some should be local. Some can be
2220: temporary filesystems, others must survive a sudden reboot.</p>
2221: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
2222: <li class="listitem"><p>40 GB for the distfiles (read-write, remote, temporary)</p></li>
2223: <li class="listitem"><p>30 GB for the binary packages (read-write, remote, permanent)</p></li>
2224: <li class="listitem"><p>1 GB for the pkgsrc tree (read-only, remote, permanent)</p></li>
2225: <li class="listitem"><p>5 GB for <code class="filename">LOCALBASE</code> (read-write, local, temporary)</p></li>
2226: <li class="listitem"><p>10 GB for the log files (read-write, remote, permanent)</p></li>
2227: <li class="listitem"><p>5 GB for temporary files (read-write, local, temporary)</p></li>
2228: </ul></div>
2229: </div>
2230: <div class="sect1">
2231: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.178 rillig 2232: <a name="bulk.var"></a>8.4. Bulk build variants</h2></div></div></div>
2233: <p>To ensure that pkgsrc packages work in different configurations, it
2234: makes sense to run non-default bulk builds from time to time. This
2235: section lists some ideas for bulk builds that intentionally let packages
2236: fail if they don't follow the pkgsrc style.</p>
2237: <div class="sect2">
2238: <div class="titlepage"><div><div><h3 class="title">
1.179 rillig 2239: <a name="bulk.var.confopt"></a>8.4.1. Detect unknown configure options</h3></div></div></div>
1.178 rillig 2240: <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
2241: <pre class="programlisting">
2242: GNU_CONFIGURE_STRICT= yes
2243: </pre>
2244: <p>When a package fails this additional check, the most common cause
2245: is that the configure option was valid for an older version of the
2246: package but does not apply anymore. In that case, just remove it.</p>
2247: </div>
2248: <div class="sect2">
2249: <div class="titlepage"><div><div><h3 class="title">
1.179 rillig 2250: <a name="bulk.var.comperr"></a>8.4.2. Detect classes of bugs by forcing compiler warnings</h3></div></div></div>
1.178 rillig 2251: <p>The job of a compiler is not restricted to producing executable
1.179 rillig 2252: code, most compilers also detect typical programming mistakes. The pkgsrc
2253: compiler wrappers make it easy to force compiler options when the package
2254: is built. This can be used to find typical bugs across all packages that
2255: are in pkgsrc. By reporting these bugs upstream, the packages will be
2256: more reliable with the next updates.</p>
2257: <p>Add some of the following lines to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p>
1.178 rillig 2258: <pre class="programlisting">
2259: CFLAGS+= -Werror=char-subscripts
1.179 rillig 2260: CFLAGS+= -Werror=implicit-function-declaration
1.178 rillig 2261: </pre>
1.179 rillig 2262: <p>When a package fails to build using these stricter compiler
2263: options, document the circumstances in which the compiler produced the
2264: error message. This includes:</p>
1.178 rillig 2265: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
2266: <li class="listitem"><p>The platform
2267: (<code class="varname">MACHINE_PLATFORM</code>)</p></li>
2268: <li class="listitem"><p>The source file</p></li>
2269: <li class="listitem"><p>An excerpt of the code. GCC and Clang already do this as
2270: part of the diagnostic.</p></li>
1.179 rillig 2271: <li class="listitem"><p>The exact error message from the compiler.</p></li>
1.178 rillig 2272: </ul></div>
2273: <p>If a package produces these error messages, but the package is
1.179 rillig 2274: fine, record this in your local <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, like this, to skip this check
2275: in the next builds:</p>
1.178 rillig 2276: <pre class="programlisting">
1.179 rillig 2277: .if ${PKGPATH} == category/package
1.178 rillig 2278: # Version ${VERSION} failed on ${MACHINE_PLATFORM}:
2279: # error message
2280: # code
1.179 rillig 2281: # Reason why the code does not need to be fixed.
1.178 rillig 2282: BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts
1.179 rillig 2283: .endif
1.178 rillig 2284: </pre>
2285: <p>If the error messages from the compiler are valid and the code
1.179 rillig 2286: needs to be fixed, prepare a local patch (see
2287: <code class="varname">LOCALPATCHES</code>) and report the bug to the upstream
2288: authors of the package, providing them with the information you collected
2289: above.</p>
2290: <p>Patches that are not essential for the package to work should only
2291: be reported upstream but not committed to pkgsrc, to make future updates
2292: easier.</p>
1.178 rillig 2293: </div>
2294: <div class="sect2">
2295: <div class="titlepage"><div><div><h3 class="title">
1.181 rillig 2296: <a name="bulk.var.builderr"></a>8.4.3. Force compiler options only in the build phase</h3></div></div></div>
2297: <p>When adding custom compiler flags via <code class="varname">CFLAGS</code>,
2298: these apply to all phases of the package build process. Especially in the
2299: configure phase, adding <code class="literal">-Werror</code> leads to wrong
2300: decisions. The GNU configure scripts feed many small test programs to the
2301: C compiler to see whether certain headers are available, functions are
2302: defined in a library and programs can be run. In many cases these
2303: programs would not survive a strict compiler run with <code class="literal">-Wall
2304: -Wextra -Werror</code>.</p>
2305: <p>The pkgsrc infrastructure is flexible enough to support compiler
2306: options being added between the <code class="literal">configure</code> and
2307: <code class="literal">build</code> phases. It's a little more complicated than the
2308: other examples in this section but still easy enough.</p>
2309: <p>The basic idea is to use the pkgsrc compiler wrapper to inject the
2310: desired compiler options. The compiler wrapper's original task is to hide
2311: unwanted directories of include files and to normalize compiler options.
2312: It does this by wrapping the compiler command and rewriting the command
2313: line. To see this in action, run <span class="command"><strong>bmake patch</strong></span> in a
2314: package directory and examine the
2315: <code class="filename">work/.cwrappers/config</code> directory. It contains
2316: individual configurations for the C compiler and the related tools. The
2317: plan is to find a hook between the configure and build phases, and to
2318: modify these configuration files at that point.</p>
2319: <p>To find this hook, have a look at
2320: <code class="filename">mk/build/build.mk</code>, which contains among others the
2321: <code class="literal">pre-build-checks-hook</code>. The word
2322: <code class="literal">checks</code> doesn't quite fit, but the
2323: <code class="literal">pre-build-hook</code> sounds good enough.</p>
2324: <p>The code to be included in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> is:</p>
2325: <pre class="programlisting">
2326: # Just a few example options.
2327: BUILD_ONLY_CFLAGS= -Wall -Werror -O2 -DTEMPDIR='"/tmp"'
2328:
2329: .if ${BUILD_ONLY_CFLAGS:U:M*}
2330: pre-build-checks-hook: add-build-only-cflags
2331:
2332: add-build-only-cflags: .PHONY
2333: ${RUN} cd ${CWRAPPERS_CONFIG_DIR}; \
2334: ${TEST} ! -f ${.TARGET} || exit 0; \
2335: for flag in ${BUILD_ONLY_CFLAGS}; do \
2336: ${ECHO} "append=$$flag" >> cc; \
2337: done; \
2338: > ${.TARGET}
2339: .endif
2340: </pre>
2341: <p>(When editing the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, make sure that the commands of the
2342: <code class="literal">add-build-only-cflags</code> target are indented with a tab,
2343: not with spaces.)</p>
2344: <p>The condition in the <code class="literal">.if</code> statement contains the
2345: <code class="literal">:U</code> modifier to prevent parse errors if the variable
2346: should be undefined, possibly because it is only defined for a subset of
2347: the packages. The <code class="literal">:M*</code> modifier ensures that there is
2348: at least one compiler option, to prevent a syntax error in the shell
2349: parser.</p>
2350: <p>The code around the <code class="literal">${.TARGET}</code> variable ensures
2351: that the additional compiler options are only appended once, even if
2352: <span class="command"><strong>bmake build</strong></span> is run multiple times. To do this, it
2353: creates a marker file.</p>
2354: <p>To verify that this setup works, run <span class="command"><strong>bmake
2355: configure</strong></span> in a package directory. Up to now, everything works
2356: as usual. Examine the directory
2357: <code class="filename">work/.cwrappers/config</code> to see that the compiler
2358: options from <code class="varname">BUILD_ONLY_CFLAGS</code> are not yet added to
2359: the file <code class="filename">cc</code>. Examine the tail of the
2360: <code class="filename">work/.work.log</code> file to see that the normal compiler
2361: options are used.</p>
2362: <p>Now run <span class="command"><strong>bmake build</strong></span>. This will append the
2363: options to the file <code class="filename">cc</code> and will create the marker
2364: file in the same directory. After that, the build starts as usual, but
2365: with the added compiler options. Examine the tail of the file
2366: <code class="filename">work/.work.log</code> to see that the lines starting with
2367: <code class="literal">[*]</code> don't contain the compiler options, but the
2368: corresponding lines starting with <code class="literal"><.></code> do end
2369: with these options.</p>
2370: <p>Building packages using this setup variant and fixing the resulting
2371: bugs is the same as in <a class="xref" href="#bulk.var.comperr" title="8.4.2. Detect classes of bugs by forcing compiler warnings">Section 8.4.2, “Detect classes of bugs by forcing compiler warnings”</a>.</p>
2372: </div>
2373: <div class="sect2">
2374: <div class="titlepage"><div><div><h3 class="title">
2375: <a name="bulk.var.dirs"></a>8.4.4. Use custom directories</h3></div></div></div>
1.178 rillig 2376: <p>Some directories like <code class="varname">PREFIX</code>,
2377: <code class="varname">VARBASE</code>, <code class="varname">PKG_SYSCONFDIR</code>,
2378: <code class="varname">PKGMANDIR</code>, <code class="varname">PKG_INFODIR</code> can be
2379: configured in pkgsrc. Set these to arbitrary paths during bootstrap or
2380: afterwards in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
2381: <pre class="programlisting">
2382: PREFIX= /a-random-uuid
2383: PKG_SYSCONFDIR= /a-random-uuid
2384: VARBASE= /a-random-uuid
2385: PKGMANDIR= a-random-uuid
2386: PKG_INFODIR= a-random-uuid
2387: </pre>
2388: </div>
2389: <div class="sect2">
2390: <div class="titlepage"><div><div><h3 class="title">
1.181 rillig 2391: <a name="bulk.var.warn"></a>8.4.5. Turn warnings into errors</h3></div></div></div>
1.178 rillig 2392: <p>When building a package, warnings are typically ignored since they
2393: just flow by and do not cause the build to fail immediately. To find
2394: these warnings, redefine them to errors in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
2395: <pre class="programlisting">
2396: DELAYED_WARNING_MSG= ${DELAYED_ERROR_MSG} "(was warning)"
2397: WARNING_MSG= ${FAIL_MSG} "(was warning)"
2398: </pre>
2399: <p>(There are many more classes of warnings in pkgsrc, and most of
2400: them can be redefined with a simple definition like above.</p>
1.179 rillig 2401: <p>If a package suggests to add <code class="varname">USE_TOOLS+=perl</code> to
1.178 rillig 2402: the package Makefile, research whether the package actually needs Perl.
2403: If it does, add <code class="varname">USE_TOOLS+=perl</code> to the package
2404: Makefile, and if it doesn't, add
2405: <code class="varname">TOOLS_BROKEN+=perl</code>.</p>
2406: </div>
2407: <div class="sect2">
2408: <div class="titlepage"><div><div><h3 class="title">
1.181 rillig 2409: <a name="bulk.var.pkglint"></a>8.4.6. Reject packages for which pkglint reports errors</h3></div></div></div>
1.178 rillig 2410: <p>Using pkglint as part of the regular build process is mostly a
2411: waste of time. If you want to fix some of the warnings, just run pkglint
2412: recursively on the whole pkgsrc tree. This will take a few minutes (up to
2413: 10), which is much faster than a complete bulk build.</p>
2414: </div>
2415: <div class="sect2">
2416: <div class="titlepage"><div><div><h3 class="title">
1.181 rillig 2417: <a name="bulk.var.strings"></a>8.4.7. Reject packages that contain forbidden strings</h3></div></div></div>
1.178 rillig 2418: <p>To ensure that the binary packages don't contain references to the
2419: build directory, there is already <code class="varname">CHECK_WRKREF</code>. If
2420: that variable includes the item <code class="literal">extra</code>, it is
2421: possible to define additional patterns that must not appear in any
2422: installed file. This is specified in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
2423: <pre class="programlisting">
2424: CHECK_WRKREF= extra
2425: CHECK_WRKREF_EXTRA_DIRS+= /usr/local
2426: CHECK_WRKREF_EXTRA_DIRS+= /usr/pkg
2427: CHECK_WRKREF_EXTRA_DIRS+= @[A-Z][A-Z]*@
2428: </pre>
2429: <p>The above patterns will probably generate many false positives,
2430: therefore the results need to be taken with a grain of salt.</p>
2431: </div>
2432: <div class="sect2">
2433: <div class="titlepage"><div><div><h3 class="title">
1.181 rillig 2434: <a name="bulk.var.test"></a>8.4.8. Reject packages whose self-test fails</h3></div></div></div>
1.178 rillig 2435: <p>To run the test suites that come with each package, add this line
2436: to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
2437: <pre class="programlisting">
2438: PKGSRC_RUN_TEST= yes
2439: </pre>
2440: <p>Be prepared that even the most basic packages fail this test. When
2441: doing a bulk build with this, it will often abort in the early phase
2442: where the packages are scanned for their dependencies since there are
2443: cyclic dependencies. There is still a lot to do in this area.</p>
2444: </div>
2445: <div class="sect2">
2446: <div class="titlepage"><div><div><h3 class="title">
1.181 rillig 2447: <a name="bulk.var.shvar"></a>8.4.9. Reject packages that use undefined shell variables</h3></div></div></div>
1.178 rillig 2448: <p>To catch typos in the shell snippets from the Makefile fragments,
2449: add the <code class="literal">-u</code> flag to most of the commands by adding this
2450: line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
2451: <pre class="programlisting">
2452: RUN= @set -eu;
2453: </pre>
1.181 rillig 2454: <p>After that, ensure that none of the bulk build log files (even
2455: those for successfully built packages) contains the string
2456: <code class="literal">parameter not set</code> or whatever error message the
2457: command <span class="command"><strong>sh -ceu '$undefined'</strong></span> outputs.</p>
1.178 rillig 2458: <p>See <code class="filename">mk/misc/common.mk</code> for the existing
2459: definition.</p>
2460: </div>
2461: <div class="sect2">
2462: <div class="titlepage"><div><div><h3 class="title">
1.181 rillig 2463: <a name="bulk.var.quiet"></a>8.4.10. Turn off verbose logging</h3></div></div></div>
1.178 rillig 2464: <p>The build logs of a package are often quite long. This allows error
2465: messages or other interesting details to hide between the noise. To make
2466: the actual error message stand out more, add these lines to
2467: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
2468: <pre class="programlisting">
2469: GNU_CONFIGURE_QUIET= yes
2470: MAKE_FLAGS+= -s
2471: </pre>
2472: <p>The <code class="literal">-s</code> option works for both GNU Make and BSD
2473: Make. On exotic platforms with their own make, it may be a little
2474: different.</p>
2475: </div>
2476: </div>
2477: <div class="sect1">
2478: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
2479: <a name="creating-cdroms"></a>8.5. Creating a multiple CD-ROM packages collection</h2></div></div></div>
1.1 dsieger 2480: <p>After your pkgsrc bulk-build has completed, you may wish to
2481: create a CD-ROM set of the resulting binary packages to assist
2482: in installing packages on other machines. The
1.137 leot 2483: <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 2484: a simple tool for creating the ISO 9660 images.
1.10 hubertf 2485: <span class="command"><strong>cdpack</strong></span> arranges the packages on the CD-ROMs in a
1.1 dsieger 2486: way that keeps all the dependencies for a given package on the same
2487: CD as that package.</p>
1.41 asau 2488: <div class="sect2">
1.1 dsieger 2489: <div class="titlepage"><div><div><h3 class="title">
1.178 rillig 2490: <a name="cdpack-example"></a>8.5.1. Example of cdpack</h3></div></div></div>
1.1 dsieger 2491: <p>Complete documentation for cdpack is found in the cdpack(1)
2492: man page. The following short example assumes that the binary
2493: packages are left in
2494: <code class="filename">/usr/pkgsrc/packages/All</code> and that
2495: sufficient disk space exists in <code class="filename">/u2</code> to
2496: hold the ISO 9660 images.</p>
2497: <pre class="screen">
2498: <code class="prompt">#</code> <strong class="userinput"><code>mkdir /u2/images</code></strong>
2499: <code class="prompt">#</code> <strong class="userinput"><code>pkg_add /usr/pkgsrc/packages/All/cdpack</code></strong>
2500: <code class="prompt">#</code> <strong class="userinput"><code>cdpack /usr/pkgsrc/packages/All /u2/images</code></strong>
2501: </pre>
2502: <p>If you wish to include a common set of files
2503: (<code class="filename">COPYRIGHT</code>, <code class="filename">README</code>,
2504: etc.) on each CD in the collection, then you need to create a
1.175 gutterid 2505: directory which contains these files, e.g.:</p>
1.1 dsieger 2506: <pre class="screen">
2507: <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common</code></strong>
2508: <code class="prompt">#</code> <strong class="userinput"><code>echo "This is a README" > /tmp/common/README</code></strong>
2509: <code class="prompt">#</code> <strong class="userinput"><code>echo "Another file" > /tmp/common/COPYING</code></strong>
2510: <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common/bin</code></strong>
2511: <code class="prompt">#</code> <strong class="userinput"><code>echo "#!/bin/sh" > /tmp/common/bin/myscript</code></strong>
2512: <code class="prompt">#</code> <strong class="userinput"><code>echo "echo Hello world" >> /tmp/common/bin/myscript</code></strong>
2513: <code class="prompt">#</code> <strong class="userinput"><code>chmod 755 /tmp/common/bin/myscript</code></strong>
2514: </pre>
2515: <p>Now create the images:</p>
2516: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</code></strong></pre>
2517: <p>Each image will contain <code class="filename">README</code>,
2518: <code class="filename">COPYING</code>, and <code class="filename">bin/myscript</code>
2519: in their root directories.</p>
2520: </div>
2521: </div>
2522: </div>
1.41 asau 2523: <div class="chapter">
1.1 dsieger 2524: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 2525: <a name="files"></a>Chapter 9. Directory layout of the installed files</h2></div></div></div>
1.1 dsieger 2526: <div class="toc">
2527: <p><b>Table of Contents</b></p>
1.100 leot 2528: <dl class="toc">
1.154 rillig 2529: <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
2530: <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 2531: </dl>
2532: </div>
2533: <p>The files that are installed by pkgsrc are organized in a way that
2534: is similar to what you find in the <code class="filename">/usr</code> directory
2535: of the base system. But some details are different. This is because
2536: pkgsrc initially came from FreeBSD and had adopted its file system
2537: hierarchy. Later it was largely influenced by NetBSD. But no matter
2538: which operating system you are using pkgsrc with, you can expect the
2539: same layout for pkgsrc.</p>
2540: <p>There are mainly four root directories for pkgsrc, which are all
2541: configurable in the <code class="filename">bootstrap/bootstrap</code> script.
2542: When pkgsrc has been installed as root, the default locations
2543: are:</p>
2544: <pre class="programlisting">
2545: LOCALBASE= /usr/pkg
2546: PKG_SYSCONFBASE= /usr/pkg/etc
2547: VARBASE= /var
1.119 sevan 2548: PKG_DBDIR= /usr/pkg/pkgdb
1.1 dsieger 2549: </pre>
2550: <p>In unprivileged mode (when pkgsrc has been installed as any other
2551: user), the default locations are:</p>
2552: <pre class="programlisting">
2553: LOCALBASE= ${HOME}/pkg
2554: PKG_SYSCONFBASE= ${HOME}/pkg/etc
2555: VARBASE= ${HOME}/pkg/var
1.119 sevan 2556: PKG_DBDIR= ${HOME}/pkg/pkgdb
1.1 dsieger 2557: </pre>
2558: <p>What these four directories are for, and what they look like is
2559: explained below.</p>
1.41 asau 2560: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2561: <li class="listitem"><p><code class="varname">LOCALBASE</code> corresponds to the
1.1 dsieger 2562: <code class="filename">/usr</code> directory in the base system. It is the
1.23 wiz 2563: <span class="quote">“<span class="quote">main</span>”</span> directory where the files are installed and contains
1.1 dsieger 2564: the well-known subdirectories like <code class="filename">bin</code>,
2565: <code class="filename">include</code>, <code class="filename">lib</code>,
2566: <code class="filename">share</code> and
2567: <code class="filename">sbin</code>.</p></li>
1.23 wiz 2568: <li class="listitem"><p><code class="varname">VARBASE</code> corresponds to
1.1 dsieger 2569: <code class="filename">/var</code> in the base system. Some programs (especially
2570: games, network daemons) need write access to it during normal
2571: operation.</p></li>
1.23 wiz 2572: <li class="listitem"><p><code class="varname">PKG_SYSCONFDIR</code> corresponds to
1.1 dsieger 2573: <code class="filename">/etc</code> in the base system. It contains configuration
1.10 hubertf 2574: 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 2575: itself.</p></li>
2576: </ul></div>
1.41 asau 2577: <div class="sect1">
1.1 dsieger 2578: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2579: <a name="files.localbase"></a>9.1. File system layout in <code class="literal">${LOCALBASE}</code>
1.1 dsieger 2580: </h2></div></div></div>
2581: <p>The following directories exist in a typical pkgsrc installation
2582: in <code class="filename">${LOCALBASE}</code>.</p>
1.41 asau 2583: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 2584: <dt><span class="term"><code class="filename">bin</code></span></dt>
2585: <dd><p>Contains executable programs that are intended to be
2586: directly used by the end user.</p></dd>
2587: <dt><span class="term"><code class="filename">emul</code></span></dt>
2588: <dd><p>Contains files for the emulation layers of various other
2589: operating systems, especially for
2590: NetBSD.</p></dd>
2591: <dt><span class="term"><code class="filename">etc</code> (the usual location of
2592: <code class="filename">${PKG_SYSCONFDIR}</code>)</span></dt>
2593: <dd><p>Contains
2594: the configuration files.</p></dd>
2595: <dt><span class="term"><code class="filename">include</code></span></dt>
2596: <dd><p>Contains headers for the C and C++ programming
2597: languages.</p></dd>
2598: <dt><span class="term"><code class="filename">info</code></span></dt>
2599: <dd><p>Contains GNU info files of various
2600: packages.</p></dd>
2601: <dt><span class="term"><code class="filename">lib</code></span></dt>
2602: <dd><p>Contains shared and static
2603: libraries.</p></dd>
2604: <dt><span class="term"><code class="filename">libdata</code></span></dt>
2605: <dd><p>Contains data files that don't change after
2606: installation. Other data files belong into
2607: <code class="filename">${VARBASE}</code>.</p></dd>
2608: <dt><span class="term"><code class="filename">libexec</code></span></dt>
2609: <dd><p>Contains programs that are not intended to be used by
2610: end users, such as helper programs or network
2611: daemons.</p></dd>
2612: <dt><span class="term"><code class="filename">libexec/cgi-bin</code></span></dt>
2613: <dd><p>Contains programs that are intended to be executed as
2614: CGI scripts by a web server.</p></dd>
2615: <dt><span class="term"><code class="filename">man</code> (the usual value of
2616: <code class="filename">${PKGMANDIR}</code>)</span></dt>
2617: <dd><p>Contains brief
2618: documentation in form of manual pages.</p></dd>
2619: <dt><span class="term"><code class="filename">sbin</code></span></dt>
2620: <dd><p>Contains programs that are intended to be used only by
2621: the super-user.</p></dd>
2622: <dt><span class="term"><code class="filename">share</code></span></dt>
2623: <dd><p>Contains platform-independent data files that don't
2624: change after installation.</p></dd>
2625: <dt><span class="term"><code class="filename">share/doc</code></span></dt>
2626: <dd><p>Contains documentation files provided by the
2627: packages.</p></dd>
2628: <dt><span class="term"><code class="filename">share/examples</code></span></dt>
2629: <dd><p>Contains example files provided by the packages. Among
2630: others, the original configuration files are saved here and copied to
2631: <code class="filename">${PKG_SYSCONFDIR}</code> during
2632: installation.</p></dd>
2633: <dt><span class="term"><code class="filename">share/examples/rc.d</code></span></dt>
2634: <dd><p>Contains the original files for rc.d
2635: scripts.</p></dd>
2636: <dt><span class="term"><code class="filename">var</code> (the usual location of
2637: <code class="filename">${VARBASE}</code>)</span></dt>
2638: <dd><p>Contains files
2639: that may be modified after
2640: installation.</p></dd>
2641: </dl></div>
2642: </div>
1.41 asau 2643: <div class="sect1">
1.1 dsieger 2644: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2645: <a name="files.varbase"></a>9.2. File system layout in <code class="literal">${VARBASE}</code>
1.1 dsieger 2646: </h2></div></div></div>
1.41 asau 2647: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 2648: <dt><span class="term"><code class="filename">db/pkg</code> (the usual location of
2649: <code class="filename">${PKG_DBDIR}</code>)</span></dt>
2650: <dd><p>Contains
2651: information about the currently installed
2652: packages.</p></dd>
2653: <dt><span class="term"><code class="filename">games</code></span></dt>
2654: <dd><p>Contains highscore
2655: files.</p></dd>
2656: <dt><span class="term"><code class="filename">log</code></span></dt>
2657: <dd><p>Contains log files.</p></dd>
2658: <dt><span class="term"><code class="filename">run</code></span></dt>
2659: <dd><p>Contains informational files about daemons that are
2660: currently running.</p></dd>
2661: </dl></div>
2662: </div>
2663: </div>
1.41 asau 2664: <div class="chapter">
1.1 dsieger 2665: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 2666: <a name="faq"></a>Chapter 10. Frequently Asked Questions</h2></div></div></div>
1.1 dsieger 2667: <div class="toc">
2668: <p><b>Table of Contents</b></p>
1.100 leot 2669: <dl class="toc">
1.154 rillig 2670: <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
2671: <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
2672: <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
2673: <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
2674: <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>
2675: <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
2676: <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
2677: <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>
2678: <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
2679: <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 2680: /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
1.154 rillig 2681: <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>
2682: <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt>
2683: <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
2684: <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
2685: <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
2686: <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
2687: <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 2688: </dl>
2689: </div>
2690: <p>This section contains hints, tips & tricks on special things in
2691: pkgsrc that we didn't find a better place for in the previous chapters, and
2692: it contains items for both pkgsrc users and developers.</p>
1.41 asau 2693: <div class="sect1">
1.1 dsieger 2694: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2695: <a name="mailing-list-pointers"></a>10.1. Are there any mailing lists for pkg-related discussion?</h2></div></div></div>
1.1 dsieger 2696: <p>The following mailing lists may be of interest to pkgsrc users:</p>
1.41 asau 2697: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2698: <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 2699: This is a general purpose list for most issues regarding
2700: pkgsrc, regardless of platform, e.g. soliciting user help
2701: for pkgsrc configuration, unexpected build failures, using
2702: particular packages, upgrading pkgsrc installations,
2703: questions regarding the pkgsrc release branches, etc. General announcements or
2704: proposals for changes that impact the pkgsrc user community,
2705: e.g. major infrastructure changes, new features, package
2706: removals, etc., may also be posted.</p></li>
1.174 leot 2707: <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 2708: A list where the results of pkgsrc bulk builds are sent and
2709: discussed.</p></li>
1.174 leot 2710: <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 2711: This list is for those who are interested in getting a
2712: commit message for every change committed to pkgsrc. It is
2713: also available in digest form, meaning one daily message
2714: containing all commit messages for changes to the package
2715: source tree in that 24 hour period.</p></li>
2716: </ul></div>
2717: <p>To subscribe, do:</p>
2718: <pre class="programlisting">
2719: <code class="prompt">%</code> echo subscribe <em class="replaceable"><code>listname</code></em> | mail majordomo@NetBSD.org
2720: </pre>
2721: <p>Archives for all these mailing lists are available from
1.174 leot 2722: <a class="ulink" href="https://mail-index.NetBSD.org/" target="_top">https://mail-index.NetBSD.org/</a>.</p>
1.1 dsieger 2723: </div>
1.41 asau 2724: <div class="sect1">
1.1 dsieger 2725: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2726: <a name="faq-pkgtools"></a>10.2. Utilities for package management (pkgtools)</h2></div></div></div>
1.1 dsieger 2727: <p>The directory <code class="filename">pkgsrc/pkgtools</code> contains
2728: a number of useful utilities for both users and developers of pkgsrc. This
1.121 sevan 2729: section attempts only to make the reader aware of some of the utilities and when
1.1 dsieger 2730: they might be useful, and not to duplicate the documentation that comes
2731: with each package.</p>
2732: <p>Utilities used by pkgsrc (automatically installed when needed):</p>
1.137 leot 2733: <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 2734: Symlinks for use by buildlink.</p></li></ul></div>
2735: <p>OS tool augmentation (automatically installed when needed):</p>
1.41 asau 2736: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2737: <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 2738: Calculates various kinds of checksums (including SHA3).</p></li>
1.137 leot 2739: <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 2740: Compatibility library for pkgsrc tools.</p></li>
1.137 leot 2741: <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 2742: non-BSD systems due to lack of native mtree.</p></li>
1.137 leot 2743: <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 2744: Up-to-date replacement for
2745: <code class="filename">/usr/sbin/pkg_install</code>, or for use on operating
2746: systems where pkg_install is not present.</p></li>
2747: </ul></div>
2748: <p>Utilities used by pkgsrc (not automatically installed):</p>
1.41 asau 2749: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2750: <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 2751: Create a binary package from an
1.10 hubertf 2752: already-installed package. Used by <span class="command"><strong>make replace</strong></span> to
1.1 dsieger 2753: save the old package.</p></li>
1.137 leot 2754: <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 2755: Adds extra functionality to pkgsrc, allowing it to fetch distfiles
2756: from multiple locations. It currently supports the following
2757: methods: multiple CD-ROMs and network FTP/HTTP connections.</p></li>
1.137 leot 2758: <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 2759: the best compiler flags to optimise code for your current
1.23 wiz 2760: CPU and compiler. </p></li>
1.1 dsieger 2761: </ul></div>
2762: <p>Utilities for keeping track of installed packages, being up to date,
2763: etc:</p>
1.41 asau 2764: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2765: <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 2766: update tool similar to apt(1). Download, install, and upgrade
2767: binary packages easily.</p></li>
1.137 leot 2768: <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 2769: packages whose installed versions do not match the latest pkgsrc
2770: entries.</p></li>
1.137 leot 2771: <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 2772: dependency graphs of packages, to aid in choosing a strategy for
2773: updating.</p></li>
1.137 leot 2774: <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
2775: 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>
2776: <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 2777: pkglint(1) program checks a pkgsrc entry for errors.</p></li>
1.137 leot 2778: <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 2779: does various checks on the complete pkgsrc system.</p></li>
1.137 leot 2780: <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 2781: packages you have installed.</p></li>
2782: </ul></div>
2783: <p>Utilities for people maintaining or creating individual packages:</p>
1.41 asau 2784: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2785: <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 2786: making and maintaining patches for a package (includes pkgdiff,
2787: pkgvi, mkpatches, etc.).</p></li>
1.137 leot 2788: <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 2789: converting to pkgsrc.</p></li>
2790: </ul></div>
2791: <p>Utilities for people maintaining pkgsrc (or: more obscure pkg
2792: utilities)</p>
1.41 asau 2793: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 2794: <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 2795: packages in a chrooted area.</p></li>
1.137 leot 2796: <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 2797: kernel version for chrooted cross builds.</p></li>
2798: </ul></div>
2799: </div>
1.41 asau 2800: <div class="sect1">
1.1 dsieger 2801: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2802: <a name="non-root-pkgsrc"></a>10.3. How to use pkgsrc as non-root</h2></div></div></div>
1.108 rillig 2803: <p>To install packages from source as a non-root user, download
1.154 rillig 2804: 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 2805: directory and run the command <span class="command"><strong>./bootstrap/bootstrap
2806: --unprivileged</strong></span>.</p>
2807: <p>This will install the binary part of pkgsrc to
2808: <code class="filename">~/pkg</code> and put the pkgsrc configuration <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>
2809: into <code class="filename">~/pkg/etc</code>.</p>
2810: <p>For more details, see <code class="filename">mk/unprivileged.mk</code>.</p>
1.1 dsieger 2811: </div>
1.41 asau 2812: <div class="sect1">
1.1 dsieger 2813: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2814: <a name="resume-transfers"></a>10.4. How to resume transfers when fetching distfiles?</h2></div></div></div>
1.1 dsieger 2815: <p>By default, resuming transfers in pkgsrc is disabled, but you can
2816: enable this feature by adding the option
2817: <code class="varname">PKG_RESUME_TRANSFERS=YES</code> into
1.10 hubertf 2818: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. If, during a fetch step, an incomplete
1.1 dsieger 2819: distfile is found, pkgsrc will try to resume it.</p>
2820: <p>You can also
1.61 wiz 2821: use a different program than the platform default program by changing the
1.16 jnemeth 2822: <code class="varname">FETCH_USING</code> variable. You can specify the program by
2823: using of ftp, fetch, wget or curl. Alternatively, fetching can be disabled
2824: by using the value manual. A value of custom disables the system defaults
2825: and dependency tracking for the fetch program. In that case you have to
2826: provide <code class="varname">FETCH_CMD</code>, <code class="varname">FETCH_BEFORE_ARGS</code>,
2827: <code class="varname">FETCH_RESUME_ARGS</code>, <code class="varname">FETCH_OUTPUT_ARGS</code>,
2828: <code class="varname">FETCH_AFTER_ARGS</code>.</p>
1.1 dsieger 2829: <p>For example, if you want to use
1.16 jnemeth 2830: <code class="filename">wget</code> to download, you'll have to use something
1.1 dsieger 2831: like:</p>
2832: <pre class="programlisting">
1.112 rillig 2833: FETCH_USING= wget
1.1 dsieger 2834: </pre>
2835: </div>
1.41 asau 2836: <div class="sect1">
1.1 dsieger 2837: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2838: <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 2839: <p>If you want to use modular X.org from pkgsrc instead of your system's own X11
1.1 dsieger 2840: (<code class="filename">/usr/X11R6</code>, <code class="filename">/usr/openwin</code>, ...)
2841: you will have to add the following line into
1.10 hubertf 2842: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p>
1.1 dsieger 2843: <pre class="programlisting">
1.4 rillig 2844: X11_TYPE=modular
1.1 dsieger 2845: </pre>
2846: </div>
1.41 asau 2847: <div class="sect1">
1.1 dsieger 2848: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2849: <a name="fetch-behind-firewall"></a>10.6. How to fetch files from behind a firewall</h2></div></div></div>
1.1 dsieger 2850: <p>If you are sitting behind a firewall which does not allow direct
2851: connections to Internet hosts (i.e. non-NAT), you may specify the
2852: relevant proxy hosts. This is done using an environment variable in the
2853: form of a URL, e.g. in Amdahl, the machine
1.23 wiz 2854: <span class="quote">“<span class="quote">orpheus.amdahl.com</span>”</span> is one of the firewalls, and it uses
1.1 dsieger 2855: port 80 as the proxy port number. So the proxy environment variables
2856: are:</p>
2857: <pre class="programlisting">
2858: ftp_proxy=ftp://orpheus.amdahl.com:80/
2859: http_proxy=http://orpheus.amdahl.com:80/
2860: </pre>
2861: </div>
1.41 asau 2862: <div class="sect1">
1.1 dsieger 2863: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2864: <a name="fetch-https"></a>10.7. How to fetch files from HTTPS sites</h2></div></div></div>
1.65 wiz 2865: <p>Some fetch tools are not prepared to support HTTPS by default
2866: (for example, the one in NetBSD 6.0), or the one installed by the
2867: pkgsrc bootstrap (to avoid an openssl dependency that low in the
2868: dependency graph).</p>
2869: <p>Usually you won't notice, because distribution files are
2870: mirrored weekly to <span class="quote">“<span class="quote">ftp.NetBSD.org</span>”</span>, but that might not
2871: be often enough if you are following pkgsrc-current. In that case, set
2872: <code class="varname">FETCH_USING</code> in your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file to
2873: <span class="quote">“<span class="quote">curl</span>”</span> or <span class="quote">“<span class="quote">wget</span>”</span>, which are both compiled
2874: with HTTPS support by default. Of course, these tools need to be
2875: installed before you can use them this way.</p>
2876: </div>
2877: <div class="sect1">
2878: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2879: <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 2880: <p>This depends on which utility is used to retrieve distfiles. From
2881: <code class="filename">bsd.pkg.mk</code>, <code class="varname">FETCH_CMD</code> is assigned
2882: the first available command from the following list:</p>
1.41 asau 2883: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 2884: <li class="listitem"><p><code class="filename">${LOCALBASE}/bin/ftp</code></p></li>
2885: <li class="listitem"><p><code class="filename">/usr/bin/ftp</code></p></li>
1.1 dsieger 2886: </ul></div>
2887: <p>On a default NetBSD installation, this will be
2888: <code class="filename">/usr/bin/ftp</code>, which automatically tries passive
2889: connections first, and falls back to active connections if the server
2890: refuses to do passive. For the other tools, add the following to your
1.10 hubertf 2891: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file:
1.1 dsieger 2892: <code class="varname">PASSIVE_FETCH=1</code>.</p>
2893: <p>Having that option present will prevent
2894: <code class="filename">/usr/bin/ftp</code> from falling back to active
2895: transfers.</p>
2896: </div>
1.41 asau 2897: <div class="sect1">
1.1 dsieger 2898: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2899: <a name="fetching-all-distfiles"></a>10.9. How to fetch all distfiles at once</h2></div></div></div>
1.1 dsieger 2900: <p>You would like to download all the distfiles in a single batch
1.10 hubertf 2901: from work or university, where you can't run a <span class="command"><strong>make
1.25 spz 2902: 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 2903: but downloading the entire directory may not be appropriate.</p>
1.10 hubertf 2904: <p>The answer here is to do a <span class="command"><strong>make fetch-list</strong></span> in
1.1 dsieger 2905: <code class="filename">/usr/pkgsrc</code> or one of its subdirectories, carry the
2906: resulting list to your machine at work/school and use it there. If you
1.174 leot 2907: 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 2908: forget to set <code class="varname">FETCH_CMD</code> to something that fetches a
2909: URL:</p>
2910: <p>At home:</p>
2911: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cd /usr/pkgsrc</code></strong>
2912: <code class="prompt">%</code> <strong class="userinput"><code>make fetch-list FETCH_CMD=wget DISTDIR=/tmp/distfiles >/tmp/fetch.sh</code></strong>
2913: <code class="prompt">%</code> <strong class="userinput"><code>scp /tmp/fetch.sh work:/tmp</code></strong></pre>
2914: <p>At work:</p>
2915: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>sh /tmp/fetch.sh</code></strong></pre>
2916: <p>then tar up <code class="filename">/tmp/distfiles</code> and take it
2917: home.</p>
2918: <p>If you have a machine running NetBSD, and you want to get
2919: <span class="emphasis"><em>all</em></span> distfiles (even ones that aren't for your
2920: machine architecture), you can do so by using the above-mentioned
1.10 hubertf 2921: <span class="command"><strong>make fetch-list</strong></span> approach, or fetch the distfiles
1.1 dsieger 2922: directly by running:</p>
2923: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make mirror-distfiles</code></strong></pre>
2924: <p>If you even decide to ignore
2925: <code class="varname">NO_{SRC,BIN}_ON_{FTP,CDROM}</code>, then you can get everything
2926: by running:</p>
2927: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make fetch NO_SKIP=yes</code></strong></pre>
2928: </div>
1.41 asau 2929: <div class="sect1">
1.1 dsieger 2930: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2931: <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 2932: /usr/share/tmac/tmac.andoc</span>”</span> mean?</h2></div></div></div>
1.137 leot 2933: <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 2934: package, you get the error from make that it doesn't know how to make
2935: <code class="filename">/usr/share/tmac/tmac.andoc</code>? This indicates that
1.23 wiz 2936: you don't have installed the <span class="quote">“<span class="quote">text</span>”</span> set (nroff, ...) from
1.1 dsieger 2937: the NetBSD base distribution on your machine. It is recommended to do
2938: that to format man pages.</p>
1.137 leot 2939: <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 2940: can get away with setting <code class="varname">NOMAN=YES</code> either in the
1.10 hubertf 2941: environment or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
1.1 dsieger 2942: </div>
1.41 asau 2943: <div class="sect1">
1.1 dsieger 2944: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2945: <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 2946: <p>You didn't install the compiler set, <code class="filename">comp.tgz</code>,
2947: when you installed your NetBSD machine. Please get and install it, by
2948: extracting it in <code class="filename">/</code>:</p>
2949: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cd /</code></strong>
2950: <code class="prompt">#</code> <strong class="userinput"><code>tar --unlink -zxvpf .../comp.tgz</code></strong></pre>
2951: <p><code class="filename">comp.tgz</code> is part of every NetBSD release. Get
1.10 hubertf 2952: the one that corresponds to your release (determine via <span class="command"><strong>uname
1.1 dsieger 2953: -r</strong></span>).</p>
2954: </div>
1.41 asau 2955: <div class="sect1">
1.1 dsieger 2956: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2957: <a name="using-sudo-with-pkgsrc"></a>10.12. Using 'sudo' with pkgsrc</h2></div></div></div>
1.1 dsieger 2958: <p>When installing packages as non-root user and using the just-in-time
1.174 leot 2959: <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 2960: password for each required package installed. To avoid this, the sudo
2961: package can be used, which does password caching over a limited time. To
2962: use it, install sudo (either as binary package or from
1.137 leot 2963: <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 2964: following into your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, somewhere
1.1 dsieger 2965: <span class="emphasis"><em>after</em></span> the definition of the
2966: <code class="varname">LOCALBASE</code> variable:</p>
2967: <pre class="programlisting">
2968: .if exists(${LOCALBASE}/bin/sudo)
2969: SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c
2970: .endif
2971: </pre>
2972: </div>
1.41 asau 2973: <div class="sect1">
1.1 dsieger 2974: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2975: <a name="faq.conf"></a>10.13. How do I change the location of configuration files?</h2></div></div></div>
1.1 dsieger 2976: <p>As the system administrator, you can choose where configuration files
2977: are installed. The default settings make all these files go into
2978: <code class="filename">${PREFIX}/etc</code> or some of its subdirectories; this may
2979: be suboptimal depending on your expectations (e.g., a read-only,
2980: NFS-exported <code class="varname">PREFIX</code> with a need of per-machine
2981: configuration of the provided packages).</p>
2982: <p>In order to change the defaults, you can modify the
2983: <code class="varname">PKG_SYSCONFBASE</code> variable (in
1.10 hubertf 2984: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>) to point to your preferred configuration
1.1 dsieger 2985: directory; some common examples include <code class="filename">/etc</code> or
2986: <code class="filename">/etc/pkg</code>.</p>
2987: <p>Furthermore, you can change this value on a per-package basis by
2988: setting the <code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> variable.
2989: <code class="varname">PKG_SYSCONFVAR</code>'s value usually matches the name of the
2990: package you would like to modify, that is, the contents of
2991: <code class="varname">PKGBASE</code>.</p>
2992: <p>Note that after changing these settings, you must rebuild and
2993: reinstall any affected packages.</p>
2994: </div>
1.41 asau 2995: <div class="sect1">
1.1 dsieger 2996: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 2997: <a name="audit-packages"></a>10.14. Automated security checks</h2></div></div></div>
1.1 dsieger 2998: <p>Please be aware that there can often be bugs in third-party software,
2999: and some of these bugs can leave a machine vulnerable to exploitation by
3000: attackers. In an effort to lessen the exposure, the NetBSD packages team
3001: maintains a database of known-exploits to packages which have at one time
3002: been included in pkgsrc. The database can be downloaded automatically, and
3003: a security audit of all packages installed on a system can take place. To
1.14 jmcneill 3004: do this, refer to the following two tools (installed as part of the
1.137 leot 3005: <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 3006: <div class="orderedlist"><ol class="orderedlist" type="1">
3007: <li class="listitem">
1.20 snj 3008: <p><span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, an easy way to
1.1 dsieger 3009: download a list of the security vulnerabilities information. This list
1.25 spz 3010: is kept up to date by the pkgsrc security team, and is distributed
3011: from the NetBSD ftp server:</p>
1.177 leot 3012: <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 3013: </li>
1.23 wiz 3014: <li class="listitem"><p><span class="command"><strong>pkg_admin audit</strong></span>, an easy way to audit the
3015: current machine, checking each known vulnerability. If a
1.1 dsieger 3016: vulnerable package is installed, it will be shown by output to stdout,
3017: including a description of the type of vulnerability, and a URL
3018: containing more information.</p></li>
3019: </ol></div>
1.121 sevan 3020: <p>Use of these tools is strongly recommended!
1.154 rillig 3021: 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 3022: reporting.</p>
3023: <p>If this database is installed, pkgsrc builds will use it to
3024: perform a security check before building any package.</p>
1.1 dsieger 3025: </div>
1.41 asau 3026: <div class="sect1">
1.1 dsieger 3027: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3028: <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 3029: <p>When you add your own preferences to the
3030: <code class="varname">CFLAGS</code> variable in your
1.10 hubertf 3031: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, these flags are passed in
1.1 dsieger 3032: environment variables to the <code class="filename">./configure</code>
1.174 leot 3033: 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 3034: <code class="varname">CFLAGS</code> from the environment variable by
3035: overriding them in the <code class="filename">Makefile</code>s of their
3036: package.</p>
3037: <p>Currently there is no solution to this problem. If you
3038: really need the package to use your <code class="varname">CFLAGS</code>
1.10 hubertf 3039: you should run <span class="command"><strong>make patch</strong></span> in the package
1.1 dsieger 3040: directory and then inspect any <code class="filename">Makefile</code> and
3041: <code class="filename">Makefile.in</code> for whether they define
3042: <code class="varname">CFLAGS</code> explicitly. Usually you can remove
1.23 wiz 3043: these lines. But be aware that some <span class="quote">“<span class="quote">smart</span>”</span>
1.1 dsieger 3044: programmers write so bad code that it only works for the
3045: specific combination of <code class="varname">CFLAGS</code> they have
3046: chosen.</p>
1.172 rillig 3047: <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>
3048: <pre class="programlisting">
3049: CPPFLAGS+= -Dpkgsrc___CPPFLAGS
3050: CFLAGS+= -Dpkgsrc___CFLAGS
3051: CXXFLAGS+= -Dpkgsrc___CXXFLAGS
3052: </pre>
3053: <p>Then run <span class="command"><strong>bmake show-all-configure show-all-build</strong></span>
3054: to see whether the above flags are passed to the actual build
3055: commands in general.</p>
3056: <p>To find out whether the flags are passed to individual compiler
3057: commands, have a look at the file <code class="filename">work/.work.log</code>. In
3058: most cases, the flags from the original command lines (the lines starting
3059: with <code class="literal">[*]</code>) are passed unmodified to the actual compiler
3060: (the lines starting with <code class="literal"><.></code>). If the flag is
3061: missing from the actual compiler command, it must have been removed by
3062: the <a class="link" href="#build.wrapper" title="19.10. The wrapper phase">pkgsrc compiler wrappers</a>.</p>
1.1 dsieger 3063: </div>
1.41 asau 3064: <div class="sect1">
1.1 dsieger 3065: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3066: <a name="ufaq-fail"></a>10.16. A package does not build. What shall I do?</h2></div></div></div>
1.23 wiz 3067: <div class="procedure"><ol class="procedure" type="1">
1.41 asau 3068: <li class="step"><p>Make sure that your copy of pkgsrc is consistent. A
1.1 dsieger 3069: case that occurs often is that people only update pkgsrc in
3070: parts, because of performance reasons. Since pkgsrc is one large
3071: system, not a collection of many small systems, there are
3072: sometimes changes that only work when the whole pkgsrc tree is
3073: updated.</p></li>
1.41 asau 3074: <li class="step"><p>Make sure that you don't have any CVS conflicts.
1.23 wiz 3075: Search for <span class="quote">“<span class="quote"><<<<<<</span>”</span> or
3076: <span class="quote">“<span class="quote">>>>>>></span>”</span> in all your pkgsrc
1.1 dsieger 3077: files.</p></li>
1.41 asau 3078: <li class="step"><p>Make sure that you don't have old copies of the packages
1.10 hubertf 3079: extracted. Run <span class="command"><strong>make clean clean-depends</strong></span> to
1.1 dsieger 3080: verify this.</p></li>
1.108 rillig 3081: <li class="step"><p>If you are a package developer who wants to invest
1.154 rillig 3082: 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 3083: <li class="step"><p>If the problem still exists, write a mail to the
1.1 dsieger 3084: <code class="literal">pkgsrc-users</code> mailing list.</p></li>
3085: </ol></div>
3086: </div>
1.41 asau 3087: <div class="sect1">
1.1 dsieger 3088: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3089: <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 3090: <p>You have modified a file from pkgsrc, and someone else has
3091: modified that same file afterwards in the CVS repository. Both changes
3092: are in the same region of the file, so when you updated pkgsrc, the
3093: <code class="literal">cvs</code> command marked the conflicting changes in the
3094: file. Because of these markers, the file is no longer a valid
3095: <code class="filename">Makefile</code>.</p>
3096: <p>Have a look at that file, and if you don't need your local changes
1.10 hubertf 3097: anymore, you can remove that file and run <span class="command"><strong>cvs -q update
1.1 dsieger 3098: -dP</strong></span> in that directory to download the current version.</p>
3099: </div>
3100: </div>
3101: </div>
1.41 asau 3102: <div class="part">
1.1 dsieger 3103: <div class="titlepage"><div><div><h1 class="title">
3104: <a name="developers-guide"></a>Part II. The pkgsrc developer's guide</h1></div></div></div>
1.41 asau 3105: <div class="partintro">
1.1 dsieger 3106: <div></div>
3107: <p>This part of the book deals with creating and
1.23 wiz 3108: modifying packages. It starts with a <span class="quote">“<span class="quote">HOWTO</span>”</span>-like
1.1 dsieger 3109: guide on creating a new package. The remaining chapters are more
3110: like a reference manual for pkgsrc.</p>
3111: <div class="toc">
3112: <p><b>Table of Contents</b></p>
1.100 leot 3113: <dl class="toc">
1.154 rillig 3114: <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt>
3115: <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt>
1.1 dsieger 3116: <dd><dl>
1.154 rillig 3117: <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt>
1.1 dsieger 3118: <dd><dl>
1.154 rillig 3119: <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt>
3120: <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt>
1.160 brook 3121: <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt>
3122: <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt>
1.1 dsieger 3123: </dl></dd>
1.154 rillig 3124: <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt>
3125: <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 3126: </dl></dd>
1.154 rillig 3127: <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt>
1.6 rillig 3128: <dd><dl>
1.154 rillig 3129: <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt>
3130: <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt>
3131: <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt>
1.6 rillig 3132: <dd><dl>
1.154 rillig 3133: <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt>
3134: <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt>
3135: <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt>
3136: <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt>
3137: <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt>
1.6 rillig 3138: </dl></dd>
1.154 rillig 3139: <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt>
3140: <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt>
1.6 rillig 3141: <dd><dl>
1.154 rillig 3142: <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt>
3143: <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt>
3144: <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt>
1.6 rillig 3145: </dl></dd>
1.154 rillig 3146: <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt>
3147: <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt>
1.6 rillig 3148: </dl></dd>
1.154 rillig 3149: <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt>
1.6 rillig 3150: <dd><dl>
1.154 rillig 3151: <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt>
3152: <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt>
3153: <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd>
3154: <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt>
1.6 rillig 3155: <dd><dl>
1.154 rillig 3156: <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt>
3157: <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt>
3158: <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>
3159: <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt>
1.6 rillig 3160: </dl></dd>
3161: </dl></dd>
1.154 rillig 3162: <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt>
1.6 rillig 3163: <dd><dl>
1.154 rillig 3164: <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt>
3165: <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
3166: <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>
3167: <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt>
3168: <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt>
3169: <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
3170: <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt>
3171: <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt>
3172: <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt>
1.6 rillig 3173: </dl></dd>
1.154 rillig 3174: <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt>
1.6 rillig 3175: <dd><dl>
1.154 rillig 3176: <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt>
3177: <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 3178: <dd><dl>
1.154 rillig 3179: <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt>
3180: <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating
1.26 wiz 3181: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
3182: and
3183: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
3184: in <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.6 rillig 3185: </dl></dd>
1.154 rillig 3186: <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 3187: <dd><dl>
1.154 rillig 3188: <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>
3189: <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 3190: </dl></dd>
3191: </dl></dd>
1.154 rillig 3192: <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt>
1.6 rillig 3193: <dd><dl>
1.154 rillig 3194: <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt>
3195: <dd><dl>
3196: <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt>
3197: <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt>
3198: </dl></dd>
3199: <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt>
3200: <dd><dl>
3201: <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt>
3202: <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt>
3203: <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt>
3204: <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt>
3205: </dl></dd>
3206: <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt>
3207: <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>
3208: <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt>
3209: <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt>
3210: <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd>
3211: <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt>
3212: <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>
3213: </dl></dd>
3214: <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt>
3215: <dd><dl>
3216: <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt>
3217: <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>
3218: <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt>
3219: <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt>
3220: </dl></dd>
3221: <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt>
3222: <dd><dl>
3223: <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt>
3224: <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt>
3225: <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt>
3226: <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt>
3227: <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
3228: <dd><dl>
3229: <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt>
3230: <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt>
3231: </dl></dd>
3232: <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt>
3233: <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt>
3234: <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt>
3235: <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt>
3236: <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt>
3237: <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
3238: <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
3239: <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt>
3240: <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
3241: <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt>
3242: <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt>
3243: <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt>
3244: </dl></dd>
3245: <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt>
3246: <dd><dl>
3247: <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt>
3248: <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt>
3249: <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt>
3250: </dl></dd>
3251: <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt>
3252: <dd><dl>
3253: <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt>
3254: <dd><dl>
3255: <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>
3256: <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt>
3257: <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt>
3258: <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt>
3259: <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt>
3260: <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt>
3261: <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt>
3262: <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt>
3263: <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt>
3264: <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt>
3265: <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt>
3266: </dl></dd>
3267: <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
3268: <dd><dl>
3269: <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt>
3270: <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>
3271: <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt>
3272: </dl></dd>
3273: <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
3274: <dd><dl>
3275: <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt>
3276: <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt>
3277: <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt>
3278: </dl></dd>
3279: <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt>
3280: <dd><dl>
3281: <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt>
3282: <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt>
3283: <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt>
3284: <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt>
3285: <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt>
3286: </dl></dd>
3287: <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
3288: <dd><dl>
3289: <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt>
3290: <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt>
1.172 rillig 3291: <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt>
3292: <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>
3293: <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt>
1.154 rillig 3294: </dl></dd>
3295: <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
3296: <dd><dl>
3297: <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt>
3298: <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt>
3299: <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt>
3300: <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt>
3301: <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt>
3302: <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt>
3303: <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt>
3304: <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt>
3305: <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt>
3306: <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt>
3307: <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt>
3308: <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt>
3309: <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt>
3310: <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt>
3311: <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt>
3312: <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt>
3313: <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt>
3314: <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in
1.1 dsieger 3315: emulation</a></span></dt>
1.154 rillig 3316: <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt>
3317: <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt>
1.1 dsieger 3318: </dl></dd>
1.154 rillig 3319: <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt>
1.1 dsieger 3320: </dl></dd>
1.154 rillig 3321: <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt>
3322: <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt>
1.1 dsieger 3323: <dd><dl>
1.154 rillig 3324: <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt>
3325: <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt>
3326: <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt>
3327: <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt>
3328: <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt>
3329: <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt>
3330: <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt>
3331: <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt>
3332: </dl></dd>
3333: <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt>
3334: <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt>
3335: <dd><dl>
3336: <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt>
3337: <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt>
3338: <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt>
3339: <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt>
1.1 dsieger 3340: </dl></dd>
3341: </dl>
3342: </div>
3343: </div>
1.41 asau 3344: <div class="chapter">
1.1 dsieger 3345: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 3346: <a name="help-devel"></a>Chapter 11. Getting help</h2></div></div></div>
3347: <p>
3348: To get help when developing pkgsrc, the definitive source is this
3349: document, the pkgsrc guide. If you don't find anything here,
3350: there are alternatives:
3351: </p>
3352: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
3353: <li class="listitem">
3354: <p>
3355: The built-in pkgsrc help, which is available after bootstrapping
3356: pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get
3357: help for any topic, such as a variable name like
3358: <code class="varname">BUILD_DEFS</code>, a make target like
3359: <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like
3360: <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p>
3361: <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>
3362: </li>
3363: <li class="listitem"><p>
1.163 rillig 3364: To see the value of a single variable, run <span class="command"><strong>bmake
3365: show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>.
3366: </p></li>
3367: <li class="listitem"><p>
3368: To see the values of the most common variables, run
3369: <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by
3370: topic. To see the variables for a single topic, run
3371: <span class="command"><strong>bmake
3372: show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example
3373: <span class="command"><strong>bmake show-all-fetch</strong></span>.
3374: </p></li>
3375: <li class="listitem"><p>
1.154 rillig 3376: The tech-pkg mailing list, to which
3377: <a class="ulink" href="https://www.NetBSD.org/mailinglists/#tech-pkg" target="_top">you
3378: can subscribe</a> and then <a class="ulink" href="mailto:tech-pkg@NetBSD.org" target="_top">ask your
3379: questions</a>.</p></li>
3380: <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible
3381: <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a>
3382: or by using a specialized chat program such as
3383: <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>.
3384: Pick any user name and join the channel #pkgsrc.</p></li>
3385: </ul></div>
3386: </div>
3387: <div class="chapter">
3388: <div class="titlepage"><div><div><h2 class="title">
3389: <a name="creating"></a>Chapter 12. Creating a new pkgsrc package from scratch</h2></div></div></div>
1.1 dsieger 3390: <div class="toc">
3391: <p><b>Table of Contents</b></p>
1.100 leot 3392: <dl class="toc">
1.154 rillig 3393: <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt>
1.1 dsieger 3394: <dd><dl>
1.154 rillig 3395: <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt>
3396: <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt>
1.160 brook 3397: <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt>
3398: <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt>
1.1 dsieger 3399: </dl></dd>
1.154 rillig 3400: <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt>
3401: <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 3402: </dl>
3403: </div>
3404: <p>When you find a package that is not yet in pkgsrc, you
3405: most likely have a URL from where you can download the source
3406: code. Starting with this URL, creating a package involves only a
3407: few steps.</p>
1.23 wiz 3408: <div class="procedure"><ol class="procedure" type="1">
1.137 leot 3409: <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 3410: <li class="step"><p>Then, choose one of the top-level directories as the
1.1 dsieger 3411: category in which you want to place your package. You can also create a
3412: directory of your own (maybe called <code class="filename">local</code>). In that
3413: category directory, create another directory for your package and change
3414: into it.</p></li>
1.41 asau 3415: <li class="step"><p>Run the program <span class="command"><strong>url2pkg</strong></span>, which will ask
1.1 dsieger 3416: you for a URL. Enter the URL of the distribution file (in most cases a
3417: <code class="filename">.tar.gz</code> file) and watch how the basic ingredients
3418: of your package are created automatically. The distribution file is
3419: extracted automatically to fill in some details in the
3420: <code class="filename">Makefile</code> that would otherwise have to be done
3421: manually.</p></li>
1.41 asau 3422: <li class="step">
1.1 dsieger 3423: <p>Examine the extracted files to determine the dependencies of
3424: your package. Ideally, this is mentioned in some
3425: <code class="filename">README</code> file, but things may differ. For each of
3426: these dependencies, look where it exists in pkgsrc, and if there is a
3427: file called <code class="filename">buildlink3.mk</code> in that directory, add a
3428: line to your package <code class="filename">Makefile</code> which includes that
3429: file just before the last line. If the
1.25 spz 3430: <code class="filename">buildlink3.mk</code> file does not exist, it must be
1.161 leot 3431: created first. The <code class="filename">buildlink3.mk</code> file makes sure
3432: that the package's include files and libraries are provided.</p>
1.25 spz 3433: <p>If you just need binaries from a package, add a
1.1 dsieger 3434: <code class="varname">DEPENDS</code> line to the Makefile, which specifies the
3435: version of the dependency and where it can be found in pkgsrc. This line
3436: should be placed in the third paragraph. If the dependency is only
3437: needed for building the package, but not when using it, use
1.156 leot 3438: <code class="varname">TOOL_DEPENDS</code> or <code class="varname">BUILD_DEPENDS</code>
3439: instead of <code class="varname">DEPENDS</code>.
3440: The difference between <code class="varname">TOOL_DEPENDS</code> and
3441: <code class="varname">BUILD_DEPENDS</code> occurs when cross-compiling:
3442: <code class="varname">TOOL_DEPENDS</code> are <span class="emphasis"><em>native</em></span>
3443: packages, i.e. packages for the architecture where the package
3444: is built;
3445: <code class="varname">BUILD_DEPENDS</code> are <span class="emphasis"><em>target</em></span>
3446: packages, i.e. packages for the architecture for which the package
1.175 gutterid 3447: is built. There is also <code class="varname">TEST_DEPENDS</code>, which is used
3448: to specify a dependency used only for testing the resulting package
3449: built, using the upstream project's included test suite.
1.1 dsieger 3450: Your package may then look like this:</p>
3451: <pre class="programlisting">
3452: [...]
3453:
1.156 leot 3454: TOOL_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
1.1 dsieger 3455: DEPENDS+= screen-[0-9]*:../../misc/screen
3456: DEPENDS+= screen>=4.0:../../misc/screen
3457:
3458: [...]
3459:
3460: .include "../../<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>package</code></em>/buildlink3.mk"
3461: .include "../../devel/glib2/buildlink3.mk"
3462: .include "../../mk/bsd.pkg.mk"
3463: </pre>
3464: </li>
1.41 asau 3465: <li class="step"><p>Run <span class="command"><strong>pkglint</strong></span> to see what things still need
1.23 wiz 3466: 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 3467: know what pkglint's warnings want to tell you, try <span class="command"><strong>pkglint
3468: --explain</strong></span> or <span class="command"><strong>pkglint
1.1 dsieger 3469: -e</strong></span>, which outputs additional
3470: explanations.</p></li>
1.41 asau 3471: <li class="step"><p>In many cases the package is not yet ready to build. You can
1.154 rillig 3472: 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 3473: over there, you can hopefully continue here.</p></li>
1.41 asau 3474: <li class="step"><p>Run <span class="command"><strong>bmake clean</strong></span> to clean the working
1.1 dsieger 3475: directory from the extracted files. Besides these files, a lot of cache
3476: files and other system information has been saved in the working
3477: directory, which may become wrong after you edited the
3478: <code class="filename">Makefile</code>.</p></li>
1.41 asau 3479: <li class="step"><p>Now, run <span class="command"><strong>bmake</strong></span> to build the package. For
1.154 rillig 3480: 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 3481: <li class="step"><p>When the package builds fine, the next step is to install
1.10 hubertf 3482: the package. Run <span class="command"><strong>bmake install</strong></span> and hope that
1.1 dsieger 3483: everything works.</p></li>
1.41 asau 3484: <li class="step"><p>Up to now, the file <code class="filename">PLIST</code>, which
1.1 dsieger 3485: contains a list of the files that are installed by the package, is
1.10 hubertf 3486: nearly empty. Run <span class="command"><strong>bmake print-PLIST
1.1 dsieger 3487: >PLIST</strong></span> to generate a probably correct list. Check
3488: the file using your preferred text editor to see if the list of
3489: files looks plausible.</p></li>
1.41 asau 3490: <li class="step"><p>Run <span class="command"><strong>pkglint</strong></span> again to see if the generated
1.1 dsieger 3491: <code class="filename">PLIST</code> contains garbage or not.</p></li>
1.41 asau 3492: <li class="step"><p>When you ran <span class="command"><strong>bmake install</strong></span>, the package
1.1 dsieger 3493: has been registered in the database of installed files, but with an
1.10 hubertf 3494: empty list of files. To fix this, run <span class="command"><strong>bmake deinstall</strong></span>
3495: and <span class="command"><strong>bmake install</strong></span> again. Now the package is
1.1 dsieger 3496: registered with the list of files from
3497: <code class="filename">PLIST</code>.</p></li>
1.41 asau 3498: <li class="step"><p>Run <span class="command"><strong>bmake package</strong></span> to create a binary
1.1 dsieger 3499: package from the set of installed files.</p></li>
3500: </ol></div>
1.41 asau 3501: <div class="sect1">
1.1 dsieger 3502: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3503: <a name="creating.common"></a>12.1. Common types of packages</h2></div></div></div>
1.41 asau 3504: <div class="sect2">
1.1 dsieger 3505: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 3506: <a name="creating.perl-module"></a>12.1.1. Perl modules</h3></div></div></div>
1.1 dsieger 3507: <p>Simple Perl modules are handled automatically by
1.10 hubertf 3508: <span class="command"><strong>url2pkg</strong></span>, including dependencies.</p>
1.1 dsieger 3509: </div>
1.41 asau 3510: <div class="sect2">
1.1 dsieger 3511: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 3512: <a name="creating.python-module"></a>12.1.2. Python modules and programs</h3></div></div></div>
1.17 imil 3513: <p>Python modules and programs packages are easily created using a
3514: set of predefined variables.</p>
3515: <p>
1.63 wiz 3516: If some Python versions are not supported by the software, set the
3517: <code class="varname">PYTHON_VERSIONS_INCOMPATIBLE</code> variable to the Python versions
3518: that are not supported, e.g.
1.17 imil 3519: </p>
3520: <pre class="programlisting">
1.93 sevan 3521: PYTHON_VERSIONS_INCOMPATIBLE= 27
1.17 imil 3522: </pre>
3523: <p>
1.103 wiz 3524: If the packaged software is a Python module, include one of
3525: <code class="filename">../../lang/python/egg.mk</code>,
3526: <code class="filename">../../lang/python/distutils.mk</code>, or
3527: <code class="filename">../../lang/python/extension.mk</code>.</p>
3528: <p>Most Python packages use either <span class="quote">“<span class="quote">distutils</span>”</span> or
3529: easy-setup/setuptools (<span class="quote">“<span class="quote">eggs</span>”</span>).
1.175 gutterid 3530: If the packaged software is using setuptools, you only need
1.103 wiz 3531: to include <span class="quote">“<span class="quote"><code class="filename">../../lang/python/egg.mk</code></span>”</span>.
3532: Otherwise, if the software uses <span class="quote">“<span class="quote">distutils</span>”</span>, include
1.175 gutterid 3533: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/distutils.mk</code></span>”</span>,
1.103 wiz 3534: so pkgsrc will use this framework.
1.175 gutterid 3535: <span class="quote">“<span class="quote">distutils</span>”</span> uses a script called <code class="filename">setup.py</code>;
1.103 wiz 3536: if the <span class="quote">“<span class="quote">distutils</span>”</span> driver is not called
3537: <code class="filename">setup.py</code>, set the <code class="varname">PYSETUP</code> variable
3538: to the name of the script.</p>
3539: <p>Either way, the package directory should be called
1.23 wiz 3540: <span class="quote">“<span class="quote">py-software</span>”</span> and <code class="varname">PKGNAME</code> should be set to
3541: <span class="quote">“<span class="quote">${PYPKGPREFIX}-${DISTNAME}</span>”</span>, e.g.
1.17 imil 3542: </p>
3543: <pre class="programlisting">
3544: DISTNAME= foopymodule-1.2.10
3545: PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
3546: </pre>
1.63 wiz 3547: <p>If it is an application, include
3548: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/application.mk</code></span>”</span>.
3549: In order to correctly set the path to the Python interpreter, use the
1.17 imil 3550: <code class="varname">REPLACE_PYTHON</code> variable and set it to the list of files
1.35 wiz 3551: (paths relative to <code class="varname">WRKSRC</code>) that must be corrected.
1.63 wiz 3552: For example:
1.17 imil 3553: </p>
3554: <pre class="programlisting">
1.35 wiz 3555: REPLACE_PYTHON= *.py
1.17 imil 3556: </pre>
1.63 wiz 3557: <p>Some Python modules have separate distributions for Python-2.x
3558: and Python-3.x support. In pkgsrc this is handled by the
3559: <code class="filename">versioned_dependencies.mk</code> file. Set
3560: <code class="varname">PYTHON_VERSIONED_DEPENDENCIES</code> to the list of
3561: packages that should be depended upon and include
3562: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/versioned_dependencies.mk</code></span>”</span>,
3563: then the pkgsrc infrastructure will depend on the appropriate package
3564: version. For example:
3565: </p>
3566: <pre class="programlisting">
1.135 wiz 3567: PYTHON_VERSIONED_DEPENDENCIES=dialog
1.63 wiz 3568: </pre>
3569: <p>
3570: Look inside <code class="filename">versioned_dependencies.mk</code> for a list
3571: of supported packages.</p>
1.17 imil 3572: </div>
1.160 brook 3573: <div class="sect2">
3574: <div class="titlepage"><div><div><h3 class="title">
3575: <a name="creating.R-package"></a>12.1.3. R packages</h3></div></div></div>
3576: <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>
3577: are handled automatically by <span class="command"><strong>R2pkg</strong></span>, which is
3578: 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>.
3579: Individual packages (and optionally their dependencies) may be created
3580: and updated. R packages generally follow the same form, and most of
3581: the relevant information needed is contained in a
3582: <code class="filename">DESCRIPTION</code> file as part of each R package on
3583: <a class="ulink" href="https://cran.r-project.org/web/packages/available_packages_by_name.html" target="_top">CRAN</a>.
3584: Consequently, <span class="command"><strong>R2pkg</strong></span> downloads that information and
3585: creates or updates a package in the canonical form. The resulting
3586: package should be reviewed for correctness.</p>
3587: </div>
3588: <div class="sect2">
3589: <div class="titlepage"><div><div><h3 class="title">
3590: <a name="creating.TeX-package"></a>12.1.4. TeXlive packages</h3></div></div></div>
3591: <p>TeXlive packages from <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a> are handled automatically by
3592: <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>
3593: <p>If the TeXlive package name is not known, it may be useful to
3594: search <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a>. A
3595: <span class="quote">“<span class="quote">Contained in</span>”</span> field on the package page typically
3596: 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
3597: archive</a>.</p>
3598: <p>If the TeXlive package name is known, download the files from
3599: the <a class="ulink" href="https://www.ctan.org/tex-archive/systems/texlive/tlnet/archive" target="_top">TeXlive
3600: archive</a>. For package <code class="filename">foo</code>, you will need
3601: to download <code class="filename">foo.tar.xz</code>. Most TeXlive packages
3602: also have associated documentation packages, so download
3603: <code class="filename">foo.doc.tar.xz</code> at the same time. These files
3604: should be placed in the appropriate category directory, which is often
3605: but not always <code class="filename">print</code>. Then run the following
3606: command in the category directory.</p>
3607: <pre class="programlisting">
3608: texlive2pkg foo.tar.xz foo.doc.tar.xz
3609: </pre>
3610: <p>This will create two packages, <code class="filename">tex-foo</code> and
3611: <code class="filename">tex-foo-doc</code>. Be sure to check that both packages
3612: are correct.</p>
3613: <p>Finally, <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a>
3614: currently does not include version information in package filenames
3615: and changes their contents periodically when updates occur.
3616: Consequently, pkgsrc avoids downloading distfiles directly from <a class="ulink" href="https://www.ctan.org/" target="_top">CTAN</a> and instead relies on the
3617: pkgsrc archives. For each new or updated TeXlive package, e.g., the
3618: main one and the corresponding documentation, upload the distfiles
3619: with the following command in each package directory.</p>
3620: <pre class="programlisting">
3621: make upload-distfiles
3622: </pre>
3623: </div>
1.1 dsieger 3624: </div>
1.41 asau 3625: <div class="sect1">
1.1 dsieger 3626: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3627: <a name="creating.examples"></a>12.2. Examples</h2></div></div></div>
1.41 asau 3628: <div class="sect2">
1.1 dsieger 3629: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 3630: <a name="creating.nvu"></a>12.2.1. How the www/nvu package came into pkgsrc</h3></div></div></div>
1.41 asau 3631: <div class="sect3">
1.1 dsieger 3632: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 3633: <a name="creating.nvu.init"></a>12.2.1.1. The initial package</h4></div></div></div>
1.1 dsieger 3634: <p>Looking at the file <code class="filename">pkgsrc/doc/TODO</code>, I saw
1.23 wiz 3635: that the <span class="quote">“<span class="quote">nvu</span>”</span> package has not yet been imported into
1.1 dsieger 3636: pkgsrc. As the description says it has to do with the web, the obvious
1.23 wiz 3637: choice for the category is <span class="quote">“<span class="quote">www</span>”</span>.</p>
1.1 dsieger 3638: <pre class="programlisting">
3639: <code class="prompt">$</code> mkdir www/nvu
3640: <code class="prompt">$</code> cd www/nvu
3641: </pre>
3642: <p>The web site says that the sources are available as a tar file, so
1.10 hubertf 3643: I fed that URL to the <span class="command"><strong>url2pkg</strong></span> program:</p>
1.1 dsieger 3644: <pre class="programlisting">
3645: <code class="prompt">$</code> url2pkg http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2
3646: </pre>
3647: <p>My editor popped up, and I added a <code class="varname">PKGNAME</code> line
3648: below the <code class="varname">DISTNAME</code> line, as the package name should
1.23 wiz 3649: not have the word <span class="quote">“<span class="quote">sources</span>”</span> in it. I also filled in the
1.1 dsieger 3650: <code class="varname">MAINTAINER</code>, <code class="varname">HOMEPAGE</code> and
3651: <code class="varname">COMMENT</code> fields. Then the package
3652: <code class="filename">Makefile</code> looked like that:</p>
3653: <pre class="programlisting">
1.121 sevan 3654: # $NetBSD $
1.1 dsieger 3655: #
3656:
3657: DISTNAME= nvu-1.0-sources
3658: PKGNAME= nvu-1.0
3659: CATEGORIES= www
3660: MASTER_SITES= http://cvs.nvu.com/download/
3661: EXTRACT_SUFX= .tar.bz2
3662:
3663: MAINTAINER= rillig@NetBSD.org
3664: HOMEPAGE= http://cvs.nvu.com/
3665: COMMENT= Web Authoring System
3666:
3667: # url2pkg-marker (please do not remove this line.)
3668: .include "../../mk/bsd.pkg.mk"
3669: </pre>
1.124 wiz 3670: <p>On the first line of output above, an artificial space has been added between NetBSD and $,
1.121 sevan 3671: this is a workaround to prevent CVS expanding to the filename of the
3672: guide.</p>
1.1 dsieger 3673: <p>Then, I quit the editor and watched pkgsrc downloading a large
3674: source archive:</p>
3675: <pre class="programlisting">
3676: url2pkg> Running "make makesum" ...
3677: => Required installed package digest>=20010302: digest-20060826 found
3678: => Fetching nvu-1.0-sources.tar.bz2
3679: Requesting http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2
3680: 100% |*************************************| 28992 KB 150.77 KB/s00:00 ETA
3681: 29687976 bytes retrieved in 03:12 (150.77 KB/s)
3682: url2pkg> Running "make extract" ...
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: work.bacc -> /tmp/roland/pkgsrc/www/nvu/work.bacc
3687: ===> Installing dependencies for nvu-1.0
3688: ===> Overriding tools for nvu-1.0
3689: ===> Extracting for nvu-1.0
3690: url2pkg> Adjusting the Makefile.
3691:
3692: Remember to correct CATEGORIES, HOMEPAGE, COMMENT, and DESCR when you're done!
3693:
3694: Good luck! (See pkgsrc/doc/pkgsrc.txt for some more help :-)
3695: </pre>
3696: </div>
1.41 asau 3697: <div class="sect3">
1.1 dsieger 3698: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 3699: <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 3700: <p>Now that the package has been extracted, let's see what's inside
3701: it. The package has a <code class="filename">README.txt</code>, but that only
3702: says something about mozilla, so it's probably useless for seeing what
3703: dependencies this package has. But since there is a GNU configure script
3704: in the package, let's hope that it will complain about everything it
3705: needs.</p>
3706: <pre class="programlisting">
3707: <code class="prompt">$</code> bmake
3708: => Required installed package digest>=20010302: digest-20060826 found
3709: => Checksum SHA1 OK for nvu-1.0-sources.tar.bz2
3710: => Checksum RMD160 OK for nvu-1.0-sources.tar.bz2
3711: ===> Patching for nvu-1.0
3712: ===> Creating toolchain wrappers for nvu-1.0
3713: ===> Configuring for nvu-1.0
3714: [...]
3715: configure: error: Perl 5.004 or higher is required.
3716: [...]
3717: WARNING: Please add USE_TOOLS+=perl to the package Makefile.
3718: [...]
3719: </pre>
3720: <p>That worked quite well. So I opened the package Makefile in my
3721: editor, and since it already has a <code class="varname">USE_TOOLS</code> line, I
1.23 wiz 3722: just appended <span class="quote">“<span class="quote">perl</span>”</span> to it. Since the dependencies of the
1.1 dsieger 3723: package have changed now, and since a perl wrapper is automatically
1.23 wiz 3724: installed in the <span class="quote">“<span class="quote">tools</span>”</span> phase, I need to build the package
1.1 dsieger 3725: from scratch.</p>
3726: <pre class="programlisting">
3727: <code class="prompt">$</code> bmake clean
3728: ===> Cleaning for nvu-1.0
3729: <code class="prompt">$</code> bmake
3730: [...]
3731: *** /tmp/roland/pkgsrc/www/nvu/work.bacc/.tools/bin/make is not \
3732: GNU Make. You will not be able to build Mozilla without GNU Make.
3733: [...]
3734: </pre>
1.23 wiz 3735: <p>So I added <span class="quote">“<span class="quote">gmake</span>”</span> to the
1.1 dsieger 3736: <code class="varname">USE_TOOLS</code> line and tried again (from scratch).</p>
3737: <pre class="programlisting">
3738: [...]
3739: checking for GTK - version >= 1.2.0... no
3740: *** Could not run GTK test program, checking why...
3741: [...]
3742: </pre>
3743: <p>Now to the other dependencies. The first question is: Where is the
3744: GTK package hidden in pkgsrc?</p>
3745: <pre class="programlisting">
3746: <code class="prompt">$</code> echo ../../*/gtk*
3747: [many packages ...]
3748: <code class="prompt">$</code> echo ../../*/gtk
3749: ../../x11/gtk
3750: <code class="prompt">$</code> echo ../../*/gtk2
3751: ../../x11/gtk2
3752: <code class="prompt">$</code> echo ../../*/gtk2/bui*
3753: ../../x11/gtk2/buildlink3.mk
3754: </pre>
3755: <p>The first try was definitely too broad. The second one had exactly
3756: one result, which is very good. But there is one pitfall with GNOME
3757: packages. Before GNOME 2 had been released, there were already many
3758: GNOME 1 packages in pkgsrc. To be able to continue to use these
3759: packages, the GNOME 2 packages were imported as separate packages, and
1.23 wiz 3760: their names usually have a <span class="quote">“<span class="quote">2</span>”</span> appended. So I checked
1.1 dsieger 3761: whether this was the case here, and indeed it was.</p>
3762: <p>Since the GTK2 package has a <code class="filename">buildlink3.mk</code>
3763: file, adding the dependency is very easy. I just inserted an
3764: <code class="literal">.include</code> line before the last line of the package
3765: <code class="filename">Makefile</code>, so that it now looks like this:</p>
3766: <pre class="programlisting">
3767: [...]
3768: .include "../../x11/gtk2/buildlink3.mk"
3769: .include "../../mk/bsd.pkg.mk
3770: </pre>
1.10 hubertf 3771: <p>After another <span class="command"><strong>bmake clean && bmake</strong></span>, the answer
1.1 dsieger 3772: was:</p>
3773: <pre class="programlisting">
3774: [...]
3775: checking for gtk-config... /home/roland/pkg/bin/gtk-config
3776: checking for GTK - version >= 1.2.0... no
3777: *** Could not run GTK test program, checking why...
3778: *** The test program failed to compile or link. See the file config.log for the
3779: *** exact error that occured. This usually means GTK was incorrectly installed
3780: *** or that you have moved GTK since it was installed. In the latter case, you
3781: *** may want to edit the gtk-config script: /home/roland/pkg/bin/gtk-config
3782: configure: error: Test for GTK failed.
3783: [...]
3784: </pre>
1.23 wiz 3785: <p>In this particular case, the assumption that <span class="quote">“<span class="quote">every package
3786: prefers GNOME 2</span>”</span> had been wrong. The first of the lines above
1.1 dsieger 3787: told me that this package really wanted to have the GNOME 1 version of
3788: GTK. If the package had looked for GTK2, it would have looked for
1.10 hubertf 3789: <span class="command"><strong>pkg-config</strong></span> instead of <span class="command"><strong>gtk-config</strong></span>.
1.1 dsieger 3790: So I changed the <code class="literal">x11/gtk2</code> to
3791: <code class="literal">x11/gtk</code> in the package <code class="filename">Makefile</code>,
3792: and tried again.</p>
3793: <pre class="programlisting">
3794: [...]
1.59 jnemeth 3795: cc -o xpidl.o -c -DOSTYPE=\"NetBSD3\" -DOSARCH=\"NetBSD\" [...]
1.1 dsieger 3796: In file included from xpidl.c:42:
3797: xpidl.h:53:24: libIDL/IDL.h: No such file or directory
3798: In file included from xpidl.c:42:
3799: xpidl.h:132: error: parse error before "IDL_ns"
3800: [...]
3801: </pre>
3802: <p>The package still does not find all of its dependencies. Now the
3803: question is: Which package provides the
3804: <code class="filename">libIDL/IDL.h</code> header file?</p>
3805: <pre class="programlisting">
3806: <code class="prompt">$</code> echo ../../*/*idl*
3807: ../../devel/py-idle ../../wip/idled ../../x11/acidlaunch
3808: <code class="prompt">$</code> echo ../../*/*IDL*
3809: ../../net/libIDL
3810: </pre>
3811: <p>Let's take the one from the second try. So I included the
3812: <code class="filename">../../net/libIDL/buildlink3.mk</code> file and tried
3813: again. But the error didn't change. After digging through some of the
3814: code, I concluded that the build process of the package was broken and
3815: couldn't have ever worked, but since the Mozilla source tree is quite
3816: large, I didn't want to fix it. So I added the following to the package
3817: <code class="filename">Makefile</code> and tried again:</p>
3818: <pre class="programlisting">
3819: CPPFLAGS+= -I${BUILDLINK_PREFIX.libIDL}/include/libIDL-2.0
1.139 leot 3820: BUILDLINK_TRANSFORM+= l:IDL:IDL-2
1.1 dsieger 3821: </pre>
3822: <p>The latter line is needed because the package expects the library
3823: <code class="filename">libIDL.so</code>, but only
3824: <code class="filename">libIDL-2.so</code> is available. So I told the compiler
3825: wrapper to rewrite that on the fly.</p>
3826: <p>The next problem was related to a recent change of the FreeType
1.137 leot 3827: 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 3828: which patch files were relevant for this issue and copied them to the
3829: <code class="filename">patches</code> directory. Then I retried, fixed the
3830: patches so that they applied cleanly and retried again. This time,
3831: everything worked.</p>
3832: </div>
1.41 asau 3833: <div class="sect3">
1.1 dsieger 3834: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 3835: <a name="creating.nvu.inst"></a>12.2.1.3. Installing the package</h4></div></div></div>
1.1 dsieger 3836: <pre class="programlisting">
3837: <code class="prompt">$</code> bmake CHECK_FILES=no install
3838: [...]
3839: <code class="prompt">$</code> bmake print-PLIST >PLIST
3840: <code class="prompt">$</code> bmake deinstall
3841: <code class="prompt">$</code> bmake install
3842: </pre>
3843: </div>
3844: </div>
3845: </div>
3846: </div>
1.41 asau 3847: <div class="chapter">
1.1 dsieger 3848: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 3849: <a name="components"></a>Chapter 13. Package components - files, directories and contents</h2></div></div></div>
1.1 dsieger 3850: <div class="toc">
3851: <p><b>Table of Contents</b></p>
1.100 leot 3852: <dl class="toc">
1.154 rillig 3853: <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt>
3854: <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt>
3855: <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt>
3856: <dd><dl>
3857: <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt>
3858: <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt>
3859: <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt>
3860: <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt>
3861: <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt>
3862: </dl></dd>
3863: <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt>
3864: <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt>
3865: <dd><dl>
3866: <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt>
3867: <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt>
3868: <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt>
1.1 dsieger 3869: </dl></dd>
1.154 rillig 3870: <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt>
3871: <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt>
1.1 dsieger 3872: </dl>
3873: </div>
3874: <p>Whenever you're preparing a package, there are a number of
3875: files involved which are described in the following
3876: sections.</p>
1.41 asau 3877: <div class="sect1">
1.1 dsieger 3878: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 3879: <a name="components.Makefile"></a>13.1. <code class="filename">Makefile</code>
1.1 dsieger 3880: </h2></div></div></div>
3881: <p>Building, installation and creation of a binary package are all
3882: controlled by the package's <code class="filename">Makefile</code>.
3883: The <code class="filename">Makefile</code> describes various things about
3884: a package, for example from where to get it, how to configure,
3885: build, and install it.</p>
3886: <p>A package <code class="filename">Makefile</code> contains several
3887: sections that describe the package.</p>
3888: <p>In the first section there are the following variables, which
3889: should appear exactly in the order given here. The order and
3890: grouping of the variables is mostly historical and has no further
3891: meaning.</p>
1.41 asau 3892: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 3893: <li class="listitem"><p><code class="varname">DISTNAME</code> is the basename of the
1.1 dsieger 3894: distribution file to be downloaded from the package's
3895: website.</p></li>
1.23 wiz 3896: <li class="listitem"><p><code class="varname">PKGNAME</code> is the name of the
1.66 asau 3897: package, as used by pkgsrc. You need to provide it if
1.1 dsieger 3898: <code class="varname">DISTNAME</code> (which is the default) is not a good
1.66 asau 3899: name for the package in pkgsrc or <code class="varname">DISTNAME</code> is not
3900: provided (no distribution file is required). Usually it is the pkgsrc
1.1 dsieger 3901: directory name together with the version number. It must match the
3902: regular expression
3903: <code class="varname">^[A-Za-z0-9][A-Za-z0-9-_.+]*$</code>, that is, it
3904: starts with a letter or digit, and contains only letters, digits,
3905: dashes, underscores, dots and plus signs.</p></li>
1.23 wiz 3906: <li class="listitem">
1.1 dsieger 3907: <p><code class="varname">CATEGORIES</code> is a list of categories
3908: which the package fits in. You can choose any of the top-level
3909: directories of pkgsrc for it.</p>
3910: <p>Currently the following values are available for
3911: <code class="varname">CATEGORIES</code>. If more than
3912: one is used, they need to be separated by spaces:</p>
3913: <pre class="programlisting">
3914: archivers cross geography meta-pkgs security
3915: audio databases graphics misc shells
3916: benchmarks devel ham multimedia sysutils
3917: biology editors inputmethod net textproc
3918: cad emulators lang news time
3919: chat finance mail parallel wm
3920: comms fonts math pkgtools www
3921: converters games mbone print x11
3922: </pre>
3923: </li>
1.23 wiz 3924: <li class="listitem"><p><code class="varname">MASTER_SITES</code>,
1.1 dsieger 3925: <code class="varname">DYNAMIC_MASTER_SITES</code>,
3926: <code class="varname">DIST_SUBDIR</code>, <code class="varname">EXTRACT_SUFX</code>
3927: and <code class="varname">DISTFILES</code> are discussed in detail in
1.154 rillig 3928: <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 3929: </ul></div>
3930: <p>The second section contains information about separately
3931: downloaded patches, if any.
3932: </p>
1.41 asau 3933: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.80 wiz 3934: <li class="listitem"><p><code class="varname">PATCHFILES</code>:
1.1 dsieger 3935: Name(s) of additional files that contain distribution patches.
3936: There is no default. pkgsrc will look for them at
3937: <code class="varname">PATCH_SITES</code>.
3938: They will automatically be uncompressed before patching if
3939: the names end with <code class="filename">.gz</code> or
3940: <code class="filename">.Z</code>.</p></li>
1.23 wiz 3941: <li class="listitem"><p><code class="varname">PATCH_SITES</code>:
1.1 dsieger 3942: Primary location(s) for distribution patch files (see
1.80 wiz 3943: <code class="varname">PATCHFILES</code> above) if not found locally.</p></li>
3944: <li class="listitem"><p><code class="varname">PATCH_DIST_STRIP</code>:
1.174 leot 3945: 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 3946: help find the correct files to patch. It defaults to
3947: <span class="command"><strong>-p0</strong></span>.</p></li>
1.1 dsieger 3948: </ul></div>
3949: <p>The third section contains the following variables.
3950: </p>
1.41 asau 3951: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 3952: <li class="listitem"><p><code class="varname">MAINTAINER</code> is the email
1.14 jmcneill 3953: address of the person who feels responsible for this package,
3954: and who is most likely to look at problems or questions regarding
1.174 leot 3955: 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 3956: Other developers may contact the <code class="varname">MAINTAINER</code>
3957: before making changes to the package, but are not required to
3958: do so. When packaging a new program, set <code class="varname">MAINTAINER</code>
3959: to yourself. If you really can't maintain the package for future
3960: updates, set it to
1.10 hubertf 3961: <code class="email"><<a class="email" href="mailto:pkgsrc-users@NetBSD.org">pkgsrc-users@NetBSD.org</a>></code>.</p></li>
1.23 wiz 3962: <li class="listitem"><p><code class="varname">OWNER</code> should be used instead
1.14 jmcneill 3963: of <code class="varname">MAINTAINER</code> when you do not want other
3964: developers to update or change the package without contacting
3965: you first. A package Makefile should contain one of
3966: <code class="varname">MAINTAINER</code> or <code class="varname">OWNER</code>, but
3967: not both. </p></li>
1.23 wiz 3968: <li class="listitem"><p><code class="varname">HOMEPAGE</code> is a URL where users can
1.1 dsieger 3969: find more information about the package.</p></li>
1.23 wiz 3970: <li class="listitem"><p><code class="varname">COMMENT</code> is a one-line
1.1 dsieger 3971: description of the package (should not include the package
3972: name).</p></li>
1.122 leot 3973: <li class="listitem"><p><code class="varname">LICENSE</code> indicates the license(s)
1.154 rillig 3974: 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 3975: </ul></div>
3976: <p>Other variables that affect the build:
3977: </p>
1.41 asau 3978: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
1.1 dsieger 3979: <p><code class="varname">WRKSRC</code>: The directory where the
3980: interesting distribution files of the package are found. The
3981: default is <code class="filename">${WRKDIR}/${DISTNAME}</code>, which
3982: works for most packages.</p>
3983: <p>If a package doesn't create a subdirectory for itself
3984: (most GNU software does, for instance), but extracts itself in
3985: the current directory, you should set
3986: <code class="varname">WRKSRC=${WRKDIR}</code>.</p>
3987: <p>If a package doesn't create a subdirectory with the
3988: name of <code class="varname">DISTNAME</code> but some different name,
3989: set <code class="varname">WRKSRC</code> to point to the proper name in
3990: <code class="filename">${WRKDIR}</code>, for example
3991: <code class="varname">WRKSRC=${WRKDIR}/${DISTNAME}/unix</code>. See
1.137 leot 3992: <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 3993: <p>The name of the working directory created by pkgsrc is
3994: taken from the <code class="varname">WRKDIR_BASENAME</code>
3995: variable. By default, its value is
3996: <code class="filename">work</code>. If you want to use the same
3997: pkgsrc tree for building different kinds of binary packages,
3998: you can change the variable according to your needs. Two
3999: other variables handle common cases of setting
4000: <code class="varname">WRKDIR_BASENAME</code> individually. If
4001: <code class="varname">OBJHOSTNAME</code> is defined in
1.10 hubertf 4002: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, the first component of
1.1 dsieger 4003: the host's name is attached to the directory name. If
4004: <code class="varname">OBJMACHINE</code> is defined, the platform name
4005: is attached, which might look like
4006: <code class="filename">work.i386</code> or
4007: <code class="filename">work.sparc</code>.</p>
4008: </li></ul></div>
4009: <p>Please pay attention to the following gotchas:</p>
1.41 asau 4010: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4011: <li class="listitem"><p>Add <code class="varname">MANCOMPRESSED</code> if man pages are
1.1 dsieger 4012: installed in compressed form by the package. For packages using
4013: BSD-style makefiles which honor MANZ, there is
4014: <code class="varname">MANCOMPRESSED_IF_MANZ</code>.</p></li>
1.23 wiz 4015: <li class="listitem"><p>Replace <code class="filename">/usr/local</code> with
4016: <span class="quote">“<span class="quote">${PREFIX}</span>”</span> in all files (see patches,
1.1 dsieger 4017: below).</p></li>
1.154 rillig 4018: <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 4019: </ul></div>
4020: </div>
1.41 asau 4021: <div class="sect1">
1.1 dsieger 4022: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4023: <a name="components.distinfo"></a>13.2. <code class="filename">distinfo</code>
1.1 dsieger 4024: </h2></div></div></div>
4025: <p>The <code class="filename">distinfo</code> file contains the message
4026: digest, or checksum, of each distfile needed for the package. This
4027: ensures that the distfiles retrieved from the Internet have not been
4028: corrupted during transfer or altered by a malign force to introduce
1.108 rillig 4029: a security hole. To provide maximum security, all distfiles are
4030: protected using three different message digest algorithms (SHA1,
4031: RMD160, SHA512), as well as the file size.</p>
1.1 dsieger 4032: <p>The <code class="filename">distinfo</code> file also contains the
4033: checksums for all the patches found in the
1.154 rillig 4034: <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 4035: are only applied intentionally and that they don't accidentally change,
4036: e.g. when merging different changes together. They also make sure that
4037: new patches are actually added to CVS and old ones are removed.
4038: Too see whether the patches and the <code class="filename">distinfo</code> file
4039: match, run <span class="command"><strong>pkglint</strong></span> after changing the patches.</p>
1.1 dsieger 4040: <p>To regenerate the <code class="filename">distinfo</code> file, use the
1.108 rillig 4041: <span class="command"><strong>make distinfo</strong></span> command.</p>
1.1 dsieger 4042: <p>Some packages have different sets of distfiles depending on
1.178 rillig 4043: 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 4044: <code class="filename">distinfo</code> file and care should be taken when
4045: upgrading such a package to ensure distfile information is not
4046: lost.</p>
4047: </div>
1.41 asau 4048: <div class="sect1">
1.1 dsieger 4049: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4050: <a name="components.patches"></a>13.3. <code class="filename">patches/*</code>
1.108 rillig 4051: </h2></div></div></div>
4052: <p>Some packages don't work out-of-the box on the various
4053: platforms that are supported by pkgsrc. These packages need
4054: to be patched to make them work. The patch files can be
1.1 dsieger 4055: found in the <code class="filename">patches/</code> directory.</p>
4056: <p>In the <span class="emphasis"><em>patch</em></span> phase, these patches are
4057: applied to the files in <code class="varname">WRKSRC</code> directory after
1.108 rillig 4058: extracting them, in alphabetic order.</p>
1.41 asau 4059: <div class="sect2">
1.1 dsieger 4060: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4061: <a name="components.patch.structure"></a>13.3.1. Structure of a single patch file</h3></div></div></div>
1.1 dsieger 4062: <p>The <code class="filename">patch-*</code> files should be in
1.10 hubertf 4063: <span class="command"><strong>diff -bu</strong></span> format, and apply without a fuzz to avoid
1.1 dsieger 4064: problems. (To force patches to apply with fuzz you can set
4065: <code class="varname">PATCH_FUZZ_FACTOR=-F2</code>). Furthermore, each patch
4066: should contain only changes for a single file, and no file should be
4067: patched by more than one patch file. This helps to keep future
4068: modifications simple.</p>
4069: <p>Each patch file is structured as follows: In the first line,
4070: there is the RCS Id of the patch itself. The second line should be
4071: empty for aesthetic reasons. After that, there should be a comment for
4072: each change that the patch does. There are a number of standard
4073: cases:</p>
1.41 asau 4074: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4075: <li class="listitem"><p>Patches for commonly known vulnerabilities should
1.1 dsieger 4076: mention the vulnerability ID (CAN, CVE).</p></li>
1.23 wiz 4077: <li class="listitem"><p>Patches that change source code should mention the
1.1 dsieger 4078: platform and other environment (for example, the compiler) that the
4079: patch is needed for.</p></li>
4080: </ul></div>
1.108 rillig 4081: <p>The patch should be commented so that any
1.1 dsieger 4082: developer who knows the code of the application can make some use of
4083: the patch. Special care should be taken for the upstream developers,
4084: since we generally want that they accept our patches, so we have less
4085: work in the future.</p>
4086: </div>
1.41 asau 4087: <div class="sect2">
1.1 dsieger 4088: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4089: <a name="components.patches.caveats"></a>13.3.2. Creating patch files</h3></div></div></div>
1.1 dsieger 4090: <p>One important thing to mention is to pay attention that no RCS
4091: IDs get stored in the patch files, as these will cause problems when
4092: later checked into the NetBSD CVS tree. Use the
1.137 leot 4093: <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 4094: problems.</p>
4095: <p>For even more automation, we recommend using
1.10 hubertf 4096: <span class="command"><strong>mkpatches</strong></span> from the same package to make a
1.1 dsieger 4097: whole set of patches. You just have to backup files before you
4098: edit them to <code class="filename">filename.orig</code>, e.g. with
1.10 hubertf 4099: <span class="command"><strong>cp -p filename filename.orig</strong></span> or, easier, by
4100: using <span class="command"><strong>pkgvi</strong></span> again from the same package. If
1.1 dsieger 4101: you upgrade a package this way, you can easily compare the new
4102: set of patches with the previously existing one with
1.24 wiz 4103: <span class="command"><strong>patchdiff</strong></span>. The files in <code class="filename">patches</code>
4104: are replaced by new files, so carefully check if you want to take all
4105: the changes.</p>
1.1 dsieger 4106: <p>When you have finished a package, remember to generate
1.10 hubertf 4107: the checksums for the patch files by using the <span class="command"><strong>make
1.154 rillig 4108: 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 4109: <p>When adding a patch that corrects a problem in the
4110: distfile (rather than e.g. enforcing pkgsrc's view of where
4111: man pages should go), send the patch as a bug report to the
4112: maintainer. This benefits non-pkgsrc users of the package,
4113: and usually makes it possible to remove the patch in future
4114: version.</p>
1.2 rillig 4115: <p>The file names of the patch files are usually of the form
1.24 wiz 4116: <code class="filename">patch-<em class="replaceable"><code>path_to_file__with__underscores.c</code></em></code>.
4117: Many packages still use the previous convention
4118: <code class="filename">patch-<em class="replaceable"><code>[a-z][a-z]</code></em></code>,
4119: but new patches should be of the form containing the filename.
1.137 leot 4120: <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 4121: automatically.</p>
1.1 dsieger 4122: </div>
1.41 asau 4123: <div class="sect2">
1.1 dsieger 4124: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4125: <a name="components.patches.sources"></a>13.3.3. Sources where the patch files come from</h3></div></div></div>
1.1 dsieger 4126: <p>If you want to share patches between multiple packages
4127: in pkgsrc, e.g. because they use the same distfiles, set
4128: <code class="varname">PATCHDIR</code> to the path where the patch files
4129: can be found, e.g.:</p>
4130: <pre class="programlisting">
1.159 rillig 4131: PATCHDIR= ../../editors/xemacs/patches
1.1 dsieger 4132: </pre>
4133: <p>Patch files that are distributed by the author or other
4134: maintainers can be listed in
4135: <code class="varname">PATCHFILES</code>.</p>
4136: <p>If it is desired to store any patches that should not be
4137: committed into pkgsrc, they can be kept outside the pkgsrc
4138: tree in the <code class="filename">$LOCALPATCHES</code> directory. The
4139: directory tree there is expected to have the same
1.23 wiz 4140: <span class="quote">“<span class="quote">category/package</span>”</span> structure as pkgsrc, and
1.1 dsieger 4141: patches are expected to be stored inside these dirs (also
4142: known as <code class="filename">$LOCALPATCHES/$PKGPATH</code>). For
4143: example, if you want to keep a private patch for
4144: <code class="filename">pkgsrc/graphics/png</code>, keep it in
4145: <code class="filename">$LOCALPATCHES/graphics/png/mypatch</code>. All
4146: files in the named directory are expected to be patch files,
4147: and <span class="emphasis"><em>they are applied after pkgsrc patches are
4148: applied</em></span>.</p>
4149: </div>
1.41 asau 4150: <div class="sect2">
1.1 dsieger 4151: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4152: <a name="components.patches.guidelines"></a>13.3.4. Patching guidelines</h3></div></div></div>
1.1 dsieger 4153: <p>When fixing a portability issue in the code do not use
4154: preprocessor magic to check for the current operating system nor
4155: platform. Doing so hurts portability to other platforms because
4156: the OS-specific details are not abstracted appropriately.</p>
4157: <p>The general rule to follow is: instead of checking for the
4158: operating system the application is being built on, check for the
4159: specific <span class="emphasis"><em>features</em></span> you need. For example,
4160: instead of assuming that kqueue is available under NetBSD and
4161: using the <code class="varname">__NetBSD__</code> macro to conditionalize
1.14 jmcneill 4162: kqueue support, add a check that detects kqueue itself —
1.1 dsieger 4163: yes, this generally involves patching the
1.10 hubertf 4164: <span class="command"><strong>configure</strong></span> script. There is absolutely nothing
1.1 dsieger 4165: that prevents some OSes from adopting interfaces from other OSes
4166: (e.g. Linux implementing kqueue), something that the above checks
4167: cannot take into account.</p>
4168: <p>Of course, checking for features generally involves more
4169: work on the developer's side, but the resulting changes are
4170: cleaner and there are chances they will work on many other
4171: platforms. Not to mention that there are higher chances of being
4172: later integrated into the mainstream sources. Remember:
4173: <span class="emphasis"><em>It doesn't work unless it is right!</em></span></p>
4174: <p>Some typical examples:</p>
4175: <div class="table">
1.154 rillig 4176: <a name="patch-examples"></a><p class="title"><b>Table 13.1. Patching examples</b></p>
1.106 tnn 4177: <div class="table-contents"><table class="table" summary="Patching examples" border="1">
1.1 dsieger 4178: <colgroup>
4179: <col>
4180: <col>
4181: <col>
4182: </colgroup>
4183: <thead><tr>
4184: <th>Where</th>
4185: <th>Incorrect</th>
4186: <th>Correct</th>
4187: </tr></thead>
4188: <tbody>
4189: <tr>
4190: <td>configure script</td>
4191: <td>
4192: <pre class="programlisting">
4193: case ${target_os} in
4194: netbsd*) have_kvm=yes ;;
4195: *) have_kvm=no ;;
4196: esac
4197: </pre>
4198: </td>
4199: <td>
4200: <pre class="programlisting">
4201: AC_CHECK_LIB(kvm, kvm_open, have_kvm=yes, have_kvm=no)
4202: </pre>
4203: </td>
4204: </tr>
4205: <tr>
4206: <td>C source file</td>
4207: <td>
4208: <pre class="programlisting">
4209: #if defined(__NetBSD__)
4210: # include <sys/event.h>
4211: #endif
4212: </pre>
4213: </td>
4214: <td>
4215: <pre class="programlisting">
4216: #if defined(HAVE_SYS_EVENT_H)
4217: # include <sys/event.h>
4218: #endif
4219: </pre>
4220: </td>
4221: </tr>
4222: <tr>
4223: <td>C source file</td>
4224: <td>
4225: <pre class="programlisting">
4226: int
4227: monitor_file(...)
4228: {
4229: #if defined(__NetBSD__)
4230: int fd = kqueue();
4231: ...
4232: #else
4233: ...
4234: #endif
4235: }
4236: </pre>
4237: </td>
4238: <td>
4239: <pre class="programlisting">
4240: int
4241: monitor_file(...)
4242: {
4243: #if defined(HAVE_KQUEUE)
4244: int fd = kqueue();
4245: ...
4246: #else
1.112 rillig 4247: ...
1.1 dsieger 4248: #endif
4249: }
4250: </pre>
4251: </td>
4252: </tr>
4253: </tbody>
4254: </table></div>
4255: </div>
1.141 maya 4256: <br class="table-break">
1.1 dsieger 4257: </div>
1.41 asau 4258: <div class="sect2">
1.1 dsieger 4259: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4260: <a name="components.patches.feedback"></a>13.3.5. Feedback to the author</h3></div></div></div>
1.1 dsieger 4261: <p>Always, always, <span class="strong"><strong>always</strong></span>
4262: feed back any <span class="emphasis"><em>portability fixes</em></span> or
4263: improvements you do to a package to the mainstream developers.
4264: This is the only way to get their attention on portability issues
4265: and to ensure that future versions can be built out-of-the box on
4266: NetBSD. Furthermore, any user that gets newer distfiles will get
4267: the fixes straight from the packaged code.</p>
4268: <p>This generally involves cleaning up the patches
4269: (because sometimes the patches that are
1.40 wiz 4270: added to pkgsrc are quick hacks), filing bug reports in the
1.1 dsieger 4271: appropriate trackers for the projects and working with the
4272: mainstream authors to accept your changes. It is
4273: <span class="emphasis"><em>extremely important</em></span> that you do it so that
4274: the packages in pkgsrc are kept simple and thus further changes
4275: can be done without much hassle.</p>
1.24 wiz 4276: <p>When you have done this, please add a URL to the upstream
4277: bug report to the patch comment.</p>
1.1 dsieger 4278: <p>Support the idea of free software!</p>
4279: </div>
4280: </div>
1.41 asau 4281: <div class="sect1">
1.1 dsieger 4282: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4283: <a name="other-mandatory-files"></a>13.4. Other mandatory files</h2></div></div></div>
1.41 asau 4284: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4285: <dt><span class="term"><code class="filename">DESCR</code></span></dt>
4286: <dd><p>A multi-line description of the piece of software. This should include
4287: any credits where they are due. Please bear in mind that others do not
4288: share your sense of humour (or spelling idiosyncrasies), and that others
4289: will read everything that you write here.</p></dd>
4290: <dt><span class="term"><code class="filename">PLIST</code></span></dt>
4291: <dd><p>This file governs the files that are installed on your
4292: system: all the binaries, manual pages, etc. There are other
4293: directives which may be entered in this file, to control the
4294: creation and deletion of directories, and the location of
1.154 rillig 4295: 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 4296: information.</p></dd>
4297: </dl></div>
4298: </div>
1.41 asau 4299: <div class="sect1">
1.1 dsieger 4300: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4301: <a name="components.optional"></a>13.5. Optional files</h2></div></div></div>
1.41 asau 4302: <div class="sect2">
1.1 dsieger 4303: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4304: <a name="components.optional.bin"></a>13.5.1. Files affecting the binary package</h3></div></div></div>
1.41 asau 4305: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4306: <dt><span class="term"><code class="filename">INSTALL</code></span></dt>
1.28 wiz 4307: <dd>
1.174 leot 4308: <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 4309: First time after package extraction and before files are
4310: moved in place, the second time after the files to install
4311: are moved in place. This can be used to do any custom
4312: procedures not possible with @exec commands in
1.174 leot 4313: <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
4314: <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 4315: Please note that you can modify variables in it easily by using
4316: <code class="varname">FILES_SUBST</code> in the package's
4317: <code class="filename">Makefile</code>:</p>
4318: <pre class="programlisting">
4319: FILES_SUBST+= SOMEVAR="somevalue"
4320: </pre>
4321: <p>replaces "@SOMEVAR@" with <span class="quote">“<span class="quote">somevalue</span>”</span> in the
4322: <code class="filename">INSTALL</code>. By default, substitution is
4323: performed for <code class="varname">PREFIX</code>,
4324: <code class="varname">LOCALBASE</code>, <code class="varname">X11BASE</code>,
4325: <code class="varname">VARBASE</code>, and a few others, type
4326: <span class="command"><strong>make help topic=FILES_SUBST</strong></span> for a
4327: complete list.</p>
4328: </dd>
1.1 dsieger 4329: <dt><span class="term"><code class="filename">DEINSTALL</code></span></dt>
4330: <dd><p>This script is executed before and after any files are removed. It is
4331: this script's responsibility to clean up any additional messy details
4332: around the package's installation, since all pkg_delete knows is how to
4333: delete the files created in the original distribution.
1.174 leot 4334: 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>
4335: 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 4336: The same methods to replace variables can be used as for
4337: the <code class="filename">INSTALL</code> file.</p></dd>
1.1 dsieger 4338: <dt><span class="term"><code class="filename">MESSAGE</code></span></dt>
4339: <dd>
4340: <p>This file is displayed after installation of the package.
4341: Useful for things like legal notices on almost-free
4342: software and hints for updating config files after
4343: installing modules for apache, PHP etc.
4344: Please note that you can modify variables in it easily by using
4345: <code class="varname">MESSAGE_SUBST</code> in the package's
4346: <code class="filename">Makefile</code>:</p>
4347: <pre class="programlisting">
4348: MESSAGE_SUBST+= SOMEVAR="somevalue"
4349: </pre>
1.23 wiz 4350: <p>replaces "${SOMEVAR}" with <span class="quote">“<span class="quote">somevalue</span>”</span> in
1.1 dsieger 4351: <code class="filename">MESSAGE</code>. By default, substitution is
4352: performed for <code class="varname">PKGNAME</code>,
4353: <code class="varname">PKGBASE</code>, <code class="varname">PREFIX</code>,
1.99 sevan 4354: <code class="varname">LOCALBASE</code>, <code class="varname">X11BASE</code>,
1.1 dsieger 4355: <code class="varname">PKG_SYSCONFDIR</code>,
4356: <code class="varname">ROOT_GROUP</code>, and
1.16 jnemeth 4357: <code class="varname">ROOT_USER</code>.</p>
1.1 dsieger 4358: <p>You can display a different or additional files by
4359: setting the <code class="varname">MESSAGE_SRC</code> variable. Its
4360: default is <code class="filename">MESSAGE</code>, if the file
4361: exists.</p>
4362: </dd>
4363: <dt><span class="term"><code class="filename">ALTERNATIVES</code></span></dt>
1.66 asau 4364: <dd>
4365: <p>This file is used by the alternatives framework.
4366: It creates, configures, and destroys generic wrappers used to
4367: run programs with similar interfaces.
4368: See pkg_alternatives(8) from pkgtools/pkg_alternatives
4369: for more information.</p>
4370: <p>Each line of the file contains two filenames, first
4371: the wrapper and then the alternative provided by the package.
4372: Both paths are relative to <code class="varname">PREFIX</code>.</p>
4373: </dd>
1.1 dsieger 4374: </dl></div>
4375: </div>
1.41 asau 4376: <div class="sect2">
1.1 dsieger 4377: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4378: <a name="components.optional.build"></a>13.5.2. Files affecting the build process</h3></div></div></div>
1.41 asau 4379: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4380: <dt><span class="term"><code class="filename">Makefile.common</code></span></dt>
4381: <dd><p>This file contains arbitrary things that could
4382: also go into a <code class="filename">Makefile</code>, but its purpose is
4383: to be used by more than one package. This file should only be
4384: used when the packages that will use the file are known in
4385: advance. For other purposes it is often better to write a
4386: <code class="filename">*.mk</code> file and give it a good name that
4387: describes what it does.</p></dd>
4388: <dt><span class="term"><code class="filename">buildlink3.mk</code></span></dt>
4389: <dd><p>This file contains the dependency information
1.154 rillig 4390: 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 4391: <dt><span class="term"><code class="filename">hacks.mk</code></span></dt>
4392: <dd><p>This file contains workarounds for compiler bugs
4393: and similar things. It is included automatically by the pkgsrc
4394: infrastructure, so you don't need an extra
4395: <code class="literal">.include</code> line for
4396: it.</p></dd>
4397: <dt><span class="term"><code class="filename">options.mk</code></span></dt>
4398: <dd><p>This file contains the code for the
1.154 rillig 4399: 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 4400: selected by the user. If a package has only one or two options,
4401: it is equally acceptable to put the code directly into the
4402: <code class="filename">Makefile</code>.</p></dd>
4403: </dl></div>
4404: </div>
1.41 asau 4405: <div class="sect2">
1.1 dsieger 4406: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4407: <a name="components.optional.none"></a>13.5.3. Files affecting nothing at all</h3></div></div></div>
1.41 asau 4408: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4409: <dt><span class="term"><code class="filename">README*</code></span></dt>
4410: <dd><p>These files do not take place in the creation of
4411: a package and thus are purely informative to the package
4412: developer.</p></dd>
4413: <dt><span class="term"><code class="filename">TODO</code></span></dt>
4414: <dd><p>This file contains things that need to be done
4415: to make the package even
4416: better.</p></dd>
4417: </dl></div>
4418: </div>
4419: </div>
1.41 asau 4420: <div class="sect1">
1.1 dsieger 4421: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4422: <a name="work-dir"></a>13.6. <code class="filename">work*</code>
1.1 dsieger 4423: </h2></div></div></div>
1.10 hubertf 4424: <p>When you type <span class="command"><strong>make</strong></span>, the distribution files are
1.1 dsieger 4425: unpacked into the directory denoted by
4426: <code class="varname">WRKDIR</code>. It can be removed by running
1.10 hubertf 4427: <span class="command"><strong>make clean</strong></span>. Besides the sources, this
1.1 dsieger 4428: directory is also used to keep various timestamp files.
4429: The directory gets <span class="emphasis"><em>removed completely</em></span> on clean.
4430: The default is <code class="filename">${.CURDIR}/work</code>
4431: or <code class="filename">${.CURDIR}/work.${MACHINE_ARCH}</code>
4432: if <code class="varname">OBJMACHINE</code> is set.</p>
4433: </div>
1.41 asau 4434: <div class="sect1">
1.1 dsieger 4435: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4436: <a name="files-dir"></a>13.7. <code class="filename">files/*</code>
1.1 dsieger 4437: </h2></div></div></div>
1.172 rillig 4438: <p>If you have any files that you wish to be placed in the package
4439: prior to configuration or building, you can place these files here
4440: and use a <span class="command"><strong>${CP}</strong></span> command in the
4441: <span class="quote">“<span class="quote">post-extract</span>”</span> target to achieve this.</p>
1.1 dsieger 4442: <p>If you want to share files in this way with other
4443: packages, set the <code class="varname">FILESDIR</code> variable to point
4444: to the other package's <code class="filename">files</code> directory,
4445: e.g.:</p>
4446: <pre class="programlisting">
1.159 rillig 4447: FILESDIR= ../../editors/xemacs/files
1.1 dsieger 4448: </pre>
4449: </div>
4450: </div>
1.41 asau 4451: <div class="chapter">
1.1 dsieger 4452: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 4453: <a name="makefile"></a>Chapter 14. Programming in <code class="filename">Makefile</code>s</h2></div></div></div>
1.1 dsieger 4454: <div class="toc">
4455: <p><b>Table of Contents</b></p>
1.100 leot 4456: <dl class="toc">
1.154 rillig 4457: <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt>
4458: <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt>
4459: <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd>
4460: <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt>
4461: <dd><dl>
4462: <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt>
4463: <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt>
4464: <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>
4465: <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt>
1.1 dsieger 4466: </dl></dd>
4467: </dl>
4468: </div>
4469: <p>Pkgsrc consists of many <code class="filename">Makefile</code> fragments,
4470: each of which forms a well-defined part of the pkgsrc system. Using
1.174 leot 4471: 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 4472: like pkgsrc requires some discipline to keep the code correct and
4473: understandable.</p>
4474: <p>The basic ingredients for <code class="filename">Makefile</code>
1.154 rillig 4475: programming are variables and shell
1.1 dsieger 4476: commands. Among these shell commands may even be more complex ones
1.174 leot 4477: 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 4478: as intended it is necessary to quote all variables correctly when they
4479: are used.</p>
1.154 rillig 4480: <p>This chapter describes some patterns that appear quite often in
1.1 dsieger 4481: <code class="filename">Makefile</code>s, including the pitfalls that come along
4482: with them.</p>
1.41 asau 4483: <div class="sect1">
1.1 dsieger 4484: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4485: <a name="makefile.style"></a>14.1. Caveats</h2></div></div></div>
1.41 asau 4486: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
1.1 dsieger 4487: <p>When you are creating a file as a
4488: target of a rule, always write the data to a temporary file first
4489: and finally rename that file. Otherwise there might occur an error
4490: in the middle of generating the file, and when the user runs
1.174 leot 4491: <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 4492: regenerated properly. Example:</p>
4493: <pre class="programlisting">
4494: wrong:
4495: @echo "line 1" > ${.TARGET}
4496: @echo "line 2" >> ${.TARGET}
4497: @false
4498:
4499: correct:
4500: @echo "line 1" > ${.TARGET}.tmp
4501: @echo "line 2" >> ${.TARGET}.tmp
4502: @false
4503: @mv ${.TARGET}.tmp ${.TARGET}
4504: </pre>
1.10 hubertf 4505: <p>When you run <span class="command"><strong>make wrong</strong></span> twice, the file
1.1 dsieger 4506: <code class="filename">wrong</code> will exist, although there was an error
1.10 hubertf 4507: message in the first run. On the other hand, running <span class="command"><strong>make
1.1 dsieger 4508: correct</strong></span> gives an error message twice, as expected.</p>
1.174 leot 4509: <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 4510: <code class="literal">${.TARGET}</code> in case of error, but this only
4511: happens when it is interrupted, for example by pressing
1.154 rillig 4512: <code class="literal">Ctrl+C</code>. This does <span class="emphasis"><em>not</em></span> happen
1.174 leot 4513: 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 4514: </li></ul></div>
4515: </div>
1.41 asau 4516: <div class="sect1">
1.1 dsieger 4517: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4518: <a name="makefile.variables"></a>14.2. <code class="filename">Makefile</code> variables</h2></div></div></div>
1.1 dsieger 4519: <p><code class="filename">Makefile</code> variables contain strings that
1.154 rillig 4520: can be processed using the five operators <code class="code">=</code>,
4521: <code class="code">+=</code>, <code class="code">?=</code>, <code class="code">:=</code> and
1.174 leot 4522: <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 4523: page.</p>
4524: <p>When a variable's value is parsed from a
1.154 rillig 4525: <code class="filename">Makefile</code>, the hash character <code class="code">#</code> and
4526: the backslash character <code class="code">\</code> are handled specially. If a
4527: backslash is the last character in a line, that backslash is removed
4528: from the line and the line continues with the next line of the file.</p>
4529: <p>The <code class="code">#</code> character starts a comment that reaches
4530: until the end of the line. To get an actual <code class="code">#</code> character,
4531: such as in a URL, write <code class="code">\#</code> instead.</p>
1.108 rillig 4532: <p>The evaluation of variables either happens immediately or lazy.
1.154 rillig 4533: It happens immediately when the variable occurs on the right-hand
4534: side of the <code class="code">:=</code> or the <code class="code">!=</code> operator, in a
1.108 rillig 4535: <code class="varname">.if</code> condition or a <code class="varname">.for</code> loop.
4536: In the other cases, it is evaluated lazily.</p>
1.1 dsieger 4537: <p>Some of the modifiers split the string into words and then
1.154 rillig 4538: operate on the words, others operate on the string as a whole. When a
4539: string is split into words, double quotes and single quotes are
1.174 leot 4540: 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 4541: <div class="sect2">
1.1 dsieger 4542: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4543: <a name="makefile.variables.names"></a>14.2.1. Naming conventions</h3></div></div></div>
1.41 asau 4544: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4545: <li class="listitem"><p>All variable names starting with an underscore
1.1 dsieger 4546: are reserved for use by the pkgsrc infrastructure. They shall
1.154 rillig 4547: not be used by packages.</p></li>
1.23 wiz 4548: <li class="listitem"><p>In <span class="command"><strong>.for</strong></span> loops you should use
1.1 dsieger 4549: lowercase variable names for the iteration
4550: variables.</p></li>
1.154 rillig 4551: <li class="listitem"><p>All list variables should have a plural name,
4552: such as <code class="varname">PKG_OPTIONS</code> or
1.1 dsieger 4553: <code class="varname">DISTFILES</code>.</p></li>
4554: </ul></div>
4555: </div>
4556: </div>
1.41 asau 4557: <div class="sect1">
1.1 dsieger 4558: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4559: <a name="makefile.code"></a>14.3. Code snippets</h2></div></div></div>
1.41 asau 4560: <div class="sect2">
1.1 dsieger 4561: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4562: <a name="adding-to-list"></a>14.3.1. Adding things to a list</h3></div></div></div>
1.108 rillig 4563: <p>When adding a string that possibly contains whitespace or quotes to
4564: a list (example 1), it must be quoted using the <code class="code">:Q</code>
4565: modifier.</p>
4566: <p>When adding another list to a list (example 2), it must not be
4567: quoted, since its elements are already quoted.</p>
1.1 dsieger 4568: <pre class="programlisting">
1.108 rillig 4569: STRING= foo * bar `date`
4570: LIST= # empty
4571: ANOTHER_LIST= a=b c=d
4572:
4573: LIST+= ${STRING:Q} # 1
4574: LIST+= ${ANOTHER_LIST} # 2
1.1 dsieger 4575: </pre>
4576: </div>
1.41 asau 4577: <div class="sect2">
1.1 dsieger 4578: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4579: <a name="echo-literal"></a>14.3.2. Echoing a string exactly as-is</h3></div></div></div>
1.108 rillig 4580: <p>Echoing a string containing special characters needs special
4581: work.</p>
1.1 dsieger 4582: <pre class="programlisting">
4583: STRING= foo bar < > * `date` $$HOME ' "
1.108 rillig 4584: EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words
1.1 dsieger 4585:
4586: all:
4587: echo ${STRING} # 1
1.108 rillig 4588: echo ${STRING:Q} # 2
4589: printf '%s\n' ${STRING:Q}'' # 3
4590: env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4
4591: </pre>
4592: <p>Example 1 leads to a syntax error in the shell, as the characters
4593: are just copied.</p>
4594: <p>Example 2 quotes the string so that the shell interprets it
4595: correctly. But the echo command may additionally interpret strings with a
4596: leading dash or those containing backslashes.</p>
1.174 leot 4597: <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 4598: interprets the format string, but not the next argument. The trailing
4599: single quotes handle the case when the string is empty. In that case, the
4600: :Q modifier would result in an empty string too, which would then be
1.174 leot 4601: 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 4602: but other programs may care.</p>
1.108 rillig 4603: <p>In example 4, the <code class="varname">EXAMPLE_ENV</code> does not
4604: need to be quoted because the quoting has already been done
4605: when adding elements to the list.</p>
1.1 dsieger 4606: </div>
1.41 asau 4607: <div class="sect2">
1.1 dsieger 4608: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4609: <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 4610: <p>When passing <code class="varname">CFLAGS</code> or similar variables to a
4611: GNU-style configure script (especially those that call other configure
4612: scripts), it must not have leading or trailing whitespace, since
4613: otherwise the configure script gets confused. To trim leading and
4614: trailing whitespace, use the <code class="code">:M</code> modifier, as in the
4615: following example:</p>
1.1 dsieger 4616: <pre class="programlisting">
4617: CPPFLAGS= # empty
1.108 rillig 4618: CPPFLAGS+= -Wundef -DPREFIX=\"${PREFIX}\"
1.1 dsieger 4619: CPPFLAGS+= ${MY_CPPFLAGS}
4620:
4621: CONFIGURE_ARGS+= CPPFLAGS=${CPPFLAGS:M*:Q}
4622:
4623: all:
4624: echo x${CPPFLAGS:Q}x # leading and trailing whitespace
1.108 rillig 4625: echo x${CONFIGURE_ARGS:Q}x # properly trimmed
1.1 dsieger 4626: </pre>
1.108 rillig 4627: <p>In this example, <code class="varname">CPPFLAGS</code> has both leading and
4628: trailing whitespace because the <code class="code">+=</code> operator always adds a
4629: space.</p>
4630: </div>
4631: <div class="sect2">
4632: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 4633: <a name="empty-variables"></a>14.3.4. Handling possibly empty variables</h3></div></div></div>
1.108 rillig 4634: <p>When a possibly empty variable is used in a shell program, it may
4635: lead to a syntax error.</p>
4636: <pre class="programlisting">
4637: EGFILES= # empty
4638:
4639: install-examples: # produces a syntax error in the shell
4640: for egfile in ${EGFILES}; do \
4641: echo "Installing $$egfile"; \
4642: done
4643: </pre>
4644: <p>The shell only sees the text <code class="code">for egfile in ; do</code>, since
1.174 leot 4645: <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 4646: To fix this syntax error, use one of the snippets below.</p>
4647: <pre class="programlisting">
4648: EMPTY= # empty
4649:
4650: install-examples:
4651: for egfile in ${EGFILES} ""; do \
4652: [ -n "$$egfile" ] || continue; \
4653: echo "Installing $$egfile"; \
1.1 dsieger 4654: done
1.108 rillig 4655: </pre>
4656: <p>In this case, an empty string is appended to the iteration list (to
4657: prevent the syntax error) and filtered out later.</p>
4658: <pre class="programlisting">
4659: EGFILES= # empty
1.1 dsieger 4660:
1.108 rillig 4661: install-examples:
4662: .for egfile in ${EGFILES}
4663: echo "Installing ${egfile}"
1.1 dsieger 4664: .endfor
4665: </pre>
1.154 rillig 4666: <p>If one of the filenames contains special characters, it should be
4667: enclosed in single or double quotes.</p>
1.108 rillig 4668: <p>To have a shell command test whether a make variable is empty, use
4669: the following code: <code class="code">${TEST} -z ${POSSIBLY_EMPTY:Q}""</code>.</p>
1.1 dsieger 4670: </div>
4671: </div>
4672: </div>
1.41 asau 4673: <div class="chapter">
1.1 dsieger 4674: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 4675: <a name="plist"></a>Chapter 15. PLIST issues</h2></div></div></div>
1.1 dsieger 4676: <div class="toc">
4677: <p><b>Table of Contents</b></p>
1.100 leot 4678: <dl class="toc">
1.154 rillig 4679: <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt>
4680: <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
4681: <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>
4682: <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt>
4683: <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt>
4684: <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
4685: <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt>
4686: <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt>
4687: <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt>
1.1 dsieger 4688: </dl>
4689: </div>
4690: <p>The <code class="filename">PLIST</code> file contains a package's
1.23 wiz 4691: <span class="quote">“<span class="quote">packing list</span>”</span>, i.e. a list of files that belong to
1.1 dsieger 4692: the package (relative to the <code class="filename">${PREFIX}</code>
4693: directory it's been installed in) plus some additional statements
1.174 leot 4694: - 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 4695: This chapter addresses some issues that need attention when
4696: dealing with the <code class="filename">PLIST</code> file (or files, see
4697: below!).</p>
1.41 asau 4698: <div class="sect1">
1.1 dsieger 4699: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4700: <a name="rcs-id"></a>15.1. RCS ID</h2></div></div></div>
1.1 dsieger 4701: <p>Be sure to add a RCS ID line as the first thing in any
4702: <code class="filename">PLIST</code> file you write:</p>
4703: <pre class="programlisting">
1.121 sevan 4704: @comment $NetBSD $
1.111 sevan 4705: </pre>
1.123 wiz 4706: <p>An artificial space has been added between NetBSD and $, this is a
1.121 sevan 4707: workaround here to prevent CVS expanding to the filename of the guide. When
1.125 leot 4708: adding the RCS ID the space should be omitted.</p>
1.1 dsieger 4709: </div>
1.41 asau 4710: <div class="sect1">
1.1 dsieger 4711: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4712: <a name="automatic-plist-generation"></a>15.2. Semi-automatic <code class="filename">PLIST</code> generation</h2></div></div></div>
1.10 hubertf 4713: <p>You can use the <span class="command"><strong>make print-PLIST</strong></span> command
1.1 dsieger 4714: to output a PLIST that matches any new files since the package
1.154 rillig 4715: 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 4716: more information on this target.</p>
4717: </div>
1.41 asau 4718: <div class="sect1">
1.1 dsieger 4719: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4720: <a name="print-PLIST"></a>15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span>
1.1 dsieger 4721: </h2></div></div></div>
4722: <p>The <code class="varname">PRINT_PLIST_AWK</code> variable takes a set
4723: of AWK patterns and actions that are used to filter the output of
4724: print-PLIST. You can <span class="emphasis"><em>append</em></span> any chunk of AWK
4725: scripting you like to it, but be careful with quoting.</p>
4726: <p>For example, to get all files inside the
4727: <code class="filename">libdata/foo</code> directory removed from the
4728: resulting PLIST:</p>
4729: <pre class="programlisting">
4730: PRINT_PLIST_AWK+= /^libdata\/foo/ { next; }
1.111 sevan 4731: </pre>
1.182 leot 4732: <p>The <code class="varname">PRINT_PLIST_AWK</code> transformations are
4733: evaluated after the file list and directory list are sorted.
4734: <code class="varname">EARLY_PRINT_PLIST_AWK</code> is like
4735: <code class="varname">PRINT_PLIST_AWK</code> except it operates before the file
4736: list and directory list are sorted.</p>
1.1 dsieger 4737: </div>
1.41 asau 4738: <div class="sect1">
1.1 dsieger 4739: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4740: <a name="plist.misc"></a>15.4. Variable substitution in PLIST</h2></div></div></div>
1.1 dsieger 4741: <p>A number of variables are substituted automatically in
4742: PLISTs when a package is installed on a system. This includes the
4743: following variables:</p>
1.41 asau 4744: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 4745: <dt><span class="term"><code class="varname">${MACHINE_ARCH}</code>, <code class="varname">${MACHINE_GNU_ARCH}</code></span></dt>
4746: <dd>
4747: <p>Some packages like emacs and perl embed information
4748: about which architecture they were built on into the
4749: pathnames where they install their files. To handle this
4750: case, PLIST will be preprocessed before actually used, and
4751: the symbol
1.23 wiz 4752: <span class="quote">“<span class="quote"><code class="varname">${MACHINE_ARCH}</code></span>”</span> will be
1.10 hubertf 4753: replaced by what <span class="command"><strong>uname -p</strong></span> gives. The
1.1 dsieger 4754: same is done if the string
4755: <code class="varname">${MACHINE_GNU_ARCH}</code> is embedded in
4756: PLIST somewhere - use this on packages that have GNU
4757: autoconf-created configure scripts.</p>
1.41 asau 4758: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 4759: <h3 class="title">Legacy note</h3>
4760: <p>There used to be a symbol
1.23 wiz 4761: <span class="quote">“<span class="quote"><code class="varname">$ARCH</code></span>”</span> that
1.10 hubertf 4762: was replaced by the output of <span class="command"><strong>uname
1.1 dsieger 4763: -m</strong></span>, but that's no longer supported and has
4764: been removed.</p>
4765: </div>
4766: </dd>
4767: <dt><span class="term"><code class="varname">${OPSYS}</code>, <code class="varname">${LOWER_OPSYS}</code>, <code class="varname">${OS_VERSION}</code></span></dt>
4768: <dd>
4769: <p>Some packages want to embed the OS name and version
4770: into some paths. To do this, use these variables in the
4771: <code class="filename">PLIST</code>:
4772: </p>
1.41 asau 4773: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4774: <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>
4775: <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>
4776: <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 4777: </ul></div>
4778: </dd>
4779: </dl></div>
1.88 tnn 4780: <p>For a list of values which are replaced by
4781: default, the output of <span class="command"><strong>make help topic=PLIST_SUBST</strong></span> as
4782: well as searching the <code class="filename">pkgsrc/mk</code> directory with <span class="command"><strong>grep</strong></span> for
4783: <code class="varname">PLIST_SUBST</code> should help.</p>
1.1 dsieger 4784: <p>If you want to change other variables not listed above, you
4785: can add variables and their expansions to this variable in the
1.154 rillig 4786: 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 4787: <pre class="programlisting">
4788: PLIST_SUBST+= SOMEVAR="somevalue"
1.111 sevan 4789: </pre>
1.23 wiz 4790: <p>This replaces all occurrences of <span class="quote">“<span class="quote">${SOMEVAR}</span>”</span>
1.1 dsieger 4791: in the <code class="filename">PLIST</code> with
1.23 wiz 4792: <span class="quote">“<span class="quote">somevalue</span>”</span>.</p>
1.18 snj 4793: <p>The <code class="varname">PLIST_VARS</code> variable can be used to simplify
4794: the common case of conditionally including some
4795: <code class="filename">PLIST</code> entries. It can be done by adding
4796: <code class="literal"><code class="varname">PLIST_VARS</code>+=foo</code> and
4797: setting the corresponding <code class="varname">PLIST.foo</code> variable
4798: to <code class="literal">yes</code> if the entry should be included.
1.23 wiz 4799: This will substitute <span class="quote">“<span class="quote"><code class="varname">${PLIST.foo}</code></span>”</span>
1.18 snj 4800: in the <code class="filename">PLIST</code> with either
1.23 wiz 4801: <span class="quote">“<span class="quote"><code class="literal">""</code></span>”</span> or
4802: <span class="quote">“<span class="quote"><code class="literal">"@comment "</code></span>”</span>.
1.18 snj 4803: For example, in <code class="filename">Makefile</code>:</p>
4804: <pre class="programlisting">
1.112 rillig 4805: PLIST_VARS+= foo
1.18 snj 4806: .if <em class="replaceable"><code>condition</code></em>
1.112 rillig 4807: PLIST.foo= yes
1.18 snj 4808: .else
1.111 sevan 4809: </pre>
1.18 snj 4810: <p>And then in <code class="filename">PLIST</code>:</p>
4811: <pre class="programlisting">
1.121 sevan 4812: @comment $NetBSD $
1.18 snj 4813: bin/bar
4814: man/man1/bar.1
4815: ${PLIST.foo}bin/foo
4816: ${PLIST.foo}man/man1/foo.1
4817: ${PLIST.foo}share/bar/foo.data
1.111 sevan 4818: </pre>
1.123 wiz 4819: <p>An artificial space has been added between NetBSD and $, this is a
1.121 sevan 4820: workaround here to prevent CVS expanding to the filename of the guide. When
4821: adding the RCS ID the space should be ommited.</p>
1.1 dsieger 4822: </div>
1.41 asau 4823: <div class="sect1">
1.1 dsieger 4824: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4825: <a name="manpage-compression"></a>15.5. Man page compression</h2></div></div></div>
1.1 dsieger 4826: <p>Man pages should be installed in compressed form if
4827: <code class="varname">MANZ</code> is set (in <code class="filename">bsd.own.mk</code>),
4828: and uncompressed otherwise. To handle this in the
1.23 wiz 4829: <code class="filename">PLIST</code> file, the suffix <span class="quote">“<span class="quote">.gz</span>”</span> is
1.1 dsieger 4830: appended/removed automatically for man pages according to
4831: <code class="varname">MANZ</code> and <code class="varname">MANCOMPRESSED</code> being set
4832: or not, see above for details. This modification of the
4833: <code class="filename">PLIST</code> file is done on a copy of it, not
4834: <code class="filename">PLIST</code> itself.</p>
4835: </div>
1.41 asau 4836: <div class="sect1">
1.1 dsieger 4837: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4838: <a name="using-PLIST_SRC"></a>15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code>
1.1 dsieger 4839: </h2></div></div></div>
4840: <p>To use one or more files as source for the <code class="filename">PLIST</code> used
4841: in generating the binary package, set the variable
4842: <code class="varname">PLIST_SRC</code> to the names of that file(s).
1.174 leot 4843: 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 4844: important. The default for <code class="varname">PLIST_SRC</code> is
4845: <code class="filename">${PKGDIR}/PLIST</code>.</p>
4846: </div>
1.41 asau 4847: <div class="sect1">
1.1 dsieger 4848: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4849: <a name="platform-specific-plist"></a>15.7. Platform-specific and differing PLISTs</h2></div></div></div>
1.1 dsieger 4850: <p>Some packages decide to install a different set of files based on
4851: the operating system being used. These differences can be
4852: automatically handled by using the following files:</p>
1.41 asau 4853: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4854: <li class="listitem"><p><code class="filename">PLIST.common</code></p></li>
4855: <li class="listitem"><p><code class="filename">PLIST.${OPSYS}</code></p></li>
4856: <li class="listitem"><p><code class="filename">PLIST.${MACHINE_ARCH}</code></p></li>
4857: <li class="listitem"><p><code class="filename">PLIST.${OPSYS}-${MACHINE_ARCH}</code></p></li>
4858: <li class="listitem"><p><code class="filename">PLIST.common_end</code></p></li>
1.1 dsieger 4859: </ul></div>
4860: </div>
1.41 asau 4861: <div class="sect1">
1.1 dsieger 4862: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4863: <a name="build-plist"></a>15.8. Build-specific PLISTs</h2></div></div></div>
1.86 wiz 4864: <p>Some packages decide to generate hard-to-guess file names
4865: during installation that are hard to wire down.</p>
4866: <p>In such cases, you can set the
4867: <code class="varname">GENERATE_PLIST</code> variable to shell code
4868: terminated (with a semicolon) that will output PLIST entries which
4869: will be appended to the PLIST</p>
4870: <p>You can find one example in editors/xemacs:</p>
4871: <pre class="programlisting">
1.111 sevan 4872: GENERATE_PLIST+= ${ECHO} bin/${DISTNAME}-`${WRKSRC}/src/xemacs -sd`.dmp ;
4873: </pre>
1.86 wiz 4874: <p>which will append something like
4875: <code class="filename">bin/xemacs-21.4.23-54e8ea71.dmp</code> to the
4876: <code class="filename">PLIST</code>.
4877: </p>
4878: </div>
4879: <div class="sect1">
4880: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4881: <a name="faq.common-dirs"></a>15.9. Sharing directories between packages</h2></div></div></div>
1.23 wiz 4882: <p>A <span class="quote">“<span class="quote">shared directory</span>”</span> is a directory where
1.1 dsieger 4883: multiple (and unrelated) packages install files. These
1.22 jakllsch 4884: directories were problematic because you had to add special
4885: tricks in the PLIST to conditionally remove them, or have some
1.1 dsieger 4886: centralized package handle them.</p>
1.22 jakllsch 4887: <p>In pkgsrc, it is now easy: Each package should create
4888: directories and install files as needed; <span class="command"><strong>pkg_delete</strong></span>
4889: will remove any directories left empty after uninstalling a
4890: package.</p>
4891: <p>If a package needs an empty directory to work, create
4892: the directory during installation as usual, and also add an
4893: entry to the PLIST:
1.111 sevan 4894:
4895: </p>
1.1 dsieger 4896: <pre class="programlisting">
1.22 jakllsch 4897: @pkgdir path/to/empty/directory
1.111 sevan 4898: </pre>
1.22 jakllsch 4899: <p>
1.111 sevan 4900:
1.86 wiz 4901: or take a look at <code class="varname">MAKE_DIRS</code> and
4902: <code class="varname">OWN_DIRS</code>.
1.22 jakllsch 4903: </p>
1.1 dsieger 4904: </div>
4905: </div>
1.41 asau 4906: <div class="chapter">
1.1 dsieger 4907: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 4908: <a name="buildlink"></a>Chapter 16. Buildlink methodology</h2></div></div></div>
1.1 dsieger 4909: <div class="toc">
4910: <p><b>Table of Contents</b></p>
1.100 leot 4911: <dl class="toc">
1.154 rillig 4912: <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt>
4913: <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 4914: <dd><dl>
1.154 rillig 4915: <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt>
4916: <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating
1.26 wiz 4917: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
4918: and
4919: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
4920: in <code class="filename">buildlink3.mk</code> files</a></span></dt>
1.1 dsieger 4921: </dl></dd>
1.154 rillig 4922: <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 4923: <dd><dl>
1.154 rillig 4924: <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>
4925: <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 4926: </dl></dd>
4927: </dl>
4928: </div>
4929: <p>Buildlink is a framework in pkgsrc that controls what headers and libraries
4930: are seen by a package's configure and build processes. This is implemented
4931: in a two step process:</p>
1.23 wiz 4932: <div class="orderedlist"><ol class="orderedlist" type="1">
4933: <li class="listitem"><p>Symlink headers and libraries for dependencies into
1.1 dsieger 4934: <code class="varname">BUILDLINK_DIR</code>, which by default is a subdirectory
4935: of <code class="varname">WRKDIR</code>.</p></li>
1.23 wiz 4936: <li class="listitem"><p>Create wrapper scripts that are used in place of the normal compiler
1.1 dsieger 4937: tools that translate <code class="option">-I${LOCALBASE}/include</code> and
4938: <code class="option">-L${LOCALBASE}/lib</code> into references to
4939: <code class="varname">BUILDLINK_DIR</code>. The wrapper scripts also make
4940: native compiler on some operating systems look like GCC, so that
4941: packages that expect GCC won't require modifications to build with
4942: those native compilers.</p></li>
4943: </ol></div>
4944: <p>This normalizes the environment in which a package is built so that the
4945: package may be built consistently despite what other software may be
4946: installed. Please note that the normal system header and library paths,
4947: e.g. <code class="filename">/usr/include</code>,
4948: <code class="filename">/usr/lib</code>, etc., are always searched -- buildlink3 is
4949: designed to insulate the package build from non-system-supplied
4950: software.</p>
1.41 asau 4951: <div class="sect1">
1.1 dsieger 4952: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 4953: <a name="converting-to-buildlink3"></a>16.1. Converting packages to use buildlink3</h2></div></div></div>
1.1 dsieger 4954: <p>The process of converting packages to use the buildlink3
1.23 wiz 4955: framework (<span class="quote">“<span class="quote">bl3ifying</span>”</span>) is fairly straightforward.
1.1 dsieger 4956: The things to keep in mind are:</p>
1.23 wiz 4957: <div class="orderedlist"><ol class="orderedlist" type="1">
4958: <li class="listitem"><p>Ensure that the build always calls the wrapper scripts
1.1 dsieger 4959: instead of the actual toolchain. Some packages are tricky,
4960: and the only way to know for sure is the check
4961: <code class="filename">${WRKDIR}/.work.log</code> to see if the
4962: wrappers are being invoked.</p></li>
1.23 wiz 4963: <li class="listitem"><p>Don't override <code class="varname">PREFIX</code> from within
1.1 dsieger 4964: the package Makefile, e.g. Java VMs, standalone shells,
4965: etc., because the code to symlink files into
4966: <code class="filename">${BUILDLINK_DIR}</code> looks for files
1.23 wiz 4967: relative to <span class="quote">“<span class="quote">pkg_info -qp <em class="replaceable"><code>pkgname</code></em></span>”</span>.
1.1 dsieger 4968: </p></li>
1.23 wiz 4969: <li class="listitem"><p>Remember that <span class="emphasis"><em>only</em></span> the
1.1 dsieger 4970: <code class="filename">buildlink3.mk</code> files that you list in a
4971: package's Makefile are added as dependencies for that package.
4972: </p></li>
4973: </ol></div>
4974: <p>If a dependency on a particular package is required for its libraries and
4975: headers, then we replace:</p>
4976: <pre class="programlisting">
4977: DEPENDS+= foo>=1.1.0:../../category/foo
4978: </pre>
4979: <p>with</p>
4980: <pre class="programlisting">
4981: .include "../../category/foo/buildlink3.mk"
4982: </pre>
4983: <p>The buildlink3.mk files usually define the required dependencies.
4984: If you need a newer version of the dependency when using buildlink3.mk
4985: files, then you can define it in your Makefile; for example:</p>
4986: <pre class="programlisting">
4987: BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0
4988: .include "../../category/foo/buildlink3.mk"
4989: </pre>
4990: <p>There are several <code class="filename">buildlink3.mk</code>
4991: files in <code class="filename">pkgsrc/mk</code>
4992: that handle special package issues:</p>
1.41 asau 4993: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 4994: <li class="listitem"><p><code class="filename">bdb.buildlink3.mk</code> chooses either
1.1 dsieger 4995: the native or a pkgsrc Berkeley DB implementation based on
4996: the values of <code class="varname">BDB_ACCEPTED</code> and
4997: <code class="varname">BDB_DEFAULT</code>.</p></li>
1.23 wiz 4998: <li class="listitem"><p><code class="filename">curses.buildlink3.mk</code>: If the system
1.1 dsieger 4999: comes with neither Curses nor NCurses, this will take care
1.137 leot 5000: 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 5001: <li class="listitem"><p><code class="filename">krb5.buildlink3.mk</code> uses the value
1.1 dsieger 5002: of <code class="varname">KRB5_ACCEPTED</code> to choose between
5003: adding a dependency on Heimdal or MIT-krb5 for packages that
5004: require a Kerberos 5 implementation.</p></li>
1.23 wiz 5005: <li class="listitem"><p><code class="filename">motif.buildlink3.mk</code> checks for a
1.1 dsieger 5006: system-provided Motif installation or adds a dependency on
1.137 leot 5007: <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 5008: <code class="varname">MOTIF_TYPE</code> to <span class="quote">“<span class="quote">dt</span>”</span>,
1.126 leot 5009: <span class="quote">“<span class="quote">lesstif</span>”</span> or <span class="quote">“<span class="quote">motif</span>”</span>
5010: to choose which Motif version will be used.</p></li>
1.55 ryoon 5011: <li class="listitem"><p><code class="filename">readline.buildlink3.mk</code> checks for a
1.56 wiz 5012: system-provided GNU readline or editline (libedit) installation,
1.137 leot 5013: 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>,
5014: <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 5015: <code class="varname">READLINE_DEFAULT</code> to choose readline implementation.
5016: If your package really needs GNU readline library, its Makefile
5017: should include <code class="filename">devel/readline/buildlink3.mk</code>
5018: instead of <code class="filename">readline.buildlink3.mk</code>.</p></li>
1.23 wiz 5019: <li class="listitem"><p><code class="filename">oss.buildlink3.mk</code> defines several
1.1 dsieger 5020: variables that may be used by packages that use the
5021: Open Sound System (OSS) API.</p></li>
1.23 wiz 5022: <li class="listitem"><p><code class="filename">pgsql.buildlink3.mk</code> will accept
1.35 wiz 5023: any of the Postgres versions in the variable
5024: <code class="varname">PGSQL_VERSIONS_ACCEPTED</code> and default to
5025: the version <code class="varname">PGSQL_VERSION_DEFAULT</code>. See
1.1 dsieger 5026: the file for more information.</p></li>
1.23 wiz 5027: <li class="listitem"><p><code class="filename">pthread.buildlink3.mk</code> uses the value of
1.1 dsieger 5028: <code class="varname">PTHREAD_OPTS</code> and checks for native pthreads or adds
1.137 leot 5029: 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 5030: <li class="listitem"><p><code class="filename">xaw.buildlink3.mk</code> uses the value of
1.1 dsieger 5031: <code class="varname">XAW_TYPE</code> to choose a particular Athena widgets
5032: library.</p></li>
5033: </ul></div>
5034: <p>The comments in those <code class="filename">buildlink3.mk</code>
5035: files provide a more complete
5036: description of how to use them properly.</p>
5037: </div>
1.41 asau 5038: <div class="sect1">
1.1 dsieger 5039: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5040: <a name="creating-buildlink3.mk"></a>16.2. Writing <code class="filename">buildlink3.mk</code> files</h2></div></div></div>
1.7 rillig 5041: <a name="buildlink3.mk"></a><p>A package's <code class="filename">buildlink3.mk</code> file is
1.1 dsieger 5042: included by Makefiles to indicate the need to compile and link
5043: against header files and libraries provided by the package. A
5044: <code class="filename">buildlink3.mk</code> file should always provide
5045: enough information to add the correct type of dependency
5046: relationship and include any other
5047: <code class="filename">buildlink3.mk</code> files that it needs to find
5048: headers and libraries that it needs in turn.</p>
5049: <p>To generate an initial <code class="filename">buildlink3.mk</code>
1.137 leot 5050: 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 5051: package is highly recommended. For most packages, the following
5052: command will generate a good starting point for
5053: <code class="filename">buildlink3.mk</code> files:</p>
5054: <pre class="screen">
5055: <code class="prompt">%</code> <strong class="userinput"><code>cd pkgsrc/<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>pkgdir</code></em>
5056: <code class="prompt">%</code> createbuildlink >buildlink3.mk</code></strong>
5057: </pre>
1.41 asau 5058: <div class="sect2">
1.1 dsieger 5059: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5060: <a name="anatomy-of-bl3"></a>16.2.1. Anatomy of a buildlink3.mk file</h3></div></div></div>
1.1 dsieger 5061: <p>The following real-life example
5062: <code class="filename">buildlink3.mk</code> is taken
5063: from <code class="filename">pkgsrc/graphics/tiff</code>:</p>
5064: <pre class="programlisting">
1.18 snj 5065: # $NetBSD: buildlink3.mk,v 1.16 2009/03/20 19:24:45 joerg Exp $
1.1 dsieger 5066:
1.112 rillig 5067: BUILDLINK_TREE+= tiff
1.1 dsieger 5068:
1.18 snj 5069: .if !defined(TIFF_BUILDLINK3_MK)
5070: TIFF_BUILDLINK3_MK:=
1.1 dsieger 5071:
1.112 rillig 5072: BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1
5073: BUILDLINK_ABI_DEPENDS.tiff+= tiff>=3.7.2nb1
5074: BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
1.1 dsieger 5075:
5076: .include "../../devel/zlib/buildlink3.mk"
5077: .include "../../graphics/jpeg/buildlink3.mk"
1.18 snj 5078: .endif # TIFF_BUILDLINK3_MK
1.1 dsieger 5079:
1.112 rillig 5080: BUILDLINK_TREE+= -tiff
1.1 dsieger 5081: </pre>
5082: <p>The header and footer manipulate
1.18 snj 5083: <code class="varname">BUILDLINK_TREE</code>, which is common across all
1.1 dsieger 5084: <code class="filename">buildlink3.mk</code> files and is used to track
1.18 snj 5085: the dependency tree.</p>
5086: <p>The main section is protected from multiple inclusion
1.1 dsieger 5087: and controls how the dependency on <em class="replaceable"><code>pkg</code></em> is
5088: added. Several important variables are set in the section:</p>
1.41 asau 5089: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5090: <li class="listitem"><p><code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.183 ! wiz 5091: is the dependency version recorded in the installed
1.1 dsieger 5092: package; this should always be set using
1.10 hubertf 5093: <span class="command"><strong>+=</strong></span> to ensure that
1.1 dsieger 5094: we're appending to any pre-existing list of values. This
1.183 ! wiz 5095: variable should be set to the last version of the
1.26 wiz 5096: package that had an backwards-incompatible API change.
1.1 dsieger 5097: </p></li>
1.23 wiz 5098: <li class="listitem"><p><code class="varname">BUILDLINK_PKGSRCDIR.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5099: is the location of the <em class="replaceable"><code>pkg</code></em>
5100: pkgsrc directory.</p></li>
1.23 wiz 5101: <li class="listitem"><p><code class="varname">BUILDLINK_DEPMETHOD.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5102: (not shown above) controls whether we use
5103: <code class="varname">BUILD_DEPENDS</code> or
5104: <code class="varname">DEPENDS</code> to add the dependency on
5105: <em class="replaceable"><code>pkg</code></em>. The build dependency is
5106: selected by setting
5107: <code class="varname">BUILDLINK_DEPMETHOD.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5108: to <span class="quote">“<span class="quote">build</span>”</span>. By default, the full dependency is
1.1 dsieger 5109: used.</p></li>
1.23 wiz 5110: <li class="listitem"><p><code class="varname">BUILDLINK_INCDIRS.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5111: and
5112: <code class="varname">BUILDLINK_LIBDIRS.<em class="replaceable"><code>pkg</code></em></code>
5113: (not shown above) are lists of subdirectories of
5114: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>
5115: to add to the header and library search paths. These
1.23 wiz 5116: default to <span class="quote">“<span class="quote">include</span>”</span> and <span class="quote">“<span class="quote">lib</span>”</span>
1.1 dsieger 5117: respectively.</p></li>
1.23 wiz 5118: <li class="listitem"><p><code class="varname">BUILDLINK_CPPFLAGS.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5119: (not shown above) is the list of preprocessor flags to add
5120: to <code class="varname">CPPFLAGS</code>, which are passed on to the
1.23 wiz 5121: configure and build phases. The <span class="quote">“<span class="quote">-I</span>”</span> option
1.1 dsieger 5122: should be avoided and instead be handled using
5123: <code class="varname">BUILDLINK_INCDIRS.<em class="replaceable"><code>pkg</code></em></code> as
5124: above.</p></li>
5125: </ul></div>
5126: <p>The following variables are all optionally defined within
5127: this second section (protected against multiple inclusion) and
5128: control which package files are symlinked into
5129: <code class="filename">${BUILDLINK_DIR}</code> and how their names are
5130: transformed during the symlinking:</p>
1.41 asau 5131: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5132: <li class="listitem"><p><code class="varname">BUILDLINK_FILES.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5133: (not shown above) is a shell glob pattern relative to
5134: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>
5135: to be symlinked into
5136: <code class="filename">${BUILDLINK_DIR}</code>,
5137: e.g. <code class="filename">include/*.h</code>.</p></li>
1.23 wiz 5138: <li class="listitem"><p><code class="varname">BUILDLINK_FILES_CMD.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5139: (not shown above) is a shell pipeline that
5140: outputs to stdout a list of files relative to
5141: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>.
5142: The resulting files are to be symlinked
5143: into <code class="filename">${BUILDLINK_DIR}</code>. By default,
5144: this takes the <code class="filename">+CONTENTS</code> of a
5145: <em class="replaceable"><code>pkg</code></em> and filters it through
5146: <code class="varname">${BUILDLINK_CONTENTS_FILTER.<em class="replaceable"><code>pkg</code></em>}</code>.</p></li>
1.23 wiz 5147: <li class="listitem"><p><code class="varname">BUILDLINK_CONTENTS_FILTER.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5148: (not shown above) is a filter command that filters
5149: <code class="filename">+CONTENTS</code> input into a list of files
5150: relative to
5151: <code class="filename">${BUILDLINK_PREFIX.<em class="replaceable"><code>pkg</code></em>}</code>
1.84 wiz 5152: on stdout. By default,
1.1 dsieger 5153: <code class="varname">BUILDLINK_CONTENTS_FILTER.<em class="replaceable"><code>pkg</code></em></code>
5154: outputs the contents of the <code class="filename">include</code>
5155: and <code class="filename">lib</code> directories in the package
1.84 wiz 5156: <code class="filename">+CONTENTS</code>.</p></li>
1.23 wiz 5157: <li class="listitem"><p><code class="varname">BUILDLINK_FNAME_TRANSFORM.<em class="replaceable"><code>pkg</code></em></code>
1.1 dsieger 5158: (not shown above) is a list of sed arguments used to
5159: transform the name of the source filename into a
1.10 hubertf 5160: destination filename, e.g. <span class="command"><strong>-e
1.1 dsieger 5161: "s|/curses.h|/ncurses.h|g"</strong></span>.</p></li>
5162: </ul></div>
1.18 snj 5163: <p>This section can additionally include any
1.1 dsieger 5164: <code class="filename">buildlink3.mk</code> needed for
5165: <em class="replaceable"><code>pkg</code></em>'s library dependencies.
5166: Including these <code class="filename">buildlink3.mk</code> files
5167: means that the headers and libraries for these
5168: dependencies are also symlinked into
5169: <code class="filename">${BUILDLINK_DIR}</code>
5170: whenever the <em class="replaceable"><code>pkg</code></em>
5171: <code class="filename">buildlink3.mk</code>
1.18 snj 5172: file is included. Dependencies are only added for directly
5173: include <code class="filename">buildlink3.mk</code> files.</p>
1.47 wiz 5174: <p>When providing a <code class="filename">buildlink3.mk</code> and
5175: including other <code class="filename">buildlink3.mk</code> files in it,
1.50 wiz 5176: please only add necessary ones, i.e., those whose libraries or
1.47 wiz 5177: header files are automatically exposed when the package is
5178: use.</p>
5179: <p>In particular, if only an executable
5180: (<code class="filename">bin/foo</code>) is linked against a library, that
5181: library does not need to be propagated in the
5182: <code class="filename">buildlink3.mk</code> file.</p>
5183: <p>The following steps should help you decide if a
5184: <code class="filename">buildlink3.mk</code> file needs to be included:
5185: </p>
5186: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
5187: <li class="listitem"><p>Look at the installed header files: What
5188: headers do they include? The packages providing these files
5189: must be buildlinked.</p></li>
1.49 wiz 5190: <li class="listitem"><p>Run <code class="filename">ldd</code> on all installed
5191: libraries and look against what other libraries they link.
5192: Some of the packages providing these probably need to be
5193: buildlinked; however, it's not automatic, since e.g. GTK on
5194: some systems pulls in the X libraries, so they will show up in
5195: the <code class="filename">ldd</code> output, while on others (like OS
1.50 wiz 5196: X) it won't. <code class="filename">ldd</code> output can thus only be
1.49 wiz 5197: used as a hint.</p></li>
1.47 wiz 5198: </ul></div>
5199: <p>
5200: </p>
1.1 dsieger 5201: </div>
1.41 asau 5202: <div class="sect2">
1.1 dsieger 5203: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5204: <a name="updating-buildlink-depends"></a>16.2.2. Updating
1.1 dsieger 5205: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.26 wiz 5206: and
5207: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5208: in <code class="filename">buildlink3.mk</code> files</h3></div></div></div>
1.183 ! wiz 5209: <p>Both variables set lower bounds for a version of this package.
! 5210: The two variables differ in that one describes source
1.26 wiz 5211: compatibility (API) and the other binary compatibility (ABI).
5212: The difference is that a change in the API breaks compilation of
5213: programs while changes in the ABI stop compiled programs from
5214: running.</p>
1.183 ! wiz 5215: <p>The
! 5216: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
! 5217: variable in a <code class="filename">buildlink3.mk</code> should be
! 5218: changed very rarely. (One possible scenario: If all packages
! 5219: using this package need a higher version than defined in the
! 5220: <code class="filename">buildlink3.mk</code>,
1.27 wiz 5221: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.183 ! wiz 5222: could be updated to that higher version.)</p>
! 5223: <p>On the other hand, changes to
! 5224: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
! 5225: are more common. The variable will need to be updated every
! 5226: time the major version of one of its shared libraries is changed,
! 5227: or any other change where a binary built against the previous
! 5228: version of the package will not run against the new version any
! 5229: longer.</p>
! 5230: <p>In such a case, the package's
1.26 wiz 5231: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.183 ! wiz 5232: must be increased to require the new package version. Then the
! 5233: <code class="varname">PKGREVISION</code> of all packages that depend on
! 5234: this package need to be increased, and if they have
1.26 wiz 5235: <code class="filename">buildlink3.mk</code> files, their
5236: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.183 ! wiz 5237: must be increased to the new version as well. This is required
! 5238: so that a package will pull in the versions of the packages that
! 5239: use the new ABI and that the packages'
! 5240: <code class="varname">PKGREVISION</code>s uniquely identify the packages
! 5241: built against the new ABI. The <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/revbump/README.html" target="_top"><code class="filename">pkgtools/revbump</code></a> package can help with
! 5242: these updates.</p>
! 5243: <p>See <a class="xref" href="#dependencies" title="21.1.5. Handling dependencies">Section 21.1.5, “Handling dependencies”</a> for more information
! 5244: about dependencies on other packages, including the
! 5245: <code class="varname">BUILDLINK_API_DEPENDS</code> definitions.</p>
1.1 dsieger 5246: <p>Please take careful consideration before adjusting
5247: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5248: or
5249: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
1.183 ! wiz 5250: in a <code class="filename">buildlink3.mk</code> file as we don't want to
! 5251: cause unneeded package deletions and rebuilds. In many cases,
! 5252: new versions of packages work just fine with older
! 5253: dependencies.</p>
1.1 dsieger 5254: <p>Also it is not needed to set
1.26 wiz 5255: <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
5256: when it is identical to
1.1 dsieger 5257: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>. </p>
5258: </div>
5259: </div>
1.41 asau 5260: <div class="sect1">
1.1 dsieger 5261: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5262: <a name="writing-builtin.mk"></a>16.3. Writing <code class="filename">builtin.mk</code> files</h2></div></div></div>
1.1 dsieger 5263: <p>Some packages in pkgsrc install headers and libraries that
5264: coincide with headers and libraries present in the base system.
5265: Aside from a <code class="filename">buildlink3.mk</code> file, these
5266: packages should also include a <code class="filename">builtin.mk</code>
5267: file that includes the necessary checks to decide whether using
5268: the built-in software or the pkgsrc software is
5269: appropriate.</p>
5270: <p>The only requirements of a builtin.mk file for
5271: <em class="replaceable"><code>pkg</code></em> are:</p>
1.23 wiz 5272: <div class="orderedlist"><ol class="orderedlist" type="1">
5273: <li class="listitem"><p>It should set
1.1 dsieger 5274: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5275: to either <span class="quote">“<span class="quote">yes</span>”</span> or <span class="quote">“<span class="quote">no</span>”</span>
1.1 dsieger 5276: after it is included.</p></li>
1.23 wiz 5277: <li class="listitem"><p>It should <span class="emphasis"><em>not</em></span> override any
1.1 dsieger 5278: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5279: which is already set before the
5280: <code class="filename">builtin.mk</code> file is included.</p></li>
1.23 wiz 5281: <li class="listitem"><p>It should be written to allow multiple inclusion. This
1.1 dsieger 5282: is <span class="emphasis"><em>very</em></span> important and takes careful
5283: attention to <code class="filename">Makefile</code> coding.</p></li>
5284: </ol></div>
1.41 asau 5285: <div class="sect2">
1.1 dsieger 5286: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5287: <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 5288: <p>The following is the recommended template for builtin.mk
5289: files:</p>
5290: <pre class="programlisting">
5291: .if !defined(IS_BUILTIN.foo)
5292: #
5293: # IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo"
5294: # genuinely exists in the system or not.
5295: #
5296: IS_BUILTIN.foo?= no
5297:
5298: # BUILTIN_PKG.foo should be set here if "foo" is built-in and its package
5299: # version can be determined.
5300: #
5301: . if !empty(IS_BUILTIN.foo:M[yY][eE][sS])
5302: BUILTIN_PKG.foo?= foo-1.0
5303: . endif
5304: .endif # IS_BUILTIN.foo
5305:
5306: .if !defined(USE_BUILTIN.foo)
5307: USE_BUILTIN.foo?= ${IS_BUILTIN.foo}
5308: . if defined(BUILTIN_PKG.foo)
5309: . for _depend_ in ${BUILDLINK_API_DEPENDS.foo}
5310: . if !empty(USE_BUILTIN.foo:M[yY][eE][sS])
5311: USE_BUILTIN.foo!= \
5312: ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo} \
5313: && ${ECHO} "yes" || ${ECHO} "no"
5314: . endif
5315: . endfor
5316: . endif
5317: .endif # USE_BUILTIN.foo
5318:
5319: CHECK_BUILTIN.foo?= no
5320: .if !empty(CHECK_BUILTIN.foo:M[nN][oO])
5321: #
5322: # Here we place code that depends on whether USE_BUILTIN.foo is set to
5323: # "yes" or "no".
5324: #
5325: .endif # CHECK_BUILTIN.foo
5326: </pre>
5327: <p>The first section sets
5328: <code class="varname">IS_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5329: depending on if <em class="replaceable"><code>pkg</code></em> really exists
5330: in the base system. This should not be a base system software
5331: with similar functionality to <em class="replaceable"><code>pkg</code></em>;
1.23 wiz 5332: it should only be <span class="quote">“<span class="quote">yes</span>”</span> if the actual package is
1.1 dsieger 5333: included as part of the base system. This variable is only
5334: used internally within the <code class="filename">builtin.mk</code>
5335: file.</p>
5336: <p>The second section sets
5337: <code class="varname">BUILTIN_PKG.<em class="replaceable"><code>pkg</code></em></code>
5338: to the version of <em class="replaceable"><code>pkg</code></em> in the base
5339: system if it exists (if
5340: <code class="varname">IS_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5341: is <span class="quote">“<span class="quote">yes</span>”</span>). This variable is only used internally
1.1 dsieger 5342: within the <code class="filename">builtin.mk</code> file.</p>
5343: <p>The third section sets
5344: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5345: and is <span class="emphasis"><em>required</em></span> in all
5346: <code class="filename">builtin.mk</code> files. The code in this
5347: section must make the determination whether the built-in
5348: software is adequate to satisfy the dependencies listed in
5349: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>.
5350: This is typically done by comparing
5351: <code class="varname">BUILTIN_PKG.<em class="replaceable"><code>pkg</code></em></code>
5352: against each of the dependencies in
5353: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>.
5354: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5355: <span class="emphasis"><em>must</em></span> be set to the correct value by the
5356: end of the <code class="filename">builtin.mk</code> file. Note that
5357: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5358: may be <span class="quote">“<span class="quote">yes</span>”</span> even if
1.1 dsieger 5359: <code class="varname">IS_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
1.23 wiz 5360: is <span class="quote">“<span class="quote">no</span>”</span> because we may make the determination
1.1 dsieger 5361: that the built-in version of the software is similar enough to
5362: be used as a replacement.</p>
5363: <p>The last section is guarded by
5364: <code class="varname">CHECK_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>,
5365: and includes code that uses the value of
5366: <code class="varname">USE_BUILTIN.<em class="replaceable"><code>pkg</code></em></code>
5367: set in the previous section. This typically includes, e.g.,
5368: adding additional dependency restrictions and listing additional
5369: files to symlink into <code class="filename">${BUILDLINK_DIR}</code> (via
5370: <code class="varname">BUILDLINK_FILES.<em class="replaceable"><code>pkg</code></em></code>).</p>
5371: </div>
1.41 asau 5372: <div class="sect2">
1.1 dsieger 5373: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5374: <a name="native-or-pkgsrc-preference"></a>16.3.2. Global preferences for native or pkgsrc software</h3></div></div></div>
1.1 dsieger 5375: <p>When building packages, it's possible to choose whether to set
5376: a global preference for using either the built-in (native)
5377: version or the pkgsrc version of software to satisfy a
5378: dependency. This is controlled by setting
5379: <code class="varname">PREFER_PKGSRC</code> and
5380: <code class="varname">PREFER_NATIVE</code>. These variables take values
1.23 wiz 5381: 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 5382: packages. <code class="varname">PREFER_PKGSRC</code> tells pkgsrc to
5383: use the pkgsrc versions of software, while
5384: <code class="varname">PREFER_NATIVE</code> tells pkgsrc to use the
5385: built-in versions. Preferences are determined by the most
5386: specific instance of the package in either
5387: <code class="varname">PREFER_PKGSRC</code> or
5388: <code class="varname">PREFER_NATIVE</code>. If a package is specified
5389: in neither or in both variables, then
5390: <code class="varname">PREFER_PKGSRC</code> has precedence over
5391: <code class="varname">PREFER_NATIVE</code>. For example, to require
5392: using pkgsrc versions of software for all but the most basic
5393: bits on a NetBSD system, you can set:</p>
5394: <pre class="programlisting">
5395: PREFER_PKGSRC= yes
5396: PREFER_NATIVE= getopt skey tcp_wrappers
5397: </pre>
5398: <p>A package <span class="emphasis"><em>must</em></span> have a
5399: <code class="filename">builtin.mk</code>
5400: file to be listed in <code class="varname">PREFER_NATIVE</code>,
5401: otherwise it is simply ignored in that list.</p>
1.117 sevan 5402: <p>Setting <code class="varname">PREFER_NATIVE</code> should be performed
5403: straight after bootstrap and <code class="varname">PREFER_PKGSRC</code> during
5404: bootstrap.
5405: Switching between settings globally at a later date can introduce
5406: complications with dependency resolution. This is caused by packages
5407: built with the opposite preference being installed alongside each other.</p>
5408: <pre class="screen">
5409: <code class="prompt">#</code> <strong class="userinput"><code>./bootstrap --prefer-pkgsrc yes</code></strong>
5410: </pre>
1.1 dsieger 5411: </div>
5412: </div>
5413: </div>
1.41 asau 5414: <div class="chapter">
1.1 dsieger 5415: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 5416: <a name="pkginstall"></a>Chapter 17. The pkginstall framework</h2></div></div></div>
1.1 dsieger 5417: <div class="toc">
5418: <p><b>Table of Contents</b></p>
1.100 leot 5419: <dl class="toc">
1.154 rillig 5420: <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 5421: <dd><dl>
1.154 rillig 5422: <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt>
5423: <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt>
1.1 dsieger 5424: </dl></dd>
1.154 rillig 5425: <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt>
1.1 dsieger 5426: <dd><dl>
1.154 rillig 5427: <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt>
5428: <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt>
5429: <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt>
5430: <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt>
5431: </dl></dd>
5432: <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt>
5433: <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>
5434: <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt>
5435: <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt>
5436: <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd>
5437: <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt>
5438: <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 5439: </dl>
5440: </div>
5441: <p>This chapter describes the framework known as
5442: <code class="literal">pkginstall</code>, whose key features are:</p>
1.41 asau 5443: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5444: <li class="listitem"><p>Generic installation and manipulation of directories and files
1.1 dsieger 5445: outside the pkgsrc-handled tree, <code class="varname">LOCALBASE</code>.</p></li>
1.23 wiz 5446: <li class="listitem"><p>Automatic handling of configuration files during installation,
1.1 dsieger 5447: provided that packages are correctly designed.</p></li>
1.23 wiz 5448: <li class="listitem"><p>Generation and installation of system startup scripts.</p></li>
5449: <li class="listitem"><p>Registration of system users and groups.</p></li>
5450: <li class="listitem"><p>Registration of system shells.</p></li>
5451: <li class="listitem"><p>Automatic updating of fonts databases.</p></li>
1.1 dsieger 5452: </ul></div>
5453: <p>The following sections inspect each of the above points in detail.</p>
5454: <p>You may be thinking that many of the things described here could be
5455: easily done with simple code in the package's post-installation target
5456: (<code class="literal">post-install</code>). <span class="emphasis"><em>This is incorrect</em></span>,
5457: as the code in them is only executed when building from source. Machines
5458: using binary packages could not benefit from it at all (as the code itself
5459: could be unavailable). Therefore, the only way to achieve any of the items
5460: described above is by means of the installation scripts, which are
5461: automatically generated by pkginstall.</p>
1.41 asau 5462: <div class="sect1">
1.1 dsieger 5463: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5464: <a name="files-and-dirs-outside-prefix"></a>17.1. Files and directories outside the installation prefix</h2></div></div></div>
1.1 dsieger 5465: <p>As you already know, the <code class="filename">PLIST</code> file holds a list
5466: of files and directories that belong to a package. The names used in it
5467: are relative to the installation prefix (<code class="filename">${PREFIX}</code>),
5468: which means that it cannot register files outside this directory (absolute
5469: path names are not allowed). Despite this restriction, some packages need
5470: to install files outside this location; e.g., under
5471: <code class="filename">${VARBASE}</code> or
5472: <code class="filename">${PKG_SYSCONFDIR}</code>. The only way to achieve this
5473: is to create such files during installation time by using
5474: installation scripts.</p>
5475: <p>The generic installation scripts are shell scripts that can
5476: contain arbitrary code. The list of scripts to execute is taken from
5477: the <code class="varname">INSTALL_FILE</code> variable, which defaults to
5478: <code class="filename">INSTALL</code>. A similar variable exists for package
5479: removal (<code class="varname">DEINSTALL_FILE</code>, whose default is
5480: <code class="filename">DEINSTALL</code>). These scripts can run arbitrary
5481: commands, so they have the potential to create and manage files
5482: anywhere in the file system.</p>
5483: <p>Using these general installation files is not recommended, but
5484: may be needed in some special cases. One reason for avoiding them is
5485: that the user has to trust the packager that there is no unwanted or
5486: simply erroneous code included in the installation script. Also,
5487: previously there were many similar scripts for the same functionality,
5488: and fixing a common error involved finding and changing all of
5489: them.</p>
5490: <p>The pkginstall framework offers another, standardized way. It
5491: provides generic scripts to abstract the manipulation of such files
5492: and directories based on variables set in the package's
5493: <code class="filename">Makefile</code>. The rest of this section describes
5494: these variables.</p>
1.41 asau 5495: <div class="sect2">
1.1 dsieger 5496: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5497: <a name="dirs-outside-prefix"></a>17.1.1. Directory manipulation</h3></div></div></div>
1.1 dsieger 5498: <p>The following variables can be set to request the creation of
5499: directories anywhere in the file system:</p>
1.41 asau 5500: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.108 rillig 5501: <li class="listitem">
5502: <p><code class="varname">MAKE_DIRS</code> and <code class="varname">OWN_DIRS</code>
1.1 dsieger 5503: contain a list of directories that should be created and should attempt
5504: to be destroyed by the installation scripts. The difference between
5505: the two is that the latter prompts the administrator to remove any
5506: directories that may be left after deinstallation (because they were
1.108 rillig 5507: not empty), while the former does not. Example:</p>
5508: <pre class="programlisting">
5509: MAKE_DIRS+= ${VARBASE}/foo/private
5510: </pre>
5511: </li>
1.23 wiz 5512: <li class="listitem">
1.1 dsieger 5513: <p><code class="varname">MAKE_DIRS_PERMS</code> and
5514: <code class="varname">OWN_DIRS_PERMS</code> contain a list of tuples describing
5515: which directories should be created and should attempt to be destroyed
5516: by the installation scripts. Each tuple holds the following values,
5517: separated by spaces: the directory name, its owner, its group and its
5518: numerical mode. For example:</p>
5519: <pre class="programlisting">
1.108 rillig 5520: MAKE_DIRS_PERMS+= ${VARBASE}/foo/private \
5521: ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0700
1.1 dsieger 5522: </pre>
5523: <p>The difference between the two is exactly the same as their
5524: non-<code class="varname">PERMS</code> counterparts.</p>
5525: </li>
5526: </ul></div>
5527: </div>
1.41 asau 5528: <div class="sect2">
1.1 dsieger 5529: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5530: <a name="files-outside-prefix"></a>17.1.2. File manipulation</h3></div></div></div>
1.1 dsieger 5531: <p>Creating non-empty files outside the installation prefix is tricky
5532: because the <code class="filename">PLIST</code> forces all files to be inside it.
5533: To overcome this problem, the only solution is to extract the file in the
5534: known place (i.e., inside the installation prefix) and copy it to the
5535: appropriate location during installation (done by the installation scripts
5536: generated by pkginstall). We will call the former the <span class="emphasis"><em>master
5537: file</em></span> in the following paragraphs, which describe the variables
5538: that can be used to automatically and consistently handle files outside the
5539: installation prefix:</p>
1.41 asau 5540: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5541: <li class="listitem">
1.1 dsieger 5542: <p><code class="varname">CONF_FILES</code> and
1.30 wiz 5543: <code class="varname">REQD_FILES</code> are pairs of master and target files.
1.1 dsieger 5544: During installation time, the master file is copied to the target one
5545: if and only if the latter does not exist. Upon deinstallation, the
5546: target file is removed provided that it was not modified by the
5547: installation.</p>
5548: <p>The difference between the two is that the latter prompts the
5549: administrator to remove any files that may be left after
5550: deinstallation (because they were not empty), while the former does
5551: not.</p>
5552: </li>
1.23 wiz 5553: <li class="listitem">
1.1 dsieger 5554: <p><code class="varname">CONF_FILES_PERMS</code> and
1.30 wiz 5555: <code class="varname">REQD_FILES_PERMS</code> contain tuples describing master
1.1 dsieger 5556: files as well as their target locations. For each of them, it also
5557: specifies their owner, their group and their numeric permissions, in
5558: this order. For example:</p>
5559: <pre class="programlisting">
1.108 rillig 5560: REQD_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile \
5561: ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0700
1.1 dsieger 5562: </pre>
5563: <p>The difference between the two is exactly the same as their
5564: non-<code class="varname">PERMS</code> counterparts.</p>
5565: </li>
5566: </ul></div>
5567: </div>
5568: </div>
1.41 asau 5569: <div class="sect1">
1.1 dsieger 5570: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5571: <a name="conf-files"></a>17.2. Configuration files</h2></div></div></div>
1.1 dsieger 5572: <p>Configuration files are special in the sense that they are installed
5573: in their own specific directory, <code class="varname">PKG_SYSCONFDIR</code>, and
5574: need special treatment during installation (most of which is automated by
5575: pkginstall). The main concept you must bear in mind is that files marked
5576: as configuration files are automatically copied to the right place (somewhere
5577: inside <code class="varname">PKG_SYSCONFDIR</code>) during installation <span class="emphasis"><em>if
5578: and only if</em></span> they didn't exist before. Similarly, they will not
5579: be removed if they have local modifications. This ensures that
5580: administrators never lose any custom changes they may have made.</p>
1.41 asau 5581: <div class="sect2">
1.1 dsieger 5582: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5583: <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 5584: <p>As said before, the <code class="varname">PKG_SYSCONFDIR</code> variable
5585: specifies where configuration files shall be installed. Its contents are
5586: set based upon the following variables:</p>
1.41 asau 5587: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 5588: <li class="listitem"><p><code class="varname">PKG_SYSCONFBASE</code>: The configuration's root
1.1 dsieger 5589: directory. Defaults to <code class="filename">${PREFIX}/etc</code> although it may
5590: be overridden by the user to point to his preferred location (e.g.,
5591: <code class="filename">/etc</code>, <code class="filename">/etc/pkg</code>, etc.).
5592: Packages must not use it directly.</p></li>
1.23 wiz 5593: <li class="listitem">
1.1 dsieger 5594: <p><code class="varname">PKG_SYSCONFSUBDIR</code>: A subdirectory of
5595: <code class="varname">PKG_SYSCONFBASE</code> under which the configuration files
5596: for the package being built shall be installed. The definition of this
5597: variable only makes sense in the package's
5598: <code class="filename">Makefile</code> (i.e., it is not user-customizable).</p>
5599: <p>As an example, consider the Apache package,
1.137 leot 5600: <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 5601: configuration files under the
5602: <code class="filename">httpd/</code> subdirectory of
5603: <code class="varname">PKG_SYSCONFBASE</code>. This should be set in the package
5604: Makefile.</p>
5605: </li>
1.23 wiz 5606: <li class="listitem"><p><code class="varname">PKG_SYSCONFVAR</code>: Specifies the name of the
1.1 dsieger 5607: variable that holds this package's configuration directory (if
5608: different from <code class="varname">PKG_SYSCONFBASE</code>). It defaults to
5609: <code class="varname">PKGBASE</code>'s value, and is always prefixed with
5610: <code class="literal">PKG_SYSCONFDIR</code>.</p></li>
1.23 wiz 5611: <li class="listitem"><p><code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code>: Holds the
1.1 dsieger 5612: directory where the configuration files for the package identified by
5613: <code class="varname">PKG_SYSCONFVAR</code>'s shall be placed.</p></li>
5614: </ul></div>
5615: <p>Based on the above variables, pkginstall determines the value of
5616: <code class="varname">PKG_SYSCONFDIR</code>, which is the <span class="emphasis"><em>only</em></span>
5617: variable that can be used within a package to refer to its configuration
5618: directory. The algorithm used to set its value is basically the
5619: following:</p>
1.23 wiz 5620: <div class="orderedlist"><ol class="orderedlist" type="1">
5621: <li class="listitem"><p>If <code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> is set,
1.1 dsieger 5622: its value is used.</p></li>
1.23 wiz 5623: <li class="listitem"><p>If the previous variable is not defined but
1.1 dsieger 5624: <code class="varname">PKG_SYSCONFSUBDIR</code> is set in the package's
5625: <code class="filename">Makefile</code>, the resulting value is
5626: <code class="filename">${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</code>.</p></li>
1.23 wiz 5627: <li class="listitem"><p>Otherwise, it is set to
1.1 dsieger 5628: <code class="filename">${PKG_SYSCONFBASE}</code>.</p></li>
5629: </ol></div>
5630: <p>It is worth mentioning that <code class="filename">${PKG_SYSCONFDIR}</code> is
1.154 rillig 5631: 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 5632: subdirectories of <code class="filename">${PKG_SYSCONFDIR}</code>, they still have to
5633: be created with OWN_DIRS or MAKE_DIRS.</p>
1.1 dsieger 5634: </div>
1.41 asau 5635: <div class="sect2">
1.1 dsieger 5636: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5637: <a name="conf-files-configure"></a>17.2.2. Telling the software where configuration files are</h3></div></div></div>
1.1 dsieger 5638: <p>Given that pkgsrc (and users!) expect configuration files to be in a
5639: known place, you need to teach each package where it shall install its
5640: files. In some cases you will have to patch the package Makefiles to
5641: achieve it. If you are lucky, though, it may be as easy as passing an
5642: extra flag to the configuration script; this is the case of GNU Autoconf-
5643: generated files:</p>
5644: <pre class="programlisting">
5645: CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
5646: </pre>
5647: <p>Note that this specifies where the package has to <span class="emphasis"><em>look
5648: for</em></span> its configuration files, not where they will be originally
5649: installed (although the difference is never explicit,
5650: unfortunately).</p>
5651: </div>
1.41 asau 5652: <div class="sect2">
1.1 dsieger 5653: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5654: <a name="conf-files-patching"></a>17.2.3. Patching installations</h3></div></div></div>
1.1 dsieger 5655: <p>As said before, pkginstall automatically handles configuration files.
5656: This means that <span class="strong"><strong>the packages themselves must not
5657: touch the contents of <code class="filename">${PKG_SYSCONFDIR}</code>
5658: directly</strong></span>. Bad news is that many software installation scripts
5659: will, out of the box, mess with the contents of that directory. So what is
5660: the correct procedure to fix this issue?</p>
5661: <p>You must teach the package (usually by manually patching it) to
5662: install any configuration files under the examples hierarchy,
5663: <code class="filename">share/examples/${PKGBASE}/</code>. This way, the
5664: <code class="filename">PLIST</code> registers them and the administrator always
5665: has the original copies available.</p>
5666: <p>Once the required configuration files are in place (i.e., under the
5667: examples hierarchy), the pkginstall framework can use them as master copies
5668: during the package installation to update what is in
5669: <code class="filename">${PKG_SYSCONFDIR}</code>. To achieve this, the variables
5670: <code class="varname">CONF_FILES</code> and <code class="varname">CONF_FILES_PERMS</code> are
1.154 rillig 5671: 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 5672: about their syntax and their purpose. Here is an example, taken from the
1.137 leot 5673: <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 5674: <pre class="programlisting">
5675: EGDIR= ${PREFIX}/share/doc/mutt/samples
5676: CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc
5677: </pre>
5678: <p>Note that the <code class="varname">EGDIR</code> variable is specific to that
5679: package and has no meaning outside it.</p>
5680: </div>
1.41 asau 5681: <div class="sect2">
1.1 dsieger 5682: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5683: <a name="conf-files-disable"></a>17.2.4. Disabling handling of configuration files</h3></div></div></div>
1.1 dsieger 5684: <p>The automatic copying of config files can be toggled by setting the
5685: environment variable <code class="varname">PKG_CONFIG</code> prior to package
5686: installation.</p>
5687: </div>
5688: </div>
1.41 asau 5689: <div class="sect1">
1.1 dsieger 5690: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5691: <a name="rcd-scripts"></a>17.3. System startup scripts</h2></div></div></div>
1.1 dsieger 5692: <p>System startup scripts are special files because they must be
5693: installed in a place known by the underlying OS, usually outside the
1.154 rillig 5694: 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 5695: can be used. However, pkginstall provides a special mechanism to handle
5696: these files.</p>
5697: <p>In order to provide system startup scripts, the package has
5698: to:</p>
1.23 wiz 5699: <div class="orderedlist"><ol class="orderedlist" type="1">
5700: <li class="listitem"><p>Store the script inside <code class="filename">${FILESDIR}</code>, with
1.1 dsieger 5701: the <code class="literal">.sh</code> suffix appended. Considering the
1.137 leot 5702: <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 5703: <code class="filename">cupsd.sh</code> in its files directory.</p></li>
1.23 wiz 5704: <li class="listitem">
1.1 dsieger 5705: <p>Tell pkginstall to handle it, appending the name of the script,
5706: without its extension, to the <code class="varname">RCD_SCRIPTS</code> variable.
5707: Continuing the previous example:</p>
5708: <pre class="programlisting">
5709: RCD_SCRIPTS+= cupsd
5710: </pre>
5711: </li>
5712: </ol></div>
5713: <p>Once this is done, pkginstall will do the following steps for each
5714: script in an automated fashion:</p>
1.23 wiz 5715: <div class="orderedlist"><ol class="orderedlist" type="1">
5716: <li class="listitem"><p>Process the file found in the files directory applying all the
1.1 dsieger 5717: substitutions described in the <code class="filename">FILES_SUBST</code>
5718: variable.</p></li>
1.23 wiz 5719: <li class="listitem"><p>Copy the script from the files directory to the examples
1.1 dsieger 5720: hierarchy, <code class="filename">${PREFIX}/share/examples/rc.d/</code>. Note
5721: that this master file must be explicitly registered in the
5722: <code class="filename">PLIST</code>.</p></li>
1.23 wiz 5723: <li class="listitem"><p>Add code to the installation scripts to copy the startup script
1.1 dsieger 5724: from the examples hierarchy into the system-wide startup scripts
5725: directory.</p></li>
5726: </ol></div>
1.41 asau 5727: <div class="sect2">
1.1 dsieger 5728: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5729: <a name="rcd-scripts-disable"></a>17.3.1. Disabling handling of system startup scripts</h3></div></div></div>
1.1 dsieger 5730: <p>The automatic copying of config files can be toggled by setting the
5731: environment variable <code class="varname">PKG_RCD_SCRIPTS</code> prior to package
5732: installation. Note that the scripts will be always copied inside the
5733: examples hierarchy, <code class="filename">${PREFIX}/share/examples/rc.d/</code>, no
5734: matter what the value of this variable is.</p>
5735: </div>
5736: </div>
1.41 asau 5737: <div class="sect1">
1.1 dsieger 5738: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5739: <a name="users-and-groups"></a>17.4. System users and groups</h2></div></div></div>
1.1 dsieger 5740: <p>If a package needs to create special users and/or groups during
5741: installation, it can do so by using the pkginstall framework.</p>
5742: <p>Users can be created by adding entries to the
5743: <code class="varname">PKG_USERS</code> variable. Each entry has the following
5744: syntax:</p>
5745: <pre class="programlisting">
5746: user:group
5747: </pre>
5748: <p>Further specification of user details may be done by setting
5749: per-user variables.
5750: <code class="varname">PKG_UID.<em class="replaceable"><code>user</code></em></code> is the
5751: numeric UID for the user.
5752: <code class="varname">PKG_GECOS.<em class="replaceable"><code>user</code></em></code> is the
5753: user's description or comment.
5754: <code class="varname">PKG_HOME.<em class="replaceable"><code>user</code></em></code> is the
5755: user's home directory, and defaults to
5756: <code class="filename">/nonexistent</code> if not specified.
5757: <code class="varname">PKG_SHELL.<em class="replaceable"><code>user</code></em></code> is the
5758: user's shell, and defaults to <code class="filename">/sbin/nologin</code> if
5759: not specified.</p>
5760: <p>Similarly, groups can be created by adding entries to the
5761: <code class="varname">PKG_GROUPS</code> variable, whose syntax is:</p>
5762: <pre class="programlisting">
5763: group
5764: </pre>
5765: <p>The numeric GID of the group may be set by defining
5766: <code class="varname">PKG_GID.<em class="replaceable"><code>group</code></em></code>.</p>
5767: <p>If a package needs to create the users and groups at an earlier
1.116 wiz 5768: stage, then it can set <code class="varname">USERGROUP_PHASE</code> to either
5769: <code class="literal">configure</code>,<code class="literal">build</code>, or
5770: <code class="literal">pre-install</code> to indicate the phase before which the
5771: users and groups are created. In this case, the numeric UIDs and GIDs
5772: of the created users and groups are automatically hardcoded into the
5773: final installation scripts.</p>
1.1 dsieger 5774: </div>
1.41 asau 5775: <div class="sect1">
1.1 dsieger 5776: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5777: <a name="shells"></a>17.5. System shells</h2></div></div></div>
1.1 dsieger 5778: <p>Packages that install system shells should register them in the shell
5779: database, <code class="filename">/etc/shells</code>, to make things easier to the
5780: administrator. This must be done from the installation scripts to keep
5781: binary packages working on any system. pkginstall provides an easy way to
5782: accomplish this task.</p>
5783: <p>When a package provides a shell interpreter, it has to set the
5784: <code class="varname">PKG_SHELL</code> variable to its absolute file name. This will
5785: add some hooks to the installation scripts to handle it. Consider the
1.137 leot 5786: 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 5787: <pre class="programlisting">
5788: PKG_SHELL= ${PREFIX}/bin/zsh
5789: </pre>
1.41 asau 5790: <div class="sect2">
1.1 dsieger 5791: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5792: <a name="shells-disable"></a>17.5.1. Disabling shell registration</h3></div></div></div>
1.1 dsieger 5793: <p>The automatic registration of shell interpreters can be disabled by
5794: the administrator by setting the <code class="filename">PKG_REGISTER_SHELLS</code>
5795: environment variable to <code class="literal">NO</code>.</p>
5796: </div>
5797: </div>
1.41 asau 5798: <div class="sect1">
1.1 dsieger 5799: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5800: <a name="fonts"></a>17.6. Fonts</h2></div></div></div>
1.1 dsieger 5801: <p>Packages that install X11 fonts should update the database files
5802: that index the fonts within each fonts directory. This can easily be
5803: accomplished within the pkginstall framework.</p>
5804: <p>When a package installs X11 fonts, it must list the directories in
5805: which fonts are installed in the
5806: <code class="varname">FONTS_DIRS.<em class="replaceable"><code>type</code></em></code> variables,
1.23 wiz 5807: where <em class="replaceable"><code>type</code></em> can be one of <span class="quote">“<span class="quote">ttf</span>”</span>,
5808: <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 5809: installation scripts to run the appropriate commands to update the fonts
5810: database files within each of those directories. For convenience, if the
5811: directory path is relative, it is taken to be relative to the package's
1.137 leot 5812: 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 5813: <pre class="programlisting">
1.67 wiz 5814: FONTS_DIRS.ttf= ${PREFIX}/share/fonts/X11/TTF
1.1 dsieger 5815: </pre>
1.41 asau 5816: <div class="sect2">
1.1 dsieger 5817: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 5818: <a name="fonts-disable"></a>17.6.1. Disabling automatic update of the fonts databases</h3></div></div></div>
1.1 dsieger 5819: <p>The automatic update of fonts databases can be disabled by
5820: the administrator by setting the <code class="filename">PKG_UPDATE_FONTS_DB</code>
5821: environment variable to <code class="literal">NO</code>.</p>
5822: </div>
5823: </div>
5824: </div>
1.41 asau 5825: <div class="chapter">
1.1 dsieger 5826: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 5827: <a name="options"></a>Chapter 18. Options handling</h2></div></div></div>
1.1 dsieger 5828: <div class="toc">
5829: <p><b>Table of Contents</b></p>
1.100 leot 5830: <dl class="toc">
1.154 rillig 5831: <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt>
5832: <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>
5833: <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt>
5834: <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt>
1.1 dsieger 5835: </dl>
5836: </div>
5837: <p>Many packages have the ability to be built to support different
5838: sets of features. <code class="filename">bsd.options.mk</code> is a framework
5839: in pkgsrc that provides generic handling of those options that
5840: determine different ways in which the packages can be built. It's
5841: possible for the user to specify exactly which sets of options will be
5842: built into a package or to allow a set of global default options
5843: apply.</p>
1.7 rillig 5844: <p>There are two broad classes of behaviors that one might want to
5845: control via options. One is whether some particular feature is
5846: enabled in a program that will be built anyway, often by including or
5847: not including a dependency on some other package. The other is
5848: whether or not an additional program will be built as part of the
5849: package. Generally, it is better to make a split package for such
5850: additional programs instead of using options, because it enables
5851: binary packages to be built which can then be added separately. For
5852: example, the foo package might have minimal dependencies (those
5853: packages without which foo doesn't make sense), and then the foo-gfoo
5854: package might include the GTK frontend program gfoo. This is better
5855: than including a gtk option to foo that adds gfoo, because either that
5856: option is default, in which case binary users can't get foo without
5857: gfoo, or not default, in which case they can't get gfoo. With split
5858: packages, they can install foo without having GTK, and later decide to
5859: install gfoo (pulling in GTK at that time). This is an advantage to
5860: source users too, avoiding the need for rebuilds.</p>
5861: <p>Plugins with widely varying dependencies should usually be split
5862: instead of options.</p>
5863: <p>It is often more work to maintain split packages, especially if
5864: the upstream package does not support this. The decision of split
5865: vs. option should be made based on the likelihood that users will want
5866: or object to the various pieces, the size of the dependencies that are
5867: included, and the amount of work.</p>
5868: <p>A further consideration is licensing. Non-free parts, or parts
5869: that depend on non-free dependencies (especially plugins) should
5870: almost always be split if feasible.</p>
1.41 asau 5871: <div class="sect1">
1.1 dsieger 5872: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5873: <a name="global-default-options"></a>18.1. Global default options</h2></div></div></div>
1.1 dsieger 5874: <p>Global default options are listed in
5875: <code class="varname">PKG_DEFAULT_OPTIONS</code>, which is a list of the options
5876: that should be built into every package if that option is supported.
1.10 hubertf 5877: This variable should be set in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p>
1.1 dsieger 5878: </div>
1.41 asau 5879: <div class="sect1">
1.1 dsieger 5880: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 5881: <a name="converting-to-options"></a>18.2. Converting packages to use <code class="filename">bsd.options.mk</code>
1.1 dsieger 5882: </h2></div></div></div>
5883: <p>The following example shows how
5884: <code class="filename">bsd.options.mk</code> should be used
5885: by the hypothetical ``wibble'' package, either in the package
5886: <code class="filename">Makefile</code>, or in a file,
5887: e.g. <code class="filename">options.mk</code>, that is included by the
5888: main package <code class="filename">Makefile</code>.</p>
5889: <pre class="programlisting">
5890: PKG_OPTIONS_VAR= PKG_OPTIONS.wibble
5891: PKG_SUPPORTED_OPTIONS= wibble-foo ldap
5892: PKG_OPTIONS_OPTIONAL_GROUPS= database
5893: PKG_OPTIONS_GROUP.database= mysql pgsql
5894: PKG_SUGGESTED_OPTIONS= wibble-foo
5895: PKG_OPTIONS_LEGACY_VARS+= WIBBLE_USE_OPENLDAP:ldap
5896: PKG_OPTIONS_LEGACY_OPTS+= foo:wibble-foo
5897:
5898: .include "../../mk/bsd.prefs.mk"
5899:
5900: # this package was previously named wibble2
5901: .if defined(PKG_OPTIONS.wibble2)
5902: PKG_LEGACY_OPTIONS+= ${PKG_OPTIONS.wibble2}
5903: PKG_OPTIONS_DEPRECATED_WARNINGS+= \
5904: "Deprecated variable PKG_OPTIONS.wibble2 used, use ${PKG_OPTIONS_VAR} instead."
5905: .endif
5906:
5907: .include "../../mk/bsd.options.mk"
5908:
5909: # Package-specific option-handling
5910:
5911: ###
5912: ### FOO support
5913: ###
5914: .if !empty(PKG_OPTIONS:Mwibble-foo)
5915: CONFIGURE_ARGS+= --enable-foo
5916: .endif
5917:
5918: ###
5919: ### LDAP support
5920: ###
5921: .if !empty(PKG_OPTIONS:Mldap)
5922: . include "../../databases/openldap-client/buildlink3.mk"
5923: CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap-client}
5924: .endif
5925:
5926: ###
5927: ### database support
5928: ###
5929: .if !empty(PKG_OPTIONS:Mmysql)
5930: . include "../../mk/mysql.buildlink3.mk"
5931: .endif
5932: .if !empty(PKG_OPTIONS:Mpgsql)
5933: . include "../../mk/pgsql.buildlink3.mk"
5934: .endif
5935: </pre>
5936: <p>The first section contains the information about which build
5937: options are supported by the package, and any default options settings
5938: if needed.</p>
1.23 wiz 5939: <div class="orderedlist"><ol class="orderedlist" type="1">
5940: <li class="listitem"><p><code class="varname">PKG_OPTIONS_VAR</code> is the name of the
1.174 leot 5941: <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 5942: options. It should be set to
5943: PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em>. Do not set it to
5944: PKG_OPTIONS.${PKGBASE}, since <code class="varname">PKGBASE</code> is not defined
5945: at the point where the options are processed.</p></li>
1.23 wiz 5946: <li class="listitem"><p><code class="varname">PKG_SUPPORTED_OPTIONS</code> is a list of
1.1 dsieger 5947: build options supported by the package.</p></li>
1.23 wiz 5948: <li class="listitem"><p><code class="varname">PKG_OPTIONS_OPTIONAL_GROUPS</code> is a
1.1 dsieger 5949: list of names of groups of mutually exclusive options. The options in
5950: each group are listed in
5951: <code class="varname">PKG_OPTIONS_GROUP.<em class="replaceable"><code>groupname</code></em></code>.
5952: The most specific setting of any option from the group takes
5953: precedence over all other options in the group. Options from the
5954: groups will be automatically added to
5955: <code class="varname">PKG_SUPPORTED_OPTIONS</code>.</p></li>
1.23 wiz 5956: <li class="listitem"><p><code class="varname">PKG_OPTIONS_REQUIRED_GROUPS</code> is like
1.1 dsieger 5957: <code class="varname">PKG_OPTIONS_OPTIONAL_GROUPS</code>, but building the
5958: packages will fail if no option from the group is
5959: selected.</p></li>
1.23 wiz 5960: <li class="listitem"><p><code class="varname">PKG_OPTIONS_NONEMPTY_SETS</code> is a list
1.1 dsieger 5961: of names of sets of options. At least one option from each set must
5962: be selected. The options in each set are listed in
5963: <code class="varname">PKG_OPTIONS_SET.<em class="replaceable"><code>setname</code></em></code>.
5964: Options from the sets will be automatically added to
5965: <code class="varname">PKG_SUPPORTED_OPTIONS</code>. Building the package will
5966: fail if no option from the set is selected.</p></li>
1.23 wiz 5967: <li class="listitem"><p><code class="varname">PKG_SUGGESTED_OPTIONS</code> is a list of
1.1 dsieger 5968: build options which are enabled by default.</p></li>
1.23 wiz 5969: <li class="listitem"><p><code class="varname">PKG_OPTIONS_LEGACY_VARS</code> is a list
1.1 dsieger 5970: of
1.23 wiz 5971: <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 5972: pairs that map legacy <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> variables to
1.1 dsieger 5973: their option counterparts. Pairs should be added with
1.23 wiz 5974: <span class="quote">“<span class="quote">+=</span>”</span> to keep the listing of global legacy variables. A
1.1 dsieger 5975: warning will be issued if the user uses a legacy
5976: variable.</p></li>
1.23 wiz 5977: <li class="listitem"><p><code class="varname">PKG_OPTIONS_LEGACY_OPTS</code> is a list
1.1 dsieger 5978: of
1.23 wiz 5979: <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 5980: pairs that map options that have been renamed to their new
1.23 wiz 5981: counterparts. Pairs should be added with <span class="quote">“<span class="quote">+=</span>”</span> to keep
1.1 dsieger 5982: the listing of global legacy options. A warning will be issued if
5983: the user uses a legacy option.</p></li>
1.23 wiz 5984: <li class="listitem"><p><code class="varname">PKG_LEGACY_OPTIONS</code> is a list of
1.1 dsieger 5985: options implied by deprecated variables used. This can be used for
5986: cases that neither <code class="varname">PKG_OPTIONS_LEGACY_VARS</code> nor
5987: <code class="varname">PKG_OPTIONS_LEGACY_OPTS</code> can handle, e. g. when
5988: <code class="varname">PKG_OPTIONS_VAR</code> is renamed.</p></li>
1.23 wiz 5989: <li class="listitem"><p><code class="varname">PKG_OPTIONS_DEPRECATED_WARNINGS</code> is
1.1 dsieger 5990: a list of warnings about deprecated variables or options used, and
5991: what to use instead.</p></li>
5992: </ol></div>
5993: <p>A package should never modify
5994: <code class="varname">PKG_DEFAULT_OPTIONS</code> or the variable named in
5995: <code class="varname">PKG_OPTIONS_VAR</code>. These are strictly user-settable.
5996: To suggest a default set of options, use
5997: <code class="varname">PKG_SUGGESTED_OPTIONS</code>.</p>
5998: <p><code class="varname">PKG_OPTIONS_VAR</code> must be defined before
5999: including <code class="filename">bsd.options.mk</code>. If none of
6000: <code class="varname">PKG_SUPPORTED_OPTIONS</code>,
6001: <code class="varname">PKG_OPTIONS_OPTIONAL_GROUPS</code>, and
6002: <code class="varname">PKG_OPTIONS_REQUIRED_GROUPS</code> are defined (as can
6003: happen with platform-specific options if none of them is supported on
6004: the current platform), <code class="varname">PKG_OPTIONS</code> is set to the
6005: empty list and the package is otherwise treated as not using the
6006: options framework.</p>
6007: <p>After the inclusion of <code class="filename">bsd.options.mk</code>, the
6008: variable <code class="varname">PKG_OPTIONS</code> contains the list of selected
6009: build options, properly filtered to remove unsupported and duplicate
6010: options.</p>
6011: <p>The remaining sections contain the logic that is specific to
6012: each option. The correct way to check for an option is to check
6013: whether it is listed in <code class="varname">PKG_OPTIONS</code>:</p>
6014: <pre class="programlisting">
6015: .if !empty(PKG_OPTIONS:M<em class="replaceable"><code>option</code></em>)
6016: </pre>
6017: </div>
1.41 asau 6018: <div class="sect1">
1.1 dsieger 6019: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6020: <a name="option-names"></a>18.3. Option Names</h2></div></div></div>
1.1 dsieger 6021: <p>Options that enable similar features in different packages (like
6022: optional support for a library) should use a common name in all
6023: packages that support it (like the name of the library). If another
6024: package already has an option with the same meaning, use the same
6025: name.</p>
6026: <p>Options that enable features specific to one package, where it's
6027: unlikely that another (unrelated) package has the same (or a similar)
6028: optional feature, should use a name prefixed with
6029: <code class="varname"><em class="replaceable"><code>pkgname</code></em>-</code>.</p>
6030: <p>If a group of related packages share an optional feature
6031: specific to that group, prefix it with the name of the
1.23 wiz 6032: <span class="quote">“<span class="quote">main</span>”</span> package
1.1 dsieger 6033: (e. g. <code class="varname">djbware-errno-hack</code>).</p>
6034: <p>For new options, add a line to
6035: <code class="filename">mk/defaults/options.description</code>. Lines have two
6036: fields, separated by tab. The first field is the option name, the
6037: second its description. The description should be a whole sentence
6038: (starting with an uppercase letter and ending with a period) that
1.23 wiz 6039: describes what enabling the option does. E. g. <span class="quote">“<span class="quote">Enable ispell
6040: support.</span>”</span> The file is sorted by option names.</p>
1.1 dsieger 6041: </div>
1.41 asau 6042: <div class="sect1">
1.7 rillig 6043: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6044: <a name="option-build"></a>18.4. Determining the options of dependencies</h2></div></div></div>
1.10 hubertf 6045: <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 6046: different dependencies based on the options with which the package was
6047: built. For querying these options, the file
6048: <code class="filename">pkgsrc/mk/pkg-build-options.mk</code> should be used. A
6049: typical example looks like this:</p>
6050: <pre class="programlisting">
6051: pkgbase := libpurple
6052: .include "../../mk/pkg-build-options.mk"
6053:
6054: .if !empty(PKG_BUILD_OPTIONS.libpurple:Mdbus)
6055: ...
6056: .endif
6057: </pre>
6058: <p>Including <code class="filename">pkg-build-options.mk</code> here will set
6059: the variable <code class="varname">PKG_BUILD_OPTIONS.libpurple</code> to the build
6060: options of the libpurple package, which can then be queried like
6061: <code class="varname">PKG_OPTIONS</code> in the <code class="filename">options.mk</code>
6062: file. See the file <code class="filename">pkg-build-options.mk</code> for more
6063: details.</p>
6064: </div>
1.1 dsieger 6065: </div>
1.41 asau 6066: <div class="chapter">
1.1 dsieger 6067: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 6068: <a name="build"></a>Chapter 19. The build process</h2></div></div></div>
1.1 dsieger 6069: <div class="toc">
6070: <p><b>Table of Contents</b></p>
1.100 leot 6071: <dl class="toc">
1.154 rillig 6072: <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt>
6073: <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt>
6074: <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt>
6075: <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt>
6076: <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
6077: <dd><dl>
6078: <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt>
6079: <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt>
6080: </dl></dd>
6081: <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt>
6082: <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt>
6083: <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt>
6084: <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt>
6085: <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt>
6086: <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
6087: <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
6088: <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt>
6089: <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
6090: <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt>
6091: <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt>
6092: <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt>
1.1 dsieger 6093: </dl>
6094: </div>
1.41 asau 6095: <div class="sect1">
1.1 dsieger 6096: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6097: <a name="build.intro"></a>19.1. Introduction</h2></div></div></div>
1.1 dsieger 6098: <p>This chapter gives a detailed description on how a package is
6099: built. Building a package is separated into different
6100: <span class="emphasis"><em>phases</em></span> (for example <code class="varname">fetch</code>,
6101: <code class="varname">build</code>, <code class="varname">install</code>), all of which are
1.18 snj 6102: described in the following sections. Each phase is split into
1.1 dsieger 6103: so-called <span class="emphasis"><em>stages</em></span>, which take the name of the
6104: containing phase, prefixed by one of <code class="varname">pre-</code>,
6105: <code class="varname">do-</code> or <code class="varname">post-</code>. (Examples are
6106: <code class="varname">pre-configure</code>, <code class="varname">post-build</code>.) Most
6107: of the actual work is done in the <code class="varname">do-*</code> stages.</p>
6108: <p>Never override the regular targets (like
6109: <code class="varname">fetch</code>), if you have to, override the
6110: <code class="varname">do-*</code> ones instead.</p>
6111: <p>The basic steps for building a program are always the same. First
6112: the program's source (<span class="emphasis"><em>distfile</em></span>) must be brought to
6113: the local system and then extracted. After any pkgsrc-specific patches
6114: to compile properly are applied, the software can be configured, then
6115: built (usually by compiling), and finally the generated binaries, etc.
6116: can be put into place on the system.</p>
6117: <p>To get more details about what is happening at each step,
6118: you can set the <code class="varname">PKG_VERBOSE</code> variable, or the
6119: <code class="varname">PATCH_DEBUG</code> variable if you are just interested
6120: in more details about the <span class="emphasis"><em>patch</em></span> step.</p>
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.prefix"></a>19.2. Program location</h2></div></div></div>
1.1 dsieger 6125: <p>Before outlining the process performed by the NetBSD package system in
6126: the next section, here's a brief discussion on where programs are
6127: installed, and which variables influence this.</p>
6128: <p>The automatic variable <code class="varname">PREFIX</code> indicates
6129: where all files of the final program shall be installed. It is
6130: usually set to <code class="varname">LOCALBASE</code>
6131: (<code class="filename">/usr/pkg</code>), or <code class="varname">CROSSBASE</code>
6132: for pkgs in the <code class="filename">cross</code> category. The value of
6133: <code class="varname">PREFIX</code> needs to be put
6134: into the various places in the program's source where paths to
1.154 rillig 6135: 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 6136: <p>When choosing which of these variables to use,
6137: follow the following rules:</p>
1.41 asau 6138: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 6139: <li class="listitem"><p><code class="varname">PREFIX</code> always points to the location
1.1 dsieger 6140: where the current pkg will be installed. When referring to a
6141: pkg's own installation path, use
1.23 wiz 6142: <span class="quote">“<span class="quote">${PREFIX}</span>”</span>.</p></li>
6143: <li class="listitem"><p><code class="varname">LOCALBASE</code> is where all non-X11 pkgs
1.1 dsieger 6144: are installed. If you need to construct a -I or -L argument
6145: to the compiler to find includes and libraries installed by
1.23 wiz 6146: another non-X11 pkg, use <span class="quote">“<span class="quote">${LOCALBASE}</span>”</span>. The name
1.1 dsieger 6147: <code class="varname">LOCALBASE</code> stems from FreeBSD, which
6148: installed all packages in <code class="filename">/usr/local</code>. As
6149: pkgsrc leaves <code class="filename">/usr/local</code> for the system
6150: administrator, this variable is a misnomer.</p></li>
1.23 wiz 6151: <li class="listitem"><p><code class="varname">X11BASE</code> is where the actual X11
1.1 dsieger 6152: distribution (from xsrc, etc.) is installed. When looking for
6153: <span class="emphasis"><em>standard</em></span> X11 includes (not those
1.23 wiz 6154: installed by a package), use <span class="quote">“<span class="quote">${X11BASE}</span>”</span>.</p></li>
1.99 sevan 6155: <li class="listitem"><p>X11-based packages using imake must set
6156: <code class="varname">USE_IMAKE</code> to be installed correctly under
6157: <code class="varname">LOCALBASE</code>.</p></li>
1.23 wiz 6158: <li class="listitem"><p>Within <code class="filename">${PREFIX}</code>, packages should
1.174 leot 6159: 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 6160: manual pages go into <code class="filename">${PREFIX}/man</code>, not
6161: <code class="filename">${PREFIX}/share/man</code>.</p></li>
6162: </ul></div>
6163: </div>
1.41 asau 6164: <div class="sect1">
1.1 dsieger 6165: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6166: <a name="build.builddirs"></a>19.3. Directories used during the build process</h2></div></div></div>
1.14 jmcneill 6167: <p>When building a package, various directories are used to store
1.1 dsieger 6168: source files, temporary files, pkgsrc-internal files, and so on. These
6169: directories are explained here.</p>
6170: <p>Some of the directory variables contain relative pathnames. There
6171: are two common base directories for these relative directories:
6172: <code class="varname">PKGSRCDIR/PKGPATH</code> is used for directories that are
6173: pkgsrc-specific. <code class="varname">WRKSRC</code> is used for directories
6174: inside the package itself.</p>
1.41 asau 6175: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6176: <dt><span class="term"><code class="varname">PKGSRCDIR</code></span></dt>
6177: <dd><p>This is an absolute pathname that points to the pkgsrc
6178: root directory. Generally, you don't need
6179: it.</p></dd>
6180: <dt><span class="term"><code class="varname">PKGDIR</code></span></dt>
6181: <dd><p>This is an absolute pathname that points to the
6182: current package.</p></dd>
6183: <dt><span class="term"><code class="varname">PKGPATH</code></span></dt>
6184: <dd><p>This is a pathname relative to
6185: <code class="varname">PKGSRCDIR</code> that points to the current
6186: package.</p></dd>
6187: <dt><span class="term"><code class="varname">WRKDIR</code></span></dt>
6188: <dd><p>This is an absolute pathname pointing to the directory
6189: where all work takes place. The distfiles are extracted to this
6190: directory. It also contains temporary directories and log files used by
6191: the various pkgsrc frameworks, like <span class="emphasis"><em>buildlink</em></span> or
6192: the <span class="emphasis"><em>wrappers</em></span>.</p></dd>
6193: <dt><span class="term"><code class="varname">WRKSRC</code></span></dt>
6194: <dd><p>This is an absolute pathname pointing to the directory
6195: where the distfiles are extracted. It is usually a direct subdirectory
6196: of <code class="varname">WRKDIR</code>, and often it's the only directory entry
6197: that isn't hidden. This variable may be changed by a package
6198: <code class="filename">Makefile</code>.</p></dd>
6199: </dl></div>
1.14 jmcneill 6200: <p>The <code class="varname">CREATE_WRKDIR_SYMLINK</code> definition takes either
6201: the value <span class="emphasis"><em>yes</em></span> or <span class="emphasis"><em>no</em></span> and defaults
1.15 rillig 6202: to <span class="emphasis"><em>no</em></span>. It indicates whether a symbolic link to the
1.14 jmcneill 6203: <code class="varname">WRKDIR</code> is to be created in the pkgsrc entry's directory.
6204: If users would like to have their pkgsrc trees behave in a
6205: read-only manner, then the value of
6206: <code class="varname">CREATE_WRKDIR_SYMLINK</code> should be set to
6207: <span class="emphasis"><em>no</em></span>.</p>
1.1 dsieger 6208: </div>
1.41 asau 6209: <div class="sect1">
1.1 dsieger 6210: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6211: <a name="build.running"></a>19.4. Running a phase</h2></div></div></div>
1.10 hubertf 6212: <p>You can run a particular phase by typing <span class="command"><strong>make
1.1 dsieger 6213: phase</strong></span>, where <span class="emphasis"><em>phase</em></span> is the name of the
6214: phase. This will automatically run all phases that are required for this
6215: phase. The default phase is <code class="varname">build</code>, that is, when you
1.10 hubertf 6216: run <span class="command"><strong>make</strong></span> without parameters in a package directory,
1.1 dsieger 6217: the package will be built, but not installed.</p>
6218: </div>
1.41 asau 6219: <div class="sect1">
1.1 dsieger 6220: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6221: <a name="build.fetch"></a>19.5. The <span class="emphasis"><em>fetch</em></span> phase</h2></div></div></div>
1.1 dsieger 6222: <p>The first step in building a package is to fetch the
6223: distribution files (distfiles) from the sites that are providing
6224: them. This is the task of the <span class="emphasis"><em>fetch</em></span>
6225: phase.</p>
1.41 asau 6226: <div class="sect2">
1.1 dsieger 6227: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 6228: <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 6229: <p>In simple cases, <code class="varname">MASTER_SITES</code>
6230: defines all URLs from where the distfile, whose name is
6231: derived from the <code class="varname">DISTNAME</code> variable, is
6232: fetched. The more complicated cases are described
6233: below.</p>
6234: <p>The variable <code class="varname">DISTFILES</code> specifies
6235: the list of distfiles that have to be fetched. Its value
1.66 asau 6236: defaults to <code class="literal">${DEFAULT_DISTFILES}</code> and
6237: its value is <code class="literal">${DISTNAME}${EXTRACT_SUFX}</code>,
1.1 dsieger 6238: so that most packages don't need to define it at all.
6239: <code class="varname">EXTRACT_SUFX</code> is
6240: <code class="literal">.tar.gz</code> by default, but can be changed
6241: freely. Note that if your package requires additional
6242: distfiles to the default one, you cannot just append the
6243: additional filenames using the <code class="literal">+=</code>
6244: operator, but you have write for example:</p>
6245: <pre class="programlisting">
1.66 asau 6246: DISTFILES= ${DEFAULT_DISTFILES} additional-files.tar.gz
1.1 dsieger 6247: </pre>
6248: <p>Each distfile is fetched from a list of sites, usually
6249: <code class="varname">MASTER_SITES</code>. If the package has multiple
6250: <code class="varname">DISTFILES</code> or multiple
6251: <code class="varname">PATCHFILES</code> from different sites, you can
6252: set
6253: <code class="varname">SITES.<em class="replaceable"><code>distfile</code></em></code>
6254: to the list of URLs where the file
6255: <code class="filename"><em class="replaceable"><code>distfile</code></em></code>
6256: (including the suffix) can be found.</p>
6257: <pre class="programlisting">
6258: DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
6259: DISTFILES+= foo-file.tar.gz
6260: SITES.foo-file.tar.gz= \
1.174 leot 6261: https://www.somewhere.com/somehow/ \
6262: https://www.somewhereelse.com/mirror/somehow/
1.1 dsieger 6263: </pre>
6264: <p>When actually fetching the distfiles, each item from
6265: <code class="varname">MASTER_SITES</code> or
6266: <code class="varname">SITES.*</code> gets the name of each distfile
6267: appended to it, without an intermediate slash. Therefore,
6268: all site values have to end with a slash or other separator
6269: character. This allows for example to set
6270: <code class="varname">MASTER_SITES</code> to a URL of a CGI script
6271: that gets the name of the distfile as a parameter. In this
6272: case, the definition would look like:</p>
6273: <pre class="programlisting">
1.174 leot 6274: MASTER_SITES= https://www.example.com/download.cgi?file=
1.1 dsieger 6275: </pre>
1.22 jakllsch 6276: <p> The exception to this rule are URLs starting with a dash.
1.66 asau 6277: In that case the URL is taken as is, fetched and the result
6278: stored under the name of the distfile. You can use this style
6279: for the case when the download URL style does not match the
6280: above common case. For example, if permanent download URL is a
6281: redirector to the real download URL, or the download file name
6282: is offered by an HTTP Content-Disposition header. In the
6283: following example, <code class="filename">foo-1.0.0.tar.gz</code> will be
6284: created instead of the default
6285: <code class="filename">v1.0.0.tar.gz</code>.</p>
6286: <pre class="programlisting">
6287: DISTNAME= foo-1.0.0
1.174 leot 6288: MASTER_SITES= -https://www.example.com/archive/v1.0.0.tar.gz
1.66 asau 6289: </pre>
1.1 dsieger 6290: <p>There are some predefined values for
6291: <code class="varname">MASTER_SITES</code>, which can be used in
6292: packages. The names of the variables should speak for
6293: themselves.</p>
1.156 leot 6294: <table border="0" summary="Simple list" class="simplelist">
6295: <tr>
6296: <td>MASTER_SITE_APACHE</td>
6297: <td>MASTER_SITE_BACKUP</td>
6298: </tr>
6299: <tr>
6300: <td>MASTER_SITE_CRATESIO</td>
6301: <td>MASTER_SITE_CYGWIN</td>
6302: </tr>
6303: <tr>
6304: <td>MASTER_SITE_DEBIAN</td>
6305: <td>MASTER_SITE_FREEBSD</td>
6306: </tr>
6307: <tr>
6308: <td>MASTER_SITE_FREEBSD_LOCAL</td>
6309: <td>MASTER_SITE_GENTOO</td>
6310: </tr>
6311: <tr>
6312: <td>MASTER_SITE_GITHUB</td>
6313: <td>MASTER_SITE_GNOME</td>
6314: </tr>
6315: <tr>
6316: <td>MASTER_SITE_GNU</td>
6317: <td>MASTER_SITE_GNUSTEP</td>
6318: </tr>
6319: <tr>
6320: <td>MASTER_SITE_HASKELL_HACKAGE</td>
6321: <td>MASTER_SITE_IFARCHIVE</td>
6322: </tr>
6323: <tr>
6324: <td>MASTER_SITE_KDE</td>
6325: <td>MASTER_SITE_MOZILLA</td>
6326: </tr>
6327: <tr>
6328: <td>MASTER_SITE_MOZILLA_ALL</td>
6329: <td>MASTER_SITE_MYSQL</td>
6330: </tr>
6331: <tr>
6332: <td>MASTER_SITE_NETLIB</td>
6333: <td>MASTER_SITE_OPENBSD</td>
6334: </tr>
6335: <tr>
6336: <td>MASTER_SITE_OPENOFFICE</td>
6337: <td>MASTER_SITE_OSDN</td>
6338: </tr>
6339: <tr>
6340: <td>MASTER_SITE_PERL_CPAN</td>
6341: <td>MASTER_SITE_PGSQL</td>
6342: </tr>
6343: <tr>
6344: <td>MASTER_SITE_PYPI</td>
6345: <td>MASTER_SITE_RUBYGEMS</td>
6346: </tr>
6347: <tr>
6348: <td>MASTER_SITE_R_CRAN</td>
6349: <td>MASTER_SITE_SOURCEFORGE</td>
6350: </tr>
6351: <tr>
6352: <td>MASTER_SITE_SUNSITE</td>
6353: <td>MASTER_SITE_SUSE</td>
6354: </tr>
6355: <tr>
6356: <td>MASTER_SITE_TEX_CTAN</td>
6357: <td>MASTER_SITE_XCONTRIB</td>
6358: </tr>
6359: <tr>
6360: <td>MASTER_SITE_XEMACS</td>
6361: <td>MASTER_SITE_XORG</td>
6362: </tr>
6363: </table>
1.1 dsieger 6364: <p>Some explanations for the less self-explaining ones:
6365: <code class="varname">MASTER_SITE_BACKUP</code> contains backup sites
1.26 wiz 6366: 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 6367: 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 6368: <p>If you choose one of these predefined sites, you may
6369: want to specify a subdirectory of that site. Since these
6370: macros may expand to more than one actual site, you
6371: <span class="emphasis"><em>must</em></span> use the following construct to
6372: specify a subdirectory:</p>
6373: <pre class="programlisting">
6374: MASTER_SITES= ${MASTER_SITE_GNU:=subdirectory/name/}
6375: MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=project_name/}
6376: </pre>
6377: <p>Note the trailing slash after the subdirectory
6378: name.</p>
6379: </div>
1.41 asau 6380: <div class="sect2">
1.1 dsieger 6381: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 6382: <a name="build.fetch.how"></a>19.5.2. How are the files fetched?</h3></div></div></div>
1.1 dsieger 6383: <p>The <span class="emphasis"><em>fetch</em></span> phase makes sure that
6384: all the distfiles exist in a local directory
6385: (<code class="varname">DISTDIR</code>, which can be set by the pkgsrc
6386: user). If the files do not exist, they are fetched using
6387: commands of the form</p>
6388: <pre class="programlisting">
6389: ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS}
6390: </pre>
6391: <p>where <code class="literal">${site}</code> varies through
6392: several possibilities in turn: first,
6393: <code class="varname">MASTER_SITE_OVERRIDE</code> is tried, then the
6394: sites specified in either <code class="varname">SITES.file</code> if
6395: defined, else <code class="varname">MASTER_SITES</code> or
6396: <code class="varname">PATCH_SITES</code>, as applies, then finally the
6397: value of <code class="varname">MASTER_SITE_BACKUP</code>. The order of
6398: all except the first and the last can be optionally sorted
6399: by the user, via setting either
6400: <code class="varname">MASTER_SORT_RANDOM</code>, and
6401: <code class="varname">MASTER_SORT_AWK</code> or
6402: <code class="varname">MASTER_SORT_REGEX</code>.</p>
1.16 jnemeth 6403: <p> The specific command and arguments used depend on the
6404: <code class="varname">FETCH_USING</code> parameter. The example above is
6405: for <code class="literal">FETCH_USING=custom</code>.</p>
1.1 dsieger 6406: <p>The distfiles mirror run by the NetBSD Foundation uses the
6407: <span class="emphasis"><em>mirror-distfiles</em></span> target to mirror the
6408: distfiles, if they are freely distributable. Packages setting
6409: <code class="varname">NO_SRC_ON_FTP</code> (usually to
1.23 wiz 6410: <span class="quote">“<span class="quote">${RESTRICTED}</span>”</span>) will not have their distfiles
1.1 dsieger 6411: mirrored.</p>
6412: </div>
6413: </div>
1.41 asau 6414: <div class="sect1">
1.1 dsieger 6415: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6416: <a name="build.checksum"></a>19.6. The <span class="emphasis"><em>checksum</em></span> phase</h2></div></div></div>
1.1 dsieger 6417: <p>After the distfile(s) are fetched, their checksum is
6418: generated and compared with the checksums stored in the
6419: distinfo file. If the checksums don't match, the build is
6420: aborted. This is to ensure the same distfile is used for
6421: building, and that the distfile wasn't changed, e.g. by some
6422: malign force, deliberately changed distfiles on the master
6423: distribution site or network lossage.</p>
6424: </div>
1.41 asau 6425: <div class="sect1">
1.1 dsieger 6426: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6427: <a name="build.extract"></a>19.7. The <span class="emphasis"><em>extract</em></span> phase</h2></div></div></div>
1.1 dsieger 6428: <p>When the distfiles are present on the local system, they
6429: need to be extracted, as they usually come in the form of some
6430: compressed archive format.</p>
6431: <p>By default, all <code class="varname">DISTFILES</code> are
6432: extracted. If you only need some of them, you can set the
6433: <code class="varname">EXTRACT_ONLY</code> variable to the list of those
6434: files.</p>
6435: <p>Extracting the files is usually done by a little
6436: program, <code class="filename">mk/extract/extract</code>, which
6437: already knows how to extract various archive formats, so most
6438: likely you will not need to change anything here. But if you
6439: need, the following variables may help you:</p>
1.41 asau 6440: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6441: <dt><span class="term"><code class="varname">EXTRACT_OPTS_{BIN,LHA,PAX,RAR,TAR,ZIP,ZOO}</code></span></dt>
6442: <dd><p>Use these variables to override the default
6443: options for an extract command, which are defined in
6444: <code class="filename">mk/extract/extract</code>.</p></dd>
6445: <dt><span class="term"><code class="varname">EXTRACT_USING</code></span></dt>
6446: <dd><p>This variable can be set to
1.14 jmcneill 6447: <code class="literal">bsdtar</code>, <code class="literal">gtar</code>, <code class="literal">nbtar</code>
6448: (which is the default value), <code class="literal">pax</code>, or an
1.1 dsieger 6449: absolute pathname pointing to the command with which tar
1.14 jmcneill 6450: archives should be extracted. It is preferred to choose bsdtar over gtar
6451: if NetBSD's pax-as-tar is not good enough.</p></dd>
1.1 dsieger 6452: </dl></div>
6453: <p>If the <code class="filename">extract</code> program doesn't
6454: serve your needs, you can also override the
6455: <code class="varname">EXTRACT_CMD</code> variable, which holds the
6456: command used for extracting the files. This command is
6457: executed in the <code class="filename">${WRKSRC}</code>
6458: directory. During execution of this command, the shell
6459: variable <code class="varname">extract_file</code> holds the absolute
6460: pathname of the file that is going to be extracted.</p>
6461: <p>And if that still does not suffice, you can override the
6462: <code class="varname">do-extract</code> target in the package
6463: Makefile.</p>
6464: </div>
1.41 asau 6465: <div class="sect1">
1.1 dsieger 6466: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6467: <a name="build.patch"></a>19.8. The <span class="emphasis"><em>patch</em></span> phase</h2></div></div></div>
1.1 dsieger 6468: <p>After extraction, all the patches named by the
6469: <code class="varname">PATCHFILES</code>, those present in the patches
6470: subdirectory of the package as well as in
6471: $LOCALPATCHES/$PKGPATH (e.g.
6472: <code class="filename">/usr/local/patches/graphics/png</code>) are
6473: applied. Patchfiles ending in <code class="filename">.Z</code> or
6474: <code class="filename">.gz</code> are uncompressed before they are
6475: applied, files ending in <code class="filename">.orig</code> or
6476: <code class="filename">.rej</code> are ignored. Any special options to
1.174 leot 6477: <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 6478: <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.180 rillig 6479: <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 arguments to make it
6480: fail if the expected text from the patch context is not found in the
6481: patched file. If that happens, fix the patch file by comparing it
6482: with the actual text in the file to be patched.</p>
1.1 dsieger 6483: </div>
1.41 asau 6484: <div class="sect1">
1.1 dsieger 6485: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6486: <a name="build.tools"></a>19.9. The <span class="emphasis"><em>tools</em></span> phase</h2></div></div></div>
6487: <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 6488: </p>
6489: </div>
1.41 asau 6490: <div class="sect1">
1.1 dsieger 6491: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6492: <a name="build.wrapper"></a>19.10. The <span class="emphasis"><em>wrapper</em></span> phase</h2></div></div></div>
1.1 dsieger 6493: <p>This phase creates wrapper programs for the compilers and
6494: linkers. The following variables can be used to tweak the
6495: wrappers.</p>
1.41 asau 6496: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6497: <dt><span class="term"><code class="varname">ECHO_WRAPPER_MSG</code></span></dt>
6498: <dd><p>The command used to print progress
6499: messages. Does nothing by default. Set to
6500: <code class="literal">${ECHO}</code> to see the progress
6501: messages.</p></dd>
6502: <dt><span class="term"><code class="varname">WRAPPER_DEBUG</code></span></dt>
6503: <dd><p>This variable can be set to
6504: <code class="literal">yes</code> (default) or <code class="literal">no</code>,
6505: depending on whether you want additional information in the
6506: wrapper log file.</p></dd>
6507: <dt><span class="term"><code class="varname">WRAPPER_UPDATE_CACHE</code></span></dt>
6508: <dd><p>This variable can be set to
6509: <code class="literal">yes</code> or <code class="literal">no</code>, depending
6510: on whether the wrapper should use its cache, which will
6511: improve the speed. The default value is
6512: <code class="literal">yes</code>, but is forced to
6513: <code class="literal">no</code> if the platform does not support
6514: it.</p></dd>
6515: <dt><span class="term"><code class="varname">WRAPPER_REORDER_CMDS</code></span></dt>
6516: <dd><p>A list of reordering commands. A reordering
6517: command has the form
6518: <code class="literal">reorder:l:<em class="replaceable"><code>lib1</code></em>:<em class="replaceable"><code>lib2</code></em></code>.
6519: It ensures that that
6520: <code class="literal">-l<em class="replaceable"><code>lib1</code></em></code> occurs
6521: before <code class="literal">-l<em class="replaceable"><code>lib2</code></em></code>.
6522: </p></dd>
6523: </dl></div>
6524: </div>
1.41 asau 6525: <div class="sect1">
1.1 dsieger 6526: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6527: <a name="build.configure"></a>19.11. The <span class="emphasis"><em>configure</em></span> phase</h2></div></div></div>
1.1 dsieger 6528: <p>Most pieces of software need information on the header
6529: files, system calls, and library routines which are available
6530: on the platform they run on. The process of determining this
6531: information is known as configuration, and is usually
6532: automated. In most cases, a script is supplied with the
6533: distfiles, and its invocation results in generation of header
6534: files, Makefiles, etc.</p>
6535: <p>If the package contains a configure script, this can be
6536: invoked by setting <code class="varname">HAS_CONFIGURE</code> to
1.23 wiz 6537: <span class="quote">“<span class="quote">yes</span>”</span>. If the configure script is a GNU autoconf
1.1 dsieger 6538: script, you should set <code class="varname">GNU_CONFIGURE</code> to
1.23 wiz 6539: <span class="quote">“<span class="quote">yes</span>”</span> instead. What happens in the
1.1 dsieger 6540: <span class="emphasis"><em>configure</em></span> phase is roughly:</p>
6541: <pre class="programlisting">
6542: .for d in ${CONFIGURE_DIRS}
6543: cd ${WRKSRC} \
6544: && cd ${d} \
6545: && env ${CONFIGURE_ENV} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
6546: .endfor
6547: </pre>
6548: <p><code class="varname">CONFIGURE_DIRS</code> (default:
1.23 wiz 6549: <span class="quote">“<span class="quote">.</span>”</span>) is a list of pathnames relative to
1.1 dsieger 6550: <code class="varname">WRKSRC</code>. In each of these directories, the
6551: configure script is run with the environment
6552: <code class="varname">CONFIGURE_ENV</code> and arguments
6553: <code class="varname">CONFIGURE_ARGS</code>. The variables
6554: <code class="varname">CONFIGURE_ENV</code>,
6555: <code class="varname">CONFIGURE_SCRIPT</code> (default:
1.23 wiz 6556: <span class="quote">“<span class="quote">./configure</span>”</span>) and
1.1 dsieger 6557: <code class="varname">CONFIGURE_ARGS</code> may all be changed by the
6558: package.</p>
1.37 wiz 6559: <p>If the program uses the Perl way of configuration (mainly Perl
6560: modules, but not only), i.e. a file called
6561: <code class="filename">Makefile.PL</code>, it should include
6562: <code class="filename">../../lang/perl5/module.mk</code>. To set any parameter for
6563: <code class="filename">Makefile.PL</code> use the <code class="varname">MAKE_PARAMS</code>
6564: variable (e.g., <code class="literal">MAKE_PARAMS+=foo=bar</code></p>
1.1 dsieger 6565: <p>If the program uses an <code class="filename">Imakefile</code>
6566: for configuration, the appropriate steps can be invoked by
6567: setting <code class="varname">USE_IMAKE</code> to
1.99 sevan 6568: <span class="quote">“<span class="quote">yes</span>”</span>. If you only need xmkmf, add it to <code class="varname">USE_TOOLS</code>.
6569: You can add variables to xmkmf's environment by adding them to the
1.1 dsieger 6570: <code class="varname">SCRIPTS_ENV</code> variable.</p>
1.11 rillig 6571: <p>If the program uses <code class="filename">cmake</code>
6572: for configuration, the appropriate steps can be invoked by
1.23 wiz 6573: setting <code class="varname">USE_CMAKE</code> to <span class="quote">“<span class="quote">yes</span>”</span>.
1.11 rillig 6574: You can add variables to cmake's environment by adding them to the
6575: <code class="varname">CONFIGURE_ENV</code> variable and arguments to cmake
6576: by adding them to the <code class="varname">CMAKE_ARGS</code> variable.
6577: The top directory argument is given by the
6578: <code class="varname">CMAKE_ARG_PATH</code> variable, that defaults to
1.23 wiz 6579: <span class="quote">“<span class="quote">.</span>”</span> (relative to <code class="varname">CONFIGURE_DIRS</code>)</p>
1.1 dsieger 6580: <p>If there is no configure step at all, set
1.23 wiz 6581: <code class="varname">NO_CONFIGURE</code> to <span class="quote">“<span class="quote">yes</span>”</span>.</p>
1.1 dsieger 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.build"></a>19.12. The <span class="emphasis"><em>build</em></span> phase</h2></div></div></div>
1.1 dsieger 6586: <p>For building a package, a rough equivalent of the
6587: following code is executed.</p>
6588: <pre class="programlisting">
6589: .for d in ${BUILD_DIRS}
6590: cd ${WRKSRC} \
6591: && cd ${d} \
6592: && env ${MAKE_ENV} \
6593: ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \
6594: -f ${MAKE_FILE} \
6595: ${BUILD_TARGET}
6596: .endfor
6597: </pre>
6598: <p><code class="varname">BUILD_DIRS</code> (default:
1.23 wiz 6599: <span class="quote">“<span class="quote">.</span>”</span>) is a list of pathnames relative to
1.1 dsieger 6600: <code class="varname">WRKSRC</code>. In each of these directories,
6601: <code class="varname">MAKE_PROGRAM</code> is run with the environment
6602: <code class="varname">MAKE_ENV</code> and arguments
6603: <code class="varname">BUILD_MAKE_FLAGS</code>. The variables
6604: <code class="varname">MAKE_ENV</code>,
6605: <code class="varname">BUILD_MAKE_FLAGS</code>,
6606: <code class="varname">MAKE_FILE</code> and
6607: <code class="varname">BUILD_TARGET</code> may all be changed by the
6608: package.</p>
6609: <p>The default value of <code class="varname">MAKE_PROGRAM</code> is
1.23 wiz 6610: <span class="quote">“<span class="quote">gmake</span>”</span> if <code class="varname">USE_TOOLS</code> contains
6611: <span class="quote">“<span class="quote">gmake</span>”</span>, <span class="quote">“<span class="quote">make</span>”</span> otherwise. The
1.1 dsieger 6612: default value of <code class="varname">MAKE_FILE</code> is
1.23 wiz 6613: <span class="quote">“<span class="quote">Makefile</span>”</span>, and <code class="varname">BUILD_TARGET</code>
6614: defaults to <span class="quote">“<span class="quote">all</span>”</span>.</p>
1.1 dsieger 6615: <p>If there is no build step at all, set
1.23 wiz 6616: <code class="varname">NO_BUILD</code> to <span class="quote">“<span class="quote">yes</span>”</span>.</p>
1.1 dsieger 6617: </div>
1.41 asau 6618: <div class="sect1">
1.1 dsieger 6619: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6620: <a name="build.test"></a>19.13. The <span class="emphasis"><em>test</em></span> phase</h2></div></div></div>
1.1 dsieger 6621: <p>[TODO]</p>
6622: </div>
1.41 asau 6623: <div class="sect1">
1.1 dsieger 6624: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6625: <a name="build.install"></a>19.14. The <span class="emphasis"><em>install</em></span> phase</h2></div></div></div>
1.1 dsieger 6626: <p>Once the build stage has completed, the final step is to
6627: install the software in public directories, so users can
6628: access the programs and files.</p>
6629: <p>In the <span class="emphasis"><em>install</em></span> phase, a rough
6630: equivalent of the following code is executed. Additionally,
6631: before and after this code, much magic is performed to do
6632: consistency checks, registering the package, and so on.</p>
6633: <pre class="programlisting">
6634: .for d in ${INSTALL_DIRS}
6635: cd ${WRKSRC} \
6636: && cd ${d} \
6637: && env ${MAKE_ENV} \
6638: ${MAKE_PROGRAM} ${INSTALL_MAKE_FLAGS} \
6639: -f ${MAKE_FILE} \
6640: ${INSTALL_TARGET}
6641: .endfor
6642: </pre>
6643: <p>The variable's meanings are analogous to the ones in the
6644: <span class="emphasis"><em>build</em></span> phase.
6645: <code class="varname">INSTALL_DIRS</code> defaults to
6646: <code class="varname">BUILD_DIRS</code>. <code class="varname">INSTALL_TARGET</code>
1.23 wiz 6647: is <span class="quote">“<span class="quote">install</span>”</span> by default, plus
6648: <span class="quote">“<span class="quote">install.man</span>”</span> if <code class="varname">USE_IMAKE</code> is
1.1 dsieger 6649: defined and <code class="varname">NO_INSTALL_MANPAGES</code> is not
6650: defined.</p>
6651: <p>In the <span class="emphasis"><em>install</em></span> phase, the following
6652: variables are useful. They are all variations of the
1.174 leot 6653: <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 6654: permissions preset. <code class="varname">INSTALL</code> is the plain
6655: install command. The specialized variants, together with their
6656: intended use, are:</p>
1.41 asau 6657: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6658: <dt><span class="term"><code class="varname">INSTALL_PROGRAM_DIR</code></span></dt>
6659: <dd><p>directories that contain
6660: binaries</p></dd>
6661: <dt><span class="term"><code class="varname">INSTALL_SCRIPT_DIR</code></span></dt>
6662: <dd><p>directories that contain
6663: scripts</p></dd>
6664: <dt><span class="term"><code class="varname">INSTALL_LIB_DIR</code></span></dt>
6665: <dd><p>directories that contain shared and static
6666: libraries</p></dd>
6667: <dt><span class="term"><code class="varname">INSTALL_DATA_DIR</code></span></dt>
6668: <dd><p>directories that contain data
6669: files</p></dd>
6670: <dt><span class="term"><code class="varname">INSTALL_MAN_DIR</code></span></dt>
6671: <dd><p>directories that contain man
6672: pages</p></dd>
1.100 leot 6673: <dt><span class="term"><code class="varname">INSTALL_GAME_DIR</code></span></dt>
6674: <dd><p>directories that contain data files for games
6675: </p></dd>
1.1 dsieger 6676: <dt><span class="term"><code class="varname">INSTALL_PROGRAM</code></span></dt>
6677: <dd><p>binaries that can be stripped from debugging
6678: symbols</p></dd>
6679: <dt><span class="term"><code class="varname">INSTALL_SCRIPT</code></span></dt>
6680: <dd><p>binaries that cannot be
6681: stripped</p></dd>
6682: <dt><span class="term"><code class="varname">INSTALL_GAME</code></span></dt>
6683: <dd><p>game
6684: binaries</p></dd>
6685: <dt><span class="term"><code class="varname">INSTALL_LIB</code></span></dt>
6686: <dd><p>shared and static
6687: libraries</p></dd>
6688: <dt><span class="term"><code class="varname">INSTALL_DATA</code></span></dt>
6689: <dd><p>data files</p></dd>
6690: <dt><span class="term"><code class="varname">INSTALL_GAME_DATA</code></span></dt>
6691: <dd><p>data files for
6692: games</p></dd>
6693: <dt><span class="term"><code class="varname">INSTALL_MAN</code></span></dt>
6694: <dd><p>man pages</p></dd>
6695: </dl></div>
6696: <p>Some other variables are:</p>
1.41 asau 6697: <div class="variablelist"><dl class="variablelist">
1.106 tnn 6698: <dt><span class="term"><code class="varname">INSTALL_UNSTRIPPED</code></span></dt>
1.174 leot 6699: <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 6700: when installing binaries. Any debugging sections and symbols present in
6701: binaries will be preserved.
6702: </p></dd>
1.1 dsieger 6703: <dt><span class="term"><code class="varname">INSTALLATION_DIRS</code></span></dt>
6704: <dd><p>A list of directories relative to
6705: <code class="varname">PREFIX</code> that are created by pkgsrc at the
6706: beginning of the <span class="emphasis"><em>install</em></span> phase.
6707: The package is supposed to create all needed directories itself
6708: before installing files to it and list all other directories here.
6709: </p></dd>
6710: </dl></div>
6711: <p>In the rare cases that a package shouldn't install anything,
1.23 wiz 6712: set <code class="varname">NO_INSTALL</code> to <span class="quote">“<span class="quote">yes</span>”</span>. This is
1.1 dsieger 6713: mostly relevant for packages in the <code class="filename">regress</code>
6714: category.</p>
6715: </div>
1.41 asau 6716: <div class="sect1">
1.1 dsieger 6717: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6718: <a name="build.package"></a>19.15. The <span class="emphasis"><em>package</em></span> phase</h2></div></div></div>
1.1 dsieger 6719: <p>Once the install stage has completed, a binary package of
6720: the installed files can be built. These binary packages can be
6721: used for quick installation without previous compilation, e.g. by
1.10 hubertf 6722: the <span class="command"><strong>make bin-install</strong></span> or by using
6723: <span class="command"><strong>pkg_add</strong></span>.</p>
1.1 dsieger 6724: <p>By default, the binary packages are created in
6725: <code class="filename">${PACKAGES}/All</code> and symlinks are created in
6726: <code class="filename">${PACKAGES}/<em class="replaceable"><code>category</code></em></code>,
6727: one for each category in the <code class="varname">CATEGORIES</code>
6728: variable. <code class="varname">PACKAGES</code> defaults to
6729: <code class="filename">pkgsrc/packages</code>.</p>
6730: </div>
1.41 asau 6731: <div class="sect1">
1.1 dsieger 6732: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6733: <a name="build.clean"></a>19.16. Cleaning up</h2></div></div></div>
1.1 dsieger 6734: <p>Once you're finished with a package, you can clean the work
1.10 hubertf 6735: directory by running <span class="command"><strong>make clean</strong></span>. If you want
1.1 dsieger 6736: to clean the work directories of all dependencies too, use
1.10 hubertf 6737: <span class="command"><strong>make clean-depends</strong></span>.</p>
1.1 dsieger 6738: </div>
1.41 asau 6739: <div class="sect1">
1.1 dsieger 6740: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 6741: <a name="build.helpful-targets"></a>19.17. Other helpful targets</h2></div></div></div>
1.41 asau 6742: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6743: <dt><span class="term">pre/post-*</span></dt>
6744: <dd><p>For any of the main targets described in the
6745: previous section, two auxiliary targets exist with
1.23 wiz 6746: <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 6747: prefix for the main target's name. These targets are
6748: invoked before and after the main target is called,
6749: allowing extra configuration or installation steps be
6750: performed from a package's Makefile, for example, which
6751: a program's configure script or install target
6752: omitted.</p></dd>
6753: <dt><span class="term">do-*</span></dt>
6754: <dd><p>Should one of the main targets do the wrong thing,
6755: and should there be no variable to fix this, you can
6756: redefine it with the do-* target. (Note that redefining
6757: the target itself instead of the do-* target is a bad
6758: idea, as the pre-* and post-* targets won't be called
6759: anymore, etc.) You will not usually need to do
6760: this.</p></dd>
6761: <dt><span class="term">reinstall</span></dt>
6762: <dd>
1.10 hubertf 6763: <p>If you did a <span class="command"><strong>make install</strong></span> and
1.1 dsieger 6764: you noticed some file was not installed properly, you
6765: can repeat the installation with this target, which will
1.23 wiz 6766: ignore the <span class="quote">“<span class="quote">already installed</span>”</span> flag.</p>
1.1 dsieger 6767: <p>This is the default value of
6768: <code class="varname">DEPENDS_TARGET</code> except in the case of
1.10 hubertf 6769: <span class="command"><strong>make update</strong></span> and <span class="command"><strong>make
1.1 dsieger 6770: package</strong></span>, where the defaults are
1.23 wiz 6771: <span class="quote">“<span class="quote">package</span>”</span> and <span class="quote">“<span class="quote">update</span>”</span>,
1.1 dsieger 6772: respectively.</p>
6773: </dd>
6774: <dt><span class="term">deinstall</span></dt>
6775: <dd>
1.174 leot 6776: <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 6777: current directory, effectively de-installing the
6778: package. The following variables can be used to tune the
6779: behaviour:</p>
1.41 asau 6780: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6781: <dt><span class="term"><code class="varname">PKG_VERBOSE</code></span></dt>
1.174 leot 6782: <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 6783: <dt><span class="term"><code class="varname">DEINSTALLDEPENDS</code></span></dt>
6784: <dd><p>Remove all packages that require (depend on)
6785: the given package. This can be used to remove any
6786: packages that may have been pulled in by a given
1.10 hubertf 6787: package, e.g. if <span class="command"><strong>make deinstall
1.1 dsieger 6788: DEINSTALLDEPENDS=1</strong></span> is done in
6789: <code class="filename">pkgsrc/x11/kde</code>, this is
6790: likely to remove whole KDE. Works by adding
1.174 leot 6791: <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 6792: command line.</p></dd>
6793: </dl></div>
6794: </dd>
6795: <dt><span class="term">bin-install</span></dt>
6796: <dd><p>Install a binary package from local disk and via FTP
6797: from a list of sites (see the
6798: <code class="varname">BINPKG_SITES</code> variable), and do a
1.10 hubertf 6799: <span class="command"><strong>make package</strong></span> if no binary package is
1.1 dsieger 6800: available anywhere. The arguments given to
1.10 hubertf 6801: <span class="command"><strong>pkg_add</strong></span> can be set via
1.1 dsieger 6802: <code class="varname">BIN_INSTALL_FLAGS</code> e.g., to do verbose
6803: operation, etc.</p></dd>
1.95 wiz 6804: <dt><span class="term">install-clean</span></dt>
6805: <dd><p>This target removes the state files for the "install" and later
6806: phases so that the "install" target may be re-invoked. This can be
6807: used after editing the PLIST to install the package without
6808: rebuilding it.</p></dd>
6809: <dt><span class="term">build-clean</span></dt>
6810: <dd><p>This target removes the state files for the "build" and later
6811: phases so that the "build" target may be re-invoked.</p></dd>
1.1 dsieger 6812: <dt><span class="term">update</span></dt>
6813: <dd>
6814: <p>This target causes the current package to be
6815: updated to the latest version. The package and all
6816: depending packages first get de-installed, then current
6817: versions of the corresponding packages get compiled and
6818: installed. This is similar to manually noting which
6819: packages are currently installed, then performing a
1.10 hubertf 6820: series of <span class="command"><strong>make deinstall</strong></span> and
6821: <span class="command"><strong>make install</strong></span> (or whatever
1.1 dsieger 6822: <code class="varname">UPDATE_TARGET</code> is set to) for these
6823: packages.</p>
1.23 wiz 6824: <p>You can use the <span class="quote">“<span class="quote">update</span>”</span> target to
1.10 hubertf 6825: resume package updating in case a previous <span class="command"><strong>make
1.1 dsieger 6826: update</strong></span> was interrupted for some reason.
6827: However, in this case, make sure you don't call
1.10 hubertf 6828: <span class="command"><strong>make clean</strong></span> or otherwise remove the
1.1 dsieger 6829: list of dependent packages in <code class="varname">WRKDIR</code>.
6830: Otherwise, you lose the ability to automatically update
6831: the current package along with the dependent packages
6832: you have installed.</p>
1.10 hubertf 6833: <p>Resuming an interrupted <span class="command"><strong>make
1.1 dsieger 6834: update</strong></span> will only work as long as the package
6835: tree remains unchanged. If the source code for one of
6836: the packages to be updated has been changed, resuming
1.10 hubertf 6837: <span class="command"><strong>make update</strong></span> will most certainly
1.1 dsieger 6838: fail!</p>
6839: <p>The following variables can be used either on the
1.10 hubertf 6840: command line or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to
6841: alter the behaviour of <span class="command"><strong>make
1.1 dsieger 6842: update</strong></span>:</p>
1.41 asau 6843: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6844: <dt><span class="term"><code class="varname">UPDATE_TARGET</code></span></dt>
6845: <dd><p>Install target to recursively use for the
6846: updated package and the dependent packages.
6847: Defaults to <code class="varname">DEPENDS_TARGET</code> if
1.23 wiz 6848: set, <span class="quote">“<span class="quote">install</span>”</span> otherwise for
1.10 hubertf 6849: <span class="command"><strong>make update</strong></span>. Other good
1.23 wiz 6850: targets are <span class="quote">“<span class="quote">package</span>”</span> or
6851: <span class="quote">“<span class="quote">bin-install</span>”</span>. Do not set this to
6852: <span class="quote">“<span class="quote">update</span>”</span> or you will get stuck in an
1.1 dsieger 6853: endless loop!</p></dd>
6854: <dt><span class="term"><code class="varname">NOCLEAN</code></span></dt>
6855: <dd><p>Don't clean up after updating. Useful if
6856: you want to leave the work sources of the updated
6857: packages around for inspection or other purposes.
6858: Be sure you eventually clean up the source tree
1.23 wiz 6859: (see the <span class="quote">“<span class="quote">clean-update</span>”</span> target below)
1.1 dsieger 6860: or you may run into troubles with old source code
6861: still lying around on your next
1.10 hubertf 6862: <span class="command"><strong>make</strong></span> or <span class="command"><strong>make
1.1 dsieger 6863: update</strong></span>.</p></dd>
6864: <dt><span class="term"><code class="varname">REINSTALL</code></span></dt>
6865: <dd><p>Deinstall each package before installing
6866: (making <code class="varname">DEPENDS_TARGET</code>). This
6867: may be necessary if the
1.23 wiz 6868: <span class="quote">“<span class="quote">clean-update</span>”</span> target (see below) was
1.10 hubertf 6869: called after interrupting a running <span class="command"><strong>make
1.1 dsieger 6870: update</strong></span>.</p></dd>
6871: <dt><span class="term"><code class="varname">DEPENDS_TARGET</code></span></dt>
6872: <dd><p>Allows you to disable recursion and hardcode
6873: the target for packages. The default is
1.23 wiz 6874: <span class="quote">“<span class="quote">update</span>”</span> for the update target,
1.1 dsieger 6875: facilitating a recursive update of prerequisite
6876: packages. Only set
6877: <code class="varname">DEPENDS_TARGET</code> if you want to
6878: disable recursive updates. Use
6879: <code class="varname">UPDATE_TARGET</code> instead to just
6880: set a specific target for each package to be
1.10 hubertf 6881: installed during <span class="command"><strong>make update</strong></span>
1.1 dsieger 6882: (see above).</p></dd>
6883: </dl></div>
6884: </dd>
6885: <dt><span class="term">clean-update</span></dt>
6886: <dd>
6887: <p>Clean the source tree for all packages that would
1.10 hubertf 6888: get updated if <span class="command"><strong>make update</strong></span> was called
1.1 dsieger 6889: from the current directory. This target should not be
6890: used if the current package (or any of its depending
6891: packages) have already been de-installed (e.g., after
1.10 hubertf 6892: calling <span class="command"><strong>make update</strong></span>) or you may lose
1.1 dsieger 6893: some packages you intended to update. As a rule of
6894: thumb: only use this target <span class="emphasis"><em>before</em></span>
1.10 hubertf 6895: the first time you run <span class="command"><strong>make update</strong></span>
1.1 dsieger 6896: and only if you have a dirty package tree (e.g., if you
6897: used <code class="varname">NOCLEAN</code>).</p>
6898: <p>If you are unsure about whether your tree is
1.10 hubertf 6899: clean, you can either perform a <span class="command"><strong>make
1.1 dsieger 6900: clean</strong></span> at the top of the tree, or use the
6901: following sequence of commands from the directory of the
6902: package you want to update (<span class="emphasis"><em>before</em></span>
1.10 hubertf 6903: running <span class="command"><strong>make update</strong></span> for the first
1.1 dsieger 6904: time, otherwise you lose all the packages you wanted to
6905: update!):</p>
6906: <pre class="screen">
6907: <code class="prompt">#</code> <strong class="userinput"><code>make clean-update</code></strong>
6908: <code class="prompt">#</code> <strong class="userinput"><code>make clean CLEANDEPENDS=YES</code></strong>
6909: <code class="prompt">#</code> <strong class="userinput"><code>make update</code></strong>
6910: </pre>
6911: <p>The following variables can be used either on the
1.10 hubertf 6912: command line or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to alter the behaviour of
6913: <span class="command"><strong>make clean-update</strong></span>:</p>
1.41 asau 6914: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 6915: <dt><span class="term"><code class="varname">CLEAR_DIRLIST</code></span></dt>
1.10 hubertf 6916: <dd><p>After <span class="command"><strong>make clean</strong></span>, do not
1.1 dsieger 6917: reconstruct the list of directories to update for
1.10 hubertf 6918: this package. Only use this if <span class="command"><strong>make
1.1 dsieger 6919: update</strong></span> successfully installed all
6920: packages you wanted to update. Normally, this is
1.10 hubertf 6921: done automatically on <span class="command"><strong>make
1.1 dsieger 6922: update</strong></span>, but may have been suppressed by
6923: the <code class="varname">NOCLEAN</code> variable (see
6924: above).</p></dd>
6925: </dl></div>
6926: </dd>
6927: <dt><span class="term">replace</span></dt>
6928: <dd>
6929: <p>Update the installation of the current package. This
6930: differs from update in that it does not replace dependent
1.137 leot 6931: 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 6932: target to work.</p>
6933: <p><span class="emphasis"><em>Be careful when using this
6934: target!</em></span> There are no guarantees that dependent
6935: packages will still work, in particular they will most
1.10 hubertf 6936: certainly break if you <span class="command"><strong>make replace</strong></span> a
1.1 dsieger 6937: library package whose shared library major version changed
6938: between your installed version and the new one. For this
6939: reason, this target is not officially supported and only
6940: recommended for advanced users.</p>
6941: </dd>
6942: <dt><span class="term">info</span></dt>
1.174 leot 6943: <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 6944: package. You can use this to check which version of a
6945: package is installed.</p></dd>
6946: <dt><span class="term">index</span></dt>
6947: <dd>
6948: <p>This is a top-level command, i.e. it should be used in
6949: the <code class="filename">pkgsrc</code> directory. It creates a
6950: database of all packages in the local pkgsrc tree, including
6951: dependencies, comment, maintainer, and some other useful
6952: information. Individual entries are created by running
1.10 hubertf 6953: <span class="command"><strong>make describe</strong></span> in the packages'
1.1 dsieger 6954: directories. This index file is saved as
6955: <code class="filename">pkgsrc/INDEX</code>. It can be displayed in
1.10 hubertf 6956: verbose format by running <span class="command"><strong>make
1.1 dsieger 6957: print-index</strong></span>. You can search in it with
1.10 hubertf 6958: <span class="command"><strong>make search
1.1 dsieger 6959: key=<em class="replaceable"><code>something</code></em></strong></span>. You can
6960: extract a list of all packages that depend on a particular
1.10 hubertf 6961: one by running <span class="command"><strong>make show-deps
1.1 dsieger 6962: PKG=<em class="replaceable"><code>somepackage</code></em></strong></span>.</p>
6963: <p>Running this command takes a very long time, some
6964: hours even on fast machines!</p>
6965: </dd>
6966: <dt><span class="term">readme</span></dt>
6967: <dd>
6968: <p>This target generates a
6969: <code class="filename">README.html</code> file, which can be
1.137 leot 6970: 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 6971: contain references to any packages which are in the
6972: <code class="varname">PACKAGES</code> directory on the local
6973: host. The generated files can be made to refer to URLs
6974: based on <code class="varname">FTP_PKG_URL_HOST</code> and
6975: <code class="varname">FTP_PKG_URL_DIR</code>. For example, if I
6976: wanted to generate <code class="filename">README.html</code>
6977: files which pointed to binary packages on the local
6978: machine, in the directory
6979: <code class="filename">/usr/packages</code>, set
6980: <code class="varname">FTP_PKG_URL_HOST=file://localhost</code> and
6981: <code class="varname">FTP_PKG_URL_DIR=/usr/packages</code>. The
6982: <code class="varname">${PACKAGES}</code> directory and its
6983: subdirectories will be searched for all the binary
6984: packages.</p>
6985: <p>The target can be run at the toplevel or in category
6986: directories, in which case it descends recursively.</p>
6987: </dd>
6988: <dt><span class="term">readme-all</span></dt>
6989: <dd><p>This is a top-level command, run it in
6990: <code class="filename">pkgsrc</code>. Use this target to create a
6991: file <code class="filename">README-all.html</code> which contains a
6992: list of all packages currently available in the NetBSD
6993: Packages Collection, together with the category they belong
6994: to and a short description. This file is compiled from the
6995: <code class="filename">pkgsrc/*/README.html</code> files, so be sure
1.10 hubertf 6996: to run this <span class="emphasis"><em>after</em></span> a <span class="command"><strong>make
1.1 dsieger 6997: readme</strong></span>.</p></dd>
6998: <dt><span class="term">cdrom-readme</span></dt>
6999: <dd><p>This is very much the same as the
1.23 wiz 7000: <span class="quote">“<span class="quote">readme</span>”</span> target (see above), but is to be
1.1 dsieger 7001: used when generating a pkgsrc tree to be written to a
7002: CD-ROM. This target also produces
7003: <code class="filename">README.html</code> files, and can be made
7004: to refer to URLs based on
7005: <code class="varname">CDROM_PKG_URL_HOST</code> and
7006: <code class="varname">CDROM_PKG_URL_DIR</code>.</p></dd>
7007: <dt><span class="term">show-distfiles</span></dt>
7008: <dd><p>This target shows which distfiles and patchfiles
7009: are needed to build the package
7010: (<code class="varname">ALLFILES</code>, which contains all
7011: <code class="varname">DISTFILES</code> and
7012: <code class="varname">PATCHFILES</code>, but not
7013: <code class="filename">patches/*</code>).</p></dd>
7014: <dt><span class="term">show-downlevel</span></dt>
7015: <dd><p>This target shows nothing if the package is not
7016: installed. If a version of this package is installed,
7017: but is not the version provided in this version of
7018: pkgsrc, then a warning message is displayed. This target
7019: can be used to show which of your installed packages are
7020: downlevel, and so the old versions can be deleted, and
7021: the current ones added.</p></dd>
7022: <dt><span class="term">show-pkgsrc-dir</span></dt>
7023: <dd><p>This target shows the directory in the pkgsrc
7024: hierarchy from which the package can be built and
7025: installed. This may not be the same directory as the one
7026: from which the package was installed. This target is
7027: intended to be used by people who may wish to upgrade
7028: many packages on a single host, and can be invoked from
7029: the top-level pkgsrc Makefile by using the
1.23 wiz 7030: <span class="quote">“<span class="quote">show-host-specific-pkgs</span>”</span> target.</p></dd>
1.1 dsieger 7031: <dt><span class="term">show-installed-depends</span></dt>
7032: <dd><p>This target shows which installed packages match
7033: the current package's <code class="varname">DEPENDS</code>. Useful
7034: if out of date dependencies are causing build
7035: problems.</p></dd>
1.95 wiz 7036: <dt><span class="term">print-build-depends-list</span></dt>
7037: <dd><p>This target shows the list of packages that the current package
7038: depends on for building.</p></dd>
7039: <dt><span class="term">print-run-depends-list</span></dt>
7040: <dd><p>This target shows the list of packages that the current package
7041: depends on for running.</p></dd>
1.1 dsieger 7042: <dt><span class="term">check-shlibs</span></dt>
7043: <dd><p>After a package is installed, check all its
7044: binaries and (on ELF platforms) shared libraries to see
7045: if they find the shared libs they need. Run by default
1.10 hubertf 7046: 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 7047: <dt><span class="term">print-PLIST</span></dt>
7048: <dd>
1.23 wiz 7049: <p>After a <span class="quote">“<span class="quote">make install</span>”</span> from a new or
1.1 dsieger 7050: upgraded pkg, this prints out an attempt to generate a
1.10 hubertf 7051: new <code class="filename">PLIST</code> from a <span class="command"><strong>find
1.1 dsieger 7052: -newer work/.extract_done</strong></span>. An attempt is made
7053: to care for shared libs etc., but it is
7054: <span class="emphasis"><em>strongly</em></span> recommended to review the
7055: result before putting it into
7056: <code class="filename">PLIST</code>. On upgrades, it's useful to
7057: diff the output of this command against an already
7058: existing <code class="filename">PLIST</code> file.</p>
1.174 leot 7059: <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 7060: other methods that don't update file access times, be
7061: sure to add these files manually to your
1.23 wiz 7062: <code class="filename">PLIST</code>, as the <span class="quote">“<span class="quote">find
7063: -newer</span>”</span> command used by this target won't catch
1.1 dsieger 7064: them!</p>
1.154 rillig 7065: <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 7066: information on this target.</p>
7067: </dd>
7068: </dl></div>
7069: </div>
7070: </div>
1.41 asau 7071: <div class="chapter">
1.1 dsieger 7072: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 7073: <a name="tools"></a>Chapter 20. Tools needed for building or running</h2></div></div></div>
1.1 dsieger 7074: <div class="toc">
7075: <p><b>Table of Contents</b></p>
1.100 leot 7076: <dl class="toc">
1.154 rillig 7077: <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt>
7078: <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt>
7079: <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt>
1.1 dsieger 7080: </dl>
7081: </div>
7082: <p>The <code class="varname">USE_TOOLS</code> definition is used both internally
7083: by pkgsrc and also for individual packages to define what commands
1.156 leot 7084: are needed for building a package (like <code class="varname">TOOL_DEPENDS</code>)
1.1 dsieger 7085: or for later run-time of an installed packaged (such as
7086: <code class="varname">DEPENDS</code>).
7087: If the native system provides an adequate tool, then in many cases, a pkgsrc
7088: package will not be used.</p>
7089: <p>When building a package, the replacement tools are
7090: made available in a directory (as symlinks or wrapper scripts)
7091: that is early in the executable search path. Just like the buildlink
7092: system, this helps with consistent builds.</p>
7093: <p>A tool may be needed to help build a specific package. For example,
7094: perl, GNU make (gmake) or yacc may be needed.</p>
7095: <p>Also a tool may be needed, for example, because the native system's supplied
7096: tool may be inefficient for building a package with pkgsrc.
7097: For example, a package may need GNU awk, bison (instead of
7098: yacc) or a better sed.</p>
7099: <p>The tools used by a package can be listed by running
1.10 hubertf 7100: <span class="command"><strong>make show-tools</strong></span>.</p>
1.41 asau 7101: <div class="sect1">
1.1 dsieger 7102: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7103: <a name="pkgsrc-tools"></a>20.1. Tools for pkgsrc builds</h2></div></div></div>
1.1 dsieger 7104: <p>The default set of tools used by pkgsrc is defined in
7105: <code class="filename">bsd.pkg.mk</code>. This includes standard Unix tools,
1.10 hubertf 7106: such as: <span class="command"><strong>cat</strong></span>, <span class="command"><strong>awk</strong></span>,
7107: <span class="command"><strong>chmod</strong></span>, <span class="command"><strong>test</strong></span>, and so on.
1.1 dsieger 7108: These can be seen by running:
1.10 hubertf 7109: <span class="command"><strong>make show-var VARNAME=USE_TOOLS</strong></span>.</p>
1.1 dsieger 7110: <p>If a package needs a specific program to build
7111: then the <code class="varname">USE_TOOLS</code> variable can be used
7112: to define the tools needed.</p>
7113: </div>
1.41 asau 7114: <div class="sect1">
1.1 dsieger 7115: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7116: <a name="package-tools"></a>20.2. Tools needed by packages</h2></div></div></div>
1.28 wiz 7117: <p>In the following examples, the :run means that it is needed at
7118: run-time (and becomes a DEPENDS).
1.1 dsieger 7119: The default is a build dependency which can be set with
7120: :build. (So in this example, it is the same as gmake:build
7121: and pkg-config:build.)</p>
7122: <pre class="programlisting">
7123: USE_TOOLS+= gmake perl:run pkg-config
7124: </pre>
7125: <p>When using the tools framework, a
7126: <code class="varname">TOOLS_PATH.foo</code> variable is defined
7127: which contains the full path to the appropriate tool. For example,
1.23 wiz 7128: <code class="varname">TOOLS_PATH.bash</code> could be <span class="quote">“<span class="quote">/bin/bash</span>”</span>
1.1 dsieger 7129: on Linux systems.</p>
7130: <p>If you always need a pkgsrc version of the
7131: tool at run-time, then just use <code class="varname">DEPENDS</code> instead.
7132: </p>
7133: </div>
1.41 asau 7134: <div class="sect1">
1.1 dsieger 7135: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7136: <a name="platform-tools"></a>20.3. Tools provided by platforms</h2></div></div></div>
1.1 dsieger 7137: <p>When improving or porting pkgsrc to a new platform, have a look
7138: at (or create) the corresponding platform specific make file fragment under
7139: <code class="filename">pkgsrc/mk/tools/tools.${OPSYS}.mk</code> which defines
7140: the name of the common tools. For example:</p>
7141: <pre class="programlisting">
7142: .if exists(/usr/bin/bzcat)
7143: TOOLS_PLATFORM.bzcat?= /usr/bin/bzcat
7144: .elif exists(/usr/bin/bzip2)
7145: TOOLS_PLATFORM.bzcat?= /usr/bin/bzip2 -cd
7146: .endif
7147:
7148: TOOLS_PLATFORM.true?= true # shell builtin
7149: </pre>
7150: </div>
7151: </div>
1.41 asau 7152: <div class="chapter">
1.1 dsieger 7153: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 7154: <a name="fixes"></a>Chapter 21. Making your package work</h2></div></div></div>
1.1 dsieger 7155: <div class="toc">
7156: <p><b>Table of Contents</b></p>
1.100 leot 7157: <dl class="toc">
1.154 rillig 7158: <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt>
1.1 dsieger 7159: <dd><dl>
1.154 rillig 7160: <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>
7161: <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt>
7162: <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt>
7163: <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt>
7164: <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt>
7165: <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt>
7166: <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt>
7167: <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt>
7168: <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt>
7169: <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt>
7170: <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt>
7171: </dl></dd>
7172: <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
7173: <dd><dl>
7174: <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt>
7175: <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>
7176: <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt>
7177: </dl></dd>
7178: <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
7179: <dd><dl>
7180: <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt>
7181: <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt>
7182: <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt>
7183: </dl></dd>
7184: <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt>
7185: <dd><dl>
7186: <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt>
7187: <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt>
7188: <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt>
7189: <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt>
7190: <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt>
7191: </dl></dd>
7192: <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
7193: <dd><dl>
7194: <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt>
7195: <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt>
1.172 rillig 7196: <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt>
7197: <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>
7198: <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt>
1.154 rillig 7199: </dl></dd>
7200: <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
7201: <dd><dl>
7202: <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt>
7203: <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt>
7204: <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt>
7205: <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt>
7206: <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt>
7207: <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt>
7208: <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt>
7209: <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt>
7210: <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt>
7211: <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt>
7212: <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt>
7213: <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt>
7214: <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt>
7215: <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt>
7216: <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt>
7217: <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt>
7218: <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt>
7219: <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in
1.1 dsieger 7220: emulation</a></span></dt>
1.154 rillig 7221: <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt>
7222: <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt>
1.1 dsieger 7223: </dl></dd>
1.154 rillig 7224: <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt>
1.1 dsieger 7225: </dl>
7226: </div>
1.41 asau 7227: <div class="sect1">
1.1 dsieger 7228: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7229: <a name="general-operation"></a>21.1. General operation</h2></div></div></div>
1.1 dsieger 7230: <p>One appealing feature of pkgsrc is that it runs on many
1.108 rillig 7231: different platforms. As a result, it is important to ensure,
7232: where possible, that packages in pkgsrc are portable. This
7233: chapter mentions some particular details you should pay
7234: attention to while working on pkgsrc.</p>
1.41 asau 7235: <div class="sect2">
1.1 dsieger 7236: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7237: <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 7238: </h3></div></div></div>
7239: <p>The pkgsrc user can configure pkgsrc by overriding several
7240: variables in the file pointed to by <code class="varname">MAKECONF</code>,
1.10 hubertf 7241: which is <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> by default. When you
1.1 dsieger 7242: want to use those variables in the preprocessor directives of
1.174 leot 7243: <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 7244: <code class="literal">.for</code>), you need to include the file
7245: <code class="filename">../../mk/bsd.prefs.mk</code> before, which in turn
7246: loads the user preferences.</p>
7247: <p>But note that some variables may not be completely defined
7248: after <code class="filename">../../mk/bsd.prefs.mk</code> has been
7249: included, as they may contain references to variables that are
1.108 rillig 7250: not yet defined. In shell commands (the lines in
7251: <code class="filename">Makefile</code> that are indented with a tab) this
7252: is no problem, since variables are only expanded when they are
7253: used. But in the preprocessor directives mentioned above and in
7254: dependency lines (of the form <code class="literal">target:
1.1 dsieger 7255: dependencies</code>) the variables are expanded at load
7256: time.</p>
1.41 asau 7257: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 7258: <h3 class="title">Note</h3>
1.108 rillig 7259: <p>To check whether a variable can be used at load time,
7260: run <span class="command"><strong>pkglint -Wall</strong></span> on your package.</p>
1.1 dsieger 7261: </div>
7262: </div>
1.41 asau 7263: <div class="sect2">
1.1 dsieger 7264: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7265: <a name="user-interaction"></a>21.1.2. User interaction</h3></div></div></div>
1.1 dsieger 7266: <p>Occasionally, packages require interaction from the user,
7267: and this can be in a number of ways:</p>
1.41 asau 7268: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 7269: <li class="listitem"><p>When fetching the distfiles, some packages require user
1.1 dsieger 7270: interaction such as entering username/password or accepting a
7271: license on a web page.</p></li>
1.23 wiz 7272: <li class="listitem"><p>When extracting the distfiles, some packages may ask for
1.1 dsieger 7273: passwords.</p></li>
1.23 wiz 7274: <li class="listitem"><p>help to configure the package before it is built</p></li>
7275: <li class="listitem"><p>help during the build process</p></li>
7276: <li class="listitem"><p>help during the installation of a package</p></li>
1.1 dsieger 7277: </ul></div>
1.108 rillig 7278: <p>A package can set the <code class="varname">INTERACTIVE_STAGE</code>
7279: variable to define which stages need interaction. This should be
7280: done in the package's <code class="filename">Makefile</code>, e.g.:</p>
1.1 dsieger 7281: <pre class="programlisting">
7282: INTERACTIVE_STAGE= configure install
1.111 sevan 7283: </pre>
1.1 dsieger 7284: <p>The user can then decide to skip this package by setting the
1.108 rillig 7285: <code class="varname">BATCH</code> variable. Packages that require interaction
7286: are also excluded from bulk builds.</p>
1.1 dsieger 7287: </div>
1.41 asau 7288: <div class="sect2">
1.1 dsieger 7289: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7290: <a name="handling-licenses"></a>21.1.3. Handling licenses</h3></div></div></div>
1.111 sevan 7291: <p>Authors of software can choose the licence under which software
7292: can be copied. The Free Software Foundation has declared some
7293: licenses "Free", and the Open Source Initiative has a definition of
7294: "Open Source".</p>
7295: <p>By default, pkgsrc allows packages with Free or Open Source
7296: licenses to be built. To allow packages with other licenses to be
7297: built as well, the pkgsrc user needs to add these licenses to the
7298: <code class="varname">ACCEPTABLE_LICENSES</code> variable in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. Note
7299: that this variable only affects which packages may be
7300: <span class="emphasis"><em>built</em></span>, while the license terms often also
7301: restrict the actual use of the package and its redistribution.</p>
1.1 dsieger 7302: <p>One might want to only install packages with a BSD license,
1.108 rillig 7303: or the GPL, and not the other. The free licenses are added to the
1.111 sevan 7304: default <code class="varname">ACCEPTABLE_LICENSES</code> variable. The pkgsrc
1.19 jnemeth 7305: user can override the default by setting the
7306: <code class="varname">ACCEPTABLE_LICENSES</code> variable with "=" instead
1.111 sevan 7307: of "+=". The licenses accepted by default are defined in the
7308: <code class="varname">DEFAULT_ACCEPTABLE_LICENSES</code> variable in the file
7309: <code class="filename">pkgsrc/mk/license.mk</code>.</p>
1.1 dsieger 7310: <p>The license tag mechanism is intended to address
7311: copyright-related issues surrounding building, installing and
7312: using a package, and not to address redistribution issues (see
7313: <code class="varname">RESTRICTED</code> and
1.111 sevan 7314: <code class="varname">NO_SRC_ON_FTP</code>, etc.).
1.19 jnemeth 7315: Packages with redistribution restrictions should set these
7316: tags.</p>
1.1 dsieger 7317: <p>Denoting that a package may be copied according to a
7318: particular license is done by placing the license in
7319: <code class="filename">pkgsrc/licenses</code> and setting the
7320: <code class="varname">LICENSE</code> variable to a string identifying the
1.137 leot 7321: 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 7322: <pre class="programlisting">
7323: LICENSE= xv-license
1.111 sevan 7324: </pre>
1.1 dsieger 7325: <p>When trying to build, the user will get a notice that the
7326: package is covered by a license which has not been placed in the
7327: <code class="varname">ACCEPTABLE_LICENSES</code> variable:</p>
7328: <pre class="programlisting">
7329: <code class="prompt">%</code> <strong class="userinput"><code>make</code></strong>
7330: ===> xv-3.10anb9 has an unacceptable license: xv-license.
7331: ===> To view the license, enter "/usr/bin/make show-license".
7332: ===> To indicate acceptance, add this line to your /etc/mk.conf:
7333: ===> ACCEPTABLE_LICENSES+=xv-license
7334: *** Error code 1
1.111 sevan 7335: </pre>
1.10 hubertf 7336: <p>The license can be viewed with <span class="command"><strong>make
1.1 dsieger 7337: show-license</strong></span>, and if the user so chooses, the line
1.10 hubertf 7338: printed above can be added to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to
1.1 dsieger 7339: convey to pkgsrc that it should not in the future fail because of
7340: that license:</p>
7341: <pre class="programlisting">
7342: ACCEPTABLE_LICENSES+=xv-license
1.111 sevan 7343: </pre>
7344: <p>The use of <code class="varname">LICENSE=shareware</code>,
7345: <code class="varname">LICENSE=no-commercial-use</code>, and similar language
7346: is deprecated because it does not crisply refer to a particular
7347: license text. Another problem with such usage is that it does not
7348: enable a user to tell pkgsrc to proceed for a single package
7349: without also telling pkgsrc to proceed for all packages with that
7350: tag.</p>
7351: <div class="sect3">
7352: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 7353: <a name="new-license"></a>21.1.3.1. Adding a package with a new license</h4></div></div></div>
1.48 rodent 7354: <p>When adding a package with a new license, the following steps
7355: are required:</p>
7356: <div class="orderedlist"><ol class="orderedlist" type="1">
7357: <li class="listitem">
1.169 rillig 7358: <p>Check whether the license qualifies as Free or Open Source by
7359: referencing <a class="ulink" href="https://www.gnu.org/licenses/license-list.en.html" target="_top">Various
7360: Licenses and Comments about Them</a> and <a class="ulink" href="https://opensource.org/licenses/alphabetical" target="_top">Licenses by Name |
1.111 sevan 7361: Open Source Initiative</a>. If this is the case, the filename in
7362: <code class="filename">pkgsrc/licenses/</code> does not need the
7363: <code class="filename">-license</code> suffix, and the license name should be
7364: added to:</p>
1.48 rodent 7365: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.169 rillig 7366: <li class="listitem"><p>DEFAULT_ACCEPTABLE_LICENSES in
7367: <code class="filename">pkgsrc/mk/license.mk</code></p></li>
7368: <li class="listitem"><p>default_acceptable_licenses in
7369: <code class="filename">pkgsrc/pkgtools/pkg_install/files/lib/license.c</code></p></li>
1.48 rodent 7370: </ul></div>
7371: </li>
1.169 rillig 7372: <li class="listitem"><p>The license text should be added to
7373: <code class="filename">pkgsrc/licenses</code> for displaying. A list of known
7374: licenses can be seen in this directory.</p></li>
1.48 rodent 7375: </ol></div>
1.111 sevan 7376: </div>
7377: <div class="sect3">
7378: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 7379: <a name="change-license"></a>21.1.3.2. Change to the license</h4></div></div></div>
1.1 dsieger 7380: <p>When the license changes (in a way other than formatting),
1.111 sevan 7381: make sure that the new license has a different name (e.g.,
1.1 dsieger 7382: append the version number if it exists, or the date). Just
7383: because a user told pkgsrc to build programs under a previous
7384: version of a license does not mean that pkgsrc should build
7385: programs under the new licenses. The higher-level point is that
7386: pkgsrc does not evaluate licenses for reasonableness; the only
7387: test is a mechanistic test of whether a particular text has been
1.111 sevan 7388: approved by either of two bodies (FSF or OSI).</p>
7389: </div>
1.1 dsieger 7390: </div>
1.41 asau 7391: <div class="sect2">
1.1 dsieger 7392: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7393: <a name="restricted-packages"></a>21.1.4. Restricted packages</h3></div></div></div>
1.1 dsieger 7394: <p>Some licenses restrict how software may be re-distributed.
1.111 sevan 7395: By declaring the restrictions, package tools can
1.1 dsieger 7396: automatically refrain from e.g. placing binary packages on FTP
7397: sites.</p>
1.111 sevan 7398: <p>There are four possible restrictions, which are
1.1 dsieger 7399: the cross product of sources (distfiles) and binaries not being
7400: placed on FTP sites and CD-ROMs. Because this is rarely the exact
7401: language in any license, and because non-Free licenses tend to be
7402: different from each other, pkgsrc adopts a definition of FTP and
1.111 sevan 7403: CD-ROM.
7404:
7405: "FTP" means making the source or binary file available over the
7406: Internet at no charge.
7407:
7408: "CD-ROM" means making the source or binary available on some kind of
7409: media, together with other source and binary packages, which is sold
7410: for a distribution charge.
1.1 dsieger 7411: </p>
7412: <p>In order to encode these restrictions, the package system
7413: defines five make variables that can be set to note these
7414: restrictions:</p>
1.41 asau 7415: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 7416: <li class="listitem">
1.1 dsieger 7417: <p><code class="varname">RESTRICTED</code></p>
7418: <p>This variable should be set whenever a restriction
7419: exists (regardless of its kind). Set this variable to a
7420: string containing the reason for the restriction. It should
7421: be understood that those wanting to understand the restriction
7422: will have to read the license, and perhaps seek advice of
7423: counsel.</p>
7424: </li>
1.23 wiz 7425: <li class="listitem">
1.1 dsieger 7426: <p><code class="varname">NO_BIN_ON_CDROM</code></p>
7427: <p>Binaries may not be placed on CD-ROM containing other
7428: binary packages, for which a distribution charge may be made.
7429: In this case, set this variable to
7430: <code class="varname">${RESTRICTED}</code>.</p>
7431: </li>
1.23 wiz 7432: <li class="listitem">
1.1 dsieger 7433: <p><code class="varname">NO_BIN_ON_FTP</code></p>
7434: <p>Binaries may not made available on the Internet without
7435: charge. In this case, set this variable to
7436: <code class="varname">${RESTRICTED}</code>. If this variable is set,
7437: binary packages will not be included on ftp.NetBSD.org.</p>
7438: </li>
1.23 wiz 7439: <li class="listitem">
1.1 dsieger 7440: <p><code class="varname">NO_SRC_ON_CDROM</code></p>
7441: <p>Distfiles may not be placed on CD-ROM, together with
7442: other distfiles, for which a fee may be charged. In this
7443: case, set this variable to <code class="varname">${RESTRICTED}</code>.
7444: </p>
7445: </li>
1.23 wiz 7446: <li class="listitem">
1.1 dsieger 7447: <p><code class="varname">NO_SRC_ON_FTP</code></p>
7448: <p>Distfiles may not made available via FTP at no charge.
7449: In this case, set this variable to
7450: <code class="varname">${RESTRICTED}</code>. If this variable is set,
7451: the distfile(s) will not be mirrored on ftp.NetBSD.org.</p>
7452: </li>
7453: </ul></div>
1.111 sevan 7454: <p>Please note that packages will be removed from pkgsrc when the
7455: distfiles are not distributable and cannot be obtained for a period
7456: of one full quarter branch. Packages with manual/interactive fetch
7457: must have a maintainer and it is his/her responsibility to ensure
7458: this.</p>
1.1 dsieger 7459: </div>
1.41 asau 7460: <div class="sect2">
1.1 dsieger 7461: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7462: <a name="dependencies"></a>21.1.5. Handling dependencies</h3></div></div></div>
1.175 gutterid 7463: <p>Your package may depend on some other package being present,
7464: and there are various ways of expressing this dependency.
7465: pkgsrc supports the <code class="varname">DEPENDS</code>,
7466: <code class="varname">BUILD_DEPENDS</code>,
7467: <code class="varname">TOOL_DEPENDS</code>, and
7468: <code class="varname">TEST_DEPENDS</code> definitions, the
1.1 dsieger 7469: <code class="varname">USE_TOOLS</code> definition, as well as dependencies
7470: via <code class="filename">buildlink3.mk</code>, which is the preferred way
7471: to handle dependencies, and which uses the variables named above.
1.154 rillig 7472: 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 7473: <p>The basic difference is that the <code class="varname">DEPENDS</code>
7474: definition registers that pre-requisite in the binary package so it
7475: will be pulled in when the binary package is later installed, whilst
7476: the <code class="varname">BUILD_DEPENDS</code>, <code class="varname">TOOL_DEPENDS</code>,
7477: and <code class="varname">TEST_DEPENDS</code> definitions do not, marking a
7478: dependency that is only needed for building or testing the resulting
7479: 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 7480: <p>This means that if you only need a package present whilst
1.175 gutterid 7481: you are building or testing, it should be noted as a
7482: <code class="varname">TOOL_DEPENDS</code>,
7483: <code class="varname">BUILD_DEPENDS</code>, or
7484: <code class="varname">TEST_DEPENDS</code>. When cross-compiling,
1.156 leot 7485: <code class="varname">TOOL_DEPENDS</code> are <span class="emphasis"><em>native</em></span>
7486: packages, i.e. packages for the architecture where the package
7487: is built;
7488: <code class="varname">BUILD_DEPENDS</code> are <span class="emphasis"><em>target</em></span>
1.175 gutterid 7489: packages, i.e., packages for the architecture for which the package
1.156 leot 7490: is built.</p>
1.175 gutterid 7491: <p>The format for a <code class="varname">DEPENDS</code>,
7492: <code class="varname">BUILD_DEPENDS</code>, <code class="varname">TOOL_DEPENDS</code>,
7493: and <code class="varname">TEST_DEPENDS</code> definition is:</p>
1.1 dsieger 7494: <pre class="programlisting">
7495: <pre-req-package-name>:../../<category>/<pre-req-package>
1.111 sevan 7496: </pre>
1.23 wiz 7497: <p>Please note that the <span class="quote">“<span class="quote">pre-req-package-name</span>”</span>
1.1 dsieger 7498: may include any of the wildcard version numbers recognized by
1.174 leot 7499: <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 7500: <div class="orderedlist"><ol class="orderedlist" type="1">
7501: <li class="listitem">
1.1 dsieger 7502: <p>If your package needs another package's binaries or
1.54 wiz 7503: libraries to build and run, and if that package has a
1.1 dsieger 7504: <code class="filename">buildlink3.mk</code> file available, use it:</p>
7505: <pre class="programlisting">
7506: .include "../../graphics/jpeg/buildlink3.mk"
1.111 sevan 7507: </pre>
1.1 dsieger 7508: </li>
1.23 wiz 7509: <li class="listitem">
1.54 wiz 7510: <p>If your package needs another package's binaries or
7511: libraries only for building, and if that package has a
7512: <code class="filename">buildlink3.mk</code> file available, use it:</p>
7513: <pre class="programlisting">
7514: .include "../../graphics/jpeg/buildlink3.mk"
1.111 sevan 7515: </pre>
1.54 wiz 7516: <p>but set
7517: <code class="varname">BUILDLINK_DEPMETHOD.<em class="replaceable"><code>jpeg</code></em>?=build</code>
7518: to make it a build dependency only. This case is rather
7519: rare.</p>
7520: </li>
7521: <li class="listitem">
1.25 spz 7522: <p>If your package needs binaries from another package to build,
1.156 leot 7523: use the <code class="varname">TOOL_DEPENDS</code> definition:</p>
1.1 dsieger 7524: <pre class="programlisting">
1.156 leot 7525: TOOL_DEPENDS+= itstool-[0-9]*:../../textproc/itstool
1.111 sevan 7526: </pre>
1.1 dsieger 7527: </li>
1.156 leot 7528: <li class="listitem"><p>If your package needs static libraries to link against, header
7529: files to include, etc. from another package to build,
7530: use the <code class="varname">BUILD_DEPENDS</code> definition.</p></li>
1.25 spz 7531: <li class="listitem"><p>If your package needs a library with which to link and
7532: there is no <code class="filename">buildlink3.mk</code> file
7533: available, create one. Using
7534: <code class="varname">DEPENDS</code> won't be sufficient because the
7535: include files and libraries will be hidden from the compiler.</p></li>
1.23 wiz 7536: <li class="listitem">
1.25 spz 7537: <p>If your package needs some executable to be able to run
7538: correctly and if there's no
7539: <code class="filename">buildlink3.mk</code> file, this is specified
7540: using the <code class="varname">DEPENDS</code> variable. The
1.137 leot 7541: <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 7542: be able to execute the latex binary from the tex-latex-bin package
1.25 spz 7543: when it runs, and that is specified:</p>
1.1 dsieger 7544: <pre class="programlisting">
1.129 wiz 7545: DEPENDS+= tex-latex-bin-[0-9]*:../../print/tex-latex-bin
1.111 sevan 7546: </pre>
1.25 spz 7547: </li>
1.175 gutterid 7548: <li class="listitem"><p>If your package includes a test suite that has extra
7549: dependencies only required for this purpose (frequently this
7550: can be run as a <span class="quote">“<span class="quote">make test</span>”</span> target), use the
7551: <code class="varname">TEST_DEPENDS</code> variable.</p></li>
1.25 spz 7552: <li class="listitem">
7553: <p>You can use wildcards in package dependencies. Note that
7554: such wildcard dependencies are retained when creating binary
7555: packages. The dependency is checked when installing the binary
7556: package and any package which matches the pattern will be
7557: used. Wildcard dependencies should be used with care.</p>
1.23 wiz 7558: <p>The <span class="quote">“<span class="quote">-[0-9]*</span>”</span> should be used instead of
7559: <span class="quote">“<span class="quote">-*</span>”</span> to avoid potentially ambiguous matches
7560: such as <span class="quote">“<span class="quote">tk-postgresql</span>”</span> matching a
7561: <span class="quote">“<span class="quote">tk-*</span>”</span> <code class="varname">DEPENDS</code>.</p>
1.1 dsieger 7562: <p>Wildcards can also be used to specify that a package
7563: will only build against a certain minimum version of a
7564: pre-requisite:</p>
7565: <pre class="programlisting">
1.25 spz 7566: DEPENDS+= ImageMagick>=6.0:../../graphics/ImageMagick
1.111 sevan 7567: </pre>
1.25 spz 7568: <p>This means that the package will build using version 6.0
7569: of ImageMagick or newer. Such a dependency may be warranted
7570: if, for example, the command line options of an executable
7571: have changed.</p>
7572: <p>If you need to depend on minimum versions of libraries,
1.183 ! wiz 7573: set
! 7574: <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
! 7575: to the appropriate pattern before including its
! 7576: <code class="filename">buildlink3.mk</code> file, e.g.</p>
! 7577: <pre class="programlisting">
! 7578: BUILDLINK_API_DEPENDS.jpeg+= jpeg>=9.0
! 7579: .include "../../graphics/jpeg/buildlink3.mk"
! 7580: </pre>
1.1 dsieger 7581: <p>For security fixes, please update the package
1.154 rillig 7582: 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 7583: information.</p>
7584: </li>
7585: </ol></div>
7586: <p>If your package needs files from another package to build,
7587: add the relevant distribution files to
7588: <code class="varname">DISTFILES</code>, so they will be extracted
1.137 leot 7589: 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 7590: (It relies on the jpeg sources being present in source form
7591: during the build.)</p>
7592: </div>
1.41 asau 7593: <div class="sect2">
1.1 dsieger 7594: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7595: <a name="conflicts"></a>21.1.6. Handling conflicts with other packages</h3></div></div></div>
1.1 dsieger 7596: <p>Your package may conflict with other packages a user might
7597: already have installed on his system, e.g. if your package
7598: installs the same set of files as another package in the pkgsrc
1.80 wiz 7599: tree or has the same <code class="varname">PKGNAME</code>.</p>
1.142 leot 7600: <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>
7601: 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>
7602: install the same shared library, thus you set in
7603: <code class="filename">pkgsrc/x11/libXaw3d/Makefile</code>:</p>
7604: <pre class="programlisting">
7605: CONFLICTS= Xaw-Xpm-[0-9]*
7606: </pre>
7607: <p>and in <code class="filename">pkgsrc/x11/Xaw-Xpm/Makefile</code>:</p>
7608: <pre class="programlisting">
7609: CONFLICTS= libXaw3d-[0-9]*
7610: </pre>
1.174 leot 7611: <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 7612: that conflict with existing packages and abort. However, in many
7613: situations this is too late in the process. Binary package managers
7614: will not know about the conflict until they attempt to install the
7615: package after already downloading it and all its dependencies.
7616: Users may also waste time building a package and its dependencies
7617: only to find out at the end that it conflicts with another package
7618: they have installed.</p>
7619: <p>To avoid these issues <code class="varname">CONFLICTS</code> entries
7620: should be added in all cases where it is known that packages conflict
7621: with each other. These <code class="varname">CONFLICTS</code> entries are
1.174 leot 7622: 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 7623: managers to inform users that packages cannot be installed onto
7624: the target system.</p>
1.1 dsieger 7625: </div>
1.41 asau 7626: <div class="sect2">
1.1 dsieger 7627: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7628: <a name="not-building-packages"></a>21.1.7. Packages that cannot or should not be built</h3></div></div></div>
1.1 dsieger 7629: <p>There are several reasons why a package might be
7630: instructed to not build under certain circumstances. If the
7631: package builds and runs on most platforms, the exceptions
1.83 dholland 7632: should be noted with <code class="varname">BROKEN_ON_PLATFORM</code>. If
7633: the package builds and runs on a small handful of platforms,
7634: set <code class="varname">BROKEN_EXCEPT_ON_PLATFORM</code> instead.
7635: Both <code class="varname">BROKEN_ON_PLATFORM</code> and
7636: <code class="varname">BROKEN_EXCEPT_ON_PLATFORM</code> are OS triples
7637: (OS-version-platform) that can use glob-style
7638: wildcards.</p>
7639: <p>If a package is not appropriate for some platforms (as
1.114 maya 7640: opposed to merely broken), a different set of variables should be
1.83 dholland 7641: used as this affects failure reporting and statistics.
7642: If the package is appropriate for most platforms, the exceptions
1.1 dsieger 7643: should be noted with <code class="varname">NOT_FOR_PLATFORM</code>. If
1.83 dholland 7644: the package is appropriate for only a small handful of platforms
7645: (often exactly one), set <code class="varname">ONLY_FOR_PLATFORM</code> instead.
1.1 dsieger 7646: Both <code class="varname">ONLY_FOR_PLATFORM</code> and
7647: <code class="varname">NOT_FOR_PLATFORM</code> are OS triples
7648: (OS-version-platform) that can use glob-style
7649: wildcards.</p>
7650: <p>Some packages are tightly bound to a specific version of an
1.137 leot 7651: 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 7652: backwards compatible with other versions of the OS, and should be
7653: uploaded to a version specific directory on the FTP server. Mark
7654: these packages by setting <code class="varname">OSVERSION_SPECIFIC</code> to
1.23 wiz 7655: <span class="quote">“<span class="quote">yes</span>”</span>. This variable is not currently used by any of
1.1 dsieger 7656: the package system internals, but may be used in the
7657: future.</p>
7658: <p>If the package should be skipped (for example, because it
7659: provides functionality already provided by the system), set
7660: <code class="varname">PKG_SKIP_REASON</code> to a descriptive message. If
7661: the package should fail because some preconditions are not met,
7662: set <code class="varname">PKG_FAIL_REASON</code> to a descriptive
7663: message.</p>
7664: </div>
1.41 asau 7665: <div class="sect2">
1.1 dsieger 7666: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7667: <a name="undeletable-packages"></a>21.1.8. Packages which should not be deleted, once installed</h3></div></div></div>
1.1 dsieger 7668: <p>To ensure that a package may not be deleted, once it has been
7669: installed, the <code class="varname">PKG_PRESERVE</code> definition should
7670: be set in the package Makefile. This will be carried into any
7671: binary package that is made from this pkgsrc entry. A
1.23 wiz 7672: <span class="quote">“<span class="quote">preserved</span>”</span> package will
1.174 leot 7673: 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 7674: <span class="quote">“<span class="quote">-f</span>”</span> option is used.</p>
1.1 dsieger 7675: </div>
1.41 asau 7676: <div class="sect2">
1.1 dsieger 7677: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7678: <a name="security-handling"></a>21.1.9. Handling packages with security problems</h3></div></div></div>
1.1 dsieger 7679: <p>When a vulnerability is found, this should be noted in
7680: <code class="filename">localsrc/security/advisories/pkg-vulnerabilities</code>,
1.31 wiz 7681: and after committing that file, ask pkgsrc-security@NetBSD.org to
7682: update the file on ftp.NetBSD.org.</p>
1.1 dsieger 7683: <p>After fixing the vulnerability by a patch, its
1.31 wiz 7684: <code class="varname">PKGREVISION</code> should be increased (this is of
7685: course not necessary if the problem is fixed by using a newer
7686: release of the software), and the pattern in the
7687: pkg-vulnerabilities file must be updated.</p>
1.1 dsieger 7688: <p>Also, if the fix should be applied to the stable pkgsrc
7689: branch, be sure to submit a pullup request!</p>
7690: <p>Binary packages already on ftp.NetBSD.org will be handled
7691: semi-automatically by a weekly cron job.</p>
7692: </div>
1.41 asau 7693: <div class="sect2">
1.1 dsieger 7694: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7695: <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 7696: <p>When making fixes to an existing package it can be useful
7697: to change the version number in <code class="varname">PKGNAME</code>. To
7698: avoid conflicting with future versions by the original author, a
1.23 wiz 7699: <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 7700: on package versions by setting <code class="varname">PKGREVISION=1</code>
1.23 wiz 7701: (2, ...). The <span class="quote">“<span class="quote">nb</span>”</span> is treated like a
7702: <span class="quote">“<span class="quote">.</span>”</span> by the package tools. e.g.</p>
1.1 dsieger 7703: <pre class="programlisting">
7704: DISTNAME= foo-17.42
7705: PKGREVISION= 9
1.111 sevan 7706: </pre>
1.1 dsieger 7707: <p>will result in a <code class="varname">PKGNAME</code> of
1.23 wiz 7708: <span class="quote">“<span class="quote">foo-17.42nb9</span>”</span>. If you want to use the original
7709: value of <code class="varname">PKGNAME</code> without the <span class="quote">“<span class="quote">nbX</span>”</span>
1.1 dsieger 7710: suffix, e.g. for setting <code class="varname">DIST_SUBDIR</code>, use
7711: <code class="varname">PKGNAME_NOREV</code>.</p>
7712: <p>When a new release of the package is released, the
7713: <code class="varname">PKGREVISION</code> should be removed, e.g. on a new
7714: minor release of the above package, things should be like:</p>
7715: <pre class="programlisting">
7716: DISTNAME= foo-17.43
1.111 sevan 7717: </pre>
1.1 dsieger 7718: <p><code class="varname">PKGREVISION</code> should be incremented for any
7719: non-trivial change in the resulting binary package. Without a
7720: <code class="varname">PKGREVISION</code> bump, someone with the previous
7721: version installed has no way of knowing that their package is out
7722: of date. Thus, changes without increasing
7723: <code class="varname">PKGREVISION</code> are essentially labeled "this is so
7724: trivial that no reasonable person would want to upgrade", and this
7725: is the rough test for when increasing
7726: <code class="varname">PKGREVISION</code> is appropriate. Examples of
7727: changes that do not merit increasing
7728: <code class="varname">PKGREVISION</code> are:</p>
1.41 asau 7729: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 7730: <li class="listitem"><p>Changing <code class="varname">HOMEPAGE</code>,
1.169 rillig 7731: <code class="varname">MAINTAINER</code>, <code class="varname">OWNER</code>, or
7732: comments in Makefile.</p></li>
7733: <li class="listitem"><p>Changing build variables if the resulting binary
7734: package is the same.</p></li>
7735: <li class="listitem"><p>Changing
7736: <code class="filename">DESCR</code>.</p></li>
7737: <li class="listitem"><p>Adding <code class="varname">PKG_OPTIONS</code> if the
7738: default options don't change.</p></li>
1.1 dsieger 7739: </ul></div>
7740: <p>Examples of changes that do merit an increase to
7741: <code class="varname">PKGREVISION</code> include:</p>
1.41 asau 7742: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.169 rillig 7743: <li class="listitem"><p>Security fixes</p></li>
7744: <li class="listitem"><p>Changes or additions to a patch
7745: file</p></li>
7746: <li class="listitem"><p>Changes to the
7747: <code class="filename">PLIST</code></p></li>
7748: <li class="listitem"><p>A dependency is changed or
7749: renamed.</p></li>
1.1 dsieger 7750: </ul></div>
7751: <p>PKGREVISION must also be incremented when dependencies have ABI
7752: changes.</p>
7753: </div>
1.41 asau 7754: <div class="sect2">
1.1 dsieger 7755: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7756: <a name="fixes.subst"></a>21.1.11. Substituting variable text in the package files (the SUBST framework)</h3></div></div></div>
1.180 rillig 7757: <p>When you want to replace the same text in multiple files, or
7758: multiple times in the same file, it is cumbersome to maintain a patch
7759: file for this. This is where the SUBST framework steps in. It provides an
7760: easy-to-use interface for replacing text in files. It just needs the
7761: following information:</p>
7762: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
7763: <li class="listitem"><p>In which phase of the package build cycle should the
7764: replacement happen?</p></li>
7765: <li class="listitem"><p>In which files should the replacement
1.172 rillig 7766: happen?</p></li>
1.180 rillig 7767: <li class="listitem"><p>Which text should be replaced with
7768: what?</p></li>
1.172 rillig 7769: </ul></div>
7770: <p>This information is encoded in a block of <code class="varname">SUBST</code>
1.180 rillig 7771: variables. A minimal example is:</p>
7772: <pre class="programlisting">
7773: SUBST_CLASSES+= paths
7774: SUBST_STAGE.paths= pre-configure
7775: SUBST_FILES.paths= src/*.c
7776: SUBST_SED.paths= -e 's,/usr/local,${PREFIX},g'
7777: </pre>
7778: <p>Translated into English, it means: In the pre-configure stage (that
7779: is, after applying the patches from the patches/ directory and before
7780: running the configure script and the portability check), replace the text
7781: <code class="literal">/usr/local</code> with the content of the variable
7782: <code class="varname">PREFIX</code>.</p>
7783: <p>Each SUBST block starts by appending an identifier to
7784: <code class="varname">SUBST_CLASSES</code> (note the <code class="literal">+=</code>). This
7785: identifier can be chosen freely by the package. If there should ever be
7786: duplicate identifiers, the pkgsrc infrastructure will catch this and fail
7787: early, so don't worry about name collisions.</p>
7788: <p>Except for <code class="varname">SUBST_CLASSES</code>, all variables in a
7789: SUBST block are parameterized using this identifier. In the remainder of
7790: this section, these parameterized variables are written as
7791: <code class="varname">SUBST_STAGE.*</code>.</p>
7792: <pre class="programlisting">
7793: SUBST_CLASSES+= paths
7794: SUBST_STAGE.paths= pre-configure
7795: SUBST_MESSAGE.paths= Fixing absolute paths.
7796: SUBST_FILES.paths= src/*.c
7797: SUBST_FILES.paths+= scripts/*.sh
7798: SUBST_SED.paths= -e 's,"/usr/local,"${PREFIX},g'
7799: SUBST_SED.paths+= -e 's,"/var/log,"${VARBASE}/log,g'
7800: SUBST_VARS.paths= LOCALBASE PREFIX PKGVERSION
7801: </pre>
7802: <p>To get a complete picture about the SUBST substitutions, run
7803: <span class="command"><strong>bmake show-all-subst</strong></span>. If something doesn't work as
7804: expected, run pkglint on the package, which detects several typical
7805: mistakes surrounding the SUBST blocks. For any questions that might
7806: remain after this, have a look at
7807: <code class="filename">mk/subst.mk</code>.</p>
7808: <div class="sect3">
7809: <div class="titlepage"><div><div><h4 class="title">
7810: <a name="fixes.subst.when"></a>21.1.11.1. Choosing the time where the substitutions happen</h4></div></div></div>
7811: <p>The <code class="varname">SUBST_STAGE.*</code> is one of
7812: {pre,do,post}-{extract,patch,configure,build,test,install}. Of these,
7813: <code class="literal">pre-configure</code> is used most often, by far. The most
7814: popular stages are, in chronological order:</p>
7815: <div class="variablelist"><dl class="variablelist">
7816: <dt><span class="term"><code class="literal">post-extract</code></span></dt>
7817: <dd>
7818: <p>The substitutions are applied immediately after the
7819: distfiles are extracted. Running <span class="command"><strong>bmake extract</strong></span> on the
7820: package will leave no traces of the original files.</p>
7821: <p>When the substitution applies to files for which there is also a
7822: patch in the <code class="filename">patches/</code> directory, this means that the
7823: patches will be computed based on the result of the substitution. When
7824: these patches are sent to the upstream maintainer later, to be fixed in
7825: the upstream package, these patches may no longer match what the upstream
7826: author is used to. Because of this, <code class="literal">pre-configure</code> is
7827: often a better choice.</p>
7828: </dd>
7829: <dt><span class="term"><code class="literal">pre-configure</code></span></dt>
7830: <dd>
7831: <p>The substitutions are applied after the patches from the
7832: <code class="filename">patches/</code> directory. This makes it possible to run
7833: <span class="command"><strong>bmake patch</strong></span> on the package, after which the patches
7834: can be edited using the tools pkgvi and mkpatches 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.</p>
7835: <p>When updating the patches, it is helpful to explicitly separate the
7836: <span class="command"><strong>bmake patch</strong></span> from the <span class="command"><strong>bmake
7837: configure</strong></span>, and to only edit the patches between these commands.
7838: Otherwise the substitutions from the SUBST block will end up in the patch
7839: file. When this happens in really obvious ways, pkglint will complain
7840: about patches that contain a hard-coded <code class="literal">/usr/pkg</code>
7841: instead of the correct and intended <code class="literal">@PREFIX@</code>, but it
7842: can only detect these really obvious
7843: cases.</p>
7844: </dd>
7845: <dt><span class="term"><code class="literal">do-configure</code></span></dt>
7846: <dd><p>This stage should only be used if the package defines a
7847: <code class="literal">pre-configure</code> action itself, and the substitution must
7848: happen after that. Typical examples are packages that use the
7849: <code class="literal">pre-configure</code> stage to regenerate the GNU configure
7850: script from
7851: <code class="filename">configure.ac</code>.</p></dd>
7852: <dt><span class="term"><code class="literal">post-configure</code></span></dt>
7853: <dd><p>This stage is used to fix up any mistakes by the
7854: configure stage.</p></dd>
7855: <dt><span class="term"><code class="literal">pre-build</code></span></dt>
7856: <dd><p>This stage should only be used for substitutions that are
7857: clearly related to building the package, not for fixing the
7858: configuration. Substitutions for pathnames (such as replacing
7859: <code class="filename">/usr/local</code> with <code class="literal">${PREFIX}</code>) or
7860: user names (such as replacing <code class="literal">@MY_USER@</code> with the
7861: actual username) belong in pre-configure or post-configure
7862: instead.</p></dd>
7863: <dt><span class="term"><code class="literal">post-build</code></span></dt>
7864: <dd>
7865: <p>Just as with pre-build, this stage should only be used
7866: for substitutions that are clearly related to building the package, not
7867: for fixing the configuration. Substitutions for pathnames (such as
7868: replacing <code class="filename">/usr/local</code> with
7869: <code class="literal">${PREFIX}</code>) or user names (such as replacing
7870: <code class="literal">@MY_USER@</code> with the actual username) belong in
7871: pre-configure or post-configure instead.</p>
7872: <p>A typical use is to update pkg-config files to include the rpath
7873: compiler options.</p>
7874: </dd>
7875: <dt><span class="term"><code class="literal">pre-install</code></span></dt>
7876: <dd><p>In general, the install phase should be as simple as
7877: possible. As with the pre-build and post-build stages, it should not be
7878: used to fix pathnames or user names, these belong in pre-configure
7879: instead. There are only few legitimate use cases for applying
7880: substitutions in this stage.</p></dd>
7881: </dl></div>
7882: </div>
7883: <div class="sect3">
7884: <div class="titlepage"><div><div><h4 class="title">
1.181 rillig 7885: <a name="fixes.subst.where"></a>21.1.11.2. Choosing the files where the substitutions happen</h4></div></div></div>
1.180 rillig 7886: <p>The <code class="varname">SUBST_FILES.*</code> variable contains a list of
7887: filename patterns. These patterns are relative to
7888: <code class="varname">WRKSRC</code> since that is where most substitutions happen.
7889: A typical example is:</p>
7890: <pre class="programlisting">
7891: SUBST_FILES.path= Makefile */Makefile */*/Makefile *.[ch]
7892: </pre>
7893: <p>The above patterns, especially the last, are quite broad. The SUBST
7894: implementation checks that each filename pattern that is mentioned here
7895: has an effect. For example, if none of the
7896: <code class="filename">*/*/Makefile</code> files contains the patterns to be found
7897: and substituted, that filename pattern is redundant and should be left
1.181 rillig 7898: out. By default, the SUBST framework will complain with an error message.
7899: If the text to be substituted occurs in some of the files from a single
7900: pattern, but not in all of them, that is totally ok, and the SUBST
1.180 rillig 7901: framework will only print an INFO message for those files.</p>
7902: <p>If there is a good reason for having redundant filename patterns,
1.181 rillig 7903: set <code class="varname">SUBST_NOOP_OK.*</code> to <code class="literal">yes</code>.</p>
1.180 rillig 7904: <p>Another popular way of choosing the files for the substitutions is
7905: via a shell command, like this:</p>
7906: <pre class="programlisting">
1.181 rillig 7907: C_FILES_CMD= cd ${WRKSRC} && ${FIND} . -name '*.c'
1.180 rillig 7908: SUBST_FILES.path= ${C_FILES_CMD:sh}
7909: </pre>
7910: <p>The variable name <code class="varname">C_FILES_CMD</code> in this example is
7911: freely chosen and independent of the SUBST framework.</p>
7912: <p>In this variant, the <code class="varname">SUBST_FILES.*</code> variable
7913: lists each file individually. Thereby chances are higher that there are
7914: filename patterns in which no substitution happens. Since the SUBST
7915: framework cannot know whether the filename patterns in
7916: <code class="varname">SUBST_FILES.*</code> have been explicitly listed in the
7917: Makefile (where any redundant filename pattern would be suspicious) or
7918: been generated by a shell command (in which redundant filename patterns
7919: are more likely and to be expected), it will complain about these
7920: redundant filename patterns. Therefore, SUBST blocks that use a shell
7921: command to generate the list of filename patterns often need to set
7922: <code class="varname">SUBST_NOOP_OK.*</code> to <code class="literal">yes</code>.</p>
7923: </div>
7924: <div class="sect3">
7925: <div class="titlepage"><div><div><h4 class="title">
7926: <a name="fixes.subst.what"></a>21.1.11.3. Choosing what to substitute</h4></div></div></div>
7927: <p>In most cases, the substitutions are given using one or more
7928: <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> commands, like this:</p>
7929: <pre class="programlisting">
7930: SUBST_SED.path= -e 's|/usr/local|${PREFIX}|g'
7931: </pre>
7932: <p>Each of the sed commands needs to be preceded by the
7933: <code class="literal">-e</code> option and should be specified on a line of its
7934: own, to avoid hiding short sed commands at the end of a line.</p>
7935: <p>Since the sed commands often contain shell metacharacters as the
7936: separator (the <code class="literal">|</code> in the above example), it is common
7937: to enclose them in single quotes.</p>
7938: <p>A common substitution is to replace placeholders of the form
7939: <code class="literal">@VARNAME@</code> with their pkgsrc counterpart variable
7940: <code class="literal">${VARNAME}</code>. A typical example is:</p>
7941: <pre class="programlisting">
7942: SUBST_VARS.path= PREFIX
7943: </pre>
7944: <p>This type of substitutions is typically done by the GNU configure
1.181 rillig 7945: scripts during the do-configure stage, but in some cases these need to be
7946: overridden. The same pattern is also used when a package defines patches
7947: that replace previously hard-coded paths like
7948: <code class="literal">/usr/local</code> with a <code class="literal">@PREFIX@</code>
7949: placeholder first, which then gets substituted by the actual
7950: <code class="literal">${PREFIX}</code> in the pre-configure stage. In many of these
7951: cases, it works equally well to just use the SUBST framework to directly
7952: replace <code class="literal">/usr/local</code> with <code class="literal">${PREFIX}</code>,
7953: thereby omitting the intermediate patch file.</p>
1.180 rillig 7954: <p>If the above is not flexible enough, it is possible to not use sed
7955: at all for the substitution but to specify an entirely different command,
7956: like this:</p>
1.1 dsieger 7957: <pre class="programlisting">
1.180 rillig 7958: SUBST_FILTER_CMD.path= LC_ALL=C ${TR} -d '\r'
7959: </pre>
7960: <p>This is used for the few remaining packages in which the
7961: distributed files use Windows-style line endings that need to be
7962: converted to UNIX-style line endings.</p>
7963: </div>
7964: <div class="sect3">
7965: <div class="titlepage"><div><div><h4 class="title">
7966: <a name="fixes.subst.other"></a>21.1.11.4. Other SUBST variables</h4></div></div></div>
7967: <p>When a SUBST block is applied during a package build, a message is
7968: logged. The default message is fine for most purposes but can be
7969: overridden by setting <code class="literal">SUBST_MESSAGE.*</code> to an individual
7970: message.</p>
7971: </div>
1.1 dsieger 7972: </div>
7973: </div>
1.41 asau 7974: <div class="sect1">
1.1 dsieger 7975: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 7976: <a name="fixes.fetch"></a>21.2. The <span class="emphasis"><em>fetch</em></span> phase</h2></div></div></div>
1.41 asau 7977: <div class="sect2">
1.1 dsieger 7978: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 7979: <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 7980: <p>If you need to download from a dynamic URL you can set
1.10 hubertf 7981: <code class="varname">DYNAMIC_MASTER_SITES</code> and a <span class="command"><strong>make
1.1 dsieger 7982: fetch</strong></span> will call <code class="filename">files/getsite.sh</code>
7983: with the name of each file to download as an argument, expecting
7984: it to output the URL of the directory from which to download
1.137 leot 7985: 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 7986: example of this usage.</p>
7987: <p>If the download can't be automated, because the user must
7988: submit personal information to apply for a password, or must pay
7989: for the source, or whatever, you can set
7990: <code class="varname">FETCH_MESSAGE</code> to a list of lines that are
7991: displayed to the user before aborting the build. Example:</p>
7992: <pre class="programlisting">
7993: FETCH_MESSAGE= "Please download the files"
7994: FETCH_MESSAGE+= " "${DISTFILES:Q}
7995: FETCH_MESSAGE+= "manually from "${MASTER_SITES:Q}"."
1.111 sevan 7996: </pre>
1.1 dsieger 7997: </div>
1.41 asau 7998: <div class="sect2">
1.1 dsieger 7999: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8000: <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 8001: <p>Sometimes authors of a software package make some
8002: modifications after the software was released, and they put up a
8003: new distfile without changing the package's version number. If a
8004: package is already in pkgsrc at that time, the checksum will
8005: no longer match. The contents of the new distfile should be
8006: compared against the old one before changing anything, to make
8007: sure the distfile was really updated on purpose, and that
8008: no trojan horse or so crept in.
8009: Please mention that the distfiles were compared and what was found
1.53 rodent 8010: in your commit message.</p>
1.109 wiz 8011: <p>Then, the correct way to work around this is to set
8012: <code class="varname">DIST_SUBDIR</code> to a unique directory name, usually
8013: based on <code class="varname">PKGNAME_NOREV</code> (but take care with
8014: python or ruby packages, where <code class="varname">PKGNAME</code> includes
8015: a variable prefix). All <code class="varname">DISTFILES</code> and
1.1 dsieger 8016: <code class="varname">PATCHFILES</code> for this package will be put in that
1.154 rillig 8017: 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 8018: happens more often, <code class="varname">PKGNAME</code> can be used (thus
1.109 wiz 8019: including the <code class="filename">nbX</code> suffix) or a date stamp can
8020: be appended, like
8021: <code class="varname">${PKGNAME_NOREV}-YYYYMMDD</code>.</p>
1.169 rillig 8022: <p><code class="varname">DIST_SUBDIR</code> is also used when a distfile's
8023: name does not contain a version and the distfile is apt to change. In
8024: cases where the likelihood of this is very small,
8025: <code class="varname">DIST_SUBDIR</code> might not be required. Additionally,
8026: <code class="varname">DIST_SUBDIR</code> must not be removed unless the
8027: distfile name changes, even if a package is being moved or
8028: renamed.</p>
1.53 rodent 8029: <p>Do not forget regenerating the <code class="filename">distinfo</code> file
1.1 dsieger 8030: after that, since it contains the <code class="varname">DIST_SUBDIR</code>
8031: path in the filenames.
1.53 rodent 8032: Also, increase the PKGREVISION if the installed package is different.
1.1 dsieger 8033: Furthermore, a mail to the package's authors seems appropriate
8034: telling them that changing distfiles after releases without
8035: changing the file names is not good practice.</p>
8036: </div>
1.88 tnn 8037: <div class="sect2">
8038: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8039: <a name="build.fetch.github"></a>21.2.3. Packages hosted on github.com</h3></div></div></div>
1.169 rillig 8040: <p>Helper methods exist for packages hosted on github.com which
8041: will often have distfile names that clash with other packages, for
8042: example <code class="filename">1.0.tar.gz</code>. Use one of the three recipes
8043: from below:</p>
1.88 tnn 8044: <div class="sect3">
8045: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8046: <a name="build.fetch.github.tag"></a>21.2.3.1. Fetch based on a tagged release</h4></div></div></div>
1.169 rillig 8047: <p>If your distfile URL looks similar to
1.174 leot 8048: <code class="literal">https://github.com/username/exampleproject/archive/v1.0.zip</code>,
1.169 rillig 8049: then you are packaging a tagged release.</p>
1.88 tnn 8050: <pre class="programlisting">
8051: DISTNAME= exampleproject-1.0
1.90 tnn 8052: MASTER_SITES= ${MASTER_SITE_GITHUB:=username/}
8053: #GITHUB_PROJECT= # can be omitted if same as DISTNAME
8054: GITHUB_TAG= v${PKGVERSION_NOREV}
1.88 tnn 8055: EXTRACT_SUFX= .zip
8056: </pre>
8057: </div>
8058: <div class="sect3">
8059: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8060: <a name="build.fetch.github.commit"></a>21.2.3.2. Fetch based on a specific commit</h4></div></div></div>
1.169 rillig 8061: <p>If your distfile URL looks similar to
1.174 leot 8062: <code class="literal">https://github.com​/example​/example​/archive​/988881adc9fc3655077dc2d4d757d480b5ea0e11.tar.gz</code>,
1.169 rillig 8063: then you are packaging a specific commit not tied to a
8064: release.</p>
1.88 tnn 8065: <pre class="programlisting">
8066: DISTNAME= example-1.0
1.107 jnemeth 8067: MASTER_SITES= ${MASTER_SITE_GITHUB:=example/}
1.90 tnn 8068: #GITHUB_PROJECT= # can be omitted if same as DISTNAME
8069: GITHUB_TAG= 988881adc9fc3655077dc2d4d757d480b5ea0e11
1.111 sevan 8070: </pre>
1.88 tnn 8071: </div>
8072: <div class="sect3">
8073: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8074: <a name="build.fetch.github.release"></a>21.2.3.3. Fetch based on release</h4></div></div></div>
1.169 rillig 8075: <p>If your distfile URL looks similar to
1.174 leot 8076: <code class="literal">https://github.com​/username/exampleproject​/releases​/download​/rel-1.6​/offensive-1.6.zip</code>,
1.169 rillig 8077: then you are packaging a release.</p>
1.88 tnn 8078: <pre class="programlisting">
8079: DISTNAME= offensive-1.6
1.90 tnn 8080: PKGNAME= ${DISTNAME:S/offensive/proper/}
8081: MASTER_SITES= ${MASTER_SITE_GITHUB:=username/}
8082: GITHUB_PROJECT= exampleproject
8083: GITHUB_RELEASE= rel-${PKGVERSION_NOREV} # usually just set this to ${DISTNAME}
8084: EXTRACT_SUFX= .zip
1.111 sevan 8085: </pre>
1.88 tnn 8086: </div>
8087: </div>
1.1 dsieger 8088: </div>
1.41 asau 8089: <div class="sect1">
1.1 dsieger 8090: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 8091: <a name="fixes.configure"></a>21.3. The <span class="emphasis"><em>configure</em></span> phase</h2></div></div></div>
1.41 asau 8092: <div class="sect2">
1.1 dsieger 8093: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8094: <a name="fixes.libtool"></a>21.3.1. Shared libraries - libtool</h3></div></div></div>
1.1 dsieger 8095: <p>pkgsrc supports many different machines, with different
8096: object formats like a.out and ELF, and varying abilities to do
8097: shared library and dynamic loading at all. To accompany this,
8098: varying commands and options have to be passed to the
8099: compiler, linker, etc. to get the Right Thing, which can be
8100: pretty annoying especially if you don't have all the machines
8101: at your hand to test things. The
1.137 leot 8102: <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 8103: can help here, as it just <span class="quote">“<span class="quote">knows</span>”</span> how to build
1.1 dsieger 8104: both static and dynamic libraries from a set of source files,
8105: thus being platform-independent.</p>
8106: <p>Here's how to use libtool in a package in seven simple
8107: steps:</p>
1.23 wiz 8108: <div class="orderedlist"><ol class="orderedlist" type="1">
8109: <li class="listitem"><p>Add <code class="varname">USE_LIBTOOL=yes</code> to the package
1.1 dsieger 8110: Makefile.</p></li>
1.23 wiz 8111: <li class="listitem"><p>For library objects, use <span class="quote">“<span class="quote">${LIBTOOL} --mode=compile
8112: ${CC}</span>”</span> in place of <span class="quote">“<span class="quote">${CC}</span>”</span>. You could even
1.1 dsieger 8113: add it to the definition of <code class="varname">CC</code>, if only
8114: libraries are being built in a given Makefile. This one command
8115: will build both PIC and non-PIC library objects, so you need not
8116: have separate shared and non-shared library rules.</p></li>
1.23 wiz 8117: <li class="listitem">
1.1 dsieger 8118: <p>For the linking of the library, remove any
1.23 wiz 8119: <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
8120: -Bshareable</span>”</span> commands, and instead use:</p>
1.1 dsieger 8121: <pre class="programlisting">
8122: ${LIBTOOL} --mode=link \
8123: ${CC} -o ${.TARGET:.a=.la} \
8124: ${OBJS:.o=.lo} \
8125: -rpath ${PREFIX}/lib \
8126: -version-info major:minor
1.111 sevan 8127: </pre>
1.1 dsieger 8128: <p>Note that the library is changed to have a
8129: <code class="filename">.la</code> extension, and the objects are
8130: changed to have a <code class="filename">.lo</code>
8131: extension. Change <code class="varname">OBJS</code> as
8132: necessary. This automatically creates all of the
8133: <code class="filename">.a</code>,
8134: <code class="filename">.so.major.minor</code>, and ELF symlinks (if
8135: necessary) in the build directory. Be sure to include
1.23 wiz 8136: <span class="quote">“<span class="quote">-version-info</span>”</span>, especially when major and
1.1 dsieger 8137: minor are zero, as libtool will otherwise strip off the
8138: shared library version.</p>
8139: <p>From the libtool manual:</p>
8140: <pre class="programlisting">
8141: So, libtool library versions are described by three integers:
8142:
8143: CURRENT
8144: The most recent interface number that this library implements.
8145:
8146: REVISION
8147: The implementation number of the CURRENT interface.
8148:
8149: AGE
8150: The difference between the newest and oldest interfaces that
8151: this library implements. In other words, the library implements
8152: all the interface numbers in the range from number `CURRENT -
8153: AGE' to `CURRENT'.
8154:
8155: If two libraries have identical CURRENT and AGE numbers, then the
8156: dynamic linker chooses the library with the greater REVISION number.
1.111 sevan 8157: </pre>
1.23 wiz 8158: <p>The <span class="quote">“<span class="quote">-release</span>”</span> option will produce
1.1 dsieger 8159: different results for a.out and ELF (excluding symlinks)
8160: in only one case. An ELF library of the form
1.23 wiz 8161: <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 8162: will have a symlink of
1.23 wiz 8163: <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 8164: on an a.out platform. This is handled
8165: automatically.</p>
1.23 wiz 8166: <p>The <span class="quote">“<span class="quote">-rpath argument</span>”</span> is the install
1.1 dsieger 8167: directory of the library being built.</p>
8168: <p>In the <code class="filename">PLIST</code>, include only the
8169: <code class="filename">.la</code> file, the other files will be
8170: added automatically.</p>
8171: </li>
1.23 wiz 8172: <li class="listitem">
1.1 dsieger 8173: <p>When linking shared object (<code class="filename">.so</code>)
1.174 leot 8174: 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 8175: shared libraries, use <span class="quote">“<span class="quote">-module
8176: -avoid-version</span>”</span> to prevent them getting version
1.1 dsieger 8177: tacked on.</p>
8178: <p>The <code class="filename">PLIST</code> file gets the
8179: <code class="filename">foo.so</code> entry.</p>
8180: </li>
1.23 wiz 8181: <li class="listitem">
1.1 dsieger 8182: <p>When linking programs that depend on these libraries
8183: <span class="emphasis"><em>before</em></span> they are installed, preface
1.174 leot 8184: 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 8185: --mode=link</span>”</span>, and it will find the correct
1.1 dsieger 8186: libraries (static or shared), but please be aware that
8187: libtool will not allow you to specify a relative path in
1.23 wiz 8188: -L (such as <span class="quote">“<span class="quote">-L../somelib</span>”</span>), because it
1.1 dsieger 8189: expects you to change that argument to be the
8190: <code class="filename">.la</code> file. e.g.</p>
8191: <pre class="programlisting">
8192: ${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib
1.111 sevan 8193: </pre>
1.1 dsieger 8194: <p>should be changed to:</p>
8195: <pre class="programlisting">
8196: ${LIBTOOL} --mode=link ${CC} -o <em class="replaceable"><code>someprog</code></em> <em class="replaceable"><code>../somelib/somelib.la</code></em>
1.111 sevan 8197: </pre>
1.1 dsieger 8198: <p>and it will do the right thing with the libraries.</p>
8199: </li>
1.23 wiz 8200: <li class="listitem">
1.174 leot 8201: <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>
8202: 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 8203: --mode=install</span>”</span>, and change the library name to
1.1 dsieger 8204: <code class="filename">.la</code>. e.g.</p>
8205: <pre class="programlisting">
1.22 jakllsch 8206: ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} ${SOMELIB:.a=.la} ${PREFIX}/lib
1.111 sevan 8207: </pre>
1.1 dsieger 8208: <p>This will install the static <code class="filename">.a</code>,
8209: shared library, any needed symlinks, and run
1.174 leot 8210: <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 8211: </li>
1.23 wiz 8212: <li class="listitem"><p>In your <code class="filename">PLIST</code>, include only
1.1 dsieger 8213: the <code class="filename">.la</code>
8214: file (this is a change from previous behaviour).</p></li>
8215: </ol></div>
8216: </div>
1.41 asau 8217: <div class="sect2">
1.1 dsieger 8218: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8219: <a name="using-libtool"></a>21.3.2. Using libtool on GNU packages that already support libtool</h3></div></div></div>
1.1 dsieger 8220: <p>Add <code class="varname">USE_LIBTOOL=yes</code> to the
8221: package Makefile. This will override the package's own libtool
8222: in most cases. For older libtool using packages, libtool is
8223: made by ltconfig script during the do-configure step; you can
1.10 hubertf 8224: check the libtool script location by doing <span class="command"><strong>make
1.1 dsieger 8225: configure; find work*/ -name libtool</strong></span>.</p>
8226: <p><code class="varname">LIBTOOL_OVERRIDE</code> specifies which libtool
8227: scripts, relative to <code class="varname">WRKSRC</code>, to override. By
1.23 wiz 8228: default, it is set to <span class="quote">“<span class="quote">libtool */libtool
8229: */*/libtool</span>”</span>. If this does not match the location of the
1.1 dsieger 8230: package's libtool script(s), set it as appropriate.</p>
8231: <p>If you do not need <code class="filename">*.a</code> static
8232: libraries built and installed, then use
8233: <code class="varname">SHLIBTOOL_OVERRIDE</code> instead.</p>
8234: <p>If your package makes use of the platform-independent library
8235: for loading dynamic shared objects, that comes with libtool
8236: (libltdl), you should include devel/libltdl/buildlink3.mk.</p>
8237: <p>Some packages use libtool incorrectly so that the package
8238: may not work or build in some circumstances. Some of the more
8239: common errors are:</p>
1.41 asau 8240: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 8241: <li class="listitem">
1.1 dsieger 8242: <p>The inclusion of a shared object (-module) as a dependent library in an
8243: executable or library. This in itself isn't a problem if one of two things
8244: has been done:</p>
1.23 wiz 8245: <div class="orderedlist"><ol class="orderedlist" type="1">
8246: <li class="listitem"><p>The shared object is named correctly, i.e.
1.1 dsieger 8247: <code class="filename">libfoo.la</code>, not
8248: <code class="filename">foo.la</code></p></li>
1.23 wiz 8249: <li class="listitem"><p>The -dlopen option is used when linking an executable.</p></li>
1.1 dsieger 8250: </ol></div>
8251: </li>
1.23 wiz 8252: <li class="listitem"><p>The use of libltdl without the correct calls to initialisation routines.
1.1 dsieger 8253: The function lt_dlinit() should be called and the macro
8254: <code class="varname">LTDL_SET_PRELOADED_SYMBOLS</code> included in
8255: executables.</p></li>
8256: </ul></div>
8257: </div>
1.41 asau 8258: <div class="sect2">
1.1 dsieger 8259: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8260: <a name="autoconf-automake"></a>21.3.3. GNU Autoconf/Automake</h3></div></div></div>
1.1 dsieger 8261: <p>If a package needs GNU autoconf or automake to be executed
8262: to regenerate the configure script and Makefile.in makefile
8263: templates, then they should be executed in a pre-configure
8264: target.</p>
8265: <p>For packages that need only autoconf:</p>
8266: <pre class="programlisting">
8267: AUTOCONF_REQD= 2.50 # if default version is not good enough
8268: USE_TOOLS+= autoconf # use "autoconf213" for autoconf-2.13
8269: ...
8270:
8271: pre-configure:
8272: cd ${WRKSRC} && autoconf
8273:
8274: ...
1.111 sevan 8275: </pre>
1.1 dsieger 8276: <p>and for packages that need automake and autoconf:</p>
8277: <pre class="programlisting">
8278: AUTOMAKE_REQD= 1.7.1 # if default version is not good enough
8279: USE_TOOLS+= automake # use "automake14" for automake-1.4
8280: ...
8281:
8282: pre-configure:
8283: set -e; cd ${WRKSRC}; \
8284: aclocal; autoheader; automake -a --foreign -i; autoconf
8285:
8286: ...
1.111 sevan 8287: </pre>
1.1 dsieger 8288: <p>Packages which use GNU Automake will almost certainly
8289: require GNU Make.</p>
8290: <p>There are times when the configure process makes
8291: additional changes to the generated files, which then causes
8292: the build process to try to re-execute the automake sequence.
8293: This is prevented by touching various files in the configure
8294: stage. If this causes problems with your package you can set
8295: <code class="varname">AUTOMAKE_OVERRIDE=NO</code> in the package
8296: Makefile.</p>
8297: </div>
8298: </div>
1.41 asau 8299: <div class="sect1">
1.1 dsieger 8300: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 8301: <a name="programming-languages"></a>21.4. Programming languages</h2></div></div></div>
1.41 asau 8302: <div class="sect2">
1.1 dsieger 8303: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8304: <a name="basic-programming-languages"></a>21.4.1. C, C++, and Fortran</h3></div></div></div>
1.1 dsieger 8305: <p>Compilers for the C, C++, and Fortran languages comes with
8306: the NetBSD base system. By default, pkgsrc assumes that a package
8307: is written in C and will hide all other compilers (via the wrapper
1.154 rillig 8308: framework, see <a class="xref" href="#buildlink" title="Chapter 16. Buildlink methodology">Chapter 16, <i>Buildlink methodology</i></a>).</p>
1.1 dsieger 8309: <p>To declare which language's compiler a package needs, set
8310: the <code class="varname">USE_LANGUAGES</code> variable. Allowed values
1.23 wiz 8311: currently are <span class="quote">“<span class="quote">c</span>”</span>, <span class="quote">“<span class="quote">c++</span>”</span>, and
8312: <span class="quote">“<span class="quote">fortran</span>”</span> (and any combination). The default is
8313: <span class="quote">“<span class="quote">c</span>”</span>. Packages using GNU configure scripts, even if
1.1 dsieger 8314: written in C++, usually need a C compiler for the configure
8315: phase.</p>
8316: </div>
1.41 asau 8317: <div class="sect2">
1.1 dsieger 8318: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8319: <a name="java-programming-language"></a>21.4.2. Java</h3></div></div></div>
1.1 dsieger 8320: <p>If a program is written in Java, use the Java framework in
8321: pkgsrc. The package must include
8322: <code class="filename">../../mk/java-vm.mk</code>. This Makefile fragment
8323: provides the following variables:</p>
1.41 asau 8324: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 8325: <li class="listitem"><p><code class="varname">USE_JAVA</code> defines if a build
1.1 dsieger 8326: dependency on the JDK is added. If
1.23 wiz 8327: <code class="varname">USE_JAVA</code> is set to <span class="quote">“<span class="quote">run</span>”</span>, then
1.1 dsieger 8328: there is only a runtime dependency on the JDK. The default is
1.23 wiz 8329: <span class="quote">“<span class="quote">yes</span>”</span>, which also adds a build dependency on the
1.1 dsieger 8330: JDK.</p></li>
1.23 wiz 8331: <li class="listitem"><p>Set <code class="varname">USE_JAVA2</code> to declare that
1.1 dsieger 8332: a package needs a Java2 implementation. The supported values
1.23 wiz 8333: are <span class="quote">“<span class="quote">yes</span>”</span>, <span class="quote">“<span class="quote">1.4</span>”</span>, and
8334: <span class="quote">“<span class="quote">1.5</span>”</span>. <span class="quote">“<span class="quote">yes</span>”</span> accepts any Java2
8335: implementation, <span class="quote">“<span class="quote">1.4</span>”</span> insists on versions 1.4 or
8336: above, and <span class="quote">“<span class="quote">1.5</span>”</span> only accepts versions 1.5 or
1.1 dsieger 8337: above. This variable is not set by default.</p></li>
1.24 wiz 8338: <li class="listitem"><p><code class="varname">PKG_JAVA_HOME</code> is
8339: automatically set to the runtime location of the used Java
8340: implementation dependency. It may be used to set
8341: <code class="varname">JAVA_HOME</code> to a good value if the program
8342: needs this variable to be defined.
8343: </p></li>
1.1 dsieger 8344: </ul></div>
8345: </div>
1.41 asau 8346: <div class="sect2">
1.1 dsieger 8347: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8348: <a name="perl-scripts"></a>21.4.3. Packages containing perl scripts</h3></div></div></div>
1.1 dsieger 8349: <p>If your package contains interpreted perl scripts, add
1.23 wiz 8350: <span class="quote">“<span class="quote">perl</span>”</span> to the <code class="varname">USE_TOOLS</code> variable
1.1 dsieger 8351: and set <code class="varname">REPLACE_PERL</code> to ensure that the proper
8352: interpreter path is set. <code class="varname">REPLACE_PERL</code> should
8353: contain a list of scripts, relative to <code class="varname">WRKSRC</code>,
1.74 wiz 8354: that you want adjusted. Every occurrence of
8355: <code class="filename">*/bin/perl</code> in a she-bang line will be
8356: replaced with the full path to the perl executable.</p>
1.1 dsieger 8357: <p>If a particular version of perl is needed, set the
8358: <code class="varname">PERL5_REQD</code> variable to the version number. The
1.23 wiz 8359: default is <span class="quote">“<span class="quote">5.0</span>”</span>.</p>
1.154 rillig 8360: <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 8361: about handling perl modules.</p>
8362: </div>
1.41 asau 8363: <div class="sect2">
1.1 dsieger 8364: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8365: <a name="shell-scripts"></a>21.4.4. Packages containing shell scripts</h3></div></div></div>
1.40 wiz 8366: <p><code class="varname">REPLACE_SH</code>,
8367: <code class="varname">REPLACE_BASH</code>, <code class="varname">REPLACE_CSH</code>,
8368: and <code class="varname">REPLACE_KSH</code> can be used to replace shell
8369: hash bangs in files. Please use the appropriate one, prefering
8370: <code class="varname">REPLACE_SH</code> in case this shell is sufficient.
1.74 wiz 8371: Each should contain a list of scripts, relative to
8372: <code class="varname">WRKSRC</code>, that you want adjusted. Every
8373: occurrence of the matching shell in a she-bang line will be
8374: replaced with the full path to the shell executable.
1.40 wiz 8375: When using <code class="varname">REPLACE_BASH</code>, don't forget to add
8376: <code class="filename">bash</code> to <code class="varname">USE_TOOLS</code>.</p>
8377: </div>
1.41 asau 8378: <div class="sect2">
1.40 wiz 8379: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8380: <a name="other-programming-languages"></a>21.4.5. Other programming languages</h3></div></div></div>
1.1 dsieger 8381: <p>Currently, there is no special handling for other languages
8382: in pkgsrc. If a compiler package provides a
8383: <code class="filename">buildlink3.mk</code> file, include that, otherwise
8384: just add a (build) dependency on the appropriate compiler
8385: package.</p>
8386: </div>
8387: </div>
1.41 asau 8388: <div class="sect1">
1.1 dsieger 8389: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 8390: <a name="fixes.build"></a>21.5. The <span class="emphasis"><em>build</em></span> phase</h2></div></div></div>
1.1 dsieger 8391: <p>The most common failures when building a package are that
8392: some platforms do not provide certain header files, functions or
8393: libraries, or they provide the functions in a library that the
8394: original package author didn't know. To work around this, you
8395: can rewrite the source code in most cases so that it does not
8396: use the missing functions or provides a replacement function.</p>
1.41 asau 8397: <div class="sect2">
1.1 dsieger 8398: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8399: <a name="fixes.build.cpp"></a>21.5.1. Compiling C and C++ code conditionally</h3></div></div></div>
1.1 dsieger 8400: <p>If a package already comes with a GNU configure script, the
8401: preferred way to fix the build failure is to change the
8402: configure script, not the code. In the other cases, you can
8403: utilize the C preprocessor, which defines certain macros
8404: depending on the operating system and hardware architecture it
8405: compiles for. These macros can be queried using for example
8406: <code class="varname">#if defined(__i386)</code>. Almost every operating
8407: system, hardware architecture and compiler has its own macro.
8408: For example, if the macros <code class="varname">__GNUC__</code>,
8409: <code class="varname">__i386__</code> and <code class="varname">__NetBSD__</code>
8410: are all defined, you know that you are using NetBSD on an i386
8411: compatible CPU, and your compiler is GCC.</p>
8412: <p>The list of the following macros for hardware and
8413: operating system depends on the compiler that is used. For
8414: example, if you want to conditionally compile code on Solaris,
8415: don't use <code class="varname">__sun__</code>, as the SunPro compiler
8416: does not define it. Use <code class="varname">__sun</code> instead.</p>
1.41 asau 8417: <div class="sect3">
1.1 dsieger 8418: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8419: <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 8420: <p>To distinguish between 4.4 BSD-derived systems and the
8421: rest of the world, you should use the following code.</p>
8422: <pre class="programlisting">
8423: #include <sys/param.h>
8424: #if (defined(BSD) && BSD >= 199306)
8425: /* BSD-specific code goes here */
8426: #else
8427: /* non-BSD-specific code goes here */
8428: #endif
8429: </pre>
8430: <p>If this distinction is not fine enough, you can also test
8431: for the following macros.</p>
8432: <pre class="programlisting">
1.45 obache 8433: Cygwin __CYGWIN__
8434: DragonFly __DragonFly__
1.1 dsieger 8435: FreeBSD __FreeBSD__
1.45 obache 8436: Haiku __HAIKU__
1.1 dsieger 8437: Interix __INTERIX
8438: IRIX __sgi (TODO: get a definite source for this)
8439: Linux linux, __linux, __linux__
1.83 dholland 8440: Mac OS X __APPLE__
1.45 obache 8441: MirBSD __MirBSD__ (__OpenBSD__ is also defined)
8442: Minix3 __minix
1.1 dsieger 8443: NetBSD __NetBSD__
8444: OpenBSD __OpenBSD__
8445: Solaris sun, __sun
8446: </pre>
8447: </div>
1.41 asau 8448: <div class="sect3">
1.1 dsieger 8449: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8450: <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 8451: <pre class="programlisting">
8452: i386 i386, __i386, __i386__
8453: MIPS __mips
8454: SPARC sparc, __sparc
8455: </pre>
8456: </div>
1.41 asau 8457: <div class="sect3">
1.1 dsieger 8458: <div class="titlepage"><div><div><h4 class="title">
1.154 rillig 8459: <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 8460: <pre class="programlisting">
8461: GCC __GNUC__ (major version), __GNUC_MINOR__
8462: MIPSpro _COMPILER_VERSION (0x741 for MIPSpro 7.41)
8463: SunPro __SUNPRO_C (0x570 for Sun C 5.7)
8464: SunPro C++ __SUNPRO_CC (0x580 for Sun C++ 5.8)
8465: </pre>
8466: </div>
8467: </div>
1.41 asau 8468: <div class="sect2">
1.1 dsieger 8469: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8470: <a name="compiler-bugs"></a>21.5.2. How to handle compiler bugs</h3></div></div></div>
1.1 dsieger 8471: <p>Some source files trigger bugs in the compiler, based on
8472: combinations of compiler version and architecture and almost
8473: always relation to optimisation being enabled. Common symptoms
8474: are gcc internal errors or never finishing compiling a
8475: file.</p>
8476: <p>Typically, a workaround involves testing the
8477: <code class="varname">MACHINE_ARCH</code> and compiler version, disabling
8478: optimisation for that combination of file,
1.87 tnn 8479: <code class="varname">MACHINE_ARCH</code> and compiler.</p>
8480: <p>This used to be a big problem in the past, but is rarely
8481: needed now as compiler technology has matured. If you still need
8482: to add a compiler specific workaround, please do so in the file
8483: <code class="filename">hacks.mk</code> and describe the symptom and
8484: compiler version as detailed as possible.</p>
1.1 dsieger 8485: </div>
1.41 asau 8486: <div class="sect2">
1.1 dsieger 8487: <div class="titlepage"><div><div><h3 class="title">
1.172 rillig 8488: <a name="fixes.build.header"></a>21.5.3. No such file or directory</h3></div></div></div>
8489: <p>Compilation sometimes fails with an error message like this:</p>
8490: <pre class="programlisting">
8491: .../x11/gtk3/work/gtk+-3.24.12/gdk/gdktypes.h:35:10:
8492: fatal error: pango/pango.h: No such file or directory
8493: </pre>
8494: <p>The proper way to fix this problem depends on the type of the
8495: header, which is described in the following sections.</p>
8496: <div class="sect3">
8497: <div class="titlepage"><div><div><h4 class="title">
8498: <a name="fixes.build.header.bl3"></a>21.5.3.1. Headers from other packages</h4></div></div></div>
8499: <p>If the header name looks like it comes from a different package,
8500: that other package should be included via the buildlink3
8501: framework.</p>
8502: <p>First, look whether the header is somewhere in the buildlink3
8503: directory below <code class="varname">WRKDIR</code>. In the above case of
8504: the missing Pango header:</p>
8505: <pre class="programlisting">
8506: <code class="prompt">$</code> find work/.buildlink/ -print | grep -F pango/pango.h
8507: </pre>
8508: <p>In the case of Pango, the output is:</p>
8509: <pre class="programlisting">
8510: work/.buildlink/include/pango-1.0/pango/pango.h
8511: </pre>
8512: <p>If the <code class="filename">pango/pango.h</code> file were placed directly
8513: in the <code class="filename">.buildlink</code> directory, it would have been
8514: found automatically. There is an extra <code class="filename">pango-1.0</code>
8515: path component though, which means that the compiler command line must
8516: contain an option of the form
8517: <code class="literal">-I${BUILDLINK3_PREFIX.pango}/include/pango-1.0</code>. In
8518: most cases this option is generated by the configure script, which can be examined using:</p>
8519: <pre class="programlisting">
8520: <code class="prompt">$</code> $ grep -o '[-]I[^[:space:]]*/pango[^[:space:]]*' work/*/Makefile
8521: -I/usr/pkg/include/pango-1.0
8522: -I/usr/pkg/include/pango-1.0
8523: -I/usr/pkg/include/pango-1.0
8524: -I/usr/pkg/include/pango-1.0
8525: -I/usr/pkg/include/pango-1.0
8526: </pre>
8527: <p>This looks good. These options are transformed by the buildlink
8528: wrapper to refer to the correct path inside
8529: <code class="filename">work/.buildlink</code>.</p>
8530: <p>Since the compilation fails though, examine the compiler command
8531: lines in <code class="filename">work/.work.log</code> to see whether the
8532: <code class="literal">-I</code> option is included in the particular command
8533: line.</p>
8534: <p>To further analyze the situation, run <span class="command"><strong>bmake
8535: build-env</strong></span>, which sets up an interactive, realistic environment
8536: including all the pkgsrc wrapper commands and environment variables. From
8537: there, try to compile some simple example programs that use the
8538: header.</p>
8539: </div>
8540: <div class="sect3">
8541: <div class="titlepage"><div><div><h4 class="title">
8542: <a name="fixes.build.header.gen"></a>21.5.3.2. Headers generated during the build</h4></div></div></div>
8543: <p>If the name of the header seems to come from the package itself,
8544: and if the build is run with parallel jobs, the package may have some
8545: undeclared dependencies between the <code class="filename">.c</code> and the
8546: <code class="filename">.h</code> files, and a C file is compiled before its
8547: required header is generated.</p>
8548: <p>To see whether the build runs with parallel jobs, run
8549: <span class="command"><strong>bmake show-all-build | grep JOBS</strong></span>. Its output looks
8550: like this:</p>
8551: <pre class="programlisting">
8552: usr MAKE_JOBS= 7
8553: pkg MAKE_JOBS_SAFE # undefined
8554: def _MAKE_JOBS_N= 7
8555: </pre>
8556: <p>In this case the pkgsrc user has asked pkgsrc to build packages
8557: with 7 jobs in parallel (<code class="varname">MAKE_JOBS</code>). The
8558: package could have disabled parallel builds by setting
8559: <code class="varname">MAKE_JOBS_SAFE</code> to <code class="literal">no</code>, but
8560: in this case it hasn't.</p>
8561: <p>To see whether the build failure is caused by parallel builds,
8562: first save the exact error message and a bit of context, maybe you need
8563: it later for reporting a bug. Next, run:</p>
8564: <pre class="programlisting">
8565: MAKE_JOBS_SAFE=no bmake clean build
8566: </pre>
8567: <p>If that succeeds, <a class="ulink" href="https://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd" target="_top">file a bug
8568: report</a> against the pkgsrc package, including the exact error
8569: message and the contents of your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file.</p>
8570: </div>
1.173 rillig 8571: <div class="sect3">
8572: <div class="titlepage"><div><div><h4 class="title">
8573: <a name="fixes.build.header.symlink"></a>21.5.3.3. Symlinks</h4></div></div></div>
8574: <p>Pkgsrc does not work reliably if any of
8575: <code class="varname">LOCALBASE</code>, <code class="varname">VARBASE</code> or
8576: <code class="varname">WRKDIR</code> contains a symlink. Since 2019Q2, the pkgsrc
8577: bootstrap program prevents installing pkgsrc in symlink-based
8578: directories. Existing pkgsrc installations are not checked for symlinks
8579: though.</p>
8580: <p>The "No such file or directory" error messages are a typical
8581: symptom of symlinks, and it's quite difficult to find out that this is
8582: the actual cause.</p>
8583: </div>
8584: <div class="sect3">
8585: <div class="titlepage"><div><div><h4 class="title">
8586: <a name="fixes.build.header.stale"></a>21.5.3.4. Stale working directories</h4></div></div></div>
8587: <p>When building a hierarchy of packages, it may happen that one
8588: package is built and then pkgsrc is updated. This situation can provoke
8589: various hard to diagnose build errors. To clean up the situation:</p>
8590: <pre class="programlisting">
8591: <code class="prompt">$</code> (cd ../../ && test -f mk/bsd.pkg.mk && rm -rf */*/work)
8592: </pre>
8593: <p>(The test for <code class="filename">bsd.pkg.mk</code> just prevents running
8594: this command in the wrong directory.)</p>
8595: <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
8596: that directory as well.</p>
8597: </div>
8598: <div class="sect3">
8599: <div class="titlepage"><div><div><h4 class="title">
8600: <a name="fixes.build.header.misc"></a>21.5.3.5. Other possible reasons</h4></div></div></div>
8601: <p>On platforms other than BSD, third-party packages are installed in
8602: <code class="filename">/usr/include</code>, together with the base system. This
8603: means that pkgsrc cannot distinguish between headers provided by the base
8604: system (which it needs) and headers from third-party packages (which are
8605: often included in pkgsrc as well). This can lead to subtle version
8606: mismatches.</p>
8607: <p>In pkgsrc installations that have been active for several years, it
8608: may happen that some files are manually deleted. To exclude this unlikely
8609: reason, run <span class="command"><strong>pkg_admin check</strong></span>.</p>
8610: <p>It may help to run <span class="command"><strong>pkg_admin rebuild-tree</strong></span> to
8611: check/fix dependencies.</p>
8612: <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>
8613: for contact information. Be prepared to describe what you have tried so
8614: far and what any error messages were.</p>
8615: </div>
1.172 rillig 8616: </div>
8617: <div class="sect2">
8618: <div class="titlepage"><div><div><h3 class="title">
8619: <a name="undefined-reference"></a>21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span>
1.23 wiz 8620: </h3></div></div></div>
1.1 dsieger 8621: <p>This error message often means that a package did not
8622: link to a shared library it needs. The following functions are
8623: known to cause this error message over and over.</p>
8624: <div class="informaltable">
1.106 tnn 8625: <a name="undefined-reference-functions"></a><table class="informaltable" border="1">
1.1 dsieger 8626: <colgroup>
8627: <col>
8628: <col>
8629: <col>
8630: </colgroup>
8631: <thead><tr>
8632: <th>Function</th>
8633: <th>Library</th>
8634: <th>Affected platforms</th>
8635: </tr></thead>
8636: <tbody>
8637: <tr>
8638: <td>accept, bind, connect</td>
8639: <td>-lsocket</td>
8640: <td>Solaris</td>
8641: </tr>
8642: <tr>
8643: <td>crypt</td>
8644: <td>-lcrypt</td>
8645: <td>DragonFly, NetBSD</td>
8646: </tr>
8647: <tr>
8648: <td>dlopen, dlsym</td>
8649: <td>-ldl</td>
8650: <td>Linux</td>
8651: </tr>
8652: <tr>
8653: <td>gethost*</td>
8654: <td>-lnsl</td>
8655: <td>Solaris</td>
8656: </tr>
8657: <tr>
8658: <td>inet_aton</td>
8659: <td>-lresolv</td>
8660: <td>Solaris</td>
8661: </tr>
8662: <tr>
8663: <td>nanosleep, sem_*, timer_*</td>
8664: <td>-lrt</td>
8665: <td>Solaris</td>
8666: </tr>
8667: <tr>
8668: <td>openpty</td>
8669: <td>-lutil</td>
8670: <td>Linux</td>
8671: </tr>
8672: </tbody>
8673: </table>
8674: </div>
8675: <p>To fix these linker errors, it is often sufficient to say
8676: <code class="literal">LIBS.<em class="replaceable"><code>OperatingSystem</code></em>+=
8677: -l<em class="replaceable"><code>foo</code></em></code> to the package
1.10 hubertf 8678: <code class="filename">Makefile</code> and then say <span class="command"><strong>bmake clean;
1.1 dsieger 8679: bmake</strong></span>.</p>
1.41 asau 8680: <div class="sect3">
1.1 dsieger 8681: <div class="titlepage"><div><div><h4 class="title">
1.172 rillig 8682: <a name="undefined-reference-sunpro"></a>21.5.4.1. Special issue: The SunPro compiler</h4></div></div></div>
1.1 dsieger 8683: <p>When you are using the SunPro compiler, there is another
8684: possibility. That compiler cannot handle the following code:</p>
8685: <pre class="programlisting">
8686: extern int extern_func(int);
8687:
8688: static inline int
8689: inline_func(int x)
8690: {
8691: return extern_func(x);
8692: }
8693:
8694: int main(void)
8695: {
8696: return 0;
8697: }
8698: </pre>
8699: <p>It generates the code for <code class="function">inline_func</code> even if
8700: that function is never used. This code then refers to
8701: <code class="function">extern_func</code>, which can usually not be resolved. To
8702: solve this problem you can try to tell the package to disable inlining
8703: of functions.</p>
8704: </div>
8705: </div>
1.41 asau 8706: <div class="sect2">
1.1 dsieger 8707: <div class="titlepage"><div><div><h3 class="title">
1.172 rillig 8708: <a name="out-of-memory"></a>21.5.5. Running out of memory</h3></div></div></div>
1.1 dsieger 8709: <p>Sometimes packages fail to build because the compiler runs
8710: into an operating system specific soft limit. With the
8711: <code class="varname">UNLIMIT_RESOURCES</code> variable pkgsrc can be told
1.94 wiz 8712: to unlimit the resources. Currently, the allowed values are any combination of
8713: <span class="quote">“<span class="quote">cputime</span>”</span>, <span class="quote">“<span class="quote">datasize</span>”</span>,
8714: <span class="quote">“<span class="quote">memorysize</span>”</span>, and <span class="quote">“<span class="quote">stacksize</span>”</span>.
1.1 dsieger 8715: Setting this variable is similar to running the shell builtin
1.10 hubertf 8716: <span class="command"><strong>ulimit</strong></span> command to raise the maximum data
1.1 dsieger 8717: segment size or maximum stack size of a process, respectively, to
8718: their hard limits.</p>
8719: </div>
8720: </div>
1.41 asau 8721: <div class="sect1">
1.1 dsieger 8722: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 8723: <a name="fixes.install"></a>21.6. The <span class="emphasis"><em>install</em></span> phase</h2></div></div></div>
1.41 asau 8724: <div class="sect2">
1.1 dsieger 8725: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8726: <a name="install-scripts"></a>21.6.1. Creating needed directories</h3></div></div></div>
1.10 hubertf 8727: <p>The BSD-compatible <span class="command"><strong>install</strong></span> supplied
1.1 dsieger 8728: with some operating systems cannot create more than one
8729: directory at a time. As such, you should call
8730: <code class="literal">${INSTALL_*_DIR}</code> like this:</p>
8731: <pre class="programlisting">
8732: ${INSTALL_DATA_DIR} ${PREFIX}/dir1
8733: ${INSTALL_DATA_DIR} ${PREFIX}/dir2
1.111 sevan 8734: </pre>
1.23 wiz 8735: <p>You can also just append <span class="quote">“<span class="quote"><code class="literal">dir1
8736: dir2</code></span>”</span> to the
1.1 dsieger 8737: <code class="varname">INSTALLATION_DIRS</code> variable, which will
8738: automatically do the right thing.</p>
8739: </div>
1.41 asau 8740: <div class="sect2">
1.1 dsieger 8741: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8742: <a name="where-to-install-documentation"></a>21.6.2. Where to install documentation</h3></div></div></div>
1.1 dsieger 8743: <p>In general, documentation should be installed into
8744: <code class="filename">${PREFIX}/share/doc/${PKGBASE}</code> or
8745: <code class="filename">${PREFIX}/share/doc/${PKGNAME}</code> (the latter
8746: includes the version number of the package).</p>
8747: <p>Many modern packages using GNU autoconf allow to set the
8748: directory where HTML documentation is installed with the
1.23 wiz 8749: <span class="quote">“<span class="quote">--with-html-dir</span>”</span> option. Sometimes using this flag
1.1 dsieger 8750: is needed because otherwise the documentation ends up in
8751: <code class="filename">${PREFIX}/share/doc/html</code> or other
8752: places.</p>
8753: <p>An exception to the above is that library API documentation
1.137 leot 8754: 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 8755: browsers (devhelp) should be left at their default location, which
8756: is <code class="filename">${PREFIX}/share/gtk-doc</code>. Such
8757: documentation can be recognized from files ending in
8758: <code class="filename">.devhelp</code> or <code class="filename">.devhelp2</code>.
8759: (It is also acceptable to install such files in
8760: <code class="filename">${PREFIX}/share/doc/${PKGBASE}</code> or
8761: <code class="filename">${PREFIX}/share/doc/${PKGNAME}</code>; the
8762: <code class="filename">.devhelp*</code> file must be directly in that
8763: directory then, no additional subdirectory level is allowed in
8764: this case. This is usually achieved by using
1.23 wiz 8765: <span class="quote">“<span class="quote">--with-html-dir=${PREFIX}/share/doc</span>”</span>.
1.1 dsieger 8766: <code class="filename">${PREFIX}/share/gtk-doc</code> is preferred
8767: though.)</p>
8768: </div>
1.41 asau 8769: <div class="sect2">
1.1 dsieger 8770: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8771: <a name="installing-score-files"></a>21.6.3. Installing highscore files</h3></div></div></div>
1.1 dsieger 8772: <p>Certain packages, most of them in the games category, install
8773: a score file that allows all users on the system to record their
8774: highscores. In order for this to work, the binaries need to be
8775: installed setgid and the score files owned by the appropriate
1.35 wiz 8776: group and/or owner (traditionally the "games" user/group). Set
8777: <code class="varname">USE_GAMESGROUP</code> to yes to support this. The
1.1 dsieger 8778: following variables, documented in more detail in
8779: <code class="filename">mk/defaults/mk.conf</code>, control this
1.35 wiz 8780: behaviour: <code class="varname">GAMEDATAMODE</code>,
8781: <code class="varname">GAMEDIRMODE</code>, <code class="varname">GAMES_GROUP</code>,
1.100 leot 8782: <code class="varname">GAMEMODE</code>, <code class="varname">GAME_USER</code>.
8783: Other useful variables are: <code class="varname">GAMEDIR_PERMS</code>,
8784: <code class="varname">GAMEDATA_PERMS</code> and
8785: <code class="varname">SETGID_GAMES_PERMS</code>.</p>
8786: <p>An example that illustrates some of the variables described above is
8787: <code class="filename">games/moon-buggy</code>. <code class="varname">OWN_DIRS_PERMS</code> is
8788: used to properly set directory permissions of the directory where the
8789: scorefile is saved, <code class="varname">REQD_FILES_PERMS</code> is used to create a
8790: dummy scorefile (<code class="filename">mbscore</code>) with the proper permissions
8791: and <code class="varname">SPECIAL_PERMS</code> is used to install setgid the game
8792: binary:</p>
8793: <pre class="programlisting">
1.112 rillig 8794: USE_GAMESGROUP= yes
1.100 leot 8795:
1.112 rillig 8796: BUILD_DEFS+= VARBASE
1.100 leot 8797:
1.112 rillig 8798: OWN_DIRS_PERMS+= ${VARBASE}/games/moon-buggy ${GAMEDIR_PERMS}
8799: REQD_FILES_PERMS+= /dev/null ${VARBASE}/games/moon-buggy/mbscore ${GAMEDATA_PERMS}
8800: SPECIAL_PERMS+= ${PREFIX}/bin/moon-buggy ${SETGID_GAMES_PERMS}
1.111 sevan 8801: </pre>
1.100 leot 8802: <p>Various <code class="varname">INSTALL_*</code> variables are also available:
8803: <code class="varname">INSTALL_GAME</code> to install setgid game binaries,
8804: <code class="varname">INSTALL_GAME_DIR</code> to install game directories that are
8805: needed to be accessed by setgid games and
8806: <code class="varname">INSTALL_GAME_DATA</code> to install scorefiles.</p>
1.14 jmcneill 8807: <p>A package should therefore never hard code file ownership or
1.100 leot 8808: access permissions but rely on <code class="varname">*_PERMS</code> as described above
8809: or alternatively on <code class="varname">INSTALL_GAME</code>,
8810: <code class="varname">INSTALL_GAME_DATA</code> and
8811: <code class="varname">INSTALL_GAME_DIR</code> to set these correctly.</p>
1.1 dsieger 8812: </div>
1.41 asau 8813: <div class="sect2">
1.1 dsieger 8814: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8815: <a name="destdir-support"></a>21.6.4. Adding DESTDIR support to packages</h3></div></div></div>
1.14 jmcneill 8816: <p><code class="varname">DESTDIR</code> support means that a package
8817: installs into a staging directory, not the final location of the
8818: files. Then a binary package is created which can be used for
8819: installation as usual. There are two ways: Either the package must
1.23 wiz 8820: install as root (<span class="quote">“<span class="quote">destdir</span>”</span>) or the package can
8821: install as non-root user (<span class="quote">“<span class="quote">user-destdir</span>”</span>).</p>
1.41 asau 8822: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 8823: <li class="listitem"><p><code class="varname">PKG_DESTDIR_SUPPORT</code> has to be
1.113 leot 8824: set to <span class="quote">“<span class="quote">destdir</span>”</span> or <span class="quote">“<span class="quote">user-destdir</span>”</span>.
8825: By default <code class="varname">PKG_DESTDIR_SUPPORT</code>
1.38 wiz 8826: is set to <span class="quote">“<span class="quote">user-destdir</span>”</span> to help catching more
8827: potential packaging problems. If bsd.prefs.mk is included in the Makefile,
1.14 jmcneill 8828: <code class="varname">PKG_DESTDIR_SUPPORT</code> needs to be set before
8829: the inclusion.</p></li>
1.23 wiz 8830: <li class="listitem"><p>All installation operations have to be prefixed with
1.4 rillig 8831: <code class="filename">${DESTDIR}</code>.</p></li>
1.23 wiz 8832: <li class="listitem"><p>automake gets this DESTDIR mostly right
1.4 rillig 8833: automatically. Many manual rules and pre/post-install often are
8834: incorrect; fix them.</p></li>
1.23 wiz 8835: <li class="listitem"><p>If files are installed with special owner/group
1.17 imil 8836: use <code class="varname">SPECIAL_PERMS</code>.</p></li>
1.23 wiz 8837: <li class="listitem"><p>In general, packages should support
1.4 rillig 8838: <code class="varname">UNPRIVILEGED</code> to be able to use
8839: DESTDIR.</p></li>
8840: </ul></div>
8841: </div>
1.41 asau 8842: <div class="sect2">
1.4 rillig 8843: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8844: <a name="hardcoded-paths"></a>21.6.5. Packages with hardcoded paths to other interpreters</h3></div></div></div>
1.1 dsieger 8845: <p>Your package may also contain scripts with hardcoded paths to
8846: other interpreters besides (or as well as) perl. To correct the
8847: full pathname to the script interpreter, you need to set the
8848: following definitions in your <code class="filename">Makefile</code> (we
1.10 hubertf 8849: shall use <span class="command"><strong>tclsh</strong></span> in this example):</p>
1.1 dsieger 8850: <pre class="programlisting">
8851: REPLACE_INTERPRETER+= tcl
8852: REPLACE.tcl.old= .*/bin/tclsh
8853: REPLACE.tcl.new= ${PREFIX}/bin/tclsh
8854: REPLACE_FILES.tcl= # list of tcl scripts which need to be fixed,
8855: # relative to ${WRKSRC}, just as in REPLACE_PERL
1.111 sevan 8856: </pre>
1.41 asau 8857: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 8858: <h3 class="title">Note</h3>
8859: <p>Before March 2006, these variables were called
8860: <code class="varname">_REPLACE.*</code> and
8861: <code class="varname">_REPLACE_FILES.*</code>.</p>
8862: </div>
8863: </div>
1.41 asau 8864: <div class="sect2">
1.1 dsieger 8865: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8866: <a name="perl-modules"></a>21.6.6. Packages installing perl modules</h3></div></div></div>
1.1 dsieger 8867: <p>Makefiles of packages providing perl5 modules should include
8868: the Makefile fragment
8869: <code class="filename">../../lang/perl5/module.mk</code>. It provides a
1.10 hubertf 8870: <span class="command"><strong>do-configure</strong></span> target for the standard perl
1.1 dsieger 8871: configuration for such modules as well as various hooks to tune
8872: this configuration. See comments in this file for
8873: details.</p>
8874: <p>Perl5 modules will install into different places depending
8875: on the version of perl used during the build process. To
8876: address this, pkgsrc will append lines to the
8877: <code class="filename">PLIST</code> corresponding to the files listed in
8878: the installed <code class="filename">.packlist</code> file generated by
8879: most perl5 modules. This is invoked by defining
8880: <code class="varname">PERL5_PACKLIST</code> to a space-separated list of
1.47 wiz 8881: packlist files relative to <code class="varname">PERL5_PACKLIST_DIR</code>
8882: (<code class="varname">PERL5_INSTALLVENDORARCH</code> by default),
8883: e.g.:</p>
1.1 dsieger 8884: <pre class="programlisting">
1.47 wiz 8885: PERL5_PACKLIST= auto/Pg/.packlist
1.111 sevan 8886: </pre>
1.47 wiz 8887: <p>The perl5 config variables
8888: <code class="varname">installarchlib</code>,
8889: <code class="varname">installscript</code>,
8890: <code class="varname">installvendorbin</code>,
8891: <code class="varname">installvendorscript</code>,
8892: <code class="varname">installvendorarch</code>,
8893: <code class="varname">installvendorlib</code>,
8894: <code class="varname">installvendorman1dir</code>, and
8895: <code class="varname">installvendorman3dir</code> represent those
8896: locations in which components of perl5 modules may be installed,
8897: provided as variable with uppercase and prefixed with
8898: <code class="varname">PERL5_</code>, e.g. <code class="varname">PERL5_INSTALLARCHLIB</code>
8899: and may be used by perl5 packages that don't have a packlist.
8900: These variables are also substituted for in the
8901: <code class="filename">PLIST</code> as uppercase prefixed with
8902: <code class="varname">PERL5_SUB_</code>.</p>
1.1 dsieger 8903: </div>
1.41 asau 8904: <div class="sect2">
1.1 dsieger 8905: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8906: <a name="faq.info-files"></a>21.6.7. Packages installing info files</h3></div></div></div>
1.1 dsieger 8907: <p>Some packages install info files or use the
1.23 wiz 8908: <span class="quote">“<span class="quote">makeinfo</span>”</span> or <span class="quote">“<span class="quote">install-info</span>”</span>
1.1 dsieger 8909: commands. <code class="varname">INFO_FILES</code> should be defined in
8910: the package Makefile so that <code class="filename">INSTALL</code> and
8911: <code class="filename">DEINSTALL</code> scripts will be generated to
8912: handle registration of the info files in the Info directory
1.23 wiz 8913: file. The <span class="quote">“<span class="quote">install-info</span>”</span> command used for the info
1.1 dsieger 8914: files registration is either provided by the system, or by a
8915: special purpose package automatically added as dependency if
8916: needed.</p>
8917: <p><code class="varname">PKGINFODIR</code> is the directory under
8918: <code class="filename">${PREFIX}</code> where info files are primarily
8919: located. <code class="varname">PKGINFODIR</code> defaults to
1.23 wiz 8920: <span class="quote">“<span class="quote">info</span>”</span> and can be overridden by the user.</p>
1.1 dsieger 8921: <p>The info files for the package should be listed in the
8922: package <code class="filename">PLIST</code>; however any split info files
8923: need not be listed.</p>
1.23 wiz 8924: <p>A package which needs the <span class="quote">“<span class="quote">makeinfo</span>”</span> command
8925: at build time must add <span class="quote">“<span class="quote">makeinfo</span>”</span> to
1.1 dsieger 8926: <code class="varname">USE_TOOLS</code> in its Makefile. If a minimum
1.23 wiz 8927: version of the <span class="quote">“<span class="quote">makeinfo</span>”</span> command is needed it
1.1 dsieger 8928: should be noted with the <code class="varname">TEXINFO_REQD</code>
8929: variable in the package <code class="filename">Makefile</code>. By
8930: default, a minimum version of 3.12 is required. If the system
1.10 hubertf 8931: does not provide a <span class="command"><strong>makeinfo</strong></span> command or if it
1.1 dsieger 8932: does not match the required minimum, a build dependency on the
1.137 leot 8933: <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 8934: be added automatically.</p>
8935: <p>The build and installation process of the software provided
8936: by the package should not use the
1.10 hubertf 8937: <span class="command"><strong>install-info</strong></span> command as the registration of
1.1 dsieger 8938: info files is the task of the package
8939: <code class="filename">INSTALL</code> script, and it must use the
1.10 hubertf 8940: appropriate <span class="command"><strong>makeinfo</strong></span> command.</p>
1.1 dsieger 8941: <p>To achieve this goal, the pkgsrc infrastructure creates
1.10 hubertf 8942: overriding scripts for the <span class="command"><strong>install-info</strong></span> and
8943: <span class="command"><strong>makeinfo</strong></span> commands in a directory listed early
1.1 dsieger 8944: in <code class="varname">PATH</code>.</p>
1.10 hubertf 8945: <p>The script overriding <span class="command"><strong>install-info</strong></span> has
1.1 dsieger 8946: no effect except the logging of a message. The script overriding
1.10 hubertf 8947: <span class="command"><strong>makeinfo</strong></span> logs a message and according to the
1.1 dsieger 8948: value of <code class="varname">TEXINFO_REQD</code> either runs the appropriate
1.10 hubertf 8949: <span class="command"><strong>makeinfo</strong></span> command or exit on error.</p>
1.1 dsieger 8950: </div>
1.41 asau 8951: <div class="sect2">
1.1 dsieger 8952: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8953: <a name="manpages"></a>21.6.8. Packages installing man pages</h3></div></div></div>
1.1 dsieger 8954: <p>All packages that install manual pages should install them
8955: into the same directory, so that there is one common place to look
8956: for them. In pkgsrc, this place is
8957: <code class="literal">${PREFIX}/${PKGMANDIR}</code>, and this expression
8958: should be used in packages. The default for
8959: <code class="varname">PKGMANDIR</code> is
1.23 wiz 8960: <span class="quote">“<span class="quote"><code class="filename">man</code></span>”</span>. Another often-used value
8961: is <span class="quote">“<span class="quote"><code class="filename">share/man</code></span>”</span>.</p>
1.41 asau 8962: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 8963: <h3 class="title">Note</h3>
8964: <p>The support for a custom <code class="varname">PKGMANDIR</code>
8965: is far from complete.</p>
8966: </div>
8967: <p>The <code class="filename">PLIST</code> files can just use
8968: <code class="filename">man/</code> as the top level directory for the man
8969: page file entries, and the pkgsrc framework will convert as
8970: needed. In all other places, the correct
8971: <code class="varname">PKGMANDIR</code> must be used.</p>
8972: <p>Packages that are
8973: configured with <code class="varname">GNU_CONFIGURE</code> set as
1.23 wiz 8974: <span class="quote">“<span class="quote">yes</span>”</span>, by default will use the
1.1 dsieger 8975: <code class="filename">./configure</code>
8976: --mandir switch to set where the man pages should be installed.
8977: The path is <code class="varname">GNU_CONFIGURE_MANDIR</code> which defaults
8978: to <code class="varname">${PREFIX}/${PKGMANDIR}</code>.</p>
8979: <p>Packages that use <code class="varname">GNU_CONFIGURE</code> but do not
8980: use --mandir, can set <code class="varname">CONFIGURE_HAS_MANDIR</code>
1.23 wiz 8981: to <span class="quote">“<span class="quote">no</span>”</span>.
1.1 dsieger 8982: Or if the <code class="filename">./configure</code> script uses
8983: a non-standard use of --mandir, you can set
8984: <code class="varname">GNU_CONFIGURE_MANDIR</code> as needed.</p>
1.154 rillig 8985: <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 8986: information on installation of compressed manual pages.</p>
8987: </div>
1.41 asau 8988: <div class="sect2">
1.1 dsieger 8989: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 8990: <a name="gconf-data-files"></a>21.6.9. Packages installing GConf data files</h3></div></div></div>
1.1 dsieger 8991: <p>If a package installs <code class="filename">.schemas</code> or
1.7 rillig 8992: <code class="filename">.entries</code> files, used by GConf,
1.1 dsieger 8993: you need to take some extra steps to make sure they get registered
8994: in the database:</p>
1.23 wiz 8995: <div class="orderedlist"><ol class="orderedlist" type="1">
8996: <li class="listitem"><p>Include <code class="filename">../../devel/GConf/schemas.mk</code>
1.1 dsieger 8997: instead of its <code class="filename">buildlink3.mk</code> file. This
1.7 rillig 8998: takes care of rebuilding the GConf database at installation and
1.1 dsieger 8999: deinstallation time, and tells the package where to install
1.7 rillig 9000: GConf data files using some standard configure arguments. It
1.1 dsieger 9001: also disallows any access to the database directly from the
9002: package.</p></li>
1.23 wiz 9003: <li class="listitem"><p>Ensure that the package installs its
1.1 dsieger 9004: <code class="filename">.schemas</code> files under
9005: <code class="filename">${PREFIX}/share/gconf/schemas</code>. If they get
9006: installed under <code class="filename">${PREFIX}/etc</code>, you will
9007: need to manually patch the package.</p></li>
1.23 wiz 9008: <li class="listitem"><p>Check the PLIST and remove any entries under the etc/gconf
1.1 dsieger 9009: directory, as they will be handled automatically. See
1.154 rillig 9010: <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 9011: <li class="listitem"><p>Define the <code class="varname">GCONF_SCHEMAS</code> variable in
1.1 dsieger 9012: your <code class="filename">Makefile</code> with a list of all
9013: <code class="filename">.schemas</code> files installed by the package, if
9014: any. Names must not contain any directories in them.</p></li>
1.23 wiz 9015: <li class="listitem"><p>Define the <code class="varname">GCONF_ENTRIES</code> variable in
1.1 dsieger 9016: your <code class="filename">Makefile</code> with a
9017: list of all <code class="filename">.entries</code> files installed by the
9018: package, if any. Names must not contain any directories in
9019: them.</p></li>
9020: </ol></div>
9021: </div>
1.41 asau 9022: <div class="sect2">
1.1 dsieger 9023: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9024: <a name="scrollkeeper-data-files"></a>21.6.10. Packages installing scrollkeeper/rarian data files</h3></div></div></div>
1.1 dsieger 9025: <p>If a package installs <code class="filename">.omf</code> files, used by
1.18 snj 9026: scrollkeeper/rarian, you need to take some extra steps to make sure they
1.1 dsieger 9027: get registered in the database:</p>
1.23 wiz 9028: <div class="orderedlist"><ol class="orderedlist" type="1">
9029: <li class="listitem"><p>Include
1.18 snj 9030: <code class="filename">../../mk/omf-scrollkeeper.mk</code>
9031: instead of rarian's <code class="filename">buildlink3.mk</code> file. This
1.1 dsieger 9032: takes care of rebuilding the scrollkeeper database at
9033: installation and deinstallation time, and disallows any access
9034: to it directly from the package.</p></li>
1.23 wiz 9035: <li class="listitem"><p>Check the PLIST and remove any entries under the
1.1 dsieger 9036: <code class="filename">libdata/scrollkeeper</code> directory, as they
9037: will be handled automatically.</p></li>
1.23 wiz 9038: <li class="listitem"><p>Remove the <code class="filename">share/omf</code> directory from
1.18 snj 9039: the PLIST. It will be handled by rarian. (<span class="command"><strong>make
9040: print-PLIST</strong></span> does this automatically.)</p></li>
1.1 dsieger 9041: </ol></div>
9042: </div>
1.41 asau 9043: <div class="sect2">
1.1 dsieger 9044: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9045: <a name="x11-fonts"></a>21.6.11. Packages installing X11 fonts</h3></div></div></div>
1.1 dsieger 9046: <p>If a package installs font files, you will need to rebuild
9047: the fonts database in the directory where they get installed at
9048: installation and deinstallation time. This can be automatically
9049: done by using the pkginstall framework.</p>
9050: <p>You can list the directories where fonts are installed in the
9051: <code class="varname">FONTS_DIRS.<em class="replaceable"><code>type</code></em></code>
9052: variables, where <em class="replaceable"><code>type</code></em> can be one of
1.23 wiz 9053: <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 9054: Also make sure that the database file
9055: <code class="filename">fonts.dir</code> is not listed in the PLIST.</p>
9056: <p>Note that you should not create new directories for fonts;
9057: instead use the standard ones to avoid that the user needs to
9058: manually configure his X server to find them.</p>
9059: </div>
1.41 asau 9060: <div class="sect2">
1.1 dsieger 9061: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9062: <a name="gtk2-modules"></a>21.6.12. Packages installing GTK2 modules</h3></div></div></div>
1.1 dsieger 9063: <p>If a package installs GTK2 immodules or loaders, you need to
9064: take some extra steps to get them registered in the GTK2 database
9065: properly:</p>
1.23 wiz 9066: <div class="orderedlist"><ol class="orderedlist" type="1">
9067: <li class="listitem"><p>Include
1.1 dsieger 9068: <code class="filename">../../x11/gtk2/modules.mk</code> instead of its
9069: <code class="filename">buildlink3.mk</code> file. This takes care of
9070: rebuilding the database at installation and deinstallation time.</p></li>
1.23 wiz 9071: <li class="listitem"><p>Set <code class="varname">GTK2_IMMODULES=YES</code> if
1.1 dsieger 9072: your package installs GTK2 immodules.</p></li>
1.23 wiz 9073: <li class="listitem"><p>Set <code class="varname">GTK2_LOADERS=YES</code> if your package installs
1.1 dsieger 9074: GTK2 loaders.</p></li>
1.23 wiz 9075: <li class="listitem">
1.1 dsieger 9076: <p>Patch the package to not touch any of the GTK2
9077: databases directly. These are:</p>
1.41 asau 9078: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9079: <li class="listitem"><p><code class="filename">libdata/gtk-2.0/gdk-pixbuf.loaders</code></p></li>
9080: <li class="listitem"><p><code class="filename">libdata/gtk-2.0/gtk.immodules</code></p></li>
1.1 dsieger 9081: </ul></div>
9082: </li>
1.23 wiz 9083: <li class="listitem"><p>Check the <code class="filename">PLIST</code> and remove
1.1 dsieger 9084: any entries under the <code class="filename">libdata/gtk-2.0</code>
9085: directory, as they will be handled automatically.</p></li>
9086: </ol></div>
9087: </div>
1.41 asau 9088: <div class="sect2">
1.1 dsieger 9089: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9090: <a name="sgml-xml-data"></a>21.6.13. Packages installing SGML or XML data</h3></div></div></div>
1.1 dsieger 9091: <p>If a package installs SGML or XML data files that need to be
9092: registered in system-wide catalogs (like DTDs, sub-catalogs,
9093: etc.), you need to take some extra steps:</p>
1.23 wiz 9094: <div class="orderedlist"><ol class="orderedlist" type="1">
9095: <li class="listitem"><p>Include
1.1 dsieger 9096: <code class="filename">../../textproc/xmlcatmgr/catalogs.mk</code> in
9097: your <code class="filename">Makefile</code>, which takes care of
9098: registering those files in system-wide catalogs at
9099: installation and deinstallation time.</p></li>
1.23 wiz 9100: <li class="listitem"><p>Set <code class="varname">SGML_CATALOGS</code> to the full path of
1.1 dsieger 9101: any SGML catalogs installed by the package.</p></li>
1.23 wiz 9102: <li class="listitem"><p>Set <code class="varname">XML_CATALOGS</code> to the full path of
1.1 dsieger 9103: any XML catalogs installed by the package.</p></li>
1.23 wiz 9104: <li class="listitem"><p>Set <code class="varname">SGML_ENTRIES</code> to individual entries
1.1 dsieger 9105: to be added to the SGML catalog. These come in groups of
9106: three strings; see xmlcatmgr(1) for more information
9107: (specifically, arguments recognized by the 'add' action).
9108: Note that you will normally not use this variable.</p></li>
1.23 wiz 9109: <li class="listitem"><p>Set <code class="varname">XML_ENTRIES</code> to individual entries
1.1 dsieger 9110: to be added to the XML catalog. These come in groups of three
9111: strings; see xmlcatmgr(1) for more information (specifically,
9112: arguments recognized by the 'add' action). Note that you will
9113: normally not use this variable.</p></li>
9114: </ol></div>
9115: </div>
1.41 asau 9116: <div class="sect2">
1.1 dsieger 9117: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9118: <a name="mime-database"></a>21.6.14. Packages installing extensions to the MIME database</h3></div></div></div>
1.1 dsieger 9119: <p>If a package provides extensions to the MIME database by
9120: installing <code class="filename">.xml</code> files inside
9121: <code class="filename">${PREFIX}/share/mime/packages</code>, you
9122: need to take some extra steps to ensure that the database is kept
9123: consistent with respect to these new files:</p>
1.23 wiz 9124: <div class="orderedlist"><ol class="orderedlist" type="1">
9125: <li class="listitem"><p>Include
1.1 dsieger 9126: <code class="filename">../../databases/shared-mime-info/mimedb.mk</code>
9127: (avoid using the <code class="filename">buildlink3.mk</code> file from
9128: this same directory, which is reserved for inclusion from
9129: other <code class="filename">buildlink3.mk</code> files). It takes
9130: care of rebuilding the MIME database at installation and
9131: deinstallation time, and disallows any access to it directly
9132: from the package.</p></li>
1.23 wiz 9133: <li class="listitem"><p>Check the PLIST and remove any entries under the
1.1 dsieger 9134: <code class="filename">share/mime</code> directory,
9135: <span class="emphasis"><em>except</em></span> for files saved under
9136: <code class="filename">share/mime/packages</code>. The former are
9137: handled automatically by
9138: the update-mime-database program, but the latter are
9139: package-dependent and must be removed by the package that
9140: installed them in the first place.</p></li>
1.23 wiz 9141: <li class="listitem"><p>Remove any <code class="filename">share/mime/*</code> directories
1.1 dsieger 9142: from the PLIST. They will be handled by the shared-mime-info
9143: package.</p></li>
9144: </ol></div>
9145: </div>
1.41 asau 9146: <div class="sect2">
1.1 dsieger 9147: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9148: <a name="intltool"></a>21.6.15. Packages using intltool</h3></div></div></div>
1.1 dsieger 9149: <p>If a package uses intltool during its build, add
9150: <code class="literal">intltool</code> to the <code class="varname">USE_TOOLS</code>,
9151: which forces it to use the intltool package provided by pkgsrc,
9152: instead of the one bundled with the distribution file.</p>
9153: <p>This tracks intltool's build-time dependencies and uses the
9154: latest available version; this way, the package benefits of any
9155: bug fixes that may have appeared since it was released.</p>
9156: </div>
1.41 asau 9157: <div class="sect2">
1.1 dsieger 9158: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9159: <a name="startup-scripts"></a>21.6.16. Packages installing startup scripts</h3></div></div></div>
1.1 dsieger 9160: <p>If a package contains a rc.d script, it won't be copied into
9161: the startup directory by default, but you can enable it, by adding
9162: the option <code class="varname">PKG_RCD_SCRIPTS=YES</code> in
1.10 hubertf 9163: <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. This option will copy the scripts
1.1 dsieger 9164: into <code class="filename">/etc/rc.d</code> when a package is installed, and
9165: it will automatically remove the scripts when the package is
9166: deinstalled.</p>
9167: </div>
1.41 asau 9168: <div class="sect2">
1.1 dsieger 9169: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9170: <a name="tex-packages"></a>21.6.17. Packages installing TeX modules</h3></div></div></div>
1.1 dsieger 9171: <p>If a package installs TeX packages into the texmf tree,
9172: the <code class="filename">ls-R</code> database of the tree needs to be
9173: updated.</p>
1.41 asau 9174: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 9175: <h3 class="title">Note</h3>
1.22 jakllsch 9176: <p>Except the main TeX packages such as kpathsea,
1.1 dsieger 9177: packages should install files
1.22 jakllsch 9178: into <code class="filename">${PREFIX}/share/texmf-dist</code>,
9179: not <code class="filename">${PREFIX}/share/texmf</code>.</p>
1.1 dsieger 9180: </div>
1.23 wiz 9181: <div class="orderedlist"><ol class="orderedlist" type="1">
9182: <li class="listitem"><p>Include
1.22 jakllsch 9183: <code class="filename">../../print/kpathsea/texmf.mk</code>. This
1.1 dsieger 9184: takes care of rebuilding the <code class="filename">ls-R</code>
9185: database at installation and deinstallation time.</p></li>
1.23 wiz 9186: <li class="listitem">
1.1 dsieger 9187: <p>If your package installs files into a texmf
9188: tree other than the one
1.22 jakllsch 9189: at <code class="filename">${PREFIX}/share/texmf-dist</code>,
9190: set <code class="varname">TEX_TEXMF_DIRS</code> to the list of all texmf
1.1 dsieger 9191: trees that need database update.</p>
9192: <p>If your package also installs font map files that need
1.10 hubertf 9193: to be registered using <span class="command"><strong>updmap</strong></span>,
1.29 dholland 9194: include <code class="filename">../../print/tex-tetex/map.mk</code> and
1.22 jakllsch 9195: set <code class="varname">TEX_MAP_FILES</code> and/or
9196: <code class="varname">TEX_MIXEDMAP_FILES</code> to the list of all
1.10 hubertf 9197: such font map files. Then <span class="command"><strong>updmap</strong></span> will
1.1 dsieger 9198: be run automatically at installation/deinstallation to
9199: enable/disable font map files for TeX output
9200: drivers.</p>
9201: </li>
1.23 wiz 9202: <li class="listitem"><p>Make sure that none of <code class="filename">ls-R</code>
1.1 dsieger 9203: databases are included in <code class="filename">PLIST</code>, as
1.29 dholland 9204: they will be removed only by the kpathsea package.</p></li>
1.1 dsieger 9205: </ol></div>
9206: </div>
1.41 asau 9207: <div class="sect2">
1.1 dsieger 9208: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9209: <a name="emulation-packages"></a>21.6.18. Packages supporting running binaries in
1.1 dsieger 9210: emulation</h3></div></div></div>
9211: <p>There are some packages that provide libraries and
9212: executables for running binaries from a one operating system
9213: on a different one (if the latter supports it). One example
9214: is running Linux binaries on NetBSD.</p>
1.137 leot 9215: <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 9216: helps in extracting and packaging Linux rpm packages.</p>
9217: <p>The <code class="varname">CHECK_SHLIBS</code> can be set to no to
1.10 hubertf 9218: avoid the <span class="command"><strong>check-shlibs</strong></span> target, which tests
1.1 dsieger 9219: if all libraries for each installed executable can be found by
9220: the dynamic linker. Since the standard dynamic linker is run,
9221: this fails for emulation packages, because the libraries used
9222: by the emulation are not in the standard directories.</p>
9223: </div>
1.41 asau 9224: <div class="sect2">
1.1 dsieger 9225: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9226: <a name="hicolor-theme"></a>21.6.19. Packages installing hicolor theme icons</h3></div></div></div>
1.1 dsieger 9227: <p>If a package installs images under the
9228: <code class="filename">share/icons/hicolor</code> and/or updates the
9229: <code class="filename">share/icons/hicolor/icon-theme.cache</code>
9230: database, you need to take some extra steps to make sure that the
9231: shared theme directory is handled appropriately and that the cache
9232: database is rebuilt:</p>
1.23 wiz 9233: <div class="orderedlist"><ol class="orderedlist" type="1">
9234: <li class="listitem"><p>Include
1.1 dsieger 9235: <code class="filename">../../graphics/hicolor-icon-theme/buildlink3.mk</code>.</p></li>
1.23 wiz 9236: <li class="listitem"><p>Check the <code class="filename">PLIST</code> and remove the
1.1 dsieger 9237: entry that refers to the theme cache.</p></li>
1.23 wiz 9238: <li class="listitem"><p>Ensure that the PLIST does not remove the shared icon
1.1 dsieger 9239: directories from the <code class="filename">share/icons/hicolor</code>
9240: hierarchy because they will be handled automatically.</p></li>
9241: </ol></div>
9242: <p>The best way to verify that the PLIST is correct with
9243: respect to the last two points is to regenerate it using
1.10 hubertf 9244: <span class="command"><strong>make print-PLIST</strong></span>.</p>
1.1 dsieger 9245: </div>
1.41 asau 9246: <div class="sect2">
1.1 dsieger 9247: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 9248: <a name="desktop-files"></a>21.6.20. Packages installing desktop files</h3></div></div></div>
1.1 dsieger 9249: <p>If a package installs <code class="filename">.desktop</code> files
9250: under <code class="filename">share/applications</code> and these include
1.53 rodent 9251: MIME information (MimeType key), you need to take extra steps to
9252: ensure that they are registered into the MIME database:</p>
1.23 wiz 9253: <div class="orderedlist"><ol class="orderedlist" type="1">
9254: <li class="listitem"><p>Include
1.1 dsieger 9255: <code class="filename">../../sysutils/desktop-file-utils/desktopdb.mk</code>.</p></li>
1.23 wiz 9256: <li class="listitem"><p>Check the PLIST and remove the entry that refers to the
1.1 dsieger 9257: <code class="filename">share/applications/mimeinfo.cache</code> file.
9258: It will be handled automatically.</p></li>
9259: </ol></div>
9260: <p>The best way to verify that the PLIST is correct with
1.10 hubertf 9261: respect to the last point is to regenerate it using <span class="command"><strong>make
1.1 dsieger 9262: print-PLIST</strong></span>.</p>
9263: </div>
9264: </div>
1.41 asau 9265: <div class="sect1">
1.1 dsieger 9266: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9267: <a name="punting"></a>21.7. Marking packages as having problems</h2></div></div></div>
1.1 dsieger 9268: <p>In some cases one does not have the time to solve a problem
1.22 jakllsch 9269: immediately. In this case, one can plainly mark a package as broken. For
9270: this, one just sets the variable <code class="varname">BROKEN</code> to the
9271: reason why the package is broken (similar to the
1.162 rillig 9272: <code class="varname">PKG_FAIL_REASON</code> variable). A user trying to build
1.22 jakllsch 9273: the package will immediately be shown this message, and the build
9274: will not be even tried.</p>
9275: <p><code class="varname">BROKEN</code> packages are removed from pkgsrc in irregular
1.1 dsieger 9276: intervals.</p>
9277: </div>
9278: </div>
1.41 asau 9279: <div class="chapter">
1.1 dsieger 9280: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9281: <a name="debug"></a>Chapter 22. Debugging</h2></div></div></div>
1.1 dsieger 9282: <p>To check out all the gotchas when building a package, here are
9283: the steps that I do in order to get a package working. Please note
9284: this is basically the same as what was explained in the previous
9285: sections, only with some debugging aids.</p>
1.41 asau 9286: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9287: <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>
9288: <li class="listitem">
1.137 leot 9289: <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 9290: create a directory for a new package, change into it, then run
1.10 hubertf 9291: <span class="command"><strong>url2pkg</strong></span>:</p>
1.1 dsieger 9292: <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>
9293: <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 9294: <code class="prompt">%</code> <strong class="userinput"><code>url2pkg https://www.example.com/path/to/distfile.tar.gz</code></strong></pre>
1.1 dsieger 9295: </li>
1.23 wiz 9296: <li class="listitem"><p>Edit the <code class="filename">Makefile</code> as requested.</p></li>
9297: <li class="listitem"><p>Fill in the <code class="filename">DESCR</code> file</p></li>
9298: <li class="listitem"><p>Run <span class="command"><strong>make configure</strong></span></p></li>
9299: <li class="listitem"><p>Add any dependencies glimpsed from documentation and the
1.1 dsieger 9300: configure step to the package's
9301: <code class="filename">Makefile</code>.</p></li>
1.23 wiz 9302: <li class="listitem">
1.1 dsieger 9303: <p>Make the package compile, doing multiple rounds of</p>
9304: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make</code></strong>
9305: <code class="prompt">%</code> <strong class="userinput"><code>pkgvi ${WRKSRC}/some/file/that/does/not/compile</code></strong>
9306: <code class="prompt">%</code> <strong class="userinput"><code>mkpatches</code></strong>
9307: <code class="prompt">%</code> <strong class="userinput"><code>patchdiff</code></strong>
9308: <code class="prompt">%</code> <strong class="userinput"><code>mv ${WRKDIR}/.newpatches/* patches</code></strong>
9309: <code class="prompt">%</code> <strong class="userinput"><code>make mps</code></strong>
9310: <code class="prompt">%</code> <strong class="userinput"><code>make clean</code></strong></pre>
9311: <p>Doing this step as non-root user will ensure that no files
9312: are modified that shouldn't be, especially during the build
1.10 hubertf 9313: phase. <span class="command"><strong>mkpatches</strong></span>,
9314: <span class="command"><strong>patchdiff</strong></span> and <span class="command"><strong>pkgvi</strong></span> are
1.137 leot 9315: 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 9316: package.</p>
9317: </li>
1.23 wiz 9318: <li class="listitem"><p>Look at the <code class="filename">Makefile</code>, fix if
1.154 rillig 9319: 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 9320: <li class="listitem">
1.1 dsieger 9321: <p>Generate a <code class="filename">PLIST</code>:</p>
9322: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
9323: <code class="prompt">#</code> <strong class="userinput"><code>make print-PLIST >PLIST</code></strong>
9324: <code class="prompt">#</code> <strong class="userinput"><code>make deinstall</code></strong>
9325: <code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
9326: <code class="prompt">#</code> <strong class="userinput"><code>make deinstall</code></strong></pre>
9327: <p>You usually need to be <code class="username">root</code> to do
9328: this. Look if there are any files left:</p>
9329: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make print-PLIST</code></strong></pre>
9330: <p>If this reveals any files that are missing in
9331: <code class="filename">PLIST</code>, add them.</p>
9332: </li>
1.23 wiz 9333: <li class="listitem">
1.1 dsieger 9334: <p>Now that the <code class="filename">PLIST</code> is OK, install the
9335: package again and make a binary package:</p>
9336: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make reinstall</code></strong>
9337: <code class="prompt">#</code> <strong class="userinput"><code>make package</code></strong></pre>
9338: </li>
1.23 wiz 9339: <li class="listitem">
1.1 dsieger 9340: <p>Delete the installed package:</p>
9341: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>pkg_delete <em class="replaceable"><code>examplepkg</code></em></code></strong></pre>
9342: </li>
1.23 wiz 9343: <li class="listitem">
1.10 hubertf 9344: <p>Repeat the above <span class="command"><strong>make print-PLIST</strong></span>
1.1 dsieger 9345: command, which shouldn't find anything now:</p>
9346: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make print-PLIST</code></strong></pre>
9347: </li>
1.23 wiz 9348: <li class="listitem">
1.1 dsieger 9349: <p>Reinstall the binary package:</p>
9350: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>pkg_add .../<em class="replaceable"><code>examplepkg</code></em>.tgz</code></strong></pre>
9351: </li>
1.23 wiz 9352: <li class="listitem"><p>Play with it. Make sure everything works.</p></li>
9353: <li class="listitem">
1.137 leot 9354: <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 9355: reports:</p>
9356: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>pkglint</code></strong></pre>
9357: </li>
1.154 rillig 9358: <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 9359: </ul></div>
9360: </div>
1.41 asau 9361: <div class="chapter">
1.1 dsieger 9362: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9363: <a name="submit"></a>Chapter 23. Submitting and Committing</h2></div></div></div>
1.1 dsieger 9364: <div class="toc">
9365: <p><b>Table of Contents</b></p>
1.100 leot 9366: <dl class="toc">
1.154 rillig 9367: <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt>
9368: <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt>
9369: <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt>
9370: <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt>
9371: <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt>
9372: <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt>
9373: <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt>
9374: <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt>
1.1 dsieger 9375: </dl>
9376: </div>
1.41 asau 9377: <div class="sect1">
1.1 dsieger 9378: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9379: <a name="submitting-binary-packages"></a>23.1. Submitting binary packages</h2></div></div></div>
1.1 dsieger 9380: <p>Our policy is that we accept binaries only from pkgsrc
9381: developers to guarantee that the packages don't contain any
9382: trojan horses etc. This is not to annoy anyone but rather to
9383: protect our users! You're still free to put up your home-made
9384: binary packages and tell the world where to get them. NetBSD
9385: developers doing bulk builds and wanting to upload them please
1.154 rillig 9386: 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 9387: builds)</i></a>.</p>
1.1 dsieger 9388: </div>
1.41 asau 9389: <div class="sect1">
1.1 dsieger 9390: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9391: <a name="submitting-your-package"></a>23.2. Submitting source packages (for non-NetBSD-developers)</h2></div></div></div>
1.1 dsieger 9392: <p>First, check that your package is complete, compiles and
1.154 rillig 9393: 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 9394: 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 9395: archive that contains all files that make up the package.
9396: Finally, send this package to the pkgsrc bug tracking system,
1.174 leot 9397: 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 9398: that, go to the web page
1.174 leot 9399: <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 9400: which contains some instructions and a link to a form where you
9401: can submit packages. The
1.137 leot 9402: <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 9403: also available as a substitute for either of the above two tools.
9404: </p>
1.1 dsieger 9405: <p>In the form of the problem report, the category should be
1.23 wiz 9406: <span class="quote">“<span class="quote">pkg</span>”</span>, the synopsis should include the package name
1.1 dsieger 9407: and version number, and the description field should contain a
9408: short description of your package (contents of the COMMENT
9409: variable or DESCR file are OK). The uuencoded package data should
1.23 wiz 9410: go into the <span class="quote">“<span class="quote">fix</span>”</span> field.</p>
1.1 dsieger 9411: <p>If you want to submit several packages, please send a
9412: separate PR for each one, it's easier for us to track things
9413: that way.</p>
9414: <p>Alternatively, you can also import new packages into
1.23 wiz 9415: pkgsrc-wip (<span class="quote">“<span class="quote">pkgsrc work-in-progress</span>”</span>); see the
1.174 leot 9416: homepage at <a class="ulink" href="https://pkgsrc.org/wip/" target="_top">https://pkgsrc.org/wip/</a>
1.1 dsieger 9417: for details.</p>
9418: </div>
1.41 asau 9419: <div class="sect1">
1.1 dsieger 9420: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9421: <a name="general-notes-for-changes"></a>23.3. General notes when adding, updating, or removing packages</h2></div></div></div>
1.1 dsieger 9422: <p>Please note all package additions, updates, moves, and
9423: removals in <code class="filename">pkgsrc/doc/CHANGES-<em class="replaceable"><code>YYYY</code></em></code>. It's very
9424: important to keep this file up to date and conforming to the
9425: existing format, because it will be used by scripts to
1.174 leot 9426: automatically update pages on <a class="ulink" href="https://www.NetBSD.org/" target="_top">www.NetBSD.org</a> and other
1.1 dsieger 9427: sites. Additionally, check the
9428: <code class="filename">pkgsrc/doc/TODO</code> file and remove the entry
9429: for the package you updated or removed, in case it was mentioned
9430: there.</p>
9431: <p>When the <code class="varname">PKGREVISION</code> of a package is
9432: bumped, the change should appear in
9433: <code class="filename">pkgsrc/doc/CHANGES-<em class="replaceable"><code>YYYY</code></em></code> if it is security
9434: related or otherwise relevant. Mass bumps that result from a
9435: dependency being updated should not be mentioned. In all other
9436: cases it's the developer's decision.</p>
9437: <p>There is a make target that helps in creating proper
1.10 hubertf 9438: <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code> entries: <span class="command"><strong>make
1.1 dsieger 9439: changes-entry</strong></span>. It uses the optional <code class="varname">CTYPE</code>
9440: and <code class="varname">NETBSD_LOGIN_NAME</code> variables. The general
9441: usage is to first make sure that your <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code>
9442: file is up-to-date (to avoid having to resolve conflicts later-on)
1.10 hubertf 9443: and then to <span class="command"><strong>cd</strong></span> to the package directory. For
9444: package updates, <span class="command"><strong>make changes-entry</strong></span> is enough.
1.1 dsieger 9445: For new packages, or package moves or removals, set the
9446: <code class="varname">CTYPE</code> variable on the command line to "Added",
9447: "Moved", or "Removed". You can set <code class="varname">NETBSD_LOGIN_NAME</code>
1.10 hubertf 9448: in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> if your local login name is
1.22 jakllsch 9449: not the same as your NetBSD login name. The target also automatically
9450: removes possibly existing entries for the package in the
9451: <code class="filename">TODO</code> file. Don't forget to commit
1.66 asau 9452: the changes, e.g. by using <span class="command"><strong>make commit-changes-entry</strong></span>!
1.22 jakllsch 9453: If you are not using a checkout directly from cvs.NetBSD.org, but e.g.
9454: a local copy of the repository, you can set USE_NETBSD_REPO=yes. This
9455: makes the cvs commands use the main repository.
9456: </p>
1.1 dsieger 9457: </div>
1.41 asau 9458: <div class="sect1">
1.1 dsieger 9459: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9460: <a name="commit-messages"></a>23.4. Commit Messages</h2></div></div></div>
1.130 wiz 9461: <p>For several years, there have been mirrors of pkgsrc in
9462: fossil, git, and hg. Standard practise when using these tools is to
9463: make the first line of a commit message function as a summary that
9464: can be read without the rest, such as is commonly done with "git log
9465: --oneline". For this reason, we have the following guidelines for
9466: pkgsrc commit messages:</p>
9467: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
9468: <li class="listitem"><p>Start the commit message with a line that explains the
1.131 wiz 9469: big picture in 65 characters or less. When a commit is for one
1.130 wiz 9470: package, include the name of the package. For updates, include the
9471: version to which it is updated.</p></li>
9472: <li class="listitem"><p>Leave the next line empty.</p></li>
9473: <li class="listitem"><p>Then come the details for the commit (changes in that
9474: package, reason for a change) and any relevant PRs. Wrap this
9475: section.</p></li>
9476: </ul></div>
9477: <p>Here is an example:
9478: </p>
9479: <pre class="programlisting">
9480: libxslt: update to 1.0.30
9481:
9482: Changes since 1.0.29:
9483: ...
9484: </pre>
9485: <p>
9486: </p>
9487: <p>Here is another example:
9488: </p>
9489: <pre class="programlisting">
9490: mk/bsd.pkg.mk: enable SSP by default on NetBSD
9491:
9492: (rationale)
9493: </pre>
9494: <p>
9495: </p>
9496: <p>Commit messages are final: no <span class="quote">“<span class="quote">cvs admin</span>”</span> is
9497: allowed on the pkgsrc repository to change commit messages.</p>
9498: </div>
9499: <div class="sect1">
9500: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9501: <a name="committing-importing"></a>23.5. Committing: Adding a package to CVS</h2></div></div></div>
1.1 dsieger 9502: <p>This section is only of interest for pkgsrc developers with write
1.33 wiz 9503: access to the pkgsrc repository.</p>
9504: <p>When the package is finished, <span class="quote">“<span class="quote">cvs add</span>”</span> the files.
9505: Start by adding the directory and then files in the directory. Don't
9506: forget to add the new package to the category's
9507: <code class="filename">Makefile</code>. Make sure you don't forget any files;
9508: you can check by running <span class="quote">“<span class="quote">cvs status</span>”</span>. An example:</p>
9509: <pre class="programlisting">
9510: <code class="prompt">$</code> cd .../pkgsrc/category
9511: <code class="prompt">$</code> cvs add pkgname
9512: <code class="prompt">$</code> cd pkgname
9513: <code class="prompt">$</code> cvs add DESCR Makefile PLIST distinfo buildlink3.mk patches
9514: <code class="prompt">$</code> cvs add patches/p*
9515: <code class="prompt">$</code> cvs status | less
1.34 wiz 9516: <code class="prompt">$</code> cvs commit
1.33 wiz 9517: <code class="prompt">$</code> cd ..
9518: <code class="prompt">$</code> vi Makefile # add SUBDIRS+=pkgname line
1.34 wiz 9519: <code class="prompt">$</code> cvs commit Makefile
1.66 asau 9520: <code class="prompt">$</code> cd pkgname
1.73 jnemeth 9521: <code class="prompt">$</code> make CTYPE=Added commit-changes-entry
1.33 wiz 9522: </pre>
1.1 dsieger 9523: <p>The commit message of the initial import should include part of the
9524: <code class="filename">DESCR</code> file, so people reading the mailing lists know
9525: what the package is/does.</p>
1.33 wiz 9526: <p>Also mention the new package in
9527: <code class="filename">pkgsrc/doc/CHANGES-20xx</code>.</p>
9528: <p>Previously, <span class="quote">“<span class="quote">cvs import</span>”</span> was suggested, but it was
9529: much easier to get wrong than <span class="quote">“<span class="quote">cvs add</span>”</span>.</p>
1.1 dsieger 9530: </div>
1.41 asau 9531: <div class="sect1">
1.1 dsieger 9532: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9533: <a name="updating-package"></a>23.6. Updating a package to a newer version</h2></div></div></div>
1.1 dsieger 9534: <p>Please always put a concise, appropriate and relevant summary of the
9535: changes between old and new versions into the commit log when updating
9536: a package. There are various reasons for this:</p>
1.41 asau 9537: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9538: <li class="listitem"><p>A URL is volatile, and can change over time. It may go away completely
1.1 dsieger 9539: or its information may be overwritten by newer information.</p></li>
1.23 wiz 9540: <li class="listitem"><p>Having the change information between old and new versions in our CVS
1.1 dsieger 9541: repository is very useful for people who use either cvs or anoncvs.</p></li>
1.23 wiz 9542: <li class="listitem"><p>Having the change information between old and new versions in our CVS
1.1 dsieger 9543: repository is very useful for people who read the pkgsrc-changes mailing
9544: list, so that they can make tactical decisions about when to upgrade
9545: the package.</p></li>
9546: </ul></div>
9547: <p>Please also recognize that, just because a new version of a package
9548: has been released, it should not automatically be upgraded in the CVS
9549: repository. We prefer to be conservative in the packages that are
9550: included in pkgsrc - development or beta packages are not really the
9551: best thing for most places in which pkgsrc is used. Please use your
9552: judgement about what should go into pkgsrc, and bear in mind that
9553: stability is to be preferred above new and possibly untested features.</p>
9554: </div>
1.41 asau 9555: <div class="sect1">
1.1 dsieger 9556: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9557: <a name="renaming-package"></a>23.7. Renaming a package in pkgsrc</h2></div></div></div>
1.20 snj 9558: <p>Renaming packages is not recommended.</p>
1.175 gutterid 9559: <p>When renaming packages, be sure to fix any references to the old name
1.20 snj 9560: in other Makefiles, options, buildlink files, etc.</p>
1.167 leot 9561: <p>
1.175 gutterid 9562: Also, when renaming a package, please add
1.167 leot 9563: the package name and version pattern(s) of the previous package
9564: to <code class="varname">SUPERSEDES</code>.
1.20 snj 9565: This may be repeated for multiple renames.
9566: The new package would be an exact replacement.
1.167 leot 9567: Example:
1.20 snj 9568: </p>
1.167 leot 9569: <pre class="programlisting">
9570: SUPERSEDES+= p5-IO-Compress-Zlib<2.017
9571: SUPERSEDES+= optcomp-[0-9]*
9572: </pre>
1.23 wiz 9573: <p>Note that <span class="quote">“<span class="quote">successor</span>”</span> in the
1.20 snj 9574: CHANGES-<em class="replaceable"><code>YYYY</code></em> file doesn't necessarily
9575: mean that it <span class="emphasis"><em>supersedes</em></span>, as that successor may
9576: not be an exact replacement but is a suggestion for the replaced
9577: functionality.</p>
9578: </div>
1.41 asau 9579: <div class="sect1">
1.20 snj 9580: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9581: <a name="moving-package"></a>23.8. Moving a package in pkgsrc</h2></div></div></div>
1.20 snj 9582: <p>It is preferred that packages are not renamed or moved, but if needed
9583: please follow these steps.
9584: </p>
1.23 wiz 9585: <div class="orderedlist"><ol class="orderedlist" type="1">
9586: <li class="listitem"><p>Make a copy of the directory somewhere else.</p></li>
9587: <li class="listitem">
1.1 dsieger 9588: <p>Remove all CVS dirs.</p>
9589: <p>Alternatively to the first two steps you can also do:</p>
9590: <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>
9591: <p>and use that for further work.</p>
9592: </li>
1.23 wiz 9593: <li class="listitem"><p>Fix <code class="varname">CATEGORIES</code> and any
9594: <code class="varname">DEPENDS</code> paths that just did <span class="quote">“<span class="quote">../package</span>”</span>
9595: instead of <span class="quote">“<span class="quote">../../category/package</span>”</span>.</p></li>
9596: <li class="listitem"><p>In the modified package's Makefile, consider setting
1.20 snj 9597: <code class="varname">PREV_PKGPATH</code> to the previous category/package
9598: pathname. The <code class="varname">PREV_PKGPATH</code> can be used by tools
9599: for doing an update using pkgsrc building; for example, it can
1.174 leot 9600: 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 9601: (if no <code class="varname">SUPERSEDES</code>) and then use the corresponding
9602: new <code class="varname">PKGPATH</code> for that moved package. Note that
9603: it may have multiple matches, so the tool should also check on the
9604: <code class="varname">PKGBASE</code> too. The <code class="varname">PREV_PKGPATH</code>
9605: probably has no value unless <code class="varname">SUPERSEDES</code> is not
9606: set, i.e. <code class="varname">PKGBASE</code> stays the same. </p></li>
1.23 wiz 9607: <li class="listitem"><p><span class="command"><strong>cvs import</strong></span> the modified package in the new
1.1 dsieger 9608: place.</p></li>
1.23 wiz 9609: <li class="listitem">
1.1 dsieger 9610: <p>Check if any package depends on it:
9611: </p>
9612: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cd /usr/pkgsrc</code></strong>
9613: <code class="prompt">%</code> <strong class="userinput"><code>grep /package */*/Makefile* */*/buildlink*</code></strong></pre>
9614: </li>
1.23 wiz 9615: <li class="listitem"><p>Fix paths in packages from step 5 to point to new location.</p></li>
9616: <li class="listitem"><p><span class="command"><strong>cvs rm (-f)</strong></span> the package at the old location.</p></li>
9617: <li class="listitem"><p>Remove from <code class="filename">oldcategory/Makefile</code>.</p></li>
9618: <li class="listitem"><p>Add to <code class="filename">newcategory/Makefile</code>.</p></li>
9619: <li class="listitem">
1.1 dsieger 9620: <p>Commit the changed and removed files:</p>
9621: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile</code></strong></pre>
9622: <p>(and any packages from step 5, of course).</p>
9623: </li>
9624: </ol></div>
9625: </div>
9626: </div>
1.41 asau 9627: <div class="chapter">
1.1 dsieger 9628: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9629: <a name="devfaq"></a>Chapter 24. Frequently Asked Questions</h2></div></div></div>
1.1 dsieger 9630: <p>This section contains the answers to questions that may
9631: arise when you are writing a package. If you don't find your
9632: question answered here, first have a look in the other chapters,
9633: and if you still don't have the answer, ask on the
9634: <code class="literal">pkgsrc-users</code> mailing list.</p>
1.41 asau 9635: <div class="qandaset">
1.174 leot 9636: <a name="devfaq.qandaset"></a><dl>
1.154 rillig 9637: <dt>24.1. <a href="#devfaq.makeflags">What is the difference between
1.1 dsieger 9638: MAKEFLAGS, .MAKEFLAGS and
9639: MAKE_FLAGS?</a>
9640: </dt>
1.154 rillig 9641: <dt>24.2. <a href="#devfaq.make">What is the difference between
1.1 dsieger 9642: MAKE, GMAKE and
9643: MAKE_PROGRAM?</a>
9644: </dt>
1.154 rillig 9645: <dt>24.3. <a href="#devfaq.cc">What is the difference between
1.1 dsieger 9646: CC, PKG_CC and
9647: PKGSRC_COMPILER?</a>
9648: </dt>
1.154 rillig 9649: <dt>24.4. <a href="#devfaq.bl3flags">What is the difference between
1.1 dsieger 9650: BUILDLINK_LDFLAGS,
9651: BUILDLINK_LDADD and
9652: BUILDLINK_LIBS?</a>
9653: </dt>
1.154 rillig 9654: <dt>24.5. <a href="#devfaq.bl3prefix">Why does make show-var
1.1 dsieger 9655: VARNAME=BUILDLINK_PREFIX.foo
9656: say it's empty?</a>
9657: </dt>
1.154 rillig 9658: <dt>24.6. <a href="#devfaq.master_sites">What does
1.1 dsieger 9659: ${MASTER_SITE_SOURCEFORGE:=package/} mean? I
9660: don't understand the := inside
9661: it.</a>
9662: </dt>
1.154 rillig 9663: <dt>24.7. <a href="#devfaq.mailinglists">Which mailing lists are there for package
1.1 dsieger 9664: developers?</a>
9665: </dt>
1.154 rillig 9666: <dt>24.8. <a href="#devfaq.documentation">Where is the pkgsrc
1.1 dsieger 9667: documentation?</a>
9668: </dt>
1.174 leot 9669: <dt>24.9. <a href="#devfaq.too-much-time">I have a little time to kill.
9670: What shall I do?</a>
1.1 dsieger 9671: </dt>
9672: </dl>
1.41 asau 9673: <table border="0" style="width: 100%;">
9674: <colgroup>
1.1 dsieger 9675: <col align="left" width="1%">
1.23 wiz 9676: <col>
1.41 asau 9677: </colgroup>
1.1 dsieger 9678: <tbody>
1.41 asau 9679: <tr class="question">
1.1 dsieger 9680: <td align="left" valign="top">
1.174 leot 9681: <a name="devfaq.makeflags"></a><a name="devfaq.makeflags.q"></a><p><b>24.1.</b></p>
1.1 dsieger 9682: </td>
9683: <td align="left" valign="top"><p>What is the difference between
9684: <code class="varname">MAKEFLAGS</code>, <code class="varname">.MAKEFLAGS</code> and
9685: <code class="varname">MAKE_FLAGS</code>?</p></td>
9686: </tr>
9687: <tr class="answer">
9688: <td align="left" valign="top"></td>
9689: <td align="left" valign="top"><p><code class="varname">MAKEFLAGS</code> are the flags passed
1.174 leot 9690: 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 9691: <code class="varname">MAKE_FLAGS</code> are the flags that are passed to
9692: the <code class="varname">MAKE_PROGRAM</code> when building the
9693: package. [FIXME: What is .MAKEFLAGS for?]</p></td>
9694: </tr>
1.41 asau 9695: <tr class="question">
1.1 dsieger 9696: <td align="left" valign="top">
1.174 leot 9697: <a name="devfaq.make"></a><a name="devfaq.make.q"></a><p><b>24.2.</b></p>
1.1 dsieger 9698: </td>
9699: <td align="left" valign="top"><p>What is the difference between
9700: <code class="varname">MAKE</code>, <code class="varname">GMAKE</code> and
9701: <code class="varname">MAKE_PROGRAM</code>?</p></td>
9702: </tr>
9703: <tr class="answer">
9704: <td align="left" valign="top"></td>
9705: <td align="left" valign="top"><p><code class="varname">MAKE</code> is the path to the
1.174 leot 9706: <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 9707: infrastructure. <code class="varname">GMAKE</code> is the path to GNU
9708: Make, but you need to say <code class="varname">USE_TOOLS+=gmake</code> to
9709: use that. <code class="varname">MAKE_PROGRAM</code> is the path to the
9710: Make program that is used for building the
9711: package.</p></td>
9712: </tr>
1.41 asau 9713: <tr class="question">
1.1 dsieger 9714: <td align="left" valign="top">
1.174 leot 9715: <a name="devfaq.cc"></a><a name="devfaq.cc.q"></a><p><b>24.3.</b></p>
1.1 dsieger 9716: </td>
9717: <td align="left" valign="top"><p>What is the difference between
9718: <code class="varname">CC</code>, <code class="varname">PKG_CC</code> and
9719: <code class="varname">PKGSRC_COMPILER</code>?</p></td>
9720: </tr>
9721: <tr class="answer">
9722: <td align="left" valign="top"></td>
9723: <td align="left" valign="top"><p><code class="varname">CC</code> is the path to the real C
9724: compiler, which can be configured by the pkgsrc user.
9725: <code class="varname">PKG_CC</code> is the path to the compiler wrapper.
9726: <code class="varname">PKGSRC_COMPILER</code> is <span class="emphasis"><em>not</em></span> a
9727: path to a compiler, but the type of compiler that should be
9728: used. See <code class="filename">mk/compiler.mk</code> for more
9729: information about the latter variable.</p></td>
9730: </tr>
1.41 asau 9731: <tr class="question">
1.1 dsieger 9732: <td align="left" valign="top">
1.174 leot 9733: <a name="devfaq.bl3flags"></a><a name="devfaq.bl3flags.q"></a><p><b>24.4.</b></p>
1.1 dsieger 9734: </td>
9735: <td align="left" valign="top"><p>What is the difference between
9736: <code class="varname">BUILDLINK_LDFLAGS</code>,
9737: <code class="varname">BUILDLINK_LDADD</code> and
9738: <code class="varname">BUILDLINK_LIBS</code>?</p></td>
9739: </tr>
9740: <tr class="answer">
9741: <td align="left" valign="top"></td>
9742: <td align="left" valign="top"><p>[FIXME]</p></td>
9743: </tr>
1.41 asau 9744: <tr class="question">
1.1 dsieger 9745: <td align="left" valign="top">
1.174 leot 9746: <a name="devfaq.bl3prefix"></a><a name="devfaq.bl3prefix.q"></a><p><b>24.5.</b></p>
1.1 dsieger 9747: </td>
1.10 hubertf 9748: <td align="left" valign="top"><p>Why does <span class="command"><strong>make show-var
1.1 dsieger 9749: VARNAME=BUILDLINK_PREFIX.<em class="replaceable"><code>foo</code></em></strong></span>
9750: say it's empty?</p></td>
9751: </tr>
9752: <tr class="answer">
9753: <td align="left" valign="top"></td>
9754: <td align="left" valign="top"><p>For optimization reasons, some variables are only
1.23 wiz 9755: available in the <span class="quote">“<span class="quote">wrapper</span>”</span> phase and later. To
9756: <span class="quote">“<span class="quote">simulate</span>”</span> the wrapper phase, append
1.10 hubertf 9757: <span class="command"><strong>PKG_PHASE=wrapper</strong></span> to the above
1.1 dsieger 9758: command.</p></td>
9759: </tr>
1.41 asau 9760: <tr class="question">
1.1 dsieger 9761: <td align="left" valign="top">
1.174 leot 9762: <a name="devfaq.master_sites"></a><a name="devfaq.master_sites.q"></a><p><b>24.6.</b></p>
1.1 dsieger 9763: </td>
9764: <td align="left" valign="top"><p>What does
1.108 rillig 9765: <code class="code">${MASTER_SITE_SOURCEFORGE:=package/}</code> mean? I
9766: don't understand the <code class="code">:=</code> inside
1.1 dsieger 9767: it.</p></td>
9768: </tr>
9769: <tr class="answer">
9770: <td align="left" valign="top"></td>
1.108 rillig 9771: <td align="left" valign="top"><p>The <code class="code">:=</code> is not really an
9772: assignment operator, although it looks like it.
1.1 dsieger 9773: Instead, it is a degenerate form of
1.108 rillig 9774: <code class="code">${LIST:<em class="replaceable"><code>old_string</code></em>=<em class="replaceable"><code>new_string</code></em>}</code>,
1.174 leot 9775: 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 9776: commonly used in the form <code class="code">${SRCS:.c=.o}</code>. In the
1.1 dsieger 9777: case of <code class="varname">MASTER_SITE_*</code>,
9778: <em class="replaceable"><code>old_string</code></em> is the empty string and
9779: <em class="replaceable"><code>new_string</code></em> is
1.108 rillig 9780: <code class="code">package/</code>. That's where the
9781: <code class="code">:</code> and the <code class="code">=</code> fall
1.1 dsieger 9782: together.</p></td>
9783: </tr>
1.41 asau 9784: <tr class="question">
1.1 dsieger 9785: <td align="left" valign="top">
1.174 leot 9786: <a name="devfaq.mailinglists"></a><a name="devfaq.mailinglists.q"></a><p><b>24.7.</b></p>
1.1 dsieger 9787: </td>
9788: <td align="left" valign="top"><p>Which mailing lists are there for package
9789: developers?</p></td>
9790: </tr>
9791: <tr class="answer">
9792: <td align="left" valign="top"></td>
1.41 asau 9793: <td align="left" valign="top"><div class="variablelist"><dl class="variablelist">
1.174 leot 9794: <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 9795: <dd><p>This is a list for technical discussions related
9796: to pkgsrc development, e.g. soliciting feedback for changes to
9797: pkgsrc infrastructure, proposed new features, questions related
9798: to porting pkgsrc to a new platform, advice for maintaining a
9799: package, patches that affect many packages, help requests moved
9800: from pkgsrc-users when an infrastructure bug is found,
9801: etc.</p></dd>
1.174 leot 9802: <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 9803: <dd><p>All bug reports in category "pkg" sent with
1.174 leot 9804: <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 9805: directly; use one of the other mailing
9806: lists.</p></dd>
9807: </dl></div></td>
9808: </tr>
1.41 asau 9809: <tr class="question">
1.1 dsieger 9810: <td align="left" valign="top">
1.174 leot 9811: <a name="devfaq.documentation"></a><a name="devfaq.documentation.q"></a><p><b>24.8.</b></p>
1.1 dsieger 9812: </td>
9813: <td align="left" valign="top"><p>Where is the pkgsrc
9814: documentation?</p></td>
9815: </tr>
9816: <tr class="answer">
9817: <td align="left" valign="top"></td>
9818: <td align="left" valign="top">
9819: <p>There are many places where you can find
9820: documentation about pkgsrc:</p>
1.41 asau 9821: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9822: <li class="listitem"><p>The pkgsrc guide (this document) is a collection
1.1 dsieger 9823: of chapters that explain large parts of pkgsrc, but some
9824: chapters tend to be outdated. Which ones they are is hard to
9825: say.</p></li>
1.174 leot 9826: <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 9827: about certain features, announcements of new parts of the pkgsrc
9828: infrastructure and sometimes even announcements that a certain
9829: feature has been marked as obsolete. The benefit here is that
9830: each message has a date appended to it.</p></li>
1.23 wiz 9831: <li class="listitem"><p>Many of the files in the
1.1 dsieger 9832: <code class="filename">mk/</code> directory start with a comment that
9833: describes the purpose of the file and how it can be used by the
9834: pkgsrc user and package authors. An easy way to find this
1.10 hubertf 9835: documentation is to run <span class="command"><strong>bmake
1.1 dsieger 9836: help</strong></span>.</p></li>
1.23 wiz 9837: <li class="listitem"><p>The CVS log messages are a rich source of
1.1 dsieger 9838: information, but they tend to be highly abbreviated, especially
9839: for actions that occur often. Some contain a detailed
9840: description of what has changed, but they are geared towards the
9841: other pkgsrc developers, not towards an average pkgsrc user.
9842: They also only document <span class="emphasis"><em>changes</em></span>, so if you
9843: don't know what has been before, these messages may not be worth
9844: too much to you.</p></li>
1.23 wiz 9845: <li class="listitem"><p>Some parts of pkgsrc are only <span class="quote">“<span class="quote">implicitly
9846: documented</span>”</span>, that is the documentation exists only in the
1.1 dsieger 9847: mind of the developer who wrote the code. To get this
1.10 hubertf 9848: information, use the <span class="command"><strong>cvs annotate</strong></span> command
1.1 dsieger 9849: to see who has written it and ask on the
9850: <code class="literal">tech-pkg</code> mailing list, so that others can
9851: find your questions later (see above). To be sure that the
9852: developer in charge reads the mail, you may CC him or
9853: her.</p></li>
9854: </ul></div>
9855: </td>
9856: </tr>
1.41 asau 9857: <tr class="question">
1.1 dsieger 9858: <td align="left" valign="top">
1.174 leot 9859: <a name="devfaq.too-much-time"></a><a name="devfaq.too-much-time.q"></a><p><b>24.9.</b></p>
1.1 dsieger 9860: </td>
1.174 leot 9861: <td align="left" valign="top"><p>I have a little time to kill.
9862: What shall I do?</p></td>
1.1 dsieger 9863: </tr>
9864: <tr class="answer">
9865: <td align="left" valign="top"></td>
9866: <td align="left" valign="top">
9867: <p>This is not really an FAQ yet, but here's the answer
9868: anyway.</p>
1.41 asau 9869: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9870: <li class="listitem"><p>Run <span class="command"><strong>pkg_chk -N</strong></span> (from the
1.137 leot 9871: <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 9872: will tell you about newer versions of installed packages that are
9873: available, but not yet updated in pkgsrc.</p></li>
1.23 wiz 9874: <li class="listitem"><p>Browse <code class="filename">pkgsrc/doc/TODO</code>
1.14 jmcneill 9875: — it contains a list of suggested new packages and a list of
1.1 dsieger 9876: cleanups and enhancements for pkgsrc that would be nice to
9877: have.</p></li>
1.23 wiz 9878: <li class="listitem"><p>Review packages for which review was requested on
1.174 leot 9879: the <a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#tech-pkg" target="_top">tech-pkg</a>
1.1 dsieger 9880: mailing list.</p></li>
9881: </ul></div>
9882: </td>
9883: </tr>
9884: </tbody>
9885: </table>
9886: </div>
9887: </div>
1.41 asau 9888: <div class="chapter">
1.1 dsieger 9889: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 9890: <a name="gnome"></a>Chapter 25. GNOME packaging and porting</h2></div></div></div>
1.1 dsieger 9891: <div class="toc">
9892: <p><b>Table of Contents</b></p>
1.100 leot 9893: <dl class="toc">
1.154 rillig 9894: <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt>
9895: <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt>
9896: <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt>
9897: <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt>
1.1 dsieger 9898: </dl>
9899: </div>
1.174 leot 9900: <p>Quoting <a class="ulink" href="https://www.gnome.org/" target="_top">GNOME's web
1.1 dsieger 9901: site</a>:</p>
9902: <div class="blockquote"><blockquote class="blockquote"><p>The GNOME project provides two things: The GNOME desktop
9903: environment, an intuitive and attractive desktop for users, and the
9904: GNOME development platform, an extensive framework for building
9905: applications that integrate into the rest of the desktop.</p></blockquote></div>
9906: <p>pkgsrc provides a seamless way to automatically build and install
9907: a complete GNOME environment <span class="emphasis"><em>under many different
9908: platforms</em></span>. We can say with confidence that pkgsrc is one of
9909: the most advanced build and packaging systems for GNOME due to its
9910: included technologies buildlink3, the wrappers and tools framework and
9911: automatic configuration file management. Lots of efforts are put into
9912: achieving a completely clean deinstallation of installed software
9913: components.</p>
1.174 leot 9914: <p>Given that pkgsrc is <a class="ulink" href="https://www.NetBSD.org/" target="_top">NetBSD</a>'s official packaging system,
1.1 dsieger 9915: the above also means that great efforts are put into making GNOME work
1.174 leot 9916: under this operating system. Recently, <a class="ulink" href="https://www.dragonflybsd.org/" target="_top">DragonFly BSD</a> also adopted
1.1 dsieger 9917: pkgsrc as its preferred packaging system, contributing lots of
9918: portability fixes to make GNOME build and install under it.</p>
9919: <p>This chapter is aimed at pkgsrc developers and other people
9920: interested in helping our GNOME porting and packaging efforts. It
9921: provides instructions on how to manage the existing packages and some
9922: important information regarding their internals.</p>
1.41 asau 9923: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 9924: <h3 class="title">We need your help!</h3>
9925: <p>Should you have some spare cycles to devote to NetBSD, pkgsrc
9926: and GNOME and are willing to learn new exciting stuff, please jump
1.174 leot 9927: straight to the <a class="ulink" href="https://www.NetBSD.org/contrib/projects.html#gnome" target="_top">pending
1.1 dsieger 9928: work</a> list! There is still a long way to go to get a
9929: fully-functional GNOME desktop under NetBSD and we need your help to
9930: achieve it!</p>
9931: </div>
1.41 asau 9932: <div class="sect1">
1.1 dsieger 9933: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9934: <a name="meta-packages"></a>25.1. Meta packages</h2></div></div></div>
1.1 dsieger 9935: <p>pkgsrc includes three GNOME-related meta packages:</p>
1.41 asau 9936: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.137 leot 9937: <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 9938: the core GNOME desktop environment. It only includes the necessary
9939: bits to get it to boot correctly, although it may lack important
9940: functionality for daily operation. The idea behind this package is
9941: to let end users build their own configurations on top of this one,
9942: first installing this meta package to achieve a functional setup and
9943: then adding individual applications.</p></li>
1.137 leot 9944: <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 9945: complete installation of the GNOME platform and desktop as defined
9946: by the GNOME project; this is based on the components distributed in
9947: the <code class="filename">platform/x.y/x.y.z/sources</code> and
9948: <code class="filename">desktop/x.y/x.y.z/sources</code> directories of the
9949: official FTP server. Developer-only tools found in those
9950: directories are not installed unless required by some other
9951: component to work properly. Similarly, packages from the bindings
9952: set (<code class="filename">bindings/x.y/x.y.z/sources</code>) are not pulled
9953: in unless required as a dependency for an end-user component. This
1.137 leot 9954: 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>
9955: <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 9956: Installs all the tools required to build a GNOME component when
9957: fetched from the CVS repository. These are required to let the
1.10 hubertf 9958: <span class="command"><strong>autogen.sh</strong></span> scripts work appropriately.</p></li>
1.1 dsieger 9959: </ul></div>
9960: <p>In all these packages, the <code class="varname">DEPENDS</code> lines are
9961: sorted in a way that eases updates: a package may depend on other
9962: packages listed before it but not on any listed after it. It is very
9963: important to keep this order to ease updates so... <span class="emphasis"><em>do not
9964: change it to alphabetical sorting!</em></span></p>
9965: </div>
1.41 asau 9966: <div class="sect1">
1.1 dsieger 9967: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 9968: <a name="new-package"></a>25.2. Packaging a GNOME application</h2></div></div></div>
1.1 dsieger 9969: <p>Almost all GNOME applications are written in C and use a common
9970: set of tools as their build system. Things get different with the new
9971: bindings to other languages (such as Python), but the following will
9972: give you a general idea on the minimum required tools:</p>
1.41 asau 9973: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 9974: <li class="listitem">
1.1 dsieger 9975: <p>Almost all GNOME applications use the GNU Autotools as their
9976: build system. As a general rule you will need to tell this to your
9977: package:</p>
9978: <pre class="programlisting">
9979: GNU_CONFIGURE=yes
9980: USE_LIBTOOL=yes
9981: USE_TOOLS+=gmake
9982: </pre>
9983: </li>
1.23 wiz 9984: <li class="listitem">
1.1 dsieger 9985: <p>If the package uses pkg-config to detect dependencies, add this
9986: tool to the list of required utilities:</p>
1.111 sevan 9987: <pre class="programlisting">
9988: USE_TOOLS+=pkg-config
9989: </pre>
1.137 leot 9990: <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 9991: the end of the build process to ensure that you did not miss to
9992: specify any dependency in your package and that the version
9993: requirements are all correct.</p>
9994: </li>
1.23 wiz 9995: <li class="listitem"><p>If the package uses intltool, be sure to add
1.1 dsieger 9996: <code class="literal">intltool</code> to the <code class="varname">USE_TOOLS</code>
9997: to handle dependencies and to force the package to use the latest
9998: available version.</p></li>
1.23 wiz 9999: <li class="listitem">
1.1 dsieger 10000: <p>If the package uses gtk-doc (a documentation generation
10001: utility), do <span class="emphasis"><em>not</em></span> add a dependency on it. The
10002: tool is rather big and the distfile should come with pregenerated
10003: documentation anyway; if it does not, it is a bug that you ought to
10004: report. For such packages you should disable gtk-doc (unless it is
10005: the default):</p>
1.111 sevan 10006: <pre class="programlisting">
10007: CONFIGURE_ARGS+=--disable-gtk-doc
10008: </pre>
1.1 dsieger 10009: <p>The default location of installed HTML files
10010: (<code class="filename">share/gtk-doc/<package-name></code>) is correct
10011: and should not be changed unless the package insists on installing
10012: them somewhere else. Otherwise programs as
1.10 hubertf 10013: <span class="command"><strong>devhelp</strong></span> will not be able to open them. You can
1.1 dsieger 10014: do that with an entry similar to:</p>
1.111 sevan 10015: <pre class="programlisting">
10016: CONFIGURE_ARGS+=--with-html-dir=${PREFIX}/share/gtk-doc/...
10017: </pre>
1.1 dsieger 10018: </li>
10019: </ul></div>
10020: <p>GNOME uses multiple <span class="emphasis"><em>shared</em></span> directories and
10021: files under the installation prefix to maintain databases. In this
10022: context, shared means that those exact same directories and files are
10023: used among several different packages, leading to conflicts in the
10024: <code class="filename">PLIST</code>. pkgsrc currently includes functionality to
10025: handle the most common cases, so you have to forget about using
10026: <code class="literal">@unexec ${RMDIR}</code> lines in your file lists and
10027: omitting shared files from them. If you find yourself doing those,
10028: <span class="emphasis"><em>your package is most likely incorrect</em></span>.</p>
10029: <p>The following table lists the common situations that result in
10030: using shared directories or files. For each of them, the appropriate
10031: solution is given. After applying the solution be sure to
10032: <span class="emphasis"><em>regenerate the package's file list</em></span> with
1.10 hubertf 10033: <span class="command"><strong>make print-PLIST</strong></span> and ensure it is correct.</p>
1.1 dsieger 10034: <div class="table">
1.154 rillig 10035: <a name="plist-handling"></a><p class="title"><b>Table 25.1. PLIST handling for GNOME packages</b></p>
1.106 tnn 10036: <div class="table-contents"><table class="table" summary="PLIST handling for GNOME packages" border="1">
1.1 dsieger 10037: <colgroup>
10038: <col>
10039: <col>
10040: </colgroup>
10041: <thead><tr>
10042: <th>If the package...</th>
10043: <th>Then...</th>
10044: </tr></thead>
10045: <tbody>
10046: <tr>
10047: <td>Installs OMF files under <code class="filename">share/omf</code>.</td>
1.154 rillig 10048: <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 10049: </tr>
10050: <tr>
10051: <td>Installs icons under the
10052: <code class="filename">share/icons/hicolor</code> hierarchy or updates
10053: <code class="filename">share/icons/hicolor/icon-theme.cache</code>.</td>
1.154 rillig 10054: <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 10055: </tr>
10056: <tr>
10057: <td>Installs files under
10058: <code class="filename">share/mime/packages</code>.</td>
1.154 rillig 10059: <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 10060: </tr>
10061: <tr>
10062: <td>Installs <code class="filename">.desktop</code> files under
10063: <code class="filename">share/applications</code> and these include MIME
10064: information.</td>
1.154 rillig 10065: <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 10066: </tr>
10067: </tbody>
10068: </table></div>
10069: </div>
10070: <br class="table-break">
10071: </div>
1.41 asau 10072: <div class="sect1">
1.1 dsieger 10073: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10074: <a name="full-update"></a>25.3. Updating GNOME to a newer version</h2></div></div></div>
1.1 dsieger 10075: <p>When seeing GNOME as a whole, there are two kinds of
10076: updates:</p>
1.41 asau 10077: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 10078: <dt><span class="term">Major update</span></dt>
10079: <dd>
10080: <p>Given that there is still a very long way for GNOME 3 (if it
10081: ever appears), we consider a major update one that goes from a
10082: <code class="literal">2.X</code> version to a <code class="literal">2.Y</code> one,
10083: where <code class="literal">Y</code> is even and greater than
10084: <code class="literal">X</code>. These are hard to achieve because they
10085: introduce lots of changes in the components' code and almost all
10086: GNOME distfiles are updated to newer versions. Some of them can
10087: even break API and ABI compatibility with the previous major
10088: version series. As a result, the update needs to be done all at
10089: once to minimize breakage.</p>
10090: <p>A major update typically consists of around 80 package
10091: updates and the addition of some new ones.</p>
10092: </dd>
10093: <dt><span class="term">Minor update</span></dt>
10094: <dd>
10095: <p>We consider a minor update one that goes from a
10096: <code class="literal">2.A.X</code> version to a <code class="literal">2.A.Y</code>
10097: one where <code class="literal">Y</code> is greater than
10098: <code class="literal">X</code>. These are easy to achieve because they do
10099: not update all GNOME components, can be done in an incremental way
10100: and do not break API nor ABI compatibility.</p>
10101: <p>A minor update typically consists of around 50 package
10102: updates, although the numbers here may vary a lot.</p>
10103: </dd>
10104: </dl></div>
10105: <p>In order to update the GNOME components in pkgsrc to a new stable
10106: release (either major or minor), the following steps should be
10107: followed:</p>
1.23 wiz 10108: <div class="orderedlist"><ol class="orderedlist" type="1">
10109: <li class="listitem">
1.1 dsieger 10110: <p>Get a list of all the tarballs that form the new release by
10111: using the following commands. These will leave the full list of the
1.18 snj 10112: components' distfiles into the <code class="filename">list.txt</code>
1.1 dsieger 10113: file:</p>
10114: <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>echo ls "*.tar.bz2" | \
10115: ftp -V ftp://ftp.gnome.org/pub/gnome/platform/x.y/x.y.z/sources/ | \
10116: awk '{ print $9 }' >list.txt</code></strong>
10117: <code class="prompt">%</code> <strong class="userinput"><code>echo ls "*.tar.bz2" | \
10118: ftp -V ftp://ftp.gnome.org/pub/gnome/desktop/x.y/x.y.z/sources/ | \
10119: awk '{ print $9 }' >>list.txt</code></strong></pre>
10120: </li>
1.23 wiz 10121: <li class="listitem"><p>Open each meta package's <code class="filename">Makefile</code> and
1.1 dsieger 10122: bump their version to the release you are updating them to. The
10123: three meta packages should be always consistent with versioning.
10124: Obviously remove any <code class="varname">PKGREVISION</code>s that might be
10125: in them.</p></li>
1.23 wiz 10126: <li class="listitem">
1.1 dsieger 10127: <p>For each meta package, update all its
10128: <code class="varname">DEPENDS</code> lines to match the latest versions as
10129: shown by the above commands. Do <span class="emphasis"><em>not</em></span> list any
10130: newer version (even if found in the FTP) because the meta packages
10131: are supposed to list the exact versions that form a specific GNOME
10132: release. Exceptions are permitted here if a newer version solves a
10133: serious issue in the overall desktop experience; these typically
10134: come in the form of a revision bump in pkgsrc, not in newer versions
10135: from the developers.</p>
10136: <p>Packages not listed in the <code class="filename">list.txt</code> file
10137: should be updated to the latest version available (if found in
10138: pkgsrc). This is the case, for example, of the dependencies on the
1.137 leot 10139: 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 10140: </li>
1.23 wiz 10141: <li class="listitem">
1.1 dsieger 10142: <p>Generate a patch from the modified meta packages and extract the
10143: list of "new" lines. This will provide you an outline on what
10144: packages need to be updated in pkgsrc and in what order:</p>
10145: <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>
10146: </li>
1.23 wiz 10147: <li class="listitem"><p>For major desktop updates it is recommended to zap all your
1.1 dsieger 10148: installed packages and start over from scratch at this point.</p></li>
1.23 wiz 10149: <li class="listitem"><p>Now comes the longest step by far: iterate over the contents
1.1 dsieger 10150: of <code class="filename">todo.txt</code> and update the packages listed in
10151: it in order. For major desktop updates none of these should be
10152: committed until the entire set is completed because there are chances
10153: of breaking not-yet-updated packages.</p></li>
1.23 wiz 10154: <li class="listitem"><p>Once the packages are up to date and working, commit them to
1.1 dsieger 10155: the tree one by one with appropriate log messages. At the end,
10156: commit the three meta package updates and all the corresponding
10157: changes to the <code class="filename">doc/CHANGES-<YEAR></code> and
10158: <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>
10159: </ol></div>
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="patching"></a>25.4. Patching guidelines</h2></div></div></div>
1.1 dsieger 10164: <p>GNOME is a very big component in pkgsrc which approaches 100
10165: packages. Please, it is very important that you always, always,
10166: <span class="strong"><strong>always</strong></span> feed back any portability
1.154 rillig 10167: 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 10168: their attention on portability issues and to ensure that future versions
10169: can be built out-of-the box on NetBSD. The less custom patches in
10170: pkgsrc, the easier further updates are. Those developers in charge of
10171: issuing major GNOME updates will be grateful if you do that.</p>
1.174 leot 10172: <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 10173: Bugzilla</a>. Not all components use these to track bugs, but most
10174: of them do. Do not be short on your reports: always provide detailed
10175: explanations of the current failure, how it can be improved to achieve
10176: maximum portability and, if at all possible, provide a patch against CVS
10177: head. The more verbose you are, the higher chances of your patch being
10178: accepted.</p>
10179: <p>Also, please avoid using preprocessor magic to fix portability
10180: issues. While the FreeBSD GNOME people are doing a great job in porting
10181: GNOME to their operating system, the official GNOME sources are now
10182: plagued by conditionals that check for <code class="varname">__FreeBSD__</code>
10183: and similar macros. This hurts portability. Please see our patching
1.154 rillig 10184: 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 10185: details.</p>
10186: </div>
10187: </div>
10188: </div>
1.41 asau 10189: <div class="part">
1.1 dsieger 10190: <div class="titlepage"><div><div><h1 class="title">
10191: <a name="infrastructure"></a>Part III. The pkgsrc infrastructure internals</h1></div></div></div>
1.41 asau 10192: <div class="partintro">
1.1 dsieger 10193: <div></div>
10194: <p>This part of the guide deals with everything
10195: from the infrastructure that is behind the interfaces described
10196: in the developer's guide. A casual package maintainer should not
10197: need anything from this part.</p>
10198: <div class="toc">
10199: <p><b>Table of Contents</b></p>
1.100 leot 10200: <dl class="toc">
1.154 rillig 10201: <dt><span class="chapter"><a href="#infr.design">26. Design of the pkgsrc infrastructure</a></span></dt>
1.1 dsieger 10202: <dd><dl>
1.154 rillig 10203: <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt>
10204: <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt>
10205: <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt>
1.1 dsieger 10206: <dd><dl>
1.154 rillig 10207: <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt>
10208: <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt>
1.1 dsieger 10209: </dl></dd>
1.154 rillig 10210: <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt>
10211: <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt>
1.1 dsieger 10212: <dd><dl>
1.154 rillig 10213: <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt>
10214: <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 10215: </dl></dd>
1.154 rillig 10216: <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt>
1.1 dsieger 10217: <dd><dl>
1.154 rillig 10218: <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>
10219: <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 10220: </dl></dd>
10221: </dl></dd>
1.154 rillig 10222: <dt><span class="chapter"><a href="#regression">27. Regression tests</a></span></dt>
1.1 dsieger 10223: <dd><dl>
1.154 rillig 10224: <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt>
10225: <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt>
1.1 dsieger 10226: <dd><dl>
1.154 rillig 10227: <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt>
10228: <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt>
1.1 dsieger 10229: </dl></dd>
10230: </dl></dd>
1.154 rillig 10231: <dt><span class="chapter"><a href="#porting">28. Porting pkgsrc</a></span></dt>
10232: <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 10233: </dl>
10234: </div>
10235: </div>
1.41 asau 10236: <div class="chapter">
1.1 dsieger 10237: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 10238: <a name="infr.design"></a>Chapter 26. Design of the pkgsrc infrastructure</h2></div></div></div>
1.1 dsieger 10239: <div class="toc">
10240: <p><b>Table of Contents</b></p>
1.100 leot 10241: <dl class="toc">
1.154 rillig 10242: <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt>
10243: <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt>
10244: <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt>
1.1 dsieger 10245: <dd><dl>
1.154 rillig 10246: <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt>
10247: <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt>
1.1 dsieger 10248: </dl></dd>
1.154 rillig 10249: <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt>
10250: <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt>
1.1 dsieger 10251: <dd><dl>
1.154 rillig 10252: <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt>
10253: <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 10254: </dl></dd>
1.154 rillig 10255: <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt>
1.1 dsieger 10256: <dd><dl>
1.154 rillig 10257: <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>
10258: <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 10259: </dl></dd>
10260: </dl>
10261: </div>
10262: <p>The pkgsrc infrastructure consists of many small Makefile
10263: fragments. Each such fragment needs a properly specified
10264: interface. This chapter explains how such an interface looks
10265: like.</p>
1.41 asau 10266: <div class="sect1">
1.1 dsieger 10267: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10268: <a name="infr.vardef"></a>26.1. The meaning of variable definitions</h2></div></div></div>
1.1 dsieger 10269: <p>Whenever a variable is defined in the pkgsrc
10270: infrastructure, the location and the way of definition provide
10271: much information about the intended use of that variable.
10272: Additionally, more documentation may be found in a header
10273: comment or in this pkgsrc guide.</p>
10274: <p>A special file is
10275: <code class="filename">mk/defaults/mk.conf</code>, which lists all
10276: variables that are intended to be user-defined. They are either
10277: defined using the <code class="literal">?=</code> operator or they are
10278: left undefined because defining them to anything would
1.23 wiz 10279: effectively mean <span class="quote">“<span class="quote">yes</span>”</span>. All these variables may be
1.1 dsieger 10280: overridden by the pkgsrc user in the <code class="varname">MAKECONF</code>
10281: file.</p>
10282: <p>Outside this file, the following conventions apply:
10283: Variables that are defined using the <code class="literal">?=</code>
10284: operator may be overridden by a package.</p>
10285: <p>Variables that are defined using the <code class="literal">=</code>
10286: operator may be used read-only at run-time.</p>
10287: <p>Variables whose name starts with an underscore must not be
10288: accessed outside the pkgsrc infrastructure at all. They may
10289: change without further notice.</p>
1.41 asau 10290: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 10291: <h3 class="title">Note</h3>
10292: <p>These conventions are currently not applied
10293: consistently to the complete pkgsrc
10294: infrastructure.</p>
10295: </div>
10296: </div>
1.41 asau 10297: <div class="sect1">
1.1 dsieger 10298: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10299: <a name="infr.vardef.problems"></a>26.2. Avoiding problems before they arise</h2></div></div></div>
1.1 dsieger 10300: <p>All variables that contain lists of things should default
10301: to being empty. Two examples that do not follow this rule are
10302: <code class="varname">USE_LANGUAGES</code> and
10303: <code class="varname">DISTFILES</code>. These variables cannot simply be
10304: modified using the <code class="literal">+=</code> operator in package
10305: <code class="filename">Makefile</code>s (or other files included by
10306: them), since there is no guarantee whether the variable is
10307: already set or not, and what its value is. In the case of
1.23 wiz 10308: <code class="varname">DISTFILES</code>, the packages <span class="quote">“<span class="quote">know</span>”</span>
1.1 dsieger 10309: the default value and just define it as in the following
10310: example.</p>
10311: <pre class="programlisting">
10312: DISTFILES= ${DISTNAME}${EXTRACT_SUFX} additional-files.tar.gz
10313: </pre>
10314: <p>Because of the selection of this default value, the same
10315: value appears in many package Makefiles. Similarly for
10316: <code class="varname">USE_LANGUAGES</code>, but in this case the default
1.23 wiz 10317: value (<span class="quote">“<span class="quote"><code class="literal">c</code></span>”</span>) is so short that it
1.1 dsieger 10318: doesn't stand out. Nevertheless it is mentioned in many
10319: files.</p>
10320: </div>
1.41 asau 10321: <div class="sect1">
1.1 dsieger 10322: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10323: <a name="infr.var"></a>26.3. Variable evaluation</h2></div></div></div>
1.41 asau 10324: <div class="sect2">
1.1 dsieger 10325: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10326: <a name="infr.var.load"></a>26.3.1. At load time</h3></div></div></div>
1.1 dsieger 10327: <p>Variable evaluation takes place either at load time or at
10328: runtime, depending on the context in which they occur. The
10329: contexts where variables are evaluated at load time are:</p>
1.41 asau 10330: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 10331: <li class="listitem"><p>The right hand side of the <code class="literal">:=</code>
1.1 dsieger 10332: and <code class="literal">!=</code> operators,</p></li>
1.23 wiz 10333: <li class="listitem"><p>Make directives like <code class="literal">.if</code> or
1.1 dsieger 10334: <code class="literal">.for</code>,</p></li>
1.23 wiz 10335: <li class="listitem"><p>Dependency lines.</p></li>
1.1 dsieger 10336: </ul></div>
10337: <p>A special exception are references to the iteration
10338: variables of <code class="literal">.for</code> loops, which are expanded
10339: inline, no matter in which context they appear.</p>
10340: <p>As the values of variables may change during load time,
10341: care must be taken not to evaluate them by accident. Typical
10342: examples for variables that should not be evaluated at load time
10343: are <code class="varname">DEPENDS</code> and
10344: <code class="varname">CONFIGURE_ARGS</code>. To make the effect more
10345: clear, here is an example:</p>
10346: <pre class="programlisting">
10347: CONFIGURE_ARGS= # none
10348: CFLAGS= -O
10349: CONFIGURE_ARGS+= CFLAGS=${CFLAGS:Q}
10350:
10351: CONFIGURE_ARGS:= ${CONFIGURE_ARGS}
10352:
10353: CFLAGS+= -Wall
1.111 sevan 10354: </pre>
1.1 dsieger 10355: <p>This code shows how the use of the <code class="literal">:=</code>
10356: operator can quickly lead to unexpected results. The first
10357: paragraph is fairly common code. The second paragraph evaluates
10358: the <code class="varname">CONFIGURE_ARGS</code> variable, which results in
10359: <code class="literal">CFLAGS=-O</code>. In the third paragraph, the
10360: <code class="literal">-Wall</code> is appended to the
10361: <code class="varname">CFLAGS</code>, but this addition will not appear in
10362: <code class="varname">CONFIGURE_ARGS</code>. In actual code, the three
10363: paragraphs from above typically occur in completely unrelated
10364: files.</p>
10365: </div>
1.41 asau 10366: <div class="sect2">
1.1 dsieger 10367: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10368: <a name="infr.var.run"></a>26.3.2. At runtime</h3></div></div></div>
1.1 dsieger 10369: <p>After all the files have been loaded, the values of the
10370: variables cannot be changed anymore. Variables that are used in
10371: the shell commands are expanded at this point.</p>
10372: </div>
10373: </div>
1.41 asau 10374: <div class="sect1">
1.1 dsieger 10375: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10376: <a name="infr.varspec"></a>26.4. How can variables be specified?</h2></div></div></div>
1.1 dsieger 10377: <p>There are many ways in which the definition and use of a
1.108 rillig 10378: variable can be restricted in order to detect bugs and violations
10379: of the (mostly unwritten) policies. A package can be checked with
10380: <code class="literal">pkglint -Wall</code> to see whether it meets these
10381: rules.</p>
1.1 dsieger 10382: </div>
1.41 asau 10383: <div class="sect1">
1.1 dsieger 10384: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10385: <a name="infr.design.intf"></a>26.5. Designing interfaces for Makefile fragments</h2></div></div></div>
1.1 dsieger 10386: <p>Most of the <code class="filename">.mk</code> files fall into one
10387: of the following classes. Cases where a file falls into more
10388: than one class should be avoided as it often leads to subtle
10389: bugs.</p>
1.41 asau 10390: <div class="sect2">
1.1 dsieger 10391: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10392: <a name="infr.design.intf.proc"></a>26.5.1. Procedures with parameters</h3></div></div></div>
1.1 dsieger 10393: <p>In a traditional imperative programming language some of
10394: the <code class="filename">.mk</code> files could be described as
1.14 jmcneill 10395: procedures. They take some input parameters and—after
10396: inclusion—provide a result in output parameters. Since all
1.1 dsieger 10397: variables in <code class="filename">Makefile</code>s have global scope
10398: care must be taken not to use parameter names that have already
10399: another meaning. For example, <code class="varname">PKGNAME</code> is a
10400: bad choice for a parameter name.</p>
10401: <p>Procedures are completely evaluated at preprocessing time.
10402: That is, when calling a procedure all input parameters must be
10403: completely resolvable. For example,
10404: <code class="varname">CONFIGURE_ARGS</code> should never be an input
10405: parameter since it is very likely that further text will be
10406: added after calling the procedure, which would effectively apply
10407: the procedure to only a part of the variable. Also, references
1.108 rillig 10408: to other variables will be modified after calling the
1.1 dsieger 10409: procedure.</p>
10410: <p>A procedure can declare its output parameters either as
10411: suitable for use in preprocessing directives or as only
10412: available at runtime. The latter alternative is for variables
10413: that contain references to other runtime variables.</p>
10414: <p>Procedures shall be written such that it is possible to
10415: call the procedure more than once. That is, the file must not
10416: contain multiple-inclusion guards.</p>
10417: <p>Examples for procedures are
10418: <code class="filename">mk/bsd.options.mk</code> and
10419: <code class="filename">mk/buildlink3/bsd.builtin.mk</code>. To express
10420: that the parameters are evaluated at load time, they should be
10421: assigned using the <code class="literal">:=</code> operator, which should
10422: be used only for this purpose.</p>
10423: </div>
1.41 asau 10424: <div class="sect2">
1.1 dsieger 10425: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10426: <a name="infr.design.intf.action"></a>26.5.2. Actions taken on behalf of parameters</h3></div></div></div>
1.1 dsieger 10427: <p>Action files take some input parameters and may define
10428: runtime variables. They shall not define loadtime variables.
10429: There are action files that are included implicitly by the
10430: pkgsrc infrastructure, while other must be included
10431: explicitly.</p>
10432: <p>An example for action files is
10433: <code class="filename">mk/subst.mk</code>.</p>
10434: </div>
10435: </div>
1.41 asau 10436: <div class="sect1">
1.1 dsieger 10437: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10438: <a name="infr.order"></a>26.6. The order in which files are loaded</h2></div></div></div>
1.1 dsieger 10439: <p>Package <code class="filename">Makefile</code>s usually consist of
10440: a set of variable definitions, and include the file
10441: <code class="filename">../../mk/bsd.pkg.mk</code> in the very last line.
10442: Before that, they may also include various other
10443: <code class="filename">*.mk</code> files if they need to query the
10444: availability of certain features like the type of compiler or
10445: the X11 implementation. Due to the heavy use of preprocessor
10446: directives like <code class="literal">.if</code> and
10447: <code class="literal">.for</code>, the order in which the files are loaded
10448: matters.</p>
10449: <p>This section describes at which point the various files
10450: are loaded and gives reasons for that order.</p>
1.41 asau 10451: <div class="sect2">
1.1 dsieger 10452: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10453: <a name="infr.order.prefs"></a>26.6.1. The order in <code class="filename">bsd.prefs.mk</code>
1.1 dsieger 10454: </h3></div></div></div>
10455: <p>The very first action in <code class="filename">bsd.prefs.mk</code>
10456: is to define some essential variables like
10457: <code class="varname">OPSYS</code>, <code class="varname">OS_VERSION</code> and
10458: <code class="varname">MACHINE_ARCH</code>.</p>
10459: <p>Then, the user settings are loaded from the file specified
1.10 hubertf 10460: 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 10461: After that, those variables
1.1 dsieger 10462: that have not been overridden by the user are loaded from
10463: <code class="filename">mk/defaults/mk.conf</code>.</p>
10464: <p>After the user settings, the system settings and platform
10465: settings are loaded, which may override the user
10466: settings.</p>
10467: <p>Then, the tool definitions are loaded. The tool wrappers
10468: are not yet in effect. This only happens when building a
10469: package, so the proper variables must be used instead of the
10470: direct tool names.</p>
10471: <p>As the last steps, some essential variables from the
10472: wrapper and the package system flavor are loaded, as well as the
10473: variables that have been cached in earlier phases of a package
10474: build.</p>
10475: </div>
1.41 asau 10476: <div class="sect2">
1.1 dsieger 10477: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10478: <a name="infr.order.pkg"></a>26.6.2. The order in <code class="filename">bsd.pkg.mk</code>
1.1 dsieger 10479: </h3></div></div></div>
10480: <p>First, <code class="filename">bsd.prefs.mk</code> is loaded.</p>
10481: <p>Then, the various <code class="filename">*-vars.mk</code> files are
10482: loaded, which fill default values for those variables that have
10483: not been defined by the package. These variables may later
10484: be used even in unrelated files.</p>
10485: <p>Then, the file <code class="filename">bsd.pkg.error.mk</code>
10486: provides the target <code class="literal">error-check</code> that is added
10487: as a special dependency to all other targets that use
10488: <code class="varname">DELAYED_ERROR_MSG</code> or
10489: <code class="varname">DELAYED_WARNING_MSG</code>.</p>
10490: <p>Then, the package-specific hacks from
10491: <code class="filename">hacks.mk</code> are included.</p>
10492: <p>Then, various other files follow. Most of them don't have
10493: any dependencies on what they need to have included before or
10494: after them, though some do.</p>
10495: <p>The code to check <code class="varname">PKG_FAIL_REASON</code> and
10496: <code class="varname">PKG_SKIP_REASON</code> is then executed, which
10497: restricts the use of these variables to all the files that have
10498: been included before. Appearances in later files will be
10499: silently ignored.</p>
10500: <p>Then, the files for the main targets are included, in the
10501: order of later execution, though the actual order should not
10502: matter.</p>
10503: <p>At last, some more files are included that don't set any
10504: interesting variables but rather just define make targets to be
10505: executed.</p>
10506: </div>
10507: </div>
10508: </div>
1.41 asau 10509: <div class="chapter">
1.1 dsieger 10510: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 10511: <a name="regression"></a>Chapter 27. Regression tests</h2></div></div></div>
1.1 dsieger 10512: <div class="toc">
10513: <p><b>Table of Contents</b></p>
1.100 leot 10514: <dl class="toc">
1.154 rillig 10515: <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt>
10516: <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt>
1.1 dsieger 10517: <dd><dl>
1.154 rillig 10518: <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt>
10519: <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt>
1.1 dsieger 10520: </dl></dd>
10521: </dl>
10522: </div>
10523: <p>The pkgsrc infrastructure consists of a large codebase,
10524: and there are many corners where every little bit of a file is
10525: well thought out, making pkgsrc likely to fail as soon as
10526: anything is changed near those parts. To prevent most changes
10527: from breaking anything, a suite of regression tests should go
10528: along with every important part of the pkgsrc infrastructure.
10529: This chapter describes how regression tests work in pkgsrc and
10530: how you can add new tests.</p>
1.41 asau 10531: <div class="sect1">
1.1 dsieger 10532: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10533: <a name="regression.run"></a>27.1. Running the regression tests</h2></div></div></div>
1.137 leot 10534: <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 10535: provides the <span class="command"><strong>pkg_regress</strong></span> command. Then you
1.1 dsieger 10536: can simply run that command, which will run all tests in the
1.168 rillig 10537: <code class="filename">regress/</code> directory.</p>
1.1 dsieger 10538: </div>
1.41 asau 10539: <div class="sect1">
1.1 dsieger 10540: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10541: <a name="regression.new"></a>27.2. Adding a new regression test</h2></div></div></div>
1.168 rillig 10542: <p>Every directory in the <code class="filename">regress/</code>
10543: directory that contains a file called <code class="filename">spec</code>
1.1 dsieger 10544: is considered a regression test. This file is a shell program
1.10 hubertf 10545: that is included by the <span class="command"><strong>pkg_regress</strong></span> command.
1.1 dsieger 10546: The following functions can be overridden to suit your
10547: needs.</p>
1.41 asau 10548: <div class="sect2">
1.1 dsieger 10549: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10550: <a name="regression.fun.override"></a>27.2.1. Overridable functions</h3></div></div></div>
1.108 rillig 10551: <p>These functions do not take any parameters. Although they
10552: are called in <span class="quote">“<span class="quote">set -e</span>”</span> mode, they don't stop at the
1.174 leot 10553: first failing command. See <a class="ulink" href="https://stackoverflow.com/q/4072984" target="_top">this Stack Overflow
1.108 rillig 10554: question</a> for details.</p>
1.41 asau 10555: <div class="variablelist"><dl class="variablelist">
1.108 rillig 10556: <dt><span class="term"><code class="varname">do_setup</code></span></dt>
1.1 dsieger 10557: <dd><p>This function prepares the environment for the
10558: test. By default it does nothing.</p></dd>
1.108 rillig 10559: <dt><span class="term"><code class="varname">do_test</code></span></dt>
10560: <dd>
10561: <p>This function runs the actual test. By default,
1.1 dsieger 10562: it calls <code class="varname">TEST_MAKE</code> with the arguments
10563: <code class="varname">MAKEARGS_TEST</code> and writes its output including
10564: error messages into the file
1.108 rillig 10565: <code class="varname">TEST_OUTFILE</code>.</p>
10566: <p>When defining this function, make sure that all output that
10567: needs to be checked is written to the correct output file.
10568: Example:</p>
10569: <pre class="programlisting">
10570: do_test() {
1.112 rillig 10571: echo "Example output"
1.108 rillig 10572: } 1>$TEST_OUTFILE 2>&1
10573: </pre>
10574: </dd>
10575: <dt><span class="term"><code class="varname">check_result</code></span></dt>
10576: <dd>
10577: <p>This function is run after the test and is
1.1 dsieger 10578: typically used to compare the actual output from the one that is
10579: expected. It can make use of the various helper functions from
1.108 rillig 10580: the next section. Example:</p>
10581: <pre class="programlisting">
10582: check_result() {
1.112 rillig 10583: exit_status 0
10584: output_require "Example"
10585: output_require "^[[:alpha:]+[[:space:]][[:alpha:]]{6}$"
10586: output_prohibit "no such file or directory"
1.168 rillig 10587: regress_fail "expected $expected but got $actual for input $input"
1.108 rillig 10588: }
10589: </pre>
10590: </dd>
10591: <dt><span class="term"><code class="varname">do_cleanup</code></span></dt>
1.1 dsieger 10592: <dd><p>This function cleans everything up after the
10593: test has been run. By default it does nothing.</p></dd>
10594: </dl></div>
10595: </div>
1.41 asau 10596: <div class="sect2">
1.1 dsieger 10597: <div class="titlepage"><div><div><h3 class="title">
1.154 rillig 10598: <a name="regression.fun.helper"></a>27.2.2. Helper functions</h3></div></div></div>
1.41 asau 10599: <div class="variablelist"><dl class="variablelist">
1.168 rillig 10600: <dt><span class="term"><code class="varname">regress_fail <em class="replaceable"><code>message...</code></em></code></span></dt>
10601: <dd><p>This function makes the test fail with the given error message.</p></dd>
1.108 rillig 10602: <dt><span class="term"><code class="varname">exit_status expected</code></span></dt>
1.1 dsieger 10603: <dd><p>This function compares the exitcode of the
1.108 rillig 10604: <span class="command"><strong>do_test</strong></span> function with its first parameter.
1.1 dsieger 10605: If they differ, the test will fail.</p></dd>
1.108 rillig 10606: <dt><span class="term"><code class="varname">output_require regex...</code></span></dt>
10607: <dd>
10608: <p>This function checks for each of its parameters
10609: if the output from <span class="command"><strong>do_test</strong></span> matches the
1.1 dsieger 10610: extended regular expression. If it does not, the test will
1.108 rillig 10611: fail. Example:</p>
10612: <pre class="programlisting">
10613: output_require "looks fine"
10614: output_require "^[[:alpha:]+[[:space:]][[:alpha:]]{6}$"
10615: </pre>
10616: </dd>
1.177 leot 10617: <dt><span class="term"><code class="varname">output_prohibit regex...</code></span></dt>
1.1 dsieger 10618: <dd><p>This function checks for each of its parameters
1.10 hubertf 10619: if the output from <span class="command"><strong>do_test()</strong></span> does
1.1 dsieger 10620: <span class="emphasis"><em>not</em></span> match the extended regular expression.
10621: If any of the regular expressions matches, the test will
10622: fail.</p></dd>
10623: </dl></div>
10624: </div>
10625: </div>
10626: </div>
1.41 asau 10627: <div class="chapter">
1.1 dsieger 10628: <div class="titlepage"><div><div><h2 class="title">
1.154 rillig 10629: <a name="porting"></a>Chapter 28. Porting pkgsrc</h2></div></div></div>
1.1 dsieger 10630: <div class="toc">
10631: <p><b>Table of Contents</b></p>
1.154 rillig 10632: <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 10633: </div>
10634: <p>The pkgsrc system has already been ported to many
10635: operating systems, hardware architectures and compilers. This
10636: chapter explains the necessary steps to make pkgsrc even more
10637: portable.</p>
1.41 asau 10638: <div class="sect1">
1.1 dsieger 10639: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 10640: <a name="porting.opsys"></a>28.1. Porting pkgsrc to a new operating system</h2></div></div></div>
1.1 dsieger 10641: <p>To port pkgsrc to a new operating system (called
10642: <code class="literal">MyOS</code> in this example), you need to touch the
10643: following files:</p>
1.41 asau 10644: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 10645: <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>
10646: <dd><p>This file contains some basic definitions, for
10647: example the name of the C
10648: compiler.</p></dd>
10649: <dt><span class="term"><code class="filename">mk/bsd.prefs.mk</code></span></dt>
10650: <dd><p>Insert code that defines the variables
10651: <code class="varname">OPSYS</code>, <code class="varname">OS_VERSION</code>,
10652: <code class="varname">LOWER_OS_VERSION</code>,
10653: <code class="varname">LOWER_VENDOR</code>,
10654: <code class="varname">MACHINE_ARCH</code>, <code class="varname">OBJECT_FMT</code>,
10655: <code class="varname">APPEND_ELF</code>, and the other variables that
10656: appear in this file.</p></dd>
10657: <dt><span class="term"><code class="filename">mk/platform/<em class="replaceable"><code>MyOS</code></em>.mk</code></span></dt>
10658: <dd><p>This file contains the platform-specific
10659: definitions that are used by pkgsrc. Start by copying one of the
10660: other files and edit it to your
10661: needs.</p></dd>
10662: <dt><span class="term"><code class="filename">mk/tools/tools.<em class="replaceable"><code>MyOS</code></em>.mk</code></span></dt>
10663: <dd><p>This file defines the paths to all the tools
10664: that are needed by one or the other package in pkgsrc, as well
10665: as by pkgsrc itself. Find out where these tools are on your
10666: platform and add them.</p></dd>
10667: </dl></div>
10668: <p>Now, you should be able to build some basic packages, like
1.137 leot 10669: <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 10670: </div>
10671: </div>
10672: </div>
1.41 asau 10673: <div class="appendix">
10674: <div class="titlepage"><div><div><h1 class="title">
10675: <a name="examples"></a>Appendix A. A simple example package: bison</h1></div></div></div>
1.1 dsieger 10676: <div class="toc">
10677: <p><b>Table of Contents</b></p>
1.100 leot 10678: <dl class="toc">
1.1 dsieger 10679: <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt>
10680: <dd><dl>
10681: <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt>
10682: <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt>
10683: <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt>
1.172 rillig 10684: <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with pkglint</a></span></dt>
1.1 dsieger 10685: </dl></dd>
10686: <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt>
10687: </dl>
10688: </div>
10689: <p>We checked to find a piece of software that wasn't in the packages
10690: collection, and picked GNU bison. Quite why someone would want to have
1.10 hubertf 10691: <span class="command"><strong>bison</strong></span> when Berkeley <span class="command"><strong>yacc</strong></span> is already
1.1 dsieger 10692: present in the tree is beyond us, but it's useful for the purposes of
10693: this exercise.</p>
1.41 asau 10694: <div class="sect1">
1.1 dsieger 10695: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10696: <a name="example-files"></a>A.1. files</h2></div></div></div>
1.41 asau 10697: <div class="sect2">
1.1 dsieger 10698: <div class="titlepage"><div><div><h3 class="title">
10699: <a name="example-Makefile"></a>A.1.1. Makefile</h3></div></div></div>
10700: <pre class="programlisting">
10701: # $NetBSD$
10702: #
10703:
10704: DISTNAME= bison-1.25
10705: CATEGORIES= devel
1.171 rillig 10706: MASTER_SITES= ${MASTER_SITE_GNU:=bison/}
1.1 dsieger 10707:
1.29 dholland 10708: MAINTAINER= pkgsrc-users@NetBSD.org
1.174 leot 10709: HOMEPAGE= https://www.gnu.org/software/bison/bison.html
1.1 dsieger 10710: COMMENT= GNU yacc clone
10711:
10712: GNU_CONFIGURE= yes
1.46 wiz 10713: INFO_FILES= yes
1.1 dsieger 10714:
10715: .include "../../mk/bsd.pkg.mk"
10716: </pre>
10717: </div>
1.41 asau 10718: <div class="sect2">
1.1 dsieger 10719: <div class="titlepage"><div><div><h3 class="title">
10720: <a name="example-descr"></a>A.1.2. DESCR</h3></div></div></div>
10721: <pre class="programlisting">
10722: GNU version of yacc. Can make re-entrant parsers, and numerous other
1.174 leot 10723: 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 10724: of the NetBSD source tree is beyond me.
10725: </pre>
10726: </div>
1.41 asau 10727: <div class="sect2">
1.1 dsieger 10728: <div class="titlepage"><div><div><h3 class="title">
10729: <a name="example-plist"></a>A.1.3. PLIST</h3></div></div></div>
10730: <pre class="programlisting">
10731: @comment $NetBSD$
10732: bin/bison
10733: man/man1/bison.1.gz
10734: share/bison.simple
10735: share/bison.hairy
10736: </pre>
10737: </div>
1.41 asau 10738: <div class="sect2">
1.1 dsieger 10739: <div class="titlepage"><div><div><h3 class="title">
1.172 rillig 10740: <a name="checking-package-with-pkglint"></a>A.1.4. Checking a package with pkglint</h3></div></div></div>
1.1 dsieger 10741: <p>The NetBSD package system comes with
1.137 leot 10742: <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 10743: which helps to check the contents of these
10744: files. After installation it is quite easy to use, just change to the
1.171 rillig 10745: directory of the package you wish to examine and run
1.10 hubertf 10746: <span class="command"><strong>pkglint</strong></span>:</p>
1.1 dsieger 10747: <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pkglint</code></strong>
1.171 rillig 10748: ERROR: Makefile: Each package must define its LICENSE.
10749: WARN: Makefile:9: HOMEPAGE should migrate from http to https.
10750: NOTE: PLIST:3: The .gz extension is unnecessary for manual pages.
10751: WARN: PLIST:5: "share/bison.hairy" should be sorted before "share/bison.simple".
10752: 1 error, 2 warnings and 1 note found.
10753: (Run "pkglint -e" to show explanations.)
10754: (Run "pkglint -fs" to show what can be fixed automatically.)
1.172 rillig 10755: (Run "pkglint -F" to automatically fix some issues.)</pre>
1.1 dsieger 10756: <p>Depending on the supplied command line arguments (see pkglint(1)),
1.170 rillig 10757: more checks will be performed. Use e.g. <span class="command"><strong>pkglint
1.1 dsieger 10758: -Wall</strong></span> for a very thorough check.</p>
10759: </div>
10760: </div>
1.41 asau 10761: <div class="sect1">
1.1 dsieger 10762: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10763: <a name="steps-for-b-i-p"></a>A.2. Steps for building, installing, packaging</h2></div></div></div>
10764: <p>Create the directory where the package lives,
10765: plus any auxiliary directories:</p>
10766: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cd /usr/pkgsrc/lang</code></strong>
10767: <code class="prompt">#</code> <strong class="userinput"><code>mkdir bison</code></strong>
10768: <code class="prompt">#</code> <strong class="userinput"><code>cd bison</code></strong>
10769: <code class="prompt">#</code> <strong class="userinput"><code>mkdir patches</code></strong></pre>
10770: <p>Create <code class="filename">Makefile</code>, <code class="filename">DESCR</code> and
1.154 rillig 10771: <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 10772: then continue with fetching the distfile:</p>
10773: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make fetch</code></strong>
10774: >> bison-1.25.tar.gz doesn't seem to exist on this system.
10775: >> Attempting to fetch from ftp://prep.ai.mit.edu/pub/gnu//.
10776: Requesting ftp://prep.ai.mit.edu/pub/gnu//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
10777: ftp: Error retrieving file: 500 Internal error
10778:
10779: >> Attempting to fetch from ftp://wuarchive.wustl.edu/systems/gnu//.
10780: Requesting ftp://wuarchive.wustl.edu/systems/gnu//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
10781: ftp: Error retrieving file: 500 Internal error
10782:
10783: >> Attempting to fetch from ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//.
10784: Requesting ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
10785: Successfully retrieved file.</pre>
10786: <p>Generate the checksum of the distfile into
10787: <code class="filename">distinfo</code>:</p>
10788: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make makedistinfo</code></strong></pre>
10789: <p>Now compile:</p>
10790: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make</code></strong>
10791: >> Checksum OK for bison-1.25.tar.gz.
10792: ===> Extracting for bison-1.25
10793: ===> Patching for bison-1.25
10794: ===> Ignoring empty patch directory
10795: ===> Configuring for bison-1.25
10796: creating cache ./config.cache
10797: checking for gcc... cc
10798: checking whether we are using GNU C... yes
10799: checking for a BSD compatible install... /usr/bin/install -c -o bin -g bin
10800: checking how to run the C preprocessor... cc -E
10801: checking for minix/config.h... no
10802: checking for POSIXized ISC... no
10803: checking whether cross-compiling... no
10804: checking for ANSI C header files... yes
10805: checking for string.h... yes
10806: checking for stdlib.h... yes
10807: checking for memory.h... yes
10808: checking for working const... yes
10809: checking for working alloca.h... no
10810: checking for alloca... yes
10811: checking for strerror... yes
10812: updating cache ./config.cache
10813: creating ./config.status
10814: creating Makefile
10815: ===> Building for bison-1.25
10816: 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
10817: 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
10818: 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
10819: 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
10820: 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
10821: 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
10822: 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
10823: 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
10824: 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
10825: 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
10826: 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
10827: 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
10828: 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
10829: 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
10830: 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
10831: 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
10832: 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
10833: 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
10834: 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
10835: 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
10836: 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
10837: 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
10838: ./files.c:240: warning: mktemp() possibly used unsafely, consider using mkstemp()
10839: rm -f bison.s1
10840: sed -e "/^#line/ s|bison|/usr/pkg/share/bison|" < ./bison.simple > bison.s1</pre>
10841: <p>Everything seems OK, so install the files:</p>
10842: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
10843: >> Checksum OK for bison-1.25.tar.gz.
10844: ===> Installing for bison-1.25
10845: sh ./mkinstalldirs /usr/pkg/bin /usr/pkg/share /usr/pkg/info /usr/pkg/man/man1
10846: rm -f /usr/pkg/bin/bison
10847: cd /usr/pkg/share; rm -f bison.simple bison.hairy
10848: rm -f /usr/pkg/man/man1/bison.1 /usr/pkg/info/bison.info*
10849: install -c -o bin -g bin -m 555 bison /usr/pkg/bin/bison
10850: /usr/bin/install -c -o bin -g bin -m 644 bison.s1 /usr/pkg/share/bison.simple
10851: /usr/bin/install -c -o bin -g bin -m 644 ./bison.hairy /usr/pkg/share/bison.hairy
10852: cd .; for f in bison.info*; do /usr/bin/install -c -o bin -g bin -m 644 $f /usr/pkg/info/$f; done
10853: /usr/bin/install -c -o bin -g bin -m 644 ./bison.1 /usr/pkg/man/man1/bison.1
10854: ===> Registering installation for bison-1.25</pre>
10855: <p>You can now use bison, and also - if you decide so - remove it with
1.10 hubertf 10856: <span class="command"><strong>pkg_delete bison</strong></span>. Should you decide that you want a
1.1 dsieger 10857: binary package, do this now:</p>
10858: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make package</code></strong>
10859: >> Checksum OK for bison-1.25.tar.gz.
10860: ===> Building package for bison-1.25
10861: Creating package bison-1.25.tgz
10862: Registering depends:.
10863: Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz'</pre>
10864: <p>Now that you don't need the source and object files
10865: any more, clean up:</p>
10866: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make clean</code></strong>
10867: ===> Cleaning for bison-1.25</pre>
10868: </div>
10869: </div>
1.41 asau 10870: <div class="appendix">
10871: <div class="titlepage"><div><div><h1 class="title">
10872: <a name="logs"></a>Appendix B. Build logs</h1></div></div></div>
1.1 dsieger 10873: <div class="toc">
10874: <p><b>Table of Contents</b></p>
1.100 leot 10875: <dl class="toc">
1.1 dsieger 10876: <dt><span class="sect1"><a href="#logs.building">B.1. Building figlet</a></span></dt>
10877: <dt><span class="sect1"><a href="#logs.package">B.2. Packaging figlet</a></span></dt>
10878: </dl>
10879: </div>
1.41 asau 10880: <div class="sect1">
1.1 dsieger 10881: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10882: <a name="logs.building"></a>B.1. Building figlet</h2></div></div></div>
10883: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make</code></strong>
10884: ===> Checking for vulnerabilities in figlet-2.2.1nb2
10885: => figlet221.tar.gz doesn't seem to exist on this system.
10886: => Attempting to fetch figlet221.tar.gz from ftp://ftp.figlet.org/pub/figlet/program/unix/.
10887: => [172219 bytes]
10888: Connected to ftp.plig.net.
10889: 220 ftp.plig.org NcFTPd Server (licensed copy) ready.
10890: 331 Guest login ok, send your complete e-mail address as password.
10891: 230-You are user #5 of 500 simultaneous users allowed.
10892: 230-
10893: 230- ___ _ _ _
10894: 230- | _| |_ ___ ___| |_|___ ___ ___ ___
10895: 230- | _| _| . |_| . | | | . |_| . | _| . |
10896: 230- |_| |_| | _|_| _|_|_|_ |_|___|_| |_ |
10897: 230- |_| |_| |___| |___|
10898: 230-
10899: 230-** Welcome to ftp.plig.org **
10900: 230-
10901: 230-Please note that all transfers from this FTP site are logged. If you
10902: 230-do not like this, please disconnect now.
10903: 230-
1.18 snj 10904: 230-This archive is available via
1.1 dsieger 10905: 230-
10906: 230-HTTP: http://ftp.plig.org/
10907: 230-FTP: ftp://ftp.plig.org/ (max 500 connections)
10908: 230-RSYNC: rsync://ftp.plig.org/ (max 30 connections)
10909: 230-
10910: 230-Please email comments, bug reports and requests for packages to be
10911: 230-mirrored to ftp-admin@plig.org.
10912: 230-
10913: 230-
10914: 230 Logged in anonymously.
10915: Remote system type is UNIX.
10916: Using binary mode to transfer files.
10917: 200 Type okay.
10918: 250 "/pub" is new cwd.
10919: 250-"/pub/figlet" is new cwd.
10920: 250-
10921: 250-Welcome to the figlet archive at ftp.figlet.org
10922: 250-
10923: 250- ftp://ftp.figlet.org/pub/figlet/
10924: 250-
10925: 250-The official FIGlet web page is:
10926: 250- http://www.figlet.org/
10927: 250-
10928: 250-If you have questions, please mailto:info@figlet.org. If you want to
10929: 250-contribute a font or something else, you can email us.
10930: 250
10931: 250 "/pub/figlet/program" is new cwd.
10932: 250 "/pub/figlet/program/unix" is new cwd.
10933: local: figlet221.tar.gz remote: figlet221.tar.gz
10934: 502 Unimplemented command.
10935: 227 Entering Passive Mode (195,40,6,41,246,104)
10936: 150 Data connection accepted from 84.128.86.72:65131; transfer starting for figlet221.tar.gz (172219 bytes).
10937: 38% |************** | 65800 64.16 KB/s 00:01 ETA
10938: 226 Transfer completed.
10939: 172219 bytes received in 00:02 (75.99 KB/s)
10940: 221 Goodbye.
10941: => Checksum OK for figlet221.tar.gz.
10942: ===> Extracting for figlet-2.2.1nb2
10943: ===> Required installed package ccache-[0-9]*: ccache-2.3nb1 found
10944: ===> Patching for figlet-2.2.1nb2
10945: ===> Applying pkgsrc patches for figlet-2.2.1nb2
10946: ===> Overriding tools for figlet-2.2.1nb2
10947: ===> Creating toolchain wrappers for figlet-2.2.1nb2
10948: ===> Configuring for figlet-2.2.1nb2
10949: ===> Building for figlet-2.2.1nb2
10950: gcc -O2 -DDEFAULTFONTDIR=\"/usr/pkg/share/figlet\" -DDEFAULTFONTFILE=\"standard.flf\" figlet.c zipio.c crc.c inflate.c -o figlet
10951: chmod a+x figlet
10952: gcc -O2 -o chkfont chkfont.c
10953: => Unwrapping files-to-be-installed.
10954: <code class="prompt">#</code>
10955: <code class="prompt">#</code> <strong class="userinput"><code>make install</code></strong>
10956: ===> Checking for vulnerabilities in figlet-2.2.1nb2
10957: ===> Installing for figlet-2.2.1nb2
10958: install -d -o root -g wheel -m 755 /usr/pkg/bin
10959: install -d -o root -g wheel -m 755 /usr/pkg/man/man6
10960: mkdir -p /usr/pkg/share/figlet
10961: cp figlet /usr/pkg/bin
10962: cp chkfont /usr/pkg/bin
10963: chmod 555 figlist showfigfonts
10964: cp figlist /usr/pkg/bin
10965: cp showfigfonts /usr/pkg/bin
10966: cp fonts/*.flf /usr/pkg/share/figlet
10967: cp fonts/*.flc /usr/pkg/share/figlet
10968: cp figlet.6 /usr/pkg/man/man6
10969: ===> Registering installation for figlet-2.2.1nb2
10970: <code class="prompt">#</code></pre>
10971: </div>
1.41 asau 10972: <div class="sect1">
1.1 dsieger 10973: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
10974: <a name="logs.package"></a>B.2. Packaging figlet</h2></div></div></div>
10975: <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>make package</code></strong>
10976: ===> Checking for vulnerabilities in figlet-2.2.1nb2
10977: ===> Packaging figlet-2.2.1nb2
10978: ===> Building binary package for figlet-2.2.1nb2
10979: Creating package /home/cvs/pkgsrc/packages/i386/All/figlet-2.2.1nb2.tgz
10980: Using SrcDir value of /usr/pkg
10981: Registering depends:.
10982: <code class="prompt">#</code></pre>
10983: </div>
10984: </div>
1.41 asau 10985: <div class="appendix">
10986: <div class="titlepage"><div><div><h1 class="title">
10987: <a name="ftp-layout"></a>Appendix C. Directory layout of the pkgsrc FTP server</h1></div></div></div>
1.1 dsieger 10988: <div class="toc">
10989: <p><b>Table of Contents</b></p>
1.100 leot 10990: <dl class="toc">
1.23 wiz 10991: <dt><span class="sect1"><a href="#ftp-distfiles">C.1. <code class="filename">distfiles</code>: The distributed source files</a></span></dt>
10992: <dt><span class="sect1"><a href="#ftp-misc">C.2. <code class="filename">misc</code>: Miscellaneous things</a></span></dt>
10993: <dt><span class="sect1"><a href="#ftp-packages">C.3. <code class="filename">packages</code>: Binary packages</a></span></dt>
10994: <dt><span class="sect1"><a href="#ftp-reports">C.4. <code class="filename">reports</code>: Bulk build reports</a></span></dt>
10995: <dt><span class="sect1"><a href="#ftp-source">C.5. <code class="filename">current</code>,
1.148 leot 10996: <code class="filename">stable</code>,
1.23 wiz 10997: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>:
1.1 dsieger 10998: source packages</a></span></dt>
10999: </dl>
11000: </div>
11001: <p>As in other big projects, the directory layout of pkgsrc
11002: is quite complex for newbies. This chapter explains where you
11003: find things on the FTP server. The base directory on
1.10 hubertf 11004: <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 11005: On other servers it may be different, but inside this directory,
11006: everything should look the same, no matter on which server you
11007: are. This directory contains some subdirectories, which are
11008: explained below.</p>
1.41 asau 11009: <div class="sect1">
1.1 dsieger 11010: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 11011: <a name="ftp-distfiles"></a>C.1. <code class="filename">distfiles</code>: The distributed source files</h2></div></div></div>
1.1 dsieger 11012: <p>The directory <code class="filename">distfiles</code> contains lots
11013: of archive files from all pkgsrc packages, which are mirrored
11014: here. The subdirectories are called after their package names
11015: and are used when the distributed files have names that don't
11016: explicitly contain a version number or are otherwise too generic
11017: (for example <code class="filename">release.tar.gz</code>).</p>
11018: </div>
1.41 asau 11019: <div class="sect1">
1.1 dsieger 11020: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 11021: <a name="ftp-misc"></a>C.2. <code class="filename">misc</code>: Miscellaneous things</h2></div></div></div>
1.1 dsieger 11022: <p>This directory contains things that individual pkgsrc
11023: developers find worth publishing.</p>
11024: </div>
1.41 asau 11025: <div class="sect1">
1.1 dsieger 11026: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 11027: <a name="ftp-packages"></a>C.3. <code class="filename">packages</code>: Binary packages</h2></div></div></div>
1.3 rillig 11028: <p>This directory contains binary packages for the various
11029: platforms that are supported by pkgsrc.
11030: 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 11031: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 11032: <li class="listitem"><p><code class="varname">OPSYS</code> is the name of the
1.9 rillig 11033: operating system for which the packages have been built. The
1.10 hubertf 11034: name is taken from the output of the <span class="command"><strong>uname</strong></span>
1.9 rillig 11035: command, so it may differ from the one you are used to
11036: hear.</p></li>
1.23 wiz 11037: <li class="listitem"><p><code class="varname">ARCH</code> is the hardware
1.8 rillig 11038: architecture of the platform for which the packages have been
1.10 hubertf 11039: built. It also includes the <code class="varname">ABI</code> (Application
11040: Binary Interface) for platforms that have several of
11041: them.</p></li>
1.23 wiz 11042: <li class="listitem"><p><code class="varname">OSVERSION</code> is the version of
1.8 rillig 11043: the operating system. For version numbers that change often (for
11044: example NetBSD-current), the often-changing part should be
11045: replaced with an <code class="literal">x</code>, for example
11046: <code class="literal">4.99.x</code>.</p></li>
1.23 wiz 11047: <li class="listitem"><p><code class="varname">TAG</code> is either
1.22 jakllsch 11048: <code class="literal">20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>
1.8 rillig 11049: for a stable branch, or <code class="literal">head</code> for packages
11050: built from the HEAD branch. The latter should only be used when
11051: the packages are updated on a regular basis. Otherwise the date
11052: from checking out pkgsrc should be appended, for example
11053: <code class="literal">head_20071015</code>.</p></li>
1.3 rillig 11054: </ul></div>
11055: <p>The rationale for exactly this scheme is that the pkgsrc users looking for binary packages
11056: can quickly click through the directories on the
11057: server and find the best binary packages for their machines. Since they
11058: usually know the operating system and the hardware architecture, OPSYS
11059: and ARCH are placed first. After these choices, they can select the
11060: best combination of OSVERSION and TAG together, since it is usually the
11061: case that packages stay compatible between different version of the
11062: operating system.</p>
11063: <p>In each of these directories, there is a
11064: whole binary packages collection for a specific platform. It has a directory called
1.1 dsieger 11065: <code class="filename">All</code> which contains all binary packages.
11066: Besides that, there are various category directories that
11067: contain symbolic links to the real binary packages.</p>
11068: </div>
1.41 asau 11069: <div class="sect1">
1.1 dsieger 11070: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 11071: <a name="ftp-reports"></a>C.4. <code class="filename">reports</code>: Bulk build reports</h2></div></div></div>
1.8 rillig 11072: <p>Here are the reports from bulk builds, for those who want
11073: to fix packages that didn't build on some of the platforms. The
1.23 wiz 11074: 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 11075: </div>
1.41 asau 11076: <div class="sect1">
1.8 rillig 11077: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.22 jakllsch 11078: <a name="ftp-source"></a>C.5. <code class="filename">current</code>,
1.148 leot 11079: <code class="filename">stable</code>,
1.22 jakllsch 11080: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>:
1.1 dsieger 11081: source packages</h2></div></div></div>
1.23 wiz 11082: <p>These directories contain the <span class="quote">“<span class="quote">real</span>”</span> pkgsrc,
1.1 dsieger 11083: that is the files that define how to create binary packages from
11084: source archives.</p>
1.149 leot 11085: <p>Each of the <code class="filename">current</code>,
11086: <code class="filename">stable</code> and
11087: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>
11088: directories share the same structure. They each contain a
11089: <code class="filename">pkgsrc</code> directory and
11090: <code class="filename">pkgsrc.tar.{bz,gz,xz}</code> file.</p>
1.1 dsieger 11091: <p>The directory <code class="filename">pkgsrc</code> contains a
11092: snapshot of the CVS repository, which is updated regularly. The
1.149 leot 11093: file <code class="filename">pkgsrc.tar.{bz,gz,xz}</code> contains the same
11094: as the directory, ready to be downloaded as a whole.</p>
11095: <p>The <code class="filename">current</code> directory contains files
11096: related to the HEAD branch of the CVS repository.
11097: In this directory there is an additional file called
11098: <code class="filename">pkgsrc-readmes.tar.{bz,gz,xz}</code> that contains
11099: all pkgsrc <code class="filename">README</code>s with information about
11100: categories and packages.
11101: </p>
11102: <p>The <code class="filename">stable</code> directory is a symlink to
11103: the latest
11104: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>.
11105: </p>
11106: <p>The
11107: <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>.
11108: directories contain files related to the
11109: <code class="filename">-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>
11110: stable branch of the CVS repository. In these directories there is
11111: an additional file called
11112: <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 11113: which contains the state of pkgsrc when it was branched.</p>
11114: </div>
11115: </div>
1.41 asau 11116: <div class="appendix">
11117: <div class="titlepage"><div><div><h1 class="title">
1.154 rillig 11118: <a name="help-topics"></a>Appendix D. Help topics</h1></div></div></div>
11119: <p>
11120: The following list contains all help topics that are available
11121: when running <span class="command"><strong>bmake help topic=:index</strong></span>.
11122: </p>
1.156 leot 11123: <table border="0" summary="Simple list" class="simplelist">
11124: <tr>
11125: <td>#!</td>
11126: <td>-lintl</td>
11127: </tr>
11128: <tr>
11129: <td>64bit</td>
11130: <td>ABI</td>
11131: </tr>
11132: <tr>
11133: <td>ACCEPTABLE_LICENSES</td>
11134: <td>ACROREAD_FONTPATH</td>
11135: </tr>
11136: <tr>
11137: <td>ADDITIONAL</td>
11138: <td>AFAIK</td>
11139: </tr>
11140: <tr>
11141: <td>AIX</td>
11142: <td>ALLOW_VULNERABLE_PACKAGES</td>
11143: </tr>
11144: <tr>
11145: <td>ALL_ENV</td>
1.177 leot 11146: <td>ALSA_PC</td>
11147: </tr>
11148: <tr>
1.175 gutterid 11149: <td>ALTERNATIVES_SRC</td>
1.177 leot 11150: <td>AMANDA_TMP</td>
1.161 leot 11151: </tr>
11152: <tr>
1.175 gutterid 11153: <td>AMANDA_USER</td>
1.177 leot 11154: <td>AMANDA_VAR</td>
1.159 rillig 11155: </tr>
11156: <tr>
1.175 gutterid 11157: <td>APACHE_GROUP</td>
1.177 leot 11158: <td>APACHE_MODULE_NAME</td>
1.156 leot 11159: </tr>
11160: <tr>
1.175 gutterid 11161: <td>APACHE_MODULE_SRC</td>
1.177 leot 11162: <td>APACHE_MODULE_SRCDIR</td>
1.156 leot 11163: </tr>
11164: <tr>
1.175 gutterid 11165: <td>APACHE_PKG_PREFIX</td>
1.177 leot 11166: <td>APACHE_SUEXEC_CONFIGURE_ARGS</td>
1.156 leot 11167: </tr>
11168: <tr>
1.175 gutterid 11169: <td>APACHE_SUEXEC_DOCROOT</td>
1.177 leot 11170: <td>APACHE_USER</td>
1.156 leot 11171: </tr>
11172: <tr>
1.175 gutterid 11173: <td>APPEND_ABI</td>
1.177 leot 11174: <td>APPEND_ELF</td>
1.156 leot 11175: </tr>
11176: <tr>
1.175 gutterid 11177: <td>ARLA_CACHE</td>
1.177 leot 11178: <td>AUDIT_PACKAGES_FLAGS</td>
1.156 leot 11179: </tr>
11180: <tr>
1.175 gutterid 11181: <td>AUTOCONF_REQD</td>
1.177 leot 11182: <td>AUTOMAKE_OVERRIDE</td>
1.156 leot 11183: </tr>
11184: <tr>
1.175 gutterid 11185: <td>AUTOMAKE_REQD</td>
1.177 leot 11186: <td>AUTO_MKDIRS</td>
1.156 leot 11187: </tr>
11188: <tr>
1.175 gutterid 11189: <td>BDB185_DEFAULT</td>
1.177 leot 11190: <td>BDBBASE</td>
1.156 leot 11191: </tr>
11192: <tr>
1.175 gutterid 11193: <td>BDB_ACCEPTED</td>
1.177 leot 11194: <td>BDB_DEFAULT</td>
1.156 leot 11195: </tr>
11196: <tr>
1.175 gutterid 11197: <td>BDB_LIBS</td>
1.177 leot 11198: <td>BDB_TYPE</td>
1.156 leot 11199: </tr>
11200: <tr>
1.175 gutterid 11201: <td>BIND_DIR</td>
1.177 leot 11202: <td>BIND_GROUP</td>
1.156 leot 11203: </tr>
11204: <tr>
1.175 gutterid 11205: <td>BIND_USER</td>
1.177 leot 11206: <td>BINPKG_SITES</td>
1.156 leot 11207: </tr>
11208: <tr>
1.175 gutterid 11209: <td>BIN_INSTALL_FLAGS</td>
1.177 leot 11210: <td>BISON_PKGDATADIR</td>
11211: </tr>
11212: <tr>
11213: <td>BLAS_ACCEPTED</td>
11214: <td>BLAS_LIBS</td>
1.156 leot 11215: </tr>
11216: <tr>
1.177 leot 11217: <td>BLAS_TYPE</td>
1.156 leot 11218: <td>BOOTSTRAP_DEPENDS</td>
11219: </tr>
11220: <tr>
11221: <td>BOOTSTRAP_SETUPTOOLS</td>
11222: <td>BROKEN</td>
11223: </tr>
11224: <tr>
11225: <td>BROKEN_EXCEPT_ON_PLATFORM</td>
11226: <td>BROKEN_ON_PLATFORM</td>
11227: </tr>
11228: <tr>
11229: <td>BSDSRCDIR</td>
11230: <td>BSDXSRCDIR</td>
11231: </tr>
11232: <tr>
11233: <td>BSD_MAKE_ENV</td>
11234: <td>BUILDLINK_AUTO_DIRS</td>
11235: </tr>
11236: <tr>
11237: <td>BUILDLINK_AUTO_VARS</td>
11238: <td>BUILDLINK_CFLAGS</td>
11239: </tr>
11240: <tr>
11241: <td>BUILDLINK_CONTENTS_FILTER</td>
11242: <td>BUILDLINK_CPPFLAGS</td>
11243: </tr>
11244: <tr>
11245: <td>BUILDLINK_DEPMETHOD</td>
11246: <td>BUILDLINK_FILES</td>
11247: </tr>
11248: <tr>
11249: <td>BUILDLINK_FILES_CMD</td>
11250: <td>BUILDLINK_FNAME_TRANSFORM</td>
11251: </tr>
11252: <tr>
11253: <td>BUILDLINK_LDFLAGS</td>
11254: <td>BUILDLINK_LIBS</td>
11255: </tr>
11256: <tr>
11257: <td>BUILDLINK_OPSYS_SUPPORT_PTHREAD</td>
11258: <td>BUILDLINK_PKGNAME</td>
11259: </tr>
11260: <tr>
11261: <td>BUILDLINK_PREFIX</td>
11262: <td>BUILDLINK_RPATHDIRS</td>
11263: </tr>
11264: <tr>
11265: <td>BUILDLINK_TREE</td>
11266: <td>BUILD_DEFS</td>
11267: </tr>
11268: <tr>
11269: <td>BUILD_DEFS_EFFECTS</td>
11270: <td>BUILD_DEPENDS</td>
11271: </tr>
11272: <tr>
11273: <td>BUILD_DIRS</td>
11274: <td>BUILD_ENV_SHELL</td>
11275: </tr>
11276: <tr>
11277: <td>BUILD_MAKE_CMD</td>
11278: <td>BUILD_MAKE_FLAGS</td>
11279: </tr>
11280: <tr>
11281: <td>BUILD_TARGET</td>
11282: <td>BUILTIN_FIND_FILES</td>
11283: </tr>
11284: <tr>
11285: <td>BUILTIN_FIND_FILES_VAR</td>
11286: <td>BUILTIN_FIND_GREP</td>
11287: </tr>
11288: <tr>
11289: <td>BUILTIN_FIND_HEADERS</td>
11290: <td>BUILTIN_FIND_HEADERS_VAR</td>
11291: </tr>
11292: <tr>
11293: <td>BUILTIN_PKG</td>
11294: <td>BUILTIN_TEST_CURSES_DEFINES</td>
11295: </tr>
11296: <tr>
11297: <td>BUILTIN_TEST_CURSES_FUNCS</td>
11298: <td>BUILTIN_VERSION_SCRIPT</td>
11299: </tr>
11300: <tr>
11301: <td>BUILTIN_X11_TYPE</td>
11302: <td>BUILTIN_X11_VERSION</td>
11303: </tr>
11304: <tr>
11305: <td>CACTI_GROUP</td>
11306: <td>CACTI_USER</td>
11307: </tr>
11308: <tr>
11309: <td>CANNA_GROUP</td>
11310: <td>CANNA_USER</td>
11311: </tr>
11312: <tr>
11313: <td>CAT</td>
11314: <td>CCACHE_BASE</td>
11315: </tr>
11316: <tr>
11317: <td>CCACHE_DIR</td>
11318: <td>CCACHE_LOGFILE</td>
11319: </tr>
11320: <tr>
11321: <td>CC_VERSION</td>
11322: <td>CC_VERSION_STRING</td>
11323: </tr>
11324: <tr>
11325: <td>CDRECORD_CONF</td>
11326: <td>CDROM_PKG_URL_DIR</td>
11327: </tr>
11328: <tr>
11329: <td>CDROM_PKG_URL_HOST</td>
1.177 leot 11330: <td>CHECKOUT_DATE</td>
11331: </tr>
11332: <tr>
1.180 rillig 11333: <td>CHECK_COMPILER</td>
1.175 gutterid 11334: <td>CHECK_FAKEHOME</td>
1.161 leot 11335: </tr>
11336: <tr>
1.180 rillig 11337: <td>CHECK_FILES</td>
1.175 gutterid 11338: <td>CHECK_FILES_SKIP</td>
1.159 rillig 11339: </tr>
11340: <tr>
1.180 rillig 11341: <td>CHECK_FILES_STRICT</td>
1.175 gutterid 11342: <td>CHECK_HEADERS</td>
1.156 leot 11343: </tr>
11344: <tr>
1.180 rillig 11345: <td>CHECK_HEADERS_SKIP</td>
1.175 gutterid 11346: <td>CHECK_INTERPRETER</td>
1.156 leot 11347: </tr>
11348: <tr>
1.180 rillig 11349: <td>CHECK_INTERPRETER_SKIP</td>
1.175 gutterid 11350: <td>CHECK_PERMS</td>
1.156 leot 11351: </tr>
11352: <tr>
1.180 rillig 11353: <td>CHECK_PERMS_AUTOFIX</td>
1.175 gutterid 11354: <td>CHECK_PERMS_SKIP</td>
1.156 leot 11355: </tr>
11356: <tr>
1.180 rillig 11357: <td>CHECK_PORTABILITY</td>
1.177 leot 11358: <td>CHECK_PORTABILITY_EXPERIMENTAL</td>
1.156 leot 11359: </tr>
11360: <tr>
1.180 rillig 11361: <td>CHECK_PORTABILITY_SKIP</td>
1.161 leot 11362: <td>CHECK_RELRO</td>
1.156 leot 11363: </tr>
11364: <tr>
1.180 rillig 11365: <td>CHECK_RELRO_SKIP</td>
1.161 leot 11366: <td>CHECK_RELRO_SUPPORTED</td>
1.156 leot 11367: </tr>
11368: <tr>
1.180 rillig 11369: <td>CHECK_SHLIBS</td>
1.161 leot 11370: <td>CHECK_SHLIBS_BLACKLIST</td>
1.156 leot 11371: </tr>
11372: <tr>
1.180 rillig 11373: <td>CHECK_SHLIBS_SKIP</td>
1.161 leot 11374: <td>CHECK_SHLIBS_SUPPORTED</td>
1.156 leot 11375: </tr>
11376: <tr>
1.180 rillig 11377: <td>CHECK_SSP</td>
1.161 leot 11378: <td>CHECK_SSP_SKIP</td>
1.156 leot 11379: </tr>
11380: <tr>
1.180 rillig 11381: <td>CHECK_SSP_SUPPORTED</td>
1.161 leot 11382: <td>CHECK_STRIPPED</td>
1.156 leot 11383: </tr>
11384: <tr>
1.180 rillig 11385: <td>CHECK_STRIPPED_SKIP</td>
1.161 leot 11386: <td>CHECK_WRKREF</td>
1.156 leot 11387: </tr>
11388: <tr>
1.180 rillig 11389: <td>CHECK_WRKREF_EXTRA_DIRS</td>
1.161 leot 11390: <td>CHECK_WRKREF_SKIP</td>
1.156 leot 11391: </tr>
11392: <tr>
1.180 rillig 11393: <td>CLAMAV_DBDIR</td>
1.161 leot 11394: <td>CLAMAV_GROUP</td>
1.156 leot 11395: </tr>
11396: <tr>
1.180 rillig 11397: <td>CLAMAV_USER</td>
1.161 leot 11398: <td>CLANGBASE</td>
1.156 leot 11399: </tr>
11400: <tr>
1.180 rillig 11401: <td>CLEANDEPENDS</td>
1.161 leot 11402: <td>CMAKE_DEPENDENCIES_REWRITE</td>
1.156 leot 11403: </tr>
11404: <tr>
1.180 rillig 11405: <td>CMAKE_INSTALL_PREFIX</td>
1.161 leot 11406: <td>CMAKE_MODULE_PATH_OVERRIDE</td>
1.156 leot 11407: </tr>
11408: <tr>
1.180 rillig 11409: <td>CMAKE_PKGSRC_BUILD_FLAGS</td>
1.161 leot 11410: <td>CMAKE_PREFIX_PATH</td>
1.156 leot 11411: </tr>
11412: <tr>
1.180 rillig 11413: <td>CMAKE_USE_GNU_INSTALL_DIRS</td>
1.177 leot 11414: <td>COMMON_LISP_DOCFILES</td>
11415: </tr>
11416: <tr>
1.180 rillig 11417: <td>COMMON_LISP_EXAMPLES</td>
1.177 leot 11418: <td>COMMON_LISP_EXTRAFILES</td>
11419: </tr>
11420: <tr>
1.180 rillig 11421: <td>COMMON_LISP_PACKAGES</td>
1.177 leot 11422: <td>COMMON_LISP_SYSTEM</td>
11423: </tr>
11424: <tr>
1.180 rillig 11425: <td>COMPILER_RPATH_FLAG</td>
1.156 leot 11426: <td>COMPILER_USE_SYMLINKS</td>
11427: </tr>
11428: <tr>
1.180 rillig 11429: <td>CONFIGURE_ARGS</td>
1.156 leot 11430: <td>CONFIGURE_DIRS</td>
11431: </tr>
11432: <tr>
1.180 rillig 11433: <td>CONFIGURE_ENV</td>
1.172 rillig 11434: <td>CONFIGURE_ENV_SHELL</td>
1.156 leot 11435: </tr>
11436: <tr>
1.180 rillig 11437: <td>CONFIGURE_HAS_INFODIR</td>
1.156 leot 11438: <td>CONFIGURE_HAS_MANDIR</td>
11439: </tr>
11440: <tr>
1.180 rillig 11441: <td>CONFIGURE_SCRIPT</td>
1.156 leot 11442: <td>CONFIG_SHELL</td>
11443: </tr>
11444: <tr>
1.180 rillig 11445: <td>CONFIG_SHELL_FLAGS</td>
1.156 leot 11446: <td>CONF_FILES</td>
11447: </tr>
11448: <tr>
1.180 rillig 11449: <td>CONF_FILES_MODE</td>
1.156 leot 11450: <td>CONF_FILES_PERMS</td>
11451: </tr>
11452: <tr>
1.180 rillig 11453: <td>CONSERVER_DEFAULTHOST</td>
1.156 leot 11454: <td>CONSERVER_DEFAULTPORT</td>
11455: </tr>
11456: <tr>
1.180 rillig 11457: <td>CP</td>
1.156 leot 11458: <td>CPP</td>
11459: </tr>
11460: <tr>
1.180 rillig 11461: <td>CPP_PRECOMP_FLAGS</td>
1.156 leot 11462: <td>CREATE_WRKDIR_SYMLINK</td>
11463: </tr>
11464: <tr>
1.180 rillig 11465: <td>CROSSBASE</td>
1.156 leot 11466: <td>CTFCONVERT</td>
11467: </tr>
11468: <tr>
1.180 rillig 11469: <td>CTF_FILES_SKIP</td>
1.156 leot 11470: <td>CTF_SUPPORTED</td>
11471: </tr>
11472: <tr>
1.180 rillig 11473: <td>CTYPE</td>
1.156 leot 11474: <td>CUPS_GROUP</td>
11475: </tr>
11476: <tr>
1.180 rillig 11477: <td>CUPS_SYSTEM_GROUPS</td>
1.156 leot 11478: <td>CUPS_USER</td>
11479: </tr>
11480: <tr>
1.180 rillig 11481: <td>CURSES_DEFAULT</td>
1.156 leot 11482: <td>CURSES_TYPE</td>
1.177 leot 11483: </tr>
11484: <tr>
1.180 rillig 11485: <td>CVS_EXTRACTDIR</td>
1.177 leot 11486: <td>CVS_MODULE</td>
11487: </tr>
11488: <tr>
1.180 rillig 11489: <td>CVS_PROJECT</td>
1.177 leot 11490: <td>CVS_REPOSITORIES</td>
11491: </tr>
11492: <tr>
1.180 rillig 11493: <td>CVS_ROOT</td>
1.177 leot 11494: <td>CVS_ROOT_GNU</td>
11495: </tr>
11496: <tr>
1.180 rillig 11497: <td>CVS_ROOT_NONGNU</td>
1.177 leot 11498: <td>CVS_ROOT_SOURCEFORGE</td>
1.161 leot 11499: </tr>
11500: <tr>
1.180 rillig 11501: <td>CVS_TAG</td>
1.160 brook 11502: <td>CXX</td>
1.159 rillig 11503: </tr>
11504: <tr>
1.180 rillig 11505: <td>CYRUS_GROUP</td>
1.160 brook 11506: <td>CYRUS_IDLE</td>
1.156 leot 11507: </tr>
11508: <tr>
1.180 rillig 11509: <td>CYRUS_USER</td>
1.160 brook 11510: <td>DAEMONTOOLS_GROUP</td>
1.156 leot 11511: </tr>
11512: <tr>
1.180 rillig 11513: <td>DAEMONTOOLS_LOG_USER</td>
1.160 brook 11514: <td>DBUS_GROUP</td>
1.156 leot 11515: </tr>
11516: <tr>
1.180 rillig 11517: <td>DBUS_USER</td>
1.160 brook 11518: <td>DEFANG_GROUP</td>
1.156 leot 11519: </tr>
11520: <tr>
1.180 rillig 11521: <td>DEFANG_USER</td>
1.160 brook 11522: <td>DEFAULT_ACCEPTABLE_LICENSES</td>
1.156 leot 11523: </tr>
11524: <tr>
1.180 rillig 11525: <td>DEFAULT_DISTFILES</td>
1.160 brook 11526: <td>DEFAULT_IRC_SERVER</td>
1.156 leot 11527: </tr>
11528: <tr>
1.180 rillig 11529: <td>DEFAULT_SERIAL_DEVICE</td>
1.160 brook 11530: <td>DEF_UMASK</td>
1.156 leot 11531: </tr>
11532: <tr>
1.180 rillig 11533: <td>DEINSTALLDEPENDS</td>
1.160 brook 11534: <td>DEINSTALL_SRC</td>
1.156 leot 11535: </tr>
11536: <tr>
1.180 rillig 11537: <td>DEINSTALL_TEMPLATES</td>
1.160 brook 11538: <td>DELAYED_ERROR_MSG</td>
1.156 leot 11539: </tr>
11540: <tr>
1.180 rillig 11541: <td>DELAYED_WARNING_MSG</td>
1.160 brook 11542: <td>DEPENDS</td>
1.156 leot 11543: </tr>
11544: <tr>
1.180 rillig 11545: <td>DEPENDS_TARGET</td>
1.160 brook 11546: <td>DEPENDS_TYPE</td>
1.156 leot 11547: </tr>
11548: <tr>
1.180 rillig 11549: <td>DESTDIR</td>
1.160 brook 11550: <td>DESTDIR_VARNAME</td>
1.156 leot 11551: </tr>
11552: <tr>
1.180 rillig 11553: <td>DIALER_GROUP</td>
1.160 brook 11554: <td>DIGEST_REQD</td>
1.156 leot 11555: </tr>
11556: <tr>
1.180 rillig 11557: <td>DISTDIR</td>
1.160 brook 11558: <td>DISTFILES</td>
1.156 leot 11559: </tr>
11560: <tr>
1.180 rillig 11561: <td>DISTINFO_FILE</td>
1.160 brook 11562: <td>DISTNAME</td>
1.156 leot 11563: </tr>
11564: <tr>
1.180 rillig 11565: <td>DIST_PATH</td>
1.160 brook 11566: <td>DIST_SUBDIR</td>
1.156 leot 11567: </tr>
11568: <tr>
1.180 rillig 11569: <td>DJBDNS_AXFR_USER</td>
1.160 brook 11570: <td>DJBDNS_CACHE_USER</td>
1.156 leot 11571: </tr>
11572: <tr>
1.180 rillig 11573: <td>DJBDNS_DJBDNS_GROUP</td>
1.160 brook 11574: <td>DJBDNS_LOG_USER</td>
1.156 leot 11575: </tr>
11576: <tr>
1.180 rillig 11577: <td>DJBDNS_RBL_USER</td>
1.160 brook 11578: <td>DJBDNS_TINY_USER</td>
1.156 leot 11579: </tr>
11580: <tr>
1.180 rillig 11581: <td>DLOPEN_REQUIRE_PTHREADS</td>
1.160 brook 11582: <td>DL_AUTO_VARS</td>
1.156 leot 11583: </tr>
11584: <tr>
1.180 rillig 11585: <td>DL_CFLAGS</td>
1.160 brook 11586: <td>DL_LDFLAGS</td>
1.156 leot 11587: </tr>
11588: <tr>
1.180 rillig 11589: <td>DL_LIBS</td>
1.160 brook 11590: <td>DNS</td>
1.156 leot 11591: </tr>
11592: <tr>
1.180 rillig 11593: <td>DOWNLOADED_DISTFILE</td>
1.160 brook 11594: <td>DT_LAYOUT</td>
1.156 leot 11595: </tr>
11596: <tr>
1.180 rillig 11597: <td>DYNAMIC_SITES_CMD</td>
1.160 brook 11598: <td>DYNAMIC_SITES_SCRIPT</td>
1.156 leot 11599: </tr>
11600: <tr>
1.180 rillig 11601: <td>ECHO</td>
1.160 brook 11602: <td>ECHO_N</td>
1.156 leot 11603: </tr>
11604: <tr>
1.180 rillig 11605: <td>ELK_GUI</td>
1.160 brook 11606: <td>EMACS_TYPE</td>
1.156 leot 11607: </tr>
11608: <tr>
1.180 rillig 11609: <td>EMULDIR</td>
1.160 brook 11610: <td>EMULSUBDIR</td>
1.156 leot 11611: </tr>
11612: <tr>
1.180 rillig 11613: <td>EMULSUBDIRSLASH</td>
1.160 brook 11614: <td>EMUL_ARCH</td>
1.156 leot 11615: </tr>
11616: <tr>
1.180 rillig 11617: <td>EMUL_DISTRO</td>
1.160 brook 11618: <td>EMUL_EXEC_FMT</td>
1.156 leot 11619: </tr>
11620: <tr>
1.180 rillig 11621: <td>EMUL_IS_NATIVE</td>
1.160 brook 11622: <td>EMUL_MODULES</td>
1.156 leot 11623: </tr>
11624: <tr>
1.180 rillig 11625: <td>EMUL_OPSYS</td>
1.160 brook 11626: <td>EMUL_PKG_FMT</td>
1.156 leot 11627: </tr>
11628: <tr>
1.180 rillig 11629: <td>EMUL_PLATFORM</td>
1.160 brook 11630: <td>EMUL_PLATFORMS</td>
1.156 leot 11631: </tr>
11632: <tr>
1.180 rillig 11633: <td>EMUL_PREFER</td>
1.160 brook 11634: <td>EMUL_REQD</td>
1.156 leot 11635: </tr>
11636: <tr>
1.180 rillig 11637: <td>EMUL_TYPE</td>
1.160 brook 11638: <td>ERROR_MSG</td>
1.156 leot 11639: </tr>
11640: <tr>
1.180 rillig 11641: <td>EXIM_GROUP</td>
1.160 brook 11642: <td>EXIM_USER</td>
1.156 leot 11643: </tr>
11644: <tr>
1.180 rillig 11645: <td>EXPORT_SYMBOLS_LDFLAGS</td>
1.160 brook 11646: <td>EXTRACTOR</td>
1.156 leot 11647: </tr>
11648: <tr>
1.180 rillig 11649: <td>EXTRACT_CMD</td>
1.160 brook 11650: <td>EXTRACT_CMD_DEFAULT</td>
1.156 leot 11651: </tr>
11652: <tr>
1.180 rillig 11653: <td>EXTRACT_DIR</td>
1.160 brook 11654: <td>EXTRACT_ELEMENTS</td>
1.156 leot 11655: </tr>
11656: <tr>
1.180 rillig 11657: <td>EXTRACT_ENV</td>
1.160 brook 11658: <td>EXTRACT_ONLY</td>
1.156 leot 11659: </tr>
11660: <tr>
1.180 rillig 11661: <td>EXTRACT_OPTS</td>
1.160 brook 11662: <td>EXTRACT_SUFX</td>
1.156 leot 11663: </tr>
11664: <tr>
1.180 rillig 11665: <td>EXTRACT_USING</td>
1.177 leot 11666: <td>FAIL</td>
11667: </tr>
11668: <tr>
1.180 rillig 11669: <td>FAILOVER_FETCH</td>
1.175 gutterid 11670: <td>FAIL_MSG</td>
1.156 leot 11671: </tr>
11672: <tr>
1.180 rillig 11673: <td>FAKE_NCURSES</td>
1.175 gutterid 11674: <td>FAM</td>
1.156 leot 11675: </tr>
11676: <tr>
1.180 rillig 11677: <td>FAM_ACCEPTED</td>
1.175 gutterid 11678: <td>FAM_DEFAULT</td>
1.156 leot 11679: </tr>
11680: <tr>
1.180 rillig 11681: <td>FAM_SERVER</td>
1.175 gutterid 11682: <td>FCPATH</td>
1.156 leot 11683: </tr>
11684: <tr>
1.180 rillig 11685: <td>FEATURE_CPPFLAGS</td>
1.175 gutterid 11686: <td>FEATURE_LDFLAGS</td>
1.156 leot 11687: </tr>
11688: <tr>
1.180 rillig 11689: <td>FEATURE_LIBS</td>
1.175 gutterid 11690: <td>FETCH_AFTER_ARGS</td>
1.156 leot 11691: </tr>
11692: <tr>
1.180 rillig 11693: <td>FETCH_BEFORE_ARGS</td>
1.175 gutterid 11694: <td>FETCH_CMD</td>
1.156 leot 11695: </tr>
11696: <tr>
1.180 rillig 11697: <td>FETCH_OUTPUT_ARGS</td>
1.175 gutterid 11698: <td>FETCH_PROXY</td>
1.156 leot 11699: </tr>
11700: <tr>
1.180 rillig 11701: <td>FETCH_RESUME_ARGS</td>
1.175 gutterid 11702: <td>FETCH_USING</td>
1.156 leot 11703: </tr>
11704: <tr>
1.180 rillig 11705: <td>FILES_SUBST</td>
1.175 gutterid 11706: <td>FILES_SUBST_SED</td>
1.156 leot 11707: </tr>
11708: <tr>
1.180 rillig 11709: <td>FIX_SYSTEM_HEADERS</td>
1.175 gutterid 11710: <td>FLUXBOX_USE_GNOME</td>
1.156 leot 11711: </tr>
11712: <tr>
1.180 rillig 11713: <td>FLUXBOX_USE_KDE</td>
1.175 gutterid 11714: <td>FLUXBOX_USE_XFT</td>
1.156 leot 11715: </tr>
11716: <tr>
1.180 rillig 11717: <td>FLUXBOX_USE_XINERAMA</td>
1.177 leot 11718: <td>FONTDIR</td>
1.156 leot 11719: </tr>
11720: <tr>
1.180 rillig 11721: <td>FONTS_DIRS</td>
1.172 rillig 11722: <td>FONTS_VERBOSE</td>
1.161 leot 11723: </tr>
11724: <tr>
1.180 rillig 11725: <td>FOO_HACKS_MK</td>
1.177 leot 11726: <td>FOSSIL_EXTRACTDIR</td>
11727: </tr>
11728: <tr>
1.180 rillig 11729: <td>FOSSIL_REPO</td>
1.177 leot 11730: <td>FOSSIL_REPOSITORIES</td>
11731: </tr>
11732: <tr>
1.180 rillig 11733: <td>FOSSIL_VERSION</td>
1.172 rillig 11734: <td>FOX_USE_XUNICODE</td>
1.156 leot 11735: </tr>
11736: <tr>
1.180 rillig 11737: <td>FREEWNN_GROUP</td>
1.172 rillig 11738: <td>FREEWNN_USER</td>
1.156 leot 11739: </tr>
11740: <tr>
1.180 rillig 11741: <td>FTP_PKG_URL_DIR</td>
1.172 rillig 11742: <td>FTP_PKG_URL_HOST</td>
1.156 leot 11743: </tr>
11744: <tr>
1.180 rillig 11745: <td>GAMEDATAMODE</td>
1.172 rillig 11746: <td>GAMEDATA_PERMS</td>
1.156 leot 11747: </tr>
11748: <tr>
1.180 rillig 11749: <td>GAMEDIRMODE</td>
1.172 rillig 11750: <td>GAMEDIR_PERMS</td>
1.156 leot 11751: </tr>
11752: <tr>
1.180 rillig 11753: <td>GAMEGRP</td>
1.172 rillig 11754: <td>GAMEMODE</td>
1.156 leot 11755: </tr>
11756: <tr>
1.180 rillig 11757: <td>GAMEOWN</td>
1.172 rillig 11758: <td>GAMES_GROUP</td>
1.156 leot 11759: </tr>
11760: <tr>
1.180 rillig 11761: <td>GAMES_USER</td>
1.172 rillig 11762: <td>GCC</td>
1.156 leot 11763: </tr>
11764: <tr>
1.180 rillig 11765: <td>GCCBASE</td>
1.172 rillig 11766: <td>GCC_REQD</td>
1.156 leot 11767: </tr>
11768: <tr>
1.180 rillig 11769: <td>GCC_VERSION_SUFFIX</td>
1.172 rillig 11770: <td>GEM_BUILD</td>
1.156 leot 11771: </tr>
11772: <tr>
1.180 rillig 11773: <td>GEM_CLEANBUILD</td>
1.172 rillig 11774: <td>GEM_CLEANBUILD_EXTENSIONS</td>
1.156 leot 11775: </tr>
11776: <tr>
1.180 rillig 11777: <td>GEM_DOCDIR</td>
1.172 rillig 11778: <td>GEM_EXTSDIR</td>
1.156 leot 11779: </tr>
11780: <tr>
1.180 rillig 11781: <td>GEM_HOME</td>
1.177 leot 11782: <td>GEM_KEEPBUILD</td>
11783: </tr>
11784: <tr>
1.180 rillig 11785: <td>GEM_LIBDIR</td>
1.156 leot 11786: <td>GEM_NAME</td>
11787: </tr>
11788: <tr>
1.180 rillig 11789: <td>GEM_PATH</td>
1.156 leot 11790: <td>GEM_SPECFILE</td>
11791: </tr>
11792: <tr>
1.180 rillig 11793: <td>GENERATE_PLIST</td>
1.156 leot 11794: <td>GHOSTSCRIPT_REQD</td>
11795: </tr>
11796: <tr>
1.180 rillig 11797: <td>GITHUB_PROJECT</td>
1.156 leot 11798: <td>GITHUB_RELEASE</td>
11799: </tr>
11800: <tr>
1.180 rillig 11801: <td>GITHUB_TAG</td>
1.156 leot 11802: <td>GITHUB_TYPE</td>
1.177 leot 11803: </tr>
11804: <tr>
1.180 rillig 11805: <td>GITLAB_PROJECT</td>
1.177 leot 11806: <td>GITLAB_TAG</td>
11807: </tr>
11808: <tr>
1.180 rillig 11809: <td>GITLAB_TYPE</td>
1.177 leot 11810: <td>GIT_BRANCH</td>
1.161 leot 11811: </tr>
11812: <tr>
1.180 rillig 11813: <td>GIT_ENV</td>
1.177 leot 11814: <td>GIT_EXTRACTDIR</td>
11815: </tr>
11816: <tr>
1.180 rillig 11817: <td>GIT_REPO</td>
1.177 leot 11818: <td>GIT_REPOSITORIES</td>
11819: </tr>
11820: <tr>
1.180 rillig 11821: <td>GIT_REVISION</td>
1.177 leot 11822: <td>GIT_TAG</td>
11823: </tr>
11824: <tr>
1.180 rillig 11825: <td>GNU</td>
1.175 gutterid 11826: <td>GNU_CONFIGURE</td>
1.159 rillig 11827: </tr>
11828: <tr>
1.180 rillig 11829: <td>GNU_CONFIGURE_INFODIR</td>
1.175 gutterid 11830: <td>GNU_CONFIGURE_MANDIR</td>
1.156 leot 11831: </tr>
11832: <tr>
1.180 rillig 11833: <td>GNU_CONFIGURE_QUIET</td>
1.178 rillig 11834: <td>GNU_CONFIGURE_STRICT</td>
1.156 leot 11835: </tr>
11836: <tr>
1.180 rillig 11837: <td>GODEP_REDIRECTS</td>
1.178 rillig 11838: <td>GO_BUILD_PATTERN</td>
1.156 leot 11839: </tr>
11840: <tr>
1.180 rillig 11841: <td>GO_DEPS</td>
1.178 rillig 11842: <td>GO_DIST_BASE</td>
1.156 leot 11843: </tr>
11844: <tr>
1.180 rillig 11845: <td>GO_MODULE_FILES</td>
1.178 rillig 11846: <td>GO_SRCPATH</td>
1.156 leot 11847: </tr>
11848: <tr>
1.180 rillig 11849: <td>GO_VERSION_DEFAULT</td>
1.178 rillig 11850: <td>GROUP_SPECIFIC_PKGS</td>
1.156 leot 11851: </tr>
11852: <tr>
1.180 rillig 11853: <td>GRUB_NETWORK_CARDS</td>
1.178 rillig 11854: <td>GRUB_PRESET_COMMAND</td>
1.156 leot 11855: </tr>
11856: <tr>
1.180 rillig 11857: <td>GRUB_SCAN_ARGS</td>
1.178 rillig 11858: <td>GZIP</td>
1.156 leot 11859: </tr>
11860: <tr>
1.180 rillig 11861: <td>HASKELL_COMPILER</td>
1.178 rillig 11862: <td>HASKELL_ENABLE_HADDOCK_DOCUMENTATION</td>
1.156 leot 11863: </tr>
11864: <tr>
1.180 rillig 11865: <td>HASKELL_ENABLE_LIBRARY_PROFILING</td>
1.178 rillig 11866: <td>HASKELL_ENABLE_SHARED_LIBRARY</td>
1.156 leot 11867: </tr>
11868: <tr>
1.180 rillig 11869: <td>HASKELL_OPTIMIZATION_LEVEL</td>
1.178 rillig 11870: <td>HAS_CONFIGURE</td>
1.177 leot 11871: </tr>
11872: <tr>
1.180 rillig 11873: <td>HEADER_TEMPLATES</td>
1.178 rillig 11874: <td>HG_REPO</td>
1.161 leot 11875: </tr>
11876: <tr>
1.180 rillig 11877: <td>HG_REPOSITORIES</td>
1.178 rillig 11878: <td>HG_TAG</td>
1.156 leot 11879: </tr>
11880: <tr>
1.180 rillig 11881: <td>HOST_PKGTOOLS_ARGS</td>
1.178 rillig 11882: <td>HOST_SPECIFIC_PKGS</td>
1.156 leot 11883: </tr>
11884: <tr>
1.180 rillig 11885: <td>HOWL_GROUP</td>
1.178 rillig 11886: <td>HOWL_USER</td>
1.156 leot 11887: </tr>
11888: <tr>
1.180 rillig 11889: <td>ICCBASE</td>
1.178 rillig 11890: <td>ICECAST_CHROOTDIR</td>
1.156 leot 11891: </tr>
11892: <tr>
1.180 rillig 11893: <td>ICON_THEMES</td>
1.178 rillig 11894: <td>IDOBASE</td>
1.156 leot 11895: </tr>
11896: <tr>
1.180 rillig 11897: <td>IGNORE_CCACHE</td>
1.178 rillig 11898: <td>IGNORE_INFO_DIRS</td>
1.156 leot 11899: </tr>
11900: <tr>
1.180 rillig 11901: <td>IGNORE_INTERACTIVE_FETCH</td>
1.178 rillig 11902: <td>IMAKE</td>
1.156 leot 11903: </tr>
11904: <tr>
1.180 rillig 11905: <td>IMAKEOPTS</td>
1.178 rillig 11906: <td>IMAKE_MAKE</td>
1.156 leot 11907: </tr>
11908: <tr>
1.180 rillig 11909: <td>IMAKE_MANINSTALL</td>
1.178 rillig 11910: <td>IMAP_UW_CCLIENT_MBOX_FMT</td>
1.156 leot 11911: </tr>
11912: <tr>
1.180 rillig 11913: <td>IMDICTDIR</td>
1.178 rillig 11914: <td>INCOMPAT_CURSES</td>
1.156 leot 11915: </tr>
11916: <tr>
1.180 rillig 11917: <td>INFO_DIR</td>
1.178 rillig 11918: <td>INFO_FILES</td>
1.156 leot 11919: </tr>
11920: <tr>
1.180 rillig 11921: <td>INFO_FILES_VERBOSE</td>
1.178 rillig 11922: <td>INFO_MSG</td>
1.156 leot 11923: </tr>
11924: <tr>
1.180 rillig 11925: <td>INIT_SYSTEM</td>
1.178 rillig 11926: <td>INN_DATA_DIR</td>
1.156 leot 11927: </tr>
11928: <tr>
1.180 rillig 11929: <td>INN_GROUP</td>
1.178 rillig 11930: <td>INN_USER</td>
1.172 rillig 11931: </tr>
11932: <tr>
1.180 rillig 11933: <td>INSTALLATION_DIRS</td>
1.178 rillig 11934: <td>INSTALLATION_DIRS_FROM_PLIST</td>
1.156 leot 11935: </tr>
11936: <tr>
1.180 rillig 11937: <td>INSTALL_ENV</td>
1.178 rillig 11938: <td>INSTALL_SH_OVERRIDE</td>
1.156 leot 11939: </tr>
11940: <tr>
1.180 rillig 11941: <td>INSTALL_SRC</td>
1.178 rillig 11942: <td>INSTALL_TEMPLATES</td>
1.156 leot 11943: </tr>
11944: <tr>
1.180 rillig 11945: <td>INSTALL_UNSTRIPPED</td>
1.178 rillig 11946: <td>IRCD_HYBRID_IRC_GROUP</td>
1.156 leot 11947: </tr>
11948: <tr>
1.180 rillig 11949: <td>IRCD_HYBRID_IRC_USER</td>
1.178 rillig 11950: <td>IRCD_HYBRID_MAXCONN</td>
1.156 leot 11951: </tr>
11952: <tr>
1.180 rillig 11953: <td>IRCD_HYBRID_NICLEN</td>
1.178 rillig 11954: <td>IRCD_HYBRID_SYSLOG_EVENTS</td>
1.156 leot 11955: </tr>
11956: <tr>
1.180 rillig 11957: <td>IRCD_HYBRID_SYSLOG_FACILITY</td>
1.178 rillig 11958: <td>IRCD_HYBRID_TOPICLEN</td>
1.156 leot 11959: </tr>
11960: <tr>
1.180 rillig 11961: <td>IRIX</td>
1.178 rillig 11962: <td>IRRD_USE_PGP</td>
1.156 leot 11963: </tr>
11964: <tr>
1.180 rillig 11965: <td>JABBERD_GROUP</td>
1.178 rillig 11966: <td>JABBERD_LOGDIR</td>
1.156 leot 11967: </tr>
11968: <tr>
1.180 rillig 11969: <td>JABBERD_PIDDIR</td>
1.178 rillig 11970: <td>JABBERD_SPOOLDIR</td>
1.156 leot 11971: </tr>
11972: <tr>
1.180 rillig 11973: <td>JABBERD_USER</td>
1.178 rillig 11974: <td>JAKARTA_HOME</td>
1.177 leot 11975: </tr>
11976: <tr>
1.180 rillig 11977: <td>JAVA_APP_PATH</td>
1.178 rillig 11978: <td>JAVA_APP_TARGETS</td>
1.161 leot 11979: </tr>
11980: <tr>
1.180 rillig 11981: <td>JAVA_BINPREFIX</td>
1.178 rillig 11982: <td>JAVA_CLASSPATH</td>
1.156 leot 11983: </tr>
11984: <tr>
1.180 rillig 11985: <td>JAVA_HOME</td>
1.178 rillig 11986: <td>JAVA_LD_LIBRARY_PATH</td>
1.156 leot 11987: </tr>
11988: <tr>
1.180 rillig 11989: <td>JAVA_NAME</td>
1.178 rillig 11990: <td>JAVA_UNLIMIT</td>
1.156 leot 11991: </tr>
11992: <tr>
1.180 rillig 11993: <td>JAVA_WRAPPERS</td>
1.178 rillig 11994: <td>JPEG_ACCEPTED</td>
1.156 leot 11995: </tr>
11996: <tr>
1.180 rillig 11997: <td>JPEG_DEFAULT</td>
1.178 rillig 11998: <td>KERBEROS</td>
1.156 leot 11999: </tr>
12000: <tr>
1.180 rillig 12001: <td>KERMIT_SUID_UUCP</td>
1.178 rillig 12002: <td>KJS_USE_PCRE</td>
1.156 leot 12003: </tr>
12004: <tr>
1.180 rillig 12005: <td>KNEWS_DOMAIN_FILE</td>
1.178 rillig 12006: <td>KNEWS_DOMAIN_NAME</td>
1.156 leot 12007: </tr>
12008: <tr>
1.180 rillig 12009: <td>KRB5_ACCEPTED</td>
1.178 rillig 12010: <td>KRB5_DEFAULT</td>
1.177 leot 12011: </tr>
12012: <tr>
1.180 rillig 12013: <td>LANGUAGES</td>
1.178 rillig 12014: <td>LAPACK_LIBS</td>
1.156 leot 12015: </tr>
12016: <tr>
1.180 rillig 12017: <td>LATEX2HTML_ICONPATH</td>
1.178 rillig 12018: <td>LDCONFIG_ADD_CMD</td>
1.156 leot 12019: </tr>
12020: <tr>
1.180 rillig 12021: <td>LDCONFIG_REMOVE_CMD</td>
1.178 rillig 12022: <td>LEAFNODE_DATA_DIR</td>
1.156 leot 12023: </tr>
12024: <tr>
1.180 rillig 12025: <td>LEAFNODE_GROUP</td>
1.178 rillig 12026: <td>LEAFNODE_USER</td>
1.156 leot 12027: </tr>
12028: <tr>
1.180 rillig 12029: <td>LIBDVDCSS_HOMEPAGE</td>
1.178 rillig 12030: <td>LIBDVDCSS_MASTER_SITES</td>
1.157 leot 12031: </tr>
12032: <tr>
1.180 rillig 12033: <td>LIBRSVG_TYPE</td>
1.178 rillig 12034: <td>LIBTOOL</td>
1.156 leot 12035: </tr>
12036: <tr>
1.180 rillig 12037: <td>LIBTOOLIZE_PLIST</td>
1.178 rillig 12038: <td>LIBTOOL_M4_OVERRIDE</td>
1.156 leot 12039: </tr>
12040: <tr>
1.180 rillig 12041: <td>LIBUSB_TYPE</td>
1.178 rillig 12042: <td>LICENSE</td>
1.177 leot 12043: </tr>
12044: <tr>
1.180 rillig 12045: <td>LINKER_RPATH_FLAG</td>
1.178 rillig 12046: <td>LINK_RPATH_FLAG</td>
1.156 leot 12047: </tr>
12048: <tr>
1.180 rillig 12049: <td>LINUX_BASE_NODEPS</td>
1.178 rillig 12050: <td>LINUX_BASE_PREFERRED</td>
1.161 leot 12051: </tr>
12052: <tr>
1.180 rillig 12053: <td>LINUX_BASE_REQUIRED</td>
1.178 rillig 12054: <td>LINUX_LOCALES</td>
1.156 leot 12055: </tr>
12056: <tr>
1.180 rillig 12057: <td>LOCALBASE</td>
1.178 rillig 12058: <td>LOCALBASE_LOCKTYPE</td>
1.156 leot 12059: </tr>
12060: <tr>
1.180 rillig 12061: <td>LOCALPATCHES</td>
1.178 rillig 12062: <td>LOVE_DATA</td>
1.156 leot 12063: </tr>
12064: <tr>
1.180 rillig 12065: <td>LOVE_GAME</td>
1.178 rillig 12066: <td>LOVE_VERSION</td>
1.156 leot 12067: </tr>
12068: <tr>
1.180 rillig 12069: <td>LP64PLATFORMS</td>
1.178 rillig 12070: <td>MACHINE_PLATFORM</td>
1.156 leot 12071: </tr>
12072: <tr>
1.180 rillig 12073: <td>MAILAGENT_DOMAIN</td>
1.178 rillig 12074: <td>MAILAGENT_EMAIL</td>
1.156 leot 12075: </tr>
12076: <tr>
1.180 rillig 12077: <td>MAILAGENT_FQDN</td>
1.178 rillig 12078: <td>MAILAGENT_ORGANIZATION</td>
1.159 rillig 12079: </tr>
12080: <tr>
1.180 rillig 12081: <td>MAJORDOMO_HOMEDIR</td>
1.178 rillig 12082: <td>MAJOR_OS_VERSION</td>
1.156 leot 12083: </tr>
12084: <tr>
1.180 rillig 12085: <td>MAKEINFO_ARGS</td>
1.178 rillig 12086: <td>MAKE_DIRS</td>
1.156 leot 12087: </tr>
12088: <tr>
1.180 rillig 12089: <td>MAKE_DIRS_PERMS</td>
1.178 rillig 12090: <td>MAKE_ENV</td>
1.156 leot 12091: </tr>
12092: <tr>
1.180 rillig 12093: <td>MAKE_FILE</td>
1.178 rillig 12094: <td>MAKE_FLAGS</td>
1.156 leot 12095: </tr>
12096: <tr>
1.180 rillig 12097: <td>MAKE_JOBS</td>
1.178 rillig 12098: <td>MAKE_JOBS_SAFE</td>
1.156 leot 12099: </tr>
12100: <tr>
1.180 rillig 12101: <td>MAKE_PROGRAM</td>
1.178 rillig 12102: <td>MANINSTALL</td>
1.156 leot 12103: </tr>
12104: <tr>
1.180 rillig 12105: <td>MANZ</td>
1.178 rillig 12106: <td>MASTER_SITES</td>
1.156 leot 12107: </tr>
12108: <tr>
1.180 rillig 12109: <td>MASTER_SITE_BACKUP</td>
1.178 rillig 12110: <td>MASTER_SITE_LOCAL</td>
1.156 leot 12111: </tr>
12112: <tr>
1.180 rillig 12113: <td>MASTER_SITE_MOZILLA</td>
1.178 rillig 12114: <td>MASTER_SITE_OVERRIDE</td>
1.156 leot 12115: </tr>
12116: <tr>
1.180 rillig 12117: <td>MASTER_SITE_PERL_CPAN</td>
1.178 rillig 12118: <td>MASTER_SORT</td>
1.156 leot 12119: </tr>
12120: <tr>
1.180 rillig 12121: <td>MASTER_SORT_RANDOM</td>
1.178 rillig 12122: <td>MASTER_SORT_REGEX</td>
1.156 leot 12123: </tr>
12124: <tr>
1.180 rillig 12125: <td>MECAB_CHARSET</td>
1.178 rillig 12126: <td>MEDIATOMB_GROUP</td>
1.156 leot 12127: </tr>
12128: <tr>
1.180 rillig 12129: <td>MEDIATOMB_USER</td>
1.178 rillig 12130: <td>MIPSPROBASE</td>
1.156 leot 12131: </tr>
12132: <tr>
1.180 rillig 12133: <td>MIREDO_GROUP</td>
1.178 rillig 12134: <td>MIREDO_USER</td>
1.156 leot 12135: </tr>
12136: <tr>
1.180 rillig 12137: <td>MISSING_FEATURES</td>
1.178 rillig 12138: <td>MKDIR</td>
1.156 leot 12139: </tr>
12140: <tr>
1.180 rillig 12141: <td>MLDONKEY_GROUP</td>
1.178 rillig 12142: <td>MLDONKEY_HOME</td>
1.156 leot 12143: </tr>
12144: <tr>
1.180 rillig 12145: <td>MLDONKEY_USER</td>
1.178 rillig 12146: <td>MONOTONE_GROUP</td>
1.156 leot 12147: </tr>
12148: <tr>
1.180 rillig 12149: <td>MONOTONE_USER</td>
1.178 rillig 12150: <td>MOTIFBASE</td>
1.156 leot 12151: </tr>
12152: <tr>
1.180 rillig 12153: <td>MOTIF_TYPE</td>
1.178 rillig 12154: <td>MOTIF_TYPE_DEFAULT</td>
1.156 leot 12155: </tr>
12156: <tr>
1.180 rillig 12157: <td>MPI_TYPE</td>
1.178 rillig 12158: <td>MSGFMT_STRIP_MSGCTXT</td>
1.156 leot 12159: </tr>
12160: <tr>
1.180 rillig 12161: <td>MSGFMT_STRIP_MSGID_PLURAL</td>
1.178 rillig 12162: <td>MTOOLS_ENABLE_FLOPPYD</td>
1.156 leot 12163: </tr>
12164: <tr>
1.180 rillig 12165: <td>MUST</td>
1.178 rillig 12166: <td>MV</td>
1.156 leot 12167: </tr>
12168: <tr>
1.180 rillig 12169: <td>MYSQL_CHARSET</td>
1.178 rillig 12170: <td>MYSQL_DATADIR</td>
1.156 leot 12171: </tr>
12172: <tr>
1.180 rillig 12173: <td>MYSQL_EXTRA_CHARSET</td>
1.178 rillig 12174: <td>MYSQL_GROUP</td>
1.156 leot 12175: </tr>
12176: <tr>
1.180 rillig 12177: <td>MYSQL_PKGSRCDIR</td>
1.178 rillig 12178: <td>MYSQL_USER</td>
1.156 leot 12179: </tr>
12180: <tr>
1.180 rillig 12181: <td>MYSQL_VERSIONS_ACCEPTED</td>
1.178 rillig 12182: <td>MYSQL_VERSION_DEFAULT</td>
1.156 leot 12183: </tr>
12184: <tr>
1.180 rillig 12185: <td>NAGIOSCMD_GROUP</td>
1.178 rillig 12186: <td>NAGIOSDIR</td>
1.156 leot 12187: </tr>
12188: <tr>
1.180 rillig 12189: <td>NAGIOS_GROUP</td>
1.178 rillig 12190: <td>NAGIOS_USER</td>
1.156 leot 12191: </tr>
12192: <tr>
1.180 rillig 12193: <td>NATIVE_APPEND_ABI</td>
1.178 rillig 12194: <td>NATIVE_APPEND_ELF</td>
1.156 leot 12195: </tr>
12196: <tr>
1.180 rillig 12197: <td>NATIVE_EXEC_FMT</td>
1.178 rillig 12198: <td>NATIVE_MACHINE_PLATFORM</td>
1.156 leot 12199: </tr>
12200: <tr>
1.180 rillig 12201: <td>NATIVE_OBJECT_FMT</td>
1.178 rillig 12202: <td>NBPAX_PROGRAM_PREFIX</td>
12203: </tr>
12204: <tr>
1.180 rillig 12205: <td>NETBSD_LOGIN_NAME</td>
1.172 rillig 12206: <td>NMH_EDITOR</td>
1.156 leot 12207: </tr>
12208: <tr>
1.180 rillig 12209: <td>NMH_MTA</td>
1.172 rillig 12210: <td>NMH_PAGER</td>
1.156 leot 12211: </tr>
12212: <tr>
1.180 rillig 12213: <td>NOLOGIN</td>
1.177 leot 12214: <td>NOTE</td>
1.156 leot 12215: </tr>
12216: <tr>
1.180 rillig 12217: <td>NOT_FOR_PLATFORM</td>
1.177 leot 12218: <td>NOT_PAX_ASLR_SAFE</td>
1.156 leot 12219: </tr>
12220: <tr>
1.180 rillig 12221: <td>NOT_PAX_MPROTECT_SAFE</td>
1.177 leot 12222: <td>NO_BUILD</td>
1.156 leot 12223: </tr>
12224: <tr>
1.180 rillig 12225: <td>NO_CHECKSUM</td>
1.177 leot 12226: <td>NO_CONFIGURE</td>
1.156 leot 12227: </tr>
12228: <tr>
1.180 rillig 12229: <td>NO_SKIP</td>
1.177 leot 12230: <td>NS_PREFERRED</td>
1.156 leot 12231: </tr>
12232: <tr>
1.180 rillig 12233: <td>NULLMAILER_GROUP</td>
1.177 leot 12234: <td>NULLMAILER_USER</td>
1.156 leot 12235: </tr>
12236: <tr>
1.180 rillig 12237: <td>OASIS</td>
1.177 leot 12238: <td>OASIS_BUILD_ARGS</td>
1.156 leot 12239: </tr>
12240: <tr>
1.180 rillig 12241: <td>OBJHOSTNAME</td>
1.177 leot 12242: <td>OBJMACHINE</td>
1.156 leot 12243: </tr>
12244: <tr>
1.180 rillig 12245: <td>OCAML_FINDLIB_DIRS</td>
1.177 leot 12246: <td>OCAML_FINDLIB_REGISTER</td>
1.156 leot 12247: </tr>
12248: <tr>
1.180 rillig 12249: <td>OCAML_FINDLIB_REGISTER_VERBOSE</td>
1.177 leot 12250: <td>OCAML_SITELIBDIR</td>
1.156 leot 12251: </tr>
12252: <tr>
1.180 rillig 12253: <td>OCAML_TOPKG_DOCDIR</td>
1.177 leot 12254: <td>OCAML_USE_DUNE</td>
1.156 leot 12255: </tr>
12256: <tr>
1.180 rillig 12257: <td>OCAML_USE_FINDLIB</td>
1.177 leot 12258: <td>OCAML_USE_JBUILDER</td>
1.156 leot 12259: </tr>
12260: <tr>
1.180 rillig 12261: <td>OCAML_USE_OASIS</td>
1.177 leot 12262: <td>OCAML_USE_OASIS_DYNRUN</td>
1.156 leot 12263: </tr>
12264: <tr>
1.180 rillig 12265: <td>OCAML_USE_OPAM</td>
1.177 leot 12266: <td>OCAML_USE_OPT_COMPILER</td>
1.156 leot 12267: </tr>
12268: <tr>
1.180 rillig 12269: <td>OCAML_USE_TOPKG</td>
1.177 leot 12270: <td>OMF</td>
1.156 leot 12271: </tr>
12272: <tr>
1.180 rillig 12273: <td>ONLY_FOR_COMPILER</td>
1.177 leot 12274: <td>ONLY_FOR_PLATFORM</td>
1.156 leot 12275: </tr>
12276: <tr>
1.180 rillig 12277: <td>OPENSSH_CHROOT</td>
1.177 leot 12278: <td>OPENSSH_GROUP</td>
1.156 leot 12279: </tr>
12280: <tr>
1.180 rillig 12281: <td>OPENSSH_USER</td>
1.177 leot 12282: <td>OPSYS</td>
1.156 leot 12283: </tr>
12284: <tr>
1.180 rillig 12285: <td>OPSYS_EMULDIR</td>
1.177 leot 12286: <td>OSS_TYPE</td>
1.156 leot 12287: </tr>
12288: <tr>
1.180 rillig 12289: <td>OSX</td>
1.177 leot 12290: <td>OSX_TOLERATE_SDK_SKEW</td>
12291: </tr>
12292: <tr>
1.180 rillig 12293: <td>OS_HAVE_ALSA</td>
1.177 leot 12294: <td>OS_HAVE_RCD</td>
1.156 leot 12295: </tr>
12296: <tr>
1.180 rillig 12297: <td>OS_VARIANT</td>
1.177 leot 12298: <td>OS_VERSION</td>
1.159 rillig 12299: </tr>
12300: <tr>
1.180 rillig 12301: <td>OTF_FONTS_DIR</td>
1.177 leot 12302: <td>OVERRIDE_DIRDEPTH</td>
1.156 leot 12303: </tr>
12304: <tr>
1.180 rillig 12305: <td>OVERRIDE_GEMSPEC</td>
1.177 leot 12306: <td>OVERRIDE_GNU_CONFIG_SCRIPTS</td>
1.156 leot 12307: </tr>
12308: <tr>
1.180 rillig 12309: <td>OVERRIDE_ROCKSPEC</td>
1.175 gutterid 12310: <td>OWN_DIRS</td>
1.161 leot 12311: </tr>
12312: <tr>
1.180 rillig 12313: <td>OWN_DIRS_PERMS</td>
1.175 gutterid 12314: <td>P4GROUP</td>
1.156 leot 12315: </tr>
12316: <tr>
1.180 rillig 12317: <td>P4PORT</td>
1.175 gutterid 12318: <td>P4ROOT</td>
1.156 leot 12319: </tr>
12320: <tr>
1.180 rillig 12321: <td>P4USER</td>
1.175 gutterid 12322: <td>PACKAGES</td>
1.156 leot 12323: </tr>
12324: <tr>
1.180 rillig 12325: <td>PALMOS_DEFAULT_SDK</td>
1.175 gutterid 12326: <td>PAMBASE</td>
1.156 leot 12327: </tr>
12328: <tr>
1.180 rillig 12329: <td>PAM_DEFAULT</td>
1.175 gutterid 12330: <td>PAPERSIZE</td>
1.156 leot 12331: </tr>
12332: <tr>
1.180 rillig 12333: <td>PASSIVE_FETCH</td>
1.175 gutterid 12334: <td>PATCHDIR</td>
1.156 leot 12335: </tr>
12336: <tr>
1.180 rillig 12337: <td>PATCHFILES</td>
1.175 gutterid 12338: <td>PATCH_ARGS</td>
1.156 leot 12339: </tr>
12340: <tr>
1.180 rillig 12341: <td>PATCH_DEBUG</td>
1.175 gutterid 12342: <td>PATCH_DIST_ARGS</td>
1.169 rillig 12343: </tr>
12344: <tr>
1.180 rillig 12345: <td>PATCH_DIST_CAT</td>
1.175 gutterid 12346: <td>PATCH_DIST_STRIP</td>
1.156 leot 12347: </tr>
12348: <tr>
1.180 rillig 12349: <td>PATCH_FUZZ_FACTOR</td>
1.175 gutterid 12350: <td>PATCH_STRIP</td>
1.156 leot 12351: </tr>
12352: <tr>
1.180 rillig 12353: <td>PATH</td>
1.169 rillig 12354: <td>PCCBASE</td>
1.156 leot 12355: </tr>
12356: <tr>
1.180 rillig 12357: <td>PEAR</td>
1.177 leot 12358: <td>PEAR_CHANNEL</td>
12359: </tr>
12360: <tr>
1.180 rillig 12361: <td>PEAR_CHANNEL_ALIAS</td>
1.177 leot 12362: <td>PEAR_CHANNEL_VERSION</td>
12363: </tr>
12364: <tr>
1.180 rillig 12365: <td>PEAR_CMD</td>
1.175 gutterid 12366: <td>PEAR_LIB</td>
1.161 leot 12367: </tr>
12368: <tr>
1.180 rillig 12369: <td>PEAR_PACKAGE_XML</td>
1.175 gutterid 12370: <td>PERL5</td>
1.161 leot 12371: </tr>
12372: <tr>
1.180 rillig 12373: <td>PERL5_CONFIGURE</td>
1.175 gutterid 12374: <td>PERL5_CONFIGURE_DIRS</td>
1.156 leot 12375: </tr>
12376: <tr>
1.180 rillig 12377: <td>PERL5_LDFLAGS</td>
1.175 gutterid 12378: <td>PERL5_LICENSE</td>
1.156 leot 12379: </tr>
12380: <tr>
1.180 rillig 12381: <td>PERL5_MODULE_TYPE</td>
1.175 gutterid 12382: <td>PERL5_PACKLIST</td>
1.156 leot 12383: </tr>
12384: <tr>
1.180 rillig 12385: <td>PERL5_PACKLIST_DIR</td>
1.175 gutterid 12386: <td>PERL5_PERLBASE</td>
1.156 leot 12387: </tr>
12388: <tr>
1.180 rillig 12389: <td>PERL5_SITEBASE</td>
1.175 gutterid 12390: <td>PERL5_USE_PACKLIST</td>
1.156 leot 12391: </tr>
12392: <tr>
1.180 rillig 12393: <td>PERL5_VENDORBASE</td>
1.175 gutterid 12394: <td>PFCTL</td>
1.156 leot 12395: </tr>
12396: <tr>
1.180 rillig 12397: <td>PFVAR_H</td>
1.175 gutterid 12398: <td>PF_VERSION</td>
1.156 leot 12399: </tr>
12400: <tr>
1.180 rillig 12401: <td>PGGROUP</td>
1.175 gutterid 12402: <td>PGHOME</td>
1.156 leot 12403: </tr>
12404: <tr>
1.180 rillig 12405: <td>PGPKGSRCDIR</td>
1.175 gutterid 12406: <td>PGSQL_TYPE</td>
1.156 leot 12407: </tr>
12408: <tr>
1.180 rillig 12409: <td>PGSQL_VERSIONS_ACCEPTED</td>
1.175 gutterid 12410: <td>PGSQL_VERSION_DEFAULT</td>
1.156 leot 12411: </tr>
12412: <tr>
1.180 rillig 12413: <td>PGUSER</td>
1.175 gutterid 12414: <td>PG_LIB_EXT</td>
1.156 leot 12415: </tr>
12416: <tr>
1.180 rillig 12417: <td>PHP</td>
1.175 gutterid 12418: <td>PHPCOMMON_MK</td>
1.156 leot 12419: </tr>
12420: <tr>
1.180 rillig 12421: <td>PHPPKGSRCDIR</td>
1.175 gutterid 12422: <td>PHP_BASE_VERS</td>
1.156 leot 12423: </tr>
12424: <tr>
1.180 rillig 12425: <td>PHP_CHECK_INSTALLED</td>
1.175 gutterid 12426: <td>PHP_EXTENSION_DIR</td>
1.156 leot 12427: </tr>
12428: <tr>
1.180 rillig 12429: <td>PHP_INITIAL_TEENY</td>
1.175 gutterid 12430: <td>PHP_PKG_PREFIX</td>
1.156 leot 12431: </tr>
12432: <tr>
1.180 rillig 12433: <td>PHP_VERSION</td>
1.175 gutterid 12434: <td>PHP_VERSIONS_ACCEPTED</td>
1.156 leot 12435: </tr>
12436: <tr>
1.180 rillig 12437: <td>PHP_VERSIONS_INCOMPATIBLE</td>
1.175 gutterid 12438: <td>PHP_VERSION_DEFAULT</td>
1.156 leot 12439: </tr>
12440: <tr>
1.180 rillig 12441: <td>PHP_VERSION_REQD</td>
1.175 gutterid 12442: <td>PILRC_USE_GTK</td>
1.156 leot 12443: </tr>
12444: <tr>
1.180 rillig 12445: <td>PKGCONFIG_BASE</td>
1.175 gutterid 12446: <td>PKGCONFIG_FILE</td>
1.156 leot 12447: </tr>
12448: <tr>
1.180 rillig 12449: <td>PKGCONFIG_OVERRIDE</td>
1.175 gutterid 12450: <td>PKGCONFIG_OVERRIDE_STAGE</td>
1.156 leot 12451: </tr>
12452: <tr>
1.180 rillig 12453: <td>PKGDIR</td>
1.175 gutterid 12454: <td>PKGGNUDIR</td>
1.156 leot 12455: </tr>
12456: <tr>
1.180 rillig 12457: <td>PKGINFODIR</td>
1.175 gutterid 12458: <td>PKGLOCALEDIR</td>
1.156 leot 12459: </tr>
12460: <tr>
1.180 rillig 12461: <td>PKGMANDIR</td>
1.175 gutterid 12462: <td>PKGNAME</td>
1.156 leot 12463: </tr>
12464: <tr>
1.180 rillig 12465: <td>PKGNAME_REQD</td>
1.175 gutterid 12466: <td>PKGPATH</td>
1.156 leot 12467: </tr>
12468: <tr>
1.180 rillig 12469: <td>PKGREVISION</td>
1.177 leot 12470: <td>PKGSRC_BLAS_TYPES</td>
12471: </tr>
12472: <tr>
1.180 rillig 12473: <td>PKGSRC_CHANGES</td>
1.177 leot 12474: <td>PKGSRC_COMPILER</td>
1.156 leot 12475: </tr>
12476: <tr>
1.180 rillig 12477: <td>PKGSRC_KEEP_BIN_PKGS</td>
1.177 leot 12478: <td>PKGSRC_LOCKTYPE</td>
1.159 rillig 12479: </tr>
12480: <tr>
1.180 rillig 12481: <td>PKGSRC_MAKE_ENV</td>
1.177 leot 12482: <td>PKGSRC_MESSAGE_RECIPIENTS</td>
1.156 leot 12483: </tr>
12484: <tr>
1.180 rillig 12485: <td>PKGSRC_MKPIE</td>
1.177 leot 12486: <td>PKGSRC_MKREPRO</td>
1.156 leot 12487: </tr>
12488: <tr>
1.180 rillig 12489: <td>PKGSRC_RUN_TEST</td>
1.177 leot 12490: <td>PKGSRC_SETENV</td>
1.156 leot 12491: </tr>
12492: <tr>
1.180 rillig 12493: <td>PKGSRC_SLEEPSECS</td>
1.177 leot 12494: <td>PKGSRC_TODO</td>
1.156 leot 12495: </tr>
12496: <tr>
1.180 rillig 12497: <td>PKGSRC_USE_CTF</td>
1.177 leot 12498: <td>PKGSRC_USE_FORTIFY</td>
1.156 leot 12499: </tr>
12500: <tr>
1.180 rillig 12501: <td>PKGSRC_USE_RELRO</td>
1.177 leot 12502: <td>PKGSRC_USE_SSP</td>
1.156 leot 12503: </tr>
12504: <tr>
1.180 rillig 12505: <td>PKGSRC_USE_STACK_CHECK</td>
1.177 leot 12506: <td>PKGTASKS_DATAFILE</td>
1.156 leot 12507: </tr>
12508: <tr>
1.180 rillig 12509: <td>PKGTOOLS_ARGS</td>
1.177 leot 12510: <td>PKGTOOLS_ENV</td>
1.156 leot 12511: </tr>
12512: <tr>
1.180 rillig 12513: <td>PKG_ALTERNATIVES</td>
1.177 leot 12514: <td>PKG_APACHE</td>
1.156 leot 12515: </tr>
12516: <tr>
1.180 rillig 12517: <td>PKG_APACHE_ACCEPTED</td>
1.177 leot 12518: <td>PKG_APACHE_DEFAULT</td>
1.156 leot 12519: </tr>
12520: <tr>
1.180 rillig 12521: <td>PKG_BEST_EXISTS</td>
1.177 leot 12522: <td>PKG_BUILD_OPTIONS</td>
1.156 leot 12523: </tr>
12524: <tr>
1.180 rillig 12525: <td>PKG_COMPRESSION</td>
1.177 leot 12526: <td>PKG_CONFIG</td>
1.156 leot 12527: </tr>
12528: <tr>
1.180 rillig 12529: <td>PKG_CONFIG_PERMS</td>
1.177 leot 12530: <td>PKG_CREATE_USERGROUP</td>
1.156 leot 12531: </tr>
12532: <tr>
1.180 rillig 12533: <td>PKG_DB_TMPDIR</td>
1.177 leot 12534: <td>PKG_DEBUG_LEVEL</td>
1.156 leot 12535: </tr>
12536: <tr>
1.180 rillig 12537: <td>PKG_DEFAULT_OPTIONS</td>
1.177 leot 12538: <td>PKG_DESTDIR_SUPPORT</td>
1.156 leot 12539: </tr>
12540: <tr>
1.180 rillig 12541: <td>PKG_DEVELOPER</td>
1.177 leot 12542: <td>PKG_DISABLED_OPTIONS</td>
1.156 leot 12543: </tr>
12544: <tr>
1.180 rillig 12545: <td>PKG_FATAL_ERRORS</td>
1.177 leot 12546: <td>PKG_FC</td>
1.156 leot 12547: </tr>
12548: <tr>
1.180 rillig 12549: <td>PKG_FILELIST_CMD</td>
1.177 leot 12550: <td>PKG_GECOS</td>
1.156 leot 12551: </tr>
12552: <tr>
1.180 rillig 12553: <td>PKG_GID</td>
1.177 leot 12554: <td>PKG_GROUPS</td>
1.156 leot 12555: </tr>
12556: <tr>
1.180 rillig 12557: <td>PKG_GROUPS_VARS</td>
1.177 leot 12558: <td>PKG_HOME</td>
1.156 leot 12559: </tr>
12560: <tr>
1.180 rillig 12561: <td>PKG_INIT_SCRIPTS</td>
1.177 leot 12562: <td>PKG_JAVA_HOME</td>
1.156 leot 12563: </tr>
12564: <tr>
1.180 rillig 12565: <td>PKG_JVM</td>
1.177 leot 12566: <td>PKG_JVMS_ACCEPTED</td>
1.156 leot 12567: </tr>
12568: <tr>
1.180 rillig 12569: <td>PKG_JVM_DEFAULT</td>
1.177 leot 12570: <td>PKG_LEGACY_OPTIONS</td>
1.156 leot 12571: </tr>
12572: <tr>
1.180 rillig 12573: <td>PKG_LIBTOOL</td>
1.177 leot 12574: <td>PKG_OPTIONS</td>
1.156 leot 12575: </tr>
12576: <tr>
1.180 rillig 12577: <td>PKG_OPTIONS_DEPRECATED_WARNINGS</td>
1.177 leot 12578: <td>PKG_OPTIONS_LEGACY_OPTS</td>
1.156 leot 12579: </tr>
12580: <tr>
1.180 rillig 12581: <td>PKG_OPTIONS_LEGACY_VARS</td>
1.177 leot 12582: <td>PKG_OPTIONS_NONEMPTY_SETS</td>
1.156 leot 12583: </tr>
12584: <tr>
1.180 rillig 12585: <td>PKG_OPTIONS_OPTIONAL_GROUPS</td>
1.177 leot 12586: <td>PKG_OPTIONS_REQUIRED_GROUPS</td>
1.156 leot 12587: </tr>
12588: <tr>
1.180 rillig 12589: <td>PKG_OPTIONS_VAR</td>
1.177 leot 12590: <td>PKG_PHP</td>
1.156 leot 12591: </tr>
12592: <tr>
1.180 rillig 12593: <td>PKG_PHP_MAJOR_VERS</td>
1.177 leot 12594: <td>PKG_PHP_VERSION</td>
1.156 leot 12595: </tr>
12596: <tr>
1.180 rillig 12597: <td>PKG_RCD_SCRIPTS</td>
1.177 leot 12598: <td>PKG_REFCOUNT_DBDIR</td>
1.156 leot 12599: </tr>
12600: <tr>
1.180 rillig 12601: <td>PKG_REGISTER_SHELLS</td>
1.177 leot 12602: <td>PKG_RESUME_TRANSFERS</td>
1.156 leot 12603: </tr>
12604: <tr>
1.180 rillig 12605: <td>PKG_SHELL</td>
1.177 leot 12606: <td>PKG_SUGGESTED_OPTIONS</td>
1.156 leot 12607: </tr>
12608: <tr>
1.180 rillig 12609: <td>PKG_SUPPORTED_OPTIONS</td>
1.177 leot 12610: <td>PKG_SYSCONFBASE</td>
1.156 leot 12611: </tr>
12612: <tr>
1.180 rillig 12613: <td>PKG_SYSCONFBASEDIR</td>
1.177 leot 12614: <td>PKG_SYSCONFDIR</td>
1.156 leot 12615: </tr>
12616: <tr>
1.180 rillig 12617: <td>PKG_SYSCONFDIR_PERMS</td>
1.177 leot 12618: <td>PKG_SYSCONFSUBDIR</td>
1.156 leot 12619: </tr>
12620: <tr>
1.180 rillig 12621: <td>PKG_SYSCONFVAR</td>
1.177 leot 12622: <td>PKG_TOOLS_BIN</td>
1.156 leot 12623: </tr>
12624: <tr>
1.180 rillig 12625: <td>PKG_UID</td>
1.177 leot 12626: <td>PKG_UPDATE_FONTS_DB</td>
1.156 leot 12627: </tr>
12628: <tr>
1.180 rillig 12629: <td>PKG_USERS</td>
1.177 leot 12630: <td>PKG_USERS_VARS</td>
1.156 leot 12631: </tr>
12632: <tr>
1.180 rillig 12633: <td>PKG_VERBOSE</td>
1.177 leot 12634: <td>PLIST</td>
1.156 leot 12635: </tr>
12636: <tr>
1.180 rillig 12637: <td>PLIST_AWK</td>
1.177 leot 12638: <td>PLIST_AWK_ENV</td>
1.156 leot 12639: </tr>
12640: <tr>
1.180 rillig 12641: <td>PLIST_SRC</td>
1.177 leot 12642: <td>PLIST_SUBST</td>
1.156 leot 12643: </tr>
12644: <tr>
1.180 rillig 12645: <td>PLIST_TYPE</td>
1.177 leot 12646: <td>PLIST_VARS</td>
1.156 leot 12647: </tr>
12648: <tr>
1.180 rillig 12649: <td>POPTOP_USE_MPPE</td>
1.177 leot 12650: <td>POSSIBLE_GFORTRAN_VERSION</td>
1.156 leot 12651: </tr>
12652: <tr>
1.180 rillig 12653: <td>POST_FETCH_HOOK</td>
1.177 leot 12654: <td>PREFER</td>
1.156 leot 12655: </tr>
12656: <tr>
1.180 rillig 12657: <td>PREFER_NATIVE</td>
1.177 leot 12658: <td>PREFER_NATIVE_PTHREADS</td>
1.156 leot 12659: </tr>
12660: <tr>
1.180 rillig 12661: <td>PREFER_PKGSRC</td>
1.177 leot 12662: <td>PREFIX</td>
1.156 leot 12663: </tr>
12664: <tr>
1.180 rillig 12665: <td>PREPEND_PATH</td>
1.177 leot 12666: <td>PRE_ROOT_CMD</td>
1.156 leot 12667: </tr>
12668: <tr>
1.180 rillig 12669: <td>PRIVILEGED_STAGES</td>
1.177 leot 12670: <td>PS</td>
1.156 leot 12671: </tr>
12672: <tr>
1.180 rillig 12673: <td>PTHREAD_AUTO_VARS</td>
1.177 leot 12674: <td>PTHREAD_CFLAGS</td>
1.156 leot 12675: </tr>
12676: <tr>
1.180 rillig 12677: <td>PTHREAD_LDFLAGS</td>
1.177 leot 12678: <td>PTHREAD_LIBS</td>
1.156 leot 12679: </tr>
12680: <tr>
1.180 rillig 12681: <td>PTHREAD_OPTS</td>
1.177 leot 12682: <td>PTHREAD_TYPE</td>
1.156 leot 12683: </tr>
12684: <tr>
1.180 rillig 12685: <td>PVM_SSH</td>
1.177 leot 12686: <td>PYPKGPREFIX</td>
1.156 leot 12687: </tr>
12688: <tr>
1.180 rillig 12689: <td>PYTHON_FOR_BUILD_ONLY</td>
1.177 leot 12690: <td>PYTHON_SELF_CONFLICT</td>
1.156 leot 12691: </tr>
12692: <tr>
1.180 rillig 12693: <td>PYTHON_VERSIONED_DEPENDENCIES</td>
1.177 leot 12694: <td>PYTHON_VERSIONS_ACCEPTED</td>
1.156 leot 12695: </tr>
12696: <tr>
1.180 rillig 12697: <td>PYTHON_VERSIONS_INCOMPATIBLE</td>
1.177 leot 12698: <td>PYTHON_VERSION_DEFAULT</td>
1.156 leot 12699: </tr>
12700: <tr>
1.180 rillig 12701: <td>PYTHON_VERSION_REQD</td>
1.177 leot 12702: <td>PYVERSSUFFIX</td>
1.156 leot 12703: </tr>
12704: <tr>
1.180 rillig 12705: <td>PY_NO_EGG</td>
1.177 leot 12706: <td>QMAILDIR</td>
1.156 leot 12707: </tr>
12708: <tr>
1.180 rillig 12709: <td>QMAIL_ALIAS_USER</td>
1.177 leot 12710: <td>QMAIL_DAEMON_USER</td>
1.156 leot 12711: </tr>
12712: <tr>
1.180 rillig 12713: <td>QMAIL_LOG_USER</td>
1.177 leot 12714: <td>QMAIL_NOFILES_GROUP</td>
1.156 leot 12715: </tr>
12716: <tr>
1.180 rillig 12717: <td>QMAIL_PASSWD_USER</td>
1.177 leot 12718: <td>QMAIL_QMAIL_GROUP</td>
1.156 leot 12719: </tr>
12720: <tr>
1.180 rillig 12721: <td>QMAIL_QUEUE_DIR</td>
1.177 leot 12722: <td>QMAIL_QUEUE_EXTRA</td>
1.156 leot 12723: </tr>
12724: <tr>
1.180 rillig 12725: <td>QMAIL_QUEUE_USER</td>
1.177 leot 12726: <td>QMAIL_REMOTE_USER</td>
1.156 leot 12727: </tr>
12728: <tr>
1.180 rillig 12729: <td>QMAIL_ROOT_USER</td>
1.177 leot 12730: <td>QMAIL_SEND_USER</td>
1.156 leot 12731: </tr>
12732: <tr>
1.180 rillig 12733: <td>QPOPPER_FAC</td>
1.177 leot 12734: <td>QPOPPER_SPOOL_DIR</td>
1.156 leot 12735: </tr>
12736: <tr>
1.180 rillig 12737: <td>QPOPPER_USER</td>
1.177 leot 12738: <td>RAKE_NAME</td>
1.156 leot 12739: </tr>
12740: <tr>
1.180 rillig 12741: <td>RASMOL_DEPTH</td>
1.177 leot 12742: <td>RCD_DIR</td>
1.156 leot 12743: </tr>
12744: <tr>
1.180 rillig 12745: <td>RCD_ORDER</td>
1.174 leot 12746: <td>RCD_SCRIPTS</td>
1.177 leot 12747: </tr>
12748: <tr>
1.180 rillig 12749: <td>RCD_SCRIPTS_DIR</td>
1.177 leot 12750: <td>RCD_SCRIPTS_EXAMPLEDIR</td>
1.159 rillig 12751: </tr>
12752: <tr>
1.180 rillig 12753: <td>RCD_SCRIPTS_MODE</td>
1.177 leot 12754: <td>RCD_SCRIPTS_SHELL</td>
1.156 leot 12755: </tr>
12756: <tr>
1.180 rillig 12757: <td>RCD_SCRIPT_SRC</td>
1.177 leot 12758: <td>RCD_SUBR</td>
1.156 leot 12759: </tr>
12760: <tr>
1.180 rillig 12761: <td>RDOC</td>
1.175 gutterid 12762: <td>READLINE_DEFAULT</td>
1.161 leot 12763: </tr>
12764: <tr>
1.180 rillig 12765: <td>READLINE_TYPE</td>
1.175 gutterid 12766: <td>REAL_ROOT_GROUP</td>
1.156 leot 12767: </tr>
12768: <tr>
1.180 rillig 12769: <td>REAL_ROOT_USER</td>
1.175 gutterid 12770: <td>RECURSIVE_MAKE</td>
1.156 leot 12771: </tr>
12772: <tr>
1.180 rillig 12773: <td>RELAY_CTRL_DIR</td>
1.175 gutterid 12774: <td>REPLACE_AWK</td>
1.156 leot 12775: </tr>
12776: <tr>
1.180 rillig 12777: <td>REPLACE_BASH</td>
1.175 gutterid 12778: <td>REPLACE_CSH</td>
1.156 leot 12779: </tr>
12780: <tr>
1.180 rillig 12781: <td>REPLACE_KSH</td>
1.175 gutterid 12782: <td>REPLACE_PERL</td>
1.156 leot 12783: </tr>
12784: <tr>
1.180 rillig 12785: <td>REPLACE_PERL6</td>
1.175 gutterid 12786: <td>REPLACE_PHP</td>
1.156 leot 12787: </tr>
12788: <tr>
1.180 rillig 12789: <td>REPLACE_PYTHON</td>
1.175 gutterid 12790: <td>REPLACE_RUBY</td>
1.166 leot 12791: </tr>
12792: <tr>
1.180 rillig 12793: <td>REPLACE_RUBY_DIRS</td>
1.175 gutterid 12794: <td>REPLACE_RUBY_PAT</td>
1.156 leot 12795: </tr>
12796: <tr>
1.180 rillig 12797: <td>REPLACE_SH</td>
1.175 gutterid 12798: <td>REPLACE_TEXLUA</td>
1.156 leot 12799: </tr>
12800: <tr>
1.180 rillig 12801: <td>REQD_DIRS</td>
1.175 gutterid 12802: <td>REQD_DIRS_PERMS</td>
1.156 leot 12803: </tr>
12804: <tr>
1.180 rillig 12805: <td>REQD_FILES</td>
1.175 gutterid 12806: <td>REQD_FILES_MODE</td>
1.156 leot 12807: </tr>
12808: <tr>
1.180 rillig 12809: <td>REQD_FILES_PERMS</td>
1.175 gutterid 12810: <td>RESOLV_AUTO_VARS</td>
1.156 leot 12811: </tr>
12812: <tr>
1.180 rillig 12813: <td>RESOLV_LDFLAGS</td>
1.175 gutterid 12814: <td>RESOLV_LIBS</td>
1.156 leot 12815: </tr>
12816: <tr>
1.180 rillig 12817: <td>RM</td>
1.177 leot 12818: <td>ROCKSPEC_NAME</td>
12819: </tr>
12820: <tr>
1.180 rillig 12821: <td>ROCKSPEC_SPECFILE</td>
1.175 gutterid 12822: <td>ROOT_CMD</td>
1.156 leot 12823: </tr>
12824: <tr>
1.180 rillig 12825: <td>ROOT_GROUP</td>
1.175 gutterid 12826: <td>ROOT_USER</td>
1.156 leot 12827: </tr>
12828: <tr>
1.180 rillig 12829: <td>RPCGEN</td>
1.175 gutterid 12830: <td>RPM</td>
1.156 leot 12831: </tr>
12832: <tr>
1.180 rillig 12833: <td>RPM2PKG_PLIST</td>
1.175 gutterid 12834: <td>RPM2PKG_PREFIX</td>
1.156 leot 12835: </tr>
12836: <tr>
1.180 rillig 12837: <td>RPM2PKG_STAGE</td>
1.175 gutterid 12838: <td>RPM2PKG_STRIP</td>
1.156 leot 12839: </tr>
12840: <tr>
1.180 rillig 12841: <td>RPM2PKG_SUBPREFIX</td>
1.175 gutterid 12842: <td>RPMFILES</td>
1.156 leot 12843: </tr>
12844: <tr>
1.180 rillig 12845: <td>RPMIGNOREPATH</td>
1.175 gutterid 12846: <td>RPM_DB_PREFIX</td>
1.156 leot 12847: </tr>
12848: <tr>
1.180 rillig 12849: <td>RSSH_CVS_PATH</td>
1.175 gutterid 12850: <td>RSSH_RDIST_PATH</td>
1.156 leot 12851: </tr>
12852: <tr>
1.180 rillig 12853: <td>RSSH_RSYNC_PATH</td>
1.175 gutterid 12854: <td>RSSH_SCP_PATH</td>
1.156 leot 12855: </tr>
12856: <tr>
1.180 rillig 12857: <td>RSSH_SFTP_SERVER_PATH</td>
1.175 gutterid 12858: <td>RUBY</td>
1.156 leot 12859: </tr>
12860: <tr>
1.180 rillig 12861: <td>RUBYGEM</td>
1.175 gutterid 12862: <td>RUBYGEM_NAME</td>
1.156 leot 12863: </tr>
12864: <tr>
1.180 rillig 12865: <td>RUBYGEM_OPTIONS</td>
1.175 gutterid 12866: <td>RUBY_ABI_VERSION</td>
1.156 leot 12867: </tr>
12868: <tr>
1.180 rillig 12869: <td>RUBY_ARCH</td>
1.175 gutterid 12870: <td>RUBY_ARCHINC</td>
1.156 leot 12871: </tr>
12872: <tr>
1.180 rillig 12873: <td>RUBY_ARCHLIB</td>
1.175 gutterid 12874: <td>RUBY_BASE</td>
1.156 leot 12875: </tr>
12876: <tr>
1.180 rillig 12877: <td>RUBY_BASERIDIR</td>
1.175 gutterid 12878: <td>RUBY_BUILD_DOCUMENT</td>
1.156 leot 12879: </tr>
12880: <tr>
1.180 rillig 12881: <td>RUBY_DLEXT</td>
1.175 gutterid 12882: <td>RUBY_DOC</td>
1.156 leot 12883: </tr>
12884: <tr>
1.180 rillig 12885: <td>RUBY_DYNAMIC_DIRS</td>
1.175 gutterid 12886: <td>RUBY_EG</td>
1.156 leot 12887: </tr>
12888: <tr>
1.180 rillig 12889: <td>RUBY_ENCODING_ARG</td>
1.175 gutterid 12890: <td>RUBY_EXTCONF</td>
1.156 leot 12891: </tr>
12892: <tr>
1.180 rillig 12893: <td>RUBY_EXTCONF_CHECK</td>
1.175 gutterid 12894: <td>RUBY_EXTCONF_DEBUG</td>
1.156 leot 12895: </tr>
12896: <tr>
1.180 rillig 12897: <td>RUBY_EXTCONF_MAKEFILE</td>
1.175 gutterid 12898: <td>RUBY_GEM_BASE</td>
1.156 leot 12899: </tr>
12900: <tr>
1.180 rillig 12901: <td>RUBY_INC</td>
1.175 gutterid 12902: <td>RUBY_LIB</td>
1.156 leot 12903: </tr>
12904: <tr>
1.180 rillig 12905: <td>RUBY_LIB_BASE</td>
1.175 gutterid 12906: <td>RUBY_NAME</td>
1.156 leot 12907: </tr>
12908: <tr>
1.180 rillig 12909: <td>RUBY_NOVERSION</td>
1.175 gutterid 12910: <td>RUBY_PKGPREFIX</td>
1.156 leot 12911: </tr>
12912: <tr>
1.180 rillig 12913: <td>RUBY_RAILS</td>
1.175 gutterid 12914: <td>RUBY_RAILS51_VERSION</td>
1.156 leot 12915: </tr>
12916: <tr>
1.180 rillig 12917: <td>RUBY_RAILS52_VERSION</td>
1.175 gutterid 12918: <td>RUBY_RAILS60_VERSION</td>
1.156 leot 12919: </tr>
12920: <tr>
1.180 rillig 12921: <td>RUBY_RAILS_ACCEPTED</td>
1.175 gutterid 12922: <td>RUBY_RAILS_DEFAULT</td>
1.174 leot 12923: </tr>
12924: <tr>
1.180 rillig 12925: <td>RUBY_RAILS_REQD</td>
1.175 gutterid 12926: <td>RUBY_RAILS_STRICT_DEP</td>
1.156 leot 12927: </tr>
12928: <tr>
1.180 rillig 12929: <td>RUBY_RIDIR</td>
1.175 gutterid 12930: <td>RUBY_SETUP</td>
1.156 leot 12931: </tr>
12932: <tr>
1.180 rillig 12933: <td>RUBY_SHLIB</td>
1.175 gutterid 12934: <td>RUBY_SHLIBALIAS</td>
1.156 leot 12935: </tr>
12936: <tr>
1.180 rillig 12937: <td>RUBY_SHLIBVER</td>
1.175 gutterid 12938: <td>RUBY_SIMPLE_INSTALL</td>
1.156 leot 12939: </tr>
12940: <tr>
1.180 rillig 12941: <td>RUBY_SITEARCHLIB</td>
1.175 gutterid 12942: <td>RUBY_SITELIB</td>
1.156 leot 12943: </tr>
12944: <tr>
1.180 rillig 12945: <td>RUBY_SITELIB_BASE</td>
1.175 gutterid 12946: <td>RUBY_SITERIDIR</td>
1.156 leot 12947: </tr>
12948: <tr>
1.180 rillig 12949: <td>RUBY_SLEXT</td>
1.175 gutterid 12950: <td>RUBY_SRCDIR</td>
1.156 leot 12951: </tr>
12952: <tr>
1.180 rillig 12953: <td>RUBY_STATICLIB</td>
1.175 gutterid 12954: <td>RUBY_SUFFIX</td>
1.156 leot 12955: </tr>
12956: <tr>
1.180 rillig 12957: <td>RUBY_SYSRIDIR</td>
1.175 gutterid 12958: <td>RUBY_USE_PTHREAD</td>
1.156 leot 12959: </tr>
12960: <tr>
1.180 rillig 12961: <td>RUBY_VENDORARCHLIB</td>
1.175 gutterid 12962: <td>RUBY_VENDORLIB</td>
1.156 leot 12963: </tr>
12964: <tr>
1.180 rillig 12965: <td>RUBY_VENDORLIB_BASE</td>
1.175 gutterid 12966: <td>RUBY_VER</td>
1.156 leot 12967: </tr>
12968: <tr>
1.180 rillig 12969: <td>RUBY_VERSION</td>
1.175 gutterid 12970: <td>RUBY_VERSIONS_ACCEPTED</td>
1.156 leot 12971: </tr>
12972: <tr>
1.180 rillig 12973: <td>RUBY_VERSIONS_INCOMPATIBLE</td>
1.175 gutterid 12974: <td>RUBY_VERSION_DEFAULT</td>
1.156 leot 12975: </tr>
12976: <tr>
1.180 rillig 12977: <td>RUBY_VERSION_REQD</td>
1.175 gutterid 12978: <td>RUBY_VER_DIR</td>
1.156 leot 12979: </tr>
12980: <tr>
1.180 rillig 12981: <td>RUN</td>
1.175 gutterid 12982: <td>RUN_LDCONFIG</td>
1.156 leot 12983: </tr>
12984: <tr>
1.180 rillig 12985: <td>SAWFISH_THEMES</td>
1.175 gutterid 12986: <td>SCO</td>
1.156 leot 12987: </tr>
12988: <tr>
1.180 rillig 12989: <td>SCREWS_GROUP</td>
1.175 gutterid 12990: <td>SCREWS_USER</td>
1.156 leot 12991: </tr>
12992: <tr>
1.180 rillig 12993: <td>SCRIPTS_ENV</td>
1.175 gutterid 12994: <td>SCROLLKEEPER_DATADIR</td>
1.156 leot 12995: </tr>
12996: <tr>
1.180 rillig 12997: <td>SCROLLKEEPER_REBUILDDB</td>
1.175 gutterid 12998: <td>SCROLLKEEPER_UPDATEDB</td>
1.156 leot 12999: </tr>
13000: <tr>
1.180 rillig 13001: <td>SDIST_PAWD</td>
1.175 gutterid 13002: <td>SERIAL_DEVICES</td>
1.156 leot 13003: </tr>
13004: <tr>
1.180 rillig 13005: <td>SETGIDGAME</td>
1.175 gutterid 13006: <td>SETGID_GAMES_PERMS</td>
1.156 leot 13007: </tr>
13008: <tr>
1.180 rillig 13009: <td>SETUID_ROOT_PERMS</td>
1.175 gutterid 13010: <td>SH</td>
1.156 leot 13011: </tr>
13012: <tr>
1.180 rillig 13013: <td>SHLIB</td>
1.177 leot 13014: <td>SHORTNAME</td>
13015: </tr>
13016: <tr>
1.180 rillig 13017: <td>SIGN_PACKAGES</td>
1.177 leot 13018: <td>SILC_CLIENT_WITH_PERL</td>
1.156 leot 13019: </tr>
13020: <tr>
1.180 rillig 13021: <td>SITE_SPECIFIC_PKGS</td>
1.177 leot 13022: <td>SKIP_DEPENDS</td>
1.156 leot 13023: </tr>
13024: <tr>
1.180 rillig 13025: <td>SMF_INSTANCES</td>
1.177 leot 13026: <td>SMF_MANIFEST</td>
1.159 rillig 13027: </tr>
13028: <tr>
1.180 rillig 13029: <td>SMF_METHODS</td>
1.177 leot 13030: <td>SMF_METHOD_SHELL</td>
1.156 leot 13031: </tr>
13032: <tr>
1.180 rillig 13033: <td>SMF_METHOD_SRC</td>
1.177 leot 13034: <td>SMF_NAME</td>
1.156 leot 13035: </tr>
13036: <tr>
1.180 rillig 13037: <td>SMF_PREFIX</td>
1.177 leot 13038: <td>SMF_SRCDIR</td>
1.156 leot 13039: </tr>
13040: <tr>
1.180 rillig 13041: <td>SNIPROXY_GROUP</td>
1.177 leot 13042: <td>SNIPROXY_USER</td>
1.156 leot 13043: </tr>
13044: <tr>
1.180 rillig 13045: <td>SOURCE_BUFFSIZE</td>
1.177 leot 13046: <td>SPECIAL_PERMS</td>
1.156 leot 13047: </tr>
13048: <tr>
1.180 rillig 13049: <td>SPECIFIC_PKGS</td>
1.177 leot 13050: <td>SSH_SUID</td>
1.156 leot 13051: </tr>
13052: <tr>
1.180 rillig 13053: <td>SSP_SUPPORTED</td>
1.177 leot 13054: <td>SSYNC_PAWD</td>
1.156 leot 13055: </tr>
13056: <tr>
1.180 rillig 13057: <td>STEP_MSG</td>
1.177 leot 13058: <td>STRIP</td>
1.156 leot 13059: </tr>
13060: <tr>
1.180 rillig 13061: <td>STRIP_DBG</td>
1.177 leot 13062: <td>STRIP_DEBUG</td>
1.156 leot 13063: </tr>
13064: <tr>
1.180 rillig 13065: <td>STRIP_DEBUG_SUPPORTED</td>
1.177 leot 13066: <td>STRIP_FILES_SKIP</td>
1.156 leot 13067: </tr>
13068: <tr>
1.180 rillig 13069: <td>SU</td>
1.177 leot 13070: <td>SUBDIR</td>
1.156 leot 13071: </tr>
13072: <tr>
1.180 rillig 13073: <td>SUBST</td>
1.177 leot 13074: <td>SUBST_CLASSES</td>
1.174 leot 13075: </tr>
13076: <tr>
1.180 rillig 13077: <td>SUBST_FILES</td>
1.177 leot 13078: <td>SUBST_FILTER_CMD</td>
1.156 leot 13079: </tr>
13080: <tr>
1.180 rillig 13081: <td>SUBST_MESSAGE</td>
1.177 leot 13082: <td>SUBST_NOOP_OK</td>
1.156 leot 13083: </tr>
13084: <tr>
1.180 rillig 13085: <td>SUBST_SED</td>
1.177 leot 13086: <td>SUBST_SHOW_DIFF</td>
1.156 leot 13087: </tr>
13088: <tr>
1.180 rillig 13089: <td>SUBST_SKIP_TEXT_CHECK</td>
1.177 leot 13090: <td>SUBST_STAGE</td>
1.156 leot 13091: </tr>
13092: <tr>
1.180 rillig 13093: <td>SUBST_VARS</td>
1.177 leot 13094: <td>SUNWSPROBASE</td>
1.156 leot 13095: </tr>
13096: <tr>
1.180 rillig 13097: <td>SUSE_PREFER</td>
1.177 leot 13098: <td>SU_CMD</td>
13099: </tr>
13100: <tr>
1.180 rillig 13101: <td>SVN_EXTRACTDIR</td>
1.177 leot 13102: <td>SVN_REPO</td>
13103: </tr>
13104: <tr>
1.180 rillig 13105: <td>SVN_REPOSITORIES</td>
1.177 leot 13106: <td>SVN_REVISION</td>
1.156 leot 13107: </tr>
13108: <tr>
1.180 rillig 13109: <td>TERMCAP_TYPE</td>
1.177 leot 13110: <td>TERMINFO_DEFAULT</td>
1.161 leot 13111: </tr>
13112: <tr>
1.180 rillig 13113: <td>TERMINFO_TYPE</td>
1.177 leot 13114: <td>TEST</td>
1.159 rillig 13115: </tr>
13116: <tr>
1.180 rillig 13117: <td>TEST_DEPENDS</td>
1.177 leot 13118: <td>TEST_DIRS</td>
1.156 leot 13119: </tr>
13120: <tr>
1.180 rillig 13121: <td>TEST_ENV</td>
1.177 leot 13122: <td>TEST_ENV_SHELL</td>
1.156 leot 13123: </tr>
13124: <tr>
1.180 rillig 13125: <td>TEST_MAKE_CMD</td>
1.177 leot 13126: <td>TEST_MAKE_FLAGS</td>
1.156 leot 13127: </tr>
13128: <tr>
1.180 rillig 13129: <td>TEST_TARGET</td>
1.177 leot 13130: <td>TEXLIVE_IGNORE_PATTERNS</td>
1.156 leot 13131: </tr>
13132: <tr>
1.180 rillig 13133: <td>TEXLIVE_REV</td>
1.177 leot 13134: <td>TEXLIVE_UNVERSIONED</td>
1.156 leot 13135: </tr>
13136: <tr>
1.180 rillig 13137: <td>TEXMFSITE</td>
1.177 leot 13138: <td>TEX_FORMATS</td>
1.156 leot 13139: </tr>
13140: <tr>
1.180 rillig 13141: <td>TEX_HYPHEN_DAT</td>
1.177 leot 13142: <td>TEX_HYPHEN_DEF</td>
1.156 leot 13143: </tr>
13144: <tr>
1.180 rillig 13145: <td>TEX_TEXMF_DIRS</td>
1.177 leot 13146: <td>THTTPD_LOG_FACILITY</td>
1.156 leot 13147: </tr>
13148: <tr>
1.180 rillig 13149: <td>TO</td>
1.177 leot 13150: <td>TOOLS_ALIASES</td>
1.156 leot 13151: </tr>
13152: <tr>
1.180 rillig 13153: <td>TOOLS_ALWAYS_WRAP</td>
1.169 rillig 13154: <td>TOOLS_ARGS</td>
1.156 leot 13155: </tr>
13156: <tr>
1.180 rillig 13157: <td>TOOLS_BROKEN</td>
1.169 rillig 13158: <td>TOOLS_CMD</td>
1.156 leot 13159: </tr>
13160: <tr>
1.180 rillig 13161: <td>TOOLS_CREATE</td>
1.169 rillig 13162: <td>TOOLS_DIR</td>
1.156 leot 13163: </tr>
13164: <tr>
1.180 rillig 13165: <td>TOOLS_FAIL</td>
1.169 rillig 13166: <td>TOOLS_GNU_MISSING</td>
1.156 leot 13167: </tr>
13168: <tr>
1.180 rillig 13169: <td>TOOLS_LDCONFIG</td>
1.169 rillig 13170: <td>TOOLS_NOOP</td>
1.156 leot 13171: </tr>
13172: <tr>
1.180 rillig 13173: <td>TOOLS_PATH</td>
1.169 rillig 13174: <td>TOOLS_SCRIPT</td>
1.156 leot 13175: </tr>
13176: <tr>
1.180 rillig 13177: <td>TOOL_DEPENDS</td>
1.177 leot 13178: <td>TTF_FONTDIR</td>
1.161 leot 13179: </tr>
13180: <tr>
1.180 rillig 13181: <td>TTF_FONTS_DIR</td>
1.169 rillig 13182: <td>TYPE</td>
1.156 leot 13183: </tr>
13184: <tr>
1.180 rillig 13185: <td>UAC_REQD_EXECS</td>
1.169 rillig 13186: <td>UCSPI_SSL_GROUP</td>
1.156 leot 13187: </tr>
13188: <tr>
1.180 rillig 13189: <td>UCSPI_SSL_USER</td>
1.169 rillig 13190: <td>UNLIMIT_RESOURCES</td>
1.156 leot 13191: </tr>
13192: <tr>
1.180 rillig 13193: <td>UNPRIVILEGED</td>
1.169 rillig 13194: <td>UNPRIVILEGED_GROUP</td>
1.156 leot 13195: </tr>
13196: <tr>
1.180 rillig 13197: <td>UNPRIVILEGED_GROUPS</td>
1.169 rillig 13198: <td>UNPRIVILEGED_USER</td>
1.156 leot 13199: </tr>
13200: <tr>
1.180 rillig 13201: <td>UNWRAP_FILES</td>
1.169 rillig 13202: <td>UNWRAP_PATTERNS</td>
1.156 leot 13203: </tr>
13204: <tr>
1.180 rillig 13205: <td>UPDATE_GEMSPEC</td>
1.169 rillig 13206: <td>UPDATE_TARGET</td>
1.156 leot 13207: </tr>
13208: <tr>
1.180 rillig 13209: <td>URI</td>
1.175 gutterid 13210: <td>USERGROUP_PHASE</td>
1.156 leot 13211: </tr>
13212: <tr>
1.180 rillig 13213: <td>USERPPP_GROUP</td>
1.175 gutterid 13214: <td>USER_SPECIFIC_PKGS</td>
1.156 leot 13215: </tr>
13216: <tr>
1.180 rillig 13217: <td>USE_ABI_DEPENDS</td>
1.175 gutterid 13218: <td>USE_APR</td>
1.156 leot 13219: </tr>
13220: <tr>
1.180 rillig 13221: <td>USE_BSD_MAKEFILE</td>
1.175 gutterid 13222: <td>USE_BUILTIN</td>
1.156 leot 13223: </tr>
13224: <tr>
1.180 rillig 13225: <td>USE_CROSS_COMPILE</td>
1.175 gutterid 13226: <td>USE_CURSES</td>
1.156 leot 13227: </tr>
13228: <tr>
1.180 rillig 13229: <td>USE_CWRAPPERS</td>
1.175 gutterid 13230: <td>USE_DB185</td>
1.156 leot 13231: </tr>
13232: <tr>
1.180 rillig 13233: <td>USE_FEATURES</td>
1.175 gutterid 13234: <td>USE_GAMESGROUP</td>
1.156 leot 13235: </tr>
13236: <tr>
1.180 rillig 13237: <td>USE_GCC_RUNTIME</td>
1.175 gutterid 13238: <td>USE_IMAKE</td>
1.156 leot 13239: </tr>
13240: <tr>
1.180 rillig 13241: <td>USE_JAVA</td>
1.175 gutterid 13242: <td>USE_JAVA2</td>
1.156 leot 13243: </tr>
13244: <tr>
1.180 rillig 13245: <td>USE_LANGUAGES</td>
1.175 gutterid 13246: <td>USE_LIBTOOL</td>
1.156 leot 13247: </tr>
13248: <tr>
1.180 rillig 13249: <td>USE_NATIVE_GCC</td>
1.175 gutterid 13250: <td>USE_NETBSD_REPO</td>
1.156 leot 13251: </tr>
13252: <tr>
1.180 rillig 13253: <td>USE_PKGSRC_GCC</td>
1.175 gutterid 13254: <td>USE_PKGSRC_GCC_RUNTIME</td>
1.156 leot 13255: </tr>
13256: <tr>
1.180 rillig 13257: <td>USE_PKGTASKS</td>
1.175 gutterid 13258: <td>USE_PKG_ADMIN_DIGEST</td>
1.156 leot 13259: </tr>
13260: <tr>
1.180 rillig 13261: <td>USE_RUBY_EXTCONF</td>
1.175 gutterid 13262: <td>USE_RUBY_INSTALL</td>
1.156 leot 13263: </tr>
13264: <tr>
1.180 rillig 13265: <td>USE_RUBY_SETUP</td>
1.175 gutterid 13266: <td>USE_RUBY_SETUP_PKG</td>
1.156 leot 13267: </tr>
13268: <tr>
1.180 rillig 13269: <td>USE_TOOLS</td>
1.175 gutterid 13270: <td>UUCP_GROUP</td>
1.156 leot 13271: </tr>
13272: <tr>
1.180 rillig 13273: <td>UUCP_USER</td>
1.175 gutterid 13274: <td>VARBASE</td>
1.156 leot 13275: </tr>
13276: <tr>
1.180 rillig 13277: <td>VARNAME</td>
1.175 gutterid 13278: <td>VIM_EXTRA_OPTS</td>
1.156 leot 13279: </tr>
13280: <tr>
1.180 rillig 13281: <td>WARNING_MSG</td>
1.175 gutterid 13282: <td>WCALC_CGIDIR</td>
1.156 leot 13283: </tr>
13284: <tr>
1.180 rillig 13285: <td>WCALC_CGIPATH</td>
1.175 gutterid 13286: <td>WCALC_HTMLDIR</td>
1.156 leot 13287: </tr>
13288: <tr>
1.180 rillig 13289: <td>WCALC_HTMLPATH</td>
1.175 gutterid 13290: <td>WDM_MANAGERS</td>
1.156 leot 13291: </tr>
13292: <tr>
1.180 rillig 13293: <td>WRAPPER_REORDER_CMDS</td>
1.175 gutterid 13294: <td>WRKDIR</td>
1.156 leot 13295: </tr>
13296: <tr>
1.180 rillig 13297: <td>WRKDIR_BASENAME</td>
1.175 gutterid 13298: <td>WRKDIR_LOCKTYPE</td>
1.156 leot 13299: </tr>
13300: <tr>
1.180 rillig 13301: <td>WRKLOG</td>
1.175 gutterid 13302: <td>WRKOBJDIR</td>
1.156 leot 13303: </tr>
13304: <tr>
1.180 rillig 13305: <td>WRKSRC</td>
1.175 gutterid 13306: <td>X10_PORT</td>
1.156 leot 13307: </tr>
13308: <tr>
1.180 rillig 13309: <td>X11</td>
1.175 gutterid 13310: <td>X11BASE</td>
1.156 leot 13311: </tr>
13312: <tr>
1.180 rillig 13313: <td>X11_PKGSRCDIR</td>
1.175 gutterid 13314: <td>X11_TYPE</td>
1.156 leot 13315: </tr>
13316: <tr>
1.180 rillig 13317: <td>X509_CERTIFICATE</td>
1.175 gutterid 13318: <td>X509_KEY</td>
1.156 leot 13319: </tr>
13320: <tr>
1.180 rillig 13321: <td>XAW_TYPE</td>
1.175 gutterid 13322: <td>XLOCK_DEFAULT_MODE</td>
1.156 leot 13323: </tr>
13324: <tr>
1.180 rillig 13325: <td>XMKMF_FLAGS</td>
1.172 rillig 13326: <td>XXX</td>
1.156 leot 13327: </tr>
13328: <tr>
1.180 rillig 13329: <td>XXXX</td>
1.172 rillig 13330: <td>YES</td>
1.159 rillig 13331: </tr>
13332: <tr>
1.180 rillig 13333: <td>ZSH_STATIC</td>
1.174 leot 13334: <td>__stdc__</td>
1.156 leot 13335: </tr>
13336: <tr>
1.180 rillig 13337: <td>_vargroups</td>
1.174 leot 13338: <td>accept</td>
13339: </tr>
13340: <tr>
1.180 rillig 13341: <td>acquire-localbase-lock</td>
1.174 leot 13342: <td>acquire-lock</td>
1.156 leot 13343: </tr>
13344: <tr>
1.180 rillig 13345: <td>add</td>
1.174 leot 13346: <td>administrator</td>
1.156 leot 13347: </tr>
13348: <tr>
1.180 rillig 13349: <td>alloca</td>
1.159 rillig 13350: <td>alternatives</td>
1.174 leot 13351: </tr>
13352: <tr>
1.180 rillig 13353: <td>aslr</td>
1.174 leot 13354: <td>asprintf</td>
1.156 leot 13355: </tr>
13356: <tr>
1.180 rillig 13357: <td>atlas</td>
1.174 leot 13358: <td>autoconf</td>
1.161 leot 13359: </tr>
13360: <tr>
1.180 rillig 13361: <td>automake</td>
1.174 leot 13362: <td>autoreconf</td>
1.156 leot 13363: </tr>
13364: <tr>
1.180 rillig 13365: <td>awk</td>
1.174 leot 13366: <td>bash</td>
1.156 leot 13367: </tr>
13368: <tr>
1.180 rillig 13369: <td>big-endian</td>
1.174 leot 13370: <td>bin-install</td>
1.156 leot 13371: </tr>
13372: <tr>
1.180 rillig 13373: <td>bind</td>
1.172 rillig 13374: <td>binpkg-list</td>
1.177 leot 13375: </tr>
13376: <tr>
1.180 rillig 13377: <td>blas</td>
1.172 rillig 13378: <td>bootstrap-depends</td>
1.159 rillig 13379: </tr>
13380: <tr>
1.180 rillig 13381: <td>broken</td>
1.172 rillig 13382: <td>broken_on_platform</td>
1.156 leot 13383: </tr>
13384: <tr>
1.180 rillig 13385: <td>bsd</td>
1.174 leot 13386: <td>bsd.prog.mk</td>
13387: </tr>
13388: <tr>
1.180 rillig 13389: <td>build</td>
1.172 rillig 13390: <td>build-env</td>
1.156 leot 13391: </tr>
13392: <tr>
1.180 rillig 13393: <td>buildlink-directories</td>
1.172 rillig 13394: <td>buildlink-oss-soundcard-h</td>
1.156 leot 13395: </tr>
13396: <tr>
1.180 rillig 13397: <td>c</td>
1.172 rillig 13398: <td>c++</td>
1.156 leot 13399: </tr>
13400: <tr>
1.180 rillig 13401: <td>ccache</td>
1.172 rillig 13402: <td>cce</td>
1.156 leot 13403: </tr>
13404: <tr>
1.180 rillig 13405: <td>cdefs</td>
1.174 leot 13406: <td>ceil</td>
13407: </tr>
13408: <tr>
1.180 rillig 13409: <td>changes</td>
1.174 leot 13410: <td>changes-entry</td>
1.156 leot 13411: </tr>
13412: <tr>
1.180 rillig 13413: <td>changes-entry-noupdate</td>
1.174 leot 13414: <td>check</td>
1.156 leot 13415: </tr>
13416: <tr>
1.180 rillig 13417: <td>check-clean</td>
1.174 leot 13418: <td>check-files</td>
1.156 leot 13419: </tr>
13420: <tr>
1.180 rillig 13421: <td>check-files-clean</td>
1.174 leot 13422: <td>check-vulnerable</td>
1.156 leot 13423: </tr>
13424: <tr>
1.180 rillig 13425: <td>checksum</td>
1.174 leot 13426: <td>checksum-phase</td>
1.156 leot 13427: </tr>
13428: <tr>
1.180 rillig 13429: <td>clean</td>
1.174 leot 13430: <td>clean-depends</td>
1.156 leot 13431: </tr>
13432: <tr>
1.180 rillig 13433: <td>cleandir</td>
1.174 leot 13434: <td>commit</td>
1.156 leot 13435: </tr>
13436: <tr>
1.180 rillig 13437: <td>commit-changes-entry</td>
1.174 leot 13438: <td>compact</td>
1.156 leot 13439: </tr>
13440: <tr>
1.180 rillig 13441: <td>compiler</td>
1.174 leot 13442: <td>conf</td>
1.156 leot 13443: </tr>
13444: <tr>
1.180 rillig 13445: <td>config.guess</td>
1.174 leot 13446: <td>config.sub</td>
1.156 leot 13447: </tr>
13448: <tr>
1.180 rillig 13449: <td>configuration</td>
1.174 leot 13450: <td>configure</td>
1.156 leot 13451: </tr>
13452: <tr>
1.180 rillig 13453: <td>configure-env</td>
1.174 leot 13454: <td>configure-help</td>
1.156 leot 13455: </tr>
13456: <tr>
1.180 rillig 13457: <td>configure_args</td>
1.174 leot 13458: <td>connect</td>
1.156 leot 13459: </tr>
13460: <tr>
1.180 rillig 13461: <td>cos</td>
1.166 leot 13462: <td>cputime</td>
1.174 leot 13463: </tr>
13464: <tr>
1.180 rillig 13465: <td>create-usergroup</td>
1.174 leot 13466: <td>csh</td>
1.156 leot 13467: </tr>
13468: <tr>
1.180 rillig 13469: <td>ctf</td>
1.177 leot 13470: <td>cvs</td>
1.161 leot 13471: </tr>
13472: <tr>
1.180 rillig 13473: <td>debug</td>
1.174 leot 13474: <td>declaration</td>
1.156 leot 13475: </tr>
13476: <tr>
1.180 rillig 13477: <td>declare</td>
1.174 leot 13478: <td>defined</td>
1.156 leot 13479: </tr>
13480: <tr>
1.180 rillig 13481: <td>depend</td>
1.174 leot 13482: <td>dependencies</td>
1.156 leot 13483: </tr>
13484: <tr>
1.180 rillig 13485: <td>depends</td>
1.174 leot 13486: <td>depends-checksum</td>
1.156 leot 13487: </tr>
13488: <tr>
1.180 rillig 13489: <td>depends-fetch</td>
1.174 leot 13490: <td>deps</td>
1.156 leot 13491: </tr>
13492: <tr>
1.180 rillig 13493: <td>describe</td>
1.174 leot 13494: <td>destdir</td>
1.156 leot 13495: </tr>
13496: <tr>
1.180 rillig 13497: <td>disable</td>
1.174 leot 13498: <td>distclean</td>
1.162 rillig 13499: </tr>
13500: <tr>
1.180 rillig 13501: <td>distinfo</td>
1.174 leot 13502: <td>dl</td>
1.156 leot 13503: </tr>
13504: <tr>
1.180 rillig 13505: <td>dlopen</td>
1.174 leot 13506: <td>do-build</td>
1.156 leot 13507: </tr>
13508: <tr>
1.180 rillig 13509: <td>do-buildlink</td>
1.174 leot 13510: <td>do-clean</td>
1.156 leot 13511: </tr>
13512: <tr>
1.180 rillig 13513: <td>do-configure</td>
1.174 leot 13514: <td>do-configure-post-hook</td>
1.170 rillig 13515: </tr>
13516: <tr>
1.180 rillig 13517: <td>do-extract</td>
1.174 leot 13518: <td>do-fetch</td>
1.177 leot 13519: </tr>
13520: <tr>
1.180 rillig 13521: <td>do-install</td>
1.174 leot 13522: <td>emul</td>
13523: </tr>
13524: <tr>
1.180 rillig 13525: <td>emul-distinfo</td>
1.174 leot 13526: <td>emul-fetch</td>
1.156 leot 13527: </tr>
13528: <tr>
1.180 rillig 13529: <td>emulation</td>
1.174 leot 13530: <td>emulator</td>
1.159 rillig 13531: </tr>
13532: <tr>
1.180 rillig 13533: <td>enable</td>
1.174 leot 13534: <td>endian</td>
1.156 leot 13535: </tr>
13536: <tr>
1.180 rillig 13537: <td>endif</td>
1.170 rillig 13538: <td>enomem</td>
1.156 leot 13539: </tr>
13540: <tr>
1.180 rillig 13541: <td>err</td>
1.170 rillig 13542: <td>errx</td>
1.156 leot 13543: </tr>
13544: <tr>
1.180 rillig 13545: <td>etc</td>
1.174 leot 13546: <td>exp</td>
13547: </tr>
13548: <tr>
1.180 rillig 13549: <td>extract-rpm</td>
1.174 leot 13550: <td>fabs</td>
1.156 leot 13551: </tr>
13552: <tr>
1.180 rillig 13553: <td>feature</td>
1.159 rillig 13554: <td>features</td>
1.156 leot 13555: </tr>
13556: <tr>
1.180 rillig 13557: <td>fetch</td>
1.159 rillig 13558: <td>fetch-list</td>
1.156 leot 13559: </tr>
13560: <tr>
1.180 rillig 13561: <td>follows</td>
1.159 rillig 13562: <td>forbids</td>
1.156 leot 13563: </tr>
13564: <tr>
1.180 rillig 13565: <td>form</td>
1.159 rillig 13566: <td>format</td>
1.156 leot 13567: </tr>
13568: <tr>
1.180 rillig 13569: <td>fortify</td>
1.159 rillig 13570: <td>fortify_source</td>
1.177 leot 13571: </tr>
13572: <tr>
1.180 rillig 13573: <td>fossil</td>
1.157 leot 13574: <td>friend</td>
1.156 leot 13575: </tr>
13576: <tr>
1.180 rillig 13577: <td>fts</td>
1.170 rillig 13578: <td>fts_close</td>
1.156 leot 13579: </tr>
13580: <tr>
1.180 rillig 13581: <td>fts_open</td>
1.170 rillig 13582: <td>fts_read</td>
1.156 leot 13583: </tr>
13584: <tr>
1.180 rillig 13585: <td>fts_set</td>
1.174 leot 13586: <td>gcc</td>
13587: </tr>
13588: <tr>
1.180 rillig 13589: <td>gethostbyaddr</td>
1.174 leot 13590: <td>gethostbyname</td>
1.156 leot 13591: </tr>
13592: <tr>
1.180 rillig 13593: <td>gethostbyname2</td>
1.170 rillig 13594: <td>getopt_long</td>
1.156 leot 13595: </tr>
13596: <tr>
1.180 rillig 13597: <td>getprogname</td>
1.174 leot 13598: <td>getservbyname</td>
13599: </tr>
13600: <tr>
1.180 rillig 13601: <td>getservbyport</td>
1.174 leot 13602: <td>getservent</td>
13603: </tr>
13604: <tr>
1.180 rillig 13605: <td>gettext</td>
1.177 leot 13606: <td>git</td>
1.156 leot 13607: </tr>
13608: <tr>
1.180 rillig 13609: <td>github</td>
1.177 leot 13610: <td>gitlab</td>
13611: </tr>
13612: <tr>
1.180 rillig 13613: <td>glob</td>
1.175 gutterid 13614: <td>gnu</td>
1.159 rillig 13615: </tr>
13616: <tr>
1.180 rillig 13617: <td>gnu_configure_strict</td>
1.175 gutterid 13618: <td>go</td>
1.156 leot 13619: </tr>
13620: <tr>
1.180 rillig 13621: <td>go-deps</td>
1.175 gutterid 13622: <td>golang</td>
1.156 leot 13623: </tr>
13624: <tr>
1.180 rillig 13625: <td>guess-license</td>
1.175 gutterid 13626: <td>hashbang</td>
1.156 leot 13627: </tr>
13628: <tr>
1.180 rillig 13629: <td>heimdal</td>
1.170 rillig 13630: <td>help</td>
1.156 leot 13631: </tr>
13632: <tr>
1.180 rillig 13633: <td>hg</td>
1.170 rillig 13634: <td>imake</td>
1.161 leot 13635: </tr>
13636: <tr>
1.180 rillig 13637: <td>increment</td>
1.174 leot 13638: <td>inet_aton</td>
1.156 leot 13639: </tr>
13640: <tr>
1.180 rillig 13641: <td>interp</td>
1.157 leot 13642: <td>interpreter</td>
1.156 leot 13643: </tr>
13644: <tr>
1.180 rillig 13645: <td>intl</td>
1.157 leot 13646: <td>iso</td>
1.156 leot 13647: </tr>
13648: <tr>
1.180 rillig 13649: <td>kerberos</td>
1.157 leot 13650: <td>krb</td>
1.156 leot 13651: </tr>
13652: <tr>
1.180 rillig 13653: <td>krb5</td>
1.157 leot 13654: <td>ksh</td>
1.177 leot 13655: </tr>
13656: <tr>
1.180 rillig 13657: <td>lapack</td>
1.175 gutterid 13658: <td>latex</td>
1.156 leot 13659: </tr>
13660: <tr>
1.180 rillig 13661: <td>libintl_bindtextdomain</td>
1.175 gutterid 13662: <td>libintl_gettext</td>
1.174 leot 13663: </tr>
13664: <tr>
1.180 rillig 13665: <td>libintl_textdomain</td>
1.175 gutterid 13666: <td>libnbcompat</td>
1.159 rillig 13667: </tr>
13668: <tr>
1.180 rillig 13669: <td>libs</td>
1.175 gutterid 13670: <td>libtool</td>
1.156 leot 13671: </tr>
13672: <tr>
1.180 rillig 13673: <td>licence</td>
1.175 gutterid 13674: <td>license</td>
1.156 leot 13675: </tr>
13676: <tr>
1.180 rillig 13677: <td>lintl</td>
1.175 gutterid 13678: <td>little-endian</td>
1.156 leot 13679: </tr>
13680: <tr>
1.180 rillig 13681: <td>lock</td>
1.175 gutterid 13682: <td>locking</td>
1.156 leot 13683: </tr>
13684: <tr>
1.180 rillig 13685: <td>lvalue</td>
1.175 gutterid 13686: <td>make</td>
1.156 leot 13687: </tr>
13688: <tr>
1.180 rillig 13689: <td>makesum</td>
1.174 leot 13690: <td>memory</td>
1.161 leot 13691: </tr>
13692: <tr>
1.180 rillig 13693: <td>mercurial</td>
1.174 leot 13694: <td>meta</td>
1.156 leot 13695: </tr>
13696: <tr>
1.180 rillig 13697: <td>meta-package</td>
1.174 leot 13698: <td>meta_package</td>
1.156 leot 13699: </tr>
13700: <tr>
1.180 rillig 13701: <td>mit-krb5</td>
1.174 leot 13702: <td>mk.conf</td>
1.177 leot 13703: </tr>
13704: <tr>
1.180 rillig 13705: <td>mkl</td>
1.175 gutterid 13706: <td>mount</td>
1.159 rillig 13707: </tr>
13708: <tr>
1.180 rillig 13709: <td>mprotect</td>
1.175 gutterid 13710: <td>mremap</td>
1.156 leot 13711: </tr>
13712: <tr>
1.180 rillig 13713: <td>nb</td>
1.175 gutterid 13714: <td>nbcompat</td>
1.156 leot 13715: </tr>
13716: <tr>
1.180 rillig 13717: <td>obstack</td>
1.175 gutterid 13718: <td>obstack_ptr_grow</td>
1.156 leot 13719: </tr>
13720: <tr>
1.180 rillig 13721: <td>occurs</td>
1.159 rillig 13722: <td>only</td>
1.161 leot 13723: </tr>
13724: <tr>
1.180 rillig 13725: <td>openblas</td>
1.158 brook 13726: <td>options</td>
1.156 leot 13727: </tr>
13728: <tr>
1.180 rillig 13729: <td>options.mk</td>
1.158 brook 13730: <td>order</td>
1.156 leot 13731: </tr>
13732: <tr>
1.180 rillig 13733: <td>override</td>
1.158 brook 13734: <td>override-intltool</td>
1.156 leot 13735: </tr>
13736: <tr>
1.180 rillig 13737: <td>override-message-intltool</td>
1.158 brook 13738: <td>package</td>
1.156 leot 13739: </tr>
13740: <tr>
1.180 rillig 13741: <td>parallel</td>
1.170 rillig 13742: <td>path</td>
1.156 leot 13743: </tr>
13744: <tr>
1.180 rillig 13745: <td>pax</td>
1.170 rillig 13746: <td>paxctl</td>
1.156 leot 13747: </tr>
13748: <tr>
1.180 rillig 13749: <td>pbulk-index</td>
1.170 rillig 13750: <td>pc</td>
1.156 leot 13751: </tr>
13752: <tr>
1.180 rillig 13753: <td>perl</td>
1.170 rillig 13754: <td>perl5</td>
1.156 leot 13755: </tr>
13756: <tr>
1.180 rillig 13757: <td>perms</td>
1.170 rillig 13758: <td>php</td>
1.156 leot 13759: </tr>
13760: <tr>
1.180 rillig 13761: <td>pkg-build-options</td>
1.170 rillig 13762: <td>pkg-config</td>
1.156 leot 13763: </tr>
13764: <tr>
1.180 rillig 13765: <td>pkg_build_options</td>
1.170 rillig 13766: <td>platform</td>
1.156 leot 13767: </tr>
13768: <tr>
1.180 rillig 13769: <td>plist</td>
1.170 rillig 13770: <td>post-extract</td>
1.156 leot 13771: </tr>
13772: <tr>
1.180 rillig 13773: <td>post-fetch</td>
1.170 rillig 13774: <td>post-wrapper</td>
1.156 leot 13775: </tr>
13776: <tr>
1.180 rillig 13777: <td>pre-build-checks-hook</td>
1.158 brook 13778: <td>pre-configure</td>
1.174 leot 13779: </tr>
13780: <tr>
1.180 rillig 13781: <td>pre-configure-checks-hook</td>
1.170 rillig 13782: <td>pre-extract</td>
1.156 leot 13783: </tr>
13784: <tr>
1.180 rillig 13785: <td>pre-fetch</td>
1.170 rillig 13786: <td>print-go-deps</td>
1.156 leot 13787: </tr>
13788: <tr>
1.180 rillig 13789: <td>print-plist</td>
1.170 rillig 13790: <td>print-summary-data</td>
1.156 leot 13791: </tr>
13792: <tr>
1.180 rillig 13793: <td>privileged-install-hook</td>
1.170 rillig 13794: <td>pypi</td>
1.156 leot 13795: </tr>
13796: <tr>
1.180 rillig 13797: <td>python</td>
1.170 rillig 13798: <td>readme-all</td>
1.156 leot 13799: </tr>
13800: <tr>
1.180 rillig 13801: <td>recv</td>
1.174 leot 13802: <td>recvfrom</td>
13803: </tr>
13804: <tr>
1.180 rillig 13805: <td>regcomp</td>
1.174 leot 13806: <td>release-localbase-lock</td>
13807: </tr>
13808: <tr>
1.180 rillig 13809: <td>release-lock</td>
1.170 rillig 13810: <td>relro</td>
1.156 leot 13811: </tr>
13812: <tr>
1.180 rillig 13813: <td>rename</td>
1.170 rillig 13814: <td>reorder</td>
1.156 leot 13815: </tr>
13816: <tr>
1.180 rillig 13817: <td>replace</td>
1.170 rillig 13818: <td>replace_interpreter</td>
1.156 leot 13819: </tr>
13820: <tr>
1.180 rillig 13821: <td>reproducible</td>
1.170 rillig 13822: <td>resolv</td>
1.156 leot 13823: </tr>
13824: <tr>
1.180 rillig 13825: <td>root</td>
1.170 rillig 13826: <td>ruby</td>
1.174 leot 13827: </tr>
13828: <tr>
1.180 rillig 13829: <td>send</td>
1.174 leot 13830: <td>sendfile</td>
1.156 leot 13831: </tr>
13832: <tr>
1.180 rillig 13833: <td>sendto</td>
1.158 brook 13834: <td>setenv</td>
1.156 leot 13835: </tr>
13836: <tr>
1.180 rillig 13837: <td>setgid</td>
1.158 brook 13838: <td>setprogname</td>
1.156 leot 13839: </tr>
13840: <tr>
1.180 rillig 13841: <td>setuid</td>
1.158 brook 13842: <td>sh</td>
1.156 leot 13843: </tr>
13844: <tr>
1.181 rillig 13845: <td>shebang</td>
1.180 rillig 13846: <td>show</td>
1.181 rillig 13847: </tr>
13848: <tr>
1.158 brook 13849: <td>show-all</td>
1.181 rillig 13850: <td>show-build-defs</td>
1.156 leot 13851: </tr>
13852: <tr>
1.158 brook 13853: <td>show-depends</td>
1.181 rillig 13854: <td>show-deps</td>
1.156 leot 13855: </tr>
13856: <tr>
1.158 brook 13857: <td>show-distfiles</td>
1.181 rillig 13858: <td>show-downlevel</td>
1.156 leot 13859: </tr>
13860: <tr>
1.158 brook 13861: <td>show-subdir-var</td>
1.181 rillig 13862: <td>show-tools</td>
1.156 leot 13863: </tr>
13864: <tr>
1.158 brook 13865: <td>show-var</td>
1.181 rillig 13866: <td>show-vars</td>
1.156 leot 13867: </tr>
13868: <tr>
1.158 brook 13869: <td>snprintf</td>
1.181 rillig 13870: <td>socket</td>
1.174 leot 13871: </tr>
13872: <tr>
1.170 rillig 13873: <td>ssp</td>
1.181 rillig 13874: <td>st_mode</td>
1.156 leot 13875: </tr>
13876: <tr>
1.170 rillig 13877: <td>stage-install</td>
1.181 rillig 13878: <td>strcasestr</td>
1.156 leot 13879: </tr>
13880: <tr>
1.162 rillig 13881: <td>strict</td>
1.181 rillig 13882: <td>strip</td>
1.162 rillig 13883: </tr>
13884: <tr>
1.174 leot 13885: <td>strndup</td>
1.181 rillig 13886: <td>strnlen</td>
1.156 leot 13887: </tr>
13888: <tr>
1.174 leot 13889: <td>strsep</td>
1.181 rillig 13890: <td>subst</td>
1.174 leot 13891: </tr>
13892: <tr>
13893: <td>substitutions</td>
1.181 rillig 13894: <td>subversion</td>
1.177 leot 13895: </tr>
13896: <tr>
1.175 gutterid 13897: <td>sun</td>
1.181 rillig 13898: <td>sunpro</td>
1.156 leot 13899: </tr>
13900: <tr>
13901: <td>sunwspro</td>
1.181 rillig 13902: <td>svn</td>
1.156 leot 13903: </tr>
13904: <tr>
1.161 leot 13905: <td>symlink</td>
1.181 rillig 13906: <td>test</td>
1.161 leot 13907: </tr>
13908: <tr>
1.174 leot 13909: <td>test-env</td>
1.181 rillig 13910: <td>tex</td>
1.156 leot 13911: </tr>
13912: <tr>
1.174 leot 13913: <td>texlive</td>
1.181 rillig 13914: <td>tmp</td>
1.156 leot 13915: </tr>
13916: <tr>
1.174 leot 13917: <td>tool</td>
1.181 rillig 13918: <td>tools</td>
1.156 leot 13919: </tr>
13920: <tr>
1.174 leot 13921: <td>tools-libtool-m4-override</td>
1.181 rillig 13922: <td>type</td>
1.156 leot 13923: </tr>
13924: <tr>
1.174 leot 13925: <td>ulimit</td>
1.181 rillig 13926: <td>undefined</td>
1.156 leot 13927: </tr>
13928: <tr>
1.174 leot 13929: <td>undo-replace</td>
1.181 rillig 13930: <td>unlimit</td>
1.156 leot 13931: </tr>
13932: <tr>
1.174 leot 13933: <td>unprivileged</td>
1.181 rillig 13934: <td>unprivileged-install-hook</td>
1.156 leot 13935: </tr>
13936: <tr>
1.174 leot 13937: <td>unstripped</td>
1.181 rillig 13938: <td>update</td>
1.156 leot 13939: </tr>
13940: <tr>
1.174 leot 13941: <td>upload</td>
1.181 rillig 13942: <td>upload-distfiles</td>
1.156 leot 13943: </tr>
13944: <tr>
1.157 leot 13945: <td>use_tools</td>
1.181 rillig 13946: <td>user</td>
1.156 leot 13947: </tr>
13948: <tr>
1.157 leot 13949: <td>utimes</td>
1.181 rillig 13950: <td>vasprintf</td>
1.156 leot 13951: </tr>
13952: <tr>
1.157 leot 13953: <td>verbose</td>
1.181 rillig 13954: <td>vsnprintf</td>
1.156 leot 13955: </tr>
13956: <tr>
1.157 leot 13957: <td>warn</td>
1.181 rillig 13958: <td>warning</td>
1.156 leot 13959: </tr>
13960: <tr>
1.157 leot 13961: <td>warnings</td>
1.181 rillig 13962: <td>warnx</td>
1.156 leot 13963: </tr>
13964: <tr>
1.174 leot 13965: <td>wattr_off</td>
1.181 rillig 13966: <td>wattr_on</td>
1.156 leot 13967: </tr>
13968: <tr>
1.174 leot 13969: <td>work</td>
1.181 rillig 13970: <td>wrapper</td>
1.156 leot 13971: </tr>
13972: <tr>
1.174 leot 13973: <td>wrkdir</td>
1.181 rillig 13974: <td> </td>
1.156 leot 13975: </tr>
13976: </table>
1.154 rillig 13977: </div>
13978: <div class="appendix">
13979: <div class="titlepage"><div><div><h1 class="title">
13980: <a name="editing"></a>Appendix E. Editing guidelines for the pkgsrc guide</h1></div></div></div>
1.1 dsieger 13981: <div class="toc">
13982: <p><b>Table of Contents</b></p>
1.100 leot 13983: <dl class="toc">
1.154 rillig 13984: <dt><span class="sect1"><a href="#targets">E.1. Make targets</a></span></dt>
13985: <dt><span class="sect1"><a href="#procedure">E.2. Procedure</a></span></dt>
1.1 dsieger 13986: </dl>
13987: </div>
13988: <p>This section contains information on editing the pkgsrc
13989: guide itself.</p>
1.41 asau 13990: <div class="sect1">
1.1 dsieger 13991: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 13992: <a name="targets"></a>E.1. Make targets</h2></div></div></div>
1.1 dsieger 13993: <p>The pkgsrc guide's source code is stored in
13994: <code class="filename">pkgsrc/doc/guide/files</code>, and several files
13995: are created from it:</p>
1.41 asau 13996: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.23 wiz 13997: <li class="listitem"><p><code class="filename">pkgsrc/doc/pkgsrc.txt</code></p></li>
13998: <li class="listitem"><p><code class="filename">pkgsrc/doc/pkgsrc.html</code></p></li>
1.174 leot 13999: <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>
14000: <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 14001: The PDF version of the pkgsrc guide.</p></li>
1.174 leot 14002: <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 14003: PostScript version of the pkgsrc guide.</p></li>
14004: </ul></div>
14005: </div>
1.41 asau 14006: <div class="sect1">
1.1 dsieger 14007: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.154 rillig 14008: <a name="procedure"></a>E.2. Procedure</h2></div></div></div>
1.1 dsieger 14009: <p>The procedure to edit the pkgsrc guide is:</p>
1.23 wiz 14010: <div class="procedure"><ol class="procedure" type="1">
1.41 asau 14011: <li class="step"><p>Make sure you have the packages needed to
1.1 dsieger 14012: regenerate the pkgsrc guide (and other XML-based NetBSD
1.45 obache 14013: documentation) installed. These are automatically installed when
1.137 leot 14014: 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 14015: <li class="step"><p>Run <span class="command"><strong>cd doc/guide</strong></span> to get to the
1.1 dsieger 14016: right directory. All further steps will take place
14017: here.</p></li>
1.41 asau 14018: <li class="step"><p>Edit the XML file(s) in
1.1 dsieger 14019: <code class="filename">files/</code>.</p></li>
1.41 asau 14020: <li class="step"><p>Run <span class="command"><strong>bmake</strong></span> to check the pkgsrc
1.1 dsieger 14021: guide for valid XML and to build the final output files. If you
14022: get any errors at this stage, you can just edit the files, as
14023: there are only symbolic links in the working directory, pointing
14024: to the files in <code class="filename">files/</code>.</p></li>
1.41 asau 14025: <li class="step"><p><span class="command"><strong>(cd files && cvs
1.1 dsieger 14026: commit)</strong></span></p></li>
1.41 asau 14027: <li class="step"><p>Run <span class="command"><strong>bmake clean && bmake</strong></span> to
1.1 dsieger 14028: regenerate the output files with the proper RCS
14029: Ids.</p></li>
1.41 asau 14030: <li class="step">
1.10 hubertf 14031: <p>Run <span class="command"><strong>bmake regen</strong></span> to install and
1.1 dsieger 14032: commit the files in both <code class="filename">pkgsrc/doc</code> and
14033: <code class="filename">htdocs</code>.</p>
1.41 asau 14034: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 14035: <h3 class="title">Note</h3>
14036: <p>If you have added, removed or renamed some chapters,
1.10 hubertf 14037: you need to synchronize them using <span class="command"><strong>cvs add</strong></span> or
14038: <span class="command"><strong>cvs delete</strong></span> in the htdocs
1.1 dsieger 14039: directory.</p>
14040: </div>
14041: </li>
14042: </ol></div>
14043: </div>
14044: </div>
14045: </div></body>
14046: </html>
CVSweb <webmaster@jp.NetBSD.org>