| @@ -92,27 +92,26 @@ | | | @@ -92,27 +92,26 @@ |
92 | </dl></dd> | | 92 | </dl></dd> |
93 | </dl></dd> | | 93 | </dl></dd> |
94 | <dt><span class="chapter"><a href="#using">4. Using pkgsrc</a></span></dt> | | 94 | <dt><span class="chapter"><a href="#using">4. Using pkgsrc</a></span></dt> |
95 | <dd><dl> | | 95 | <dd><dl> |
96 | <dt><span class="sect1"><a href="#using-pkg">4.1. Using binary packages</a></span></dt> | | 96 | <dt><span class="sect1"><a href="#using-pkg">4.1. Using binary packages</a></span></dt> |
97 | <dd><dl> | | 97 | <dd><dl> |
98 | <dt><span class="sect2"><a href="#finding-binary-packages">4.1.1. Finding binary packages</a></span></dt> | | 98 | <dt><span class="sect2"><a href="#finding-binary-packages">4.1.1. Finding binary packages</a></span></dt> |
99 | <dt><span class="sect2"><a href="#installing-binary-packages">4.1.2. Installing binary packages</a></span></dt> | | 99 | <dt><span class="sect2"><a href="#installing-binary-packages">4.1.2. Installing binary packages</a></span></dt> |
100 | <dt><span class="sect2"><a href="#using.pkg_delete">4.1.3. Deinstalling packages</a></span></dt> | | 100 | <dt><span class="sect2"><a href="#using.pkg_delete">4.1.3. Deinstalling packages</a></span></dt> |
101 | <dt><span class="sect2"><a href="#using.pkg_info">4.1.4. Getting information about installed packages</a></span></dt> | | 101 | <dt><span class="sect2"><a href="#using.pkg_info">4.1.4. Getting information about installed packages</a></span></dt> |
102 | <dt><span class="sect2"><a href="#vulnerabilities">4.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> | | 102 | <dt><span class="sect2"><a href="#vulnerabilities">4.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> |
103 | <dt><span class="sect2"><a href="#pkg_versions">4.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> | | 103 | <dt><span class="sect2"><a href="#pkg_versions">4.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> |
104 | <dt><span class="sect2"><a href="#using.pkg_admin">4.1.7. Other administrative functions</a></span></dt> | | 104 | <dt><span class="sect2"><a href="#using.pkg_admin">4.1.7. Other administrative functions</a></span></dt> |
105 | <dt><span class="sect2"><a href="#a-word-of-warning">4.1.8. A word of warning</a></span></dt> | | | |
106 | </dl></dd> | | 105 | </dl></dd> |
107 | <dt><span class="sect1"><a href="#building-packages-from-source">4.2. Building packages from source</a></span></dt> | | 106 | <dt><span class="sect1"><a href="#building-packages-from-source">4.2. Building packages from source</a></span></dt> |
108 | <dd><dl> | | 107 | <dd><dl> |
109 | <dt><span class="sect2"><a href="#requirements">4.2.1. Requirements</a></span></dt> | | 108 | <dt><span class="sect2"><a href="#requirements">4.2.1. Requirements</a></span></dt> |
110 | <dt><span class="sect2"><a href="#fetching-distfiles">4.2.2. Fetching distfiles</a></span></dt> | | 109 | <dt><span class="sect2"><a href="#fetching-distfiles">4.2.2. Fetching distfiles</a></span></dt> |
111 | <dt><span class="sect2"><a href="#how-to-build-and-install">4.2.3. How to build and install</a></span></dt> | | 110 | <dt><span class="sect2"><a href="#how-to-build-and-install">4.2.3. How to build and install</a></span></dt> |
112 | </dl></dd> | | 111 | </dl></dd> |
113 | </dl></dd> | | 112 | </dl></dd> |
114 | <dt><span class="chapter"><a href="#configuring">5. Configuring pkgsrc</a></span></dt> | | 113 | <dt><span class="chapter"><a href="#configuring">5. Configuring pkgsrc</a></span></dt> |
115 | <dd><dl> | | 114 | <dd><dl> |
116 | <dt><span class="sect1"><a href="#general-configuration">5.1. General configuration</a></span></dt> | | 115 | <dt><span class="sect1"><a href="#general-configuration">5.1. General configuration</a></span></dt> |
117 | <dt><span class="sect1"><a href="#variables-affecting-build">5.2. Variables affecting the build process</a></span></dt> | | 116 | <dt><span class="sect1"><a href="#variables-affecting-build">5.2. Variables affecting the build process</a></span></dt> |
118 | <dt><span class="sect1"><a href="#variables-affecting-installation">5.3. Variables affecting the installation process</a></span></dt> | | 117 | <dt><span class="sect1"><a href="#variables-affecting-installation">5.3. Variables affecting the installation process</a></span></dt> |
| @@ -174,56 +173,54 @@ builds) | | | @@ -174,56 +173,54 @@ builds) |
174 | <dt><span class="sect1"><a href="#creating.common">10.1. Common types of packages</a></span></dt> | | 173 | <dt><span class="sect1"><a href="#creating.common">10.1. Common types of packages</a></span></dt> |
175 | <dd><dl> | | 174 | <dd><dl> |
176 | <dt><span class="sect2"><a href="#creating.perl-module">10.1.1. Perl modules</a></span></dt> | | 175 | <dt><span class="sect2"><a href="#creating.perl-module">10.1.1. Perl modules</a></span></dt> |
177 | <dt><span class="sect2"><a href="#creating.kde-app">10.1.2. KDE3 applications</a></span></dt> | | 176 | <dt><span class="sect2"><a href="#creating.kde-app">10.1.2. KDE3 applications</a></span></dt> |
178 | <dt><span class="sect2"><a href="#creating.python-module">10.1.3. Python modules and programs</a></span></dt> | | 177 | <dt><span class="sect2"><a href="#creating.python-module">10.1.3. Python modules and programs</a></span></dt> |
179 | </dl></dd> | | 178 | </dl></dd> |
180 | <dt><span class="sect1"><a href="#creating.examples">10.2. Examples</a></span></dt> | | 179 | <dt><span class="sect1"><a href="#creating.examples">10.2. Examples</a></span></dt> |
181 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">10.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> | | 180 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">10.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> |
182 | </dl></dd> | | 181 | </dl></dd> |
183 | <dt><span class="chapter"><a href="#components">11. Package components - files, directories and contents</a></span></dt> | | 182 | <dt><span class="chapter"><a href="#components">11. Package components - files, directories and contents</a></span></dt> |
184 | <dd><dl> | | 183 | <dd><dl> |
185 | <dt><span class="sect1"><a href="#components.Makefile">11.1. <code class="filename">Makefile</code></a></span></dt> | | 184 | <dt><span class="sect1"><a href="#components.Makefile">11.1. <code class="filename">Makefile</code></a></span></dt> |
186 | <dt><span class="sect1"><a href="#components.distinfo">11.2. <code class="filename">distinfo</code></a></span></dt> | | 185 | <dt><span class="sect1"><a href="#components.distinfo">11.2. <code class="filename">distinfo</code></a></span></dt> |
187 | <dt><span class="sect1"><a href="#components.patches">11.3. patches/*</a></span></dt> | | 186 | <dt><span class="sect1"><a href="#components.patches">11.3. <code class="filename">patches/*</code></a></span></dt> |
188 | <dd><dl> | | 187 | <dd><dl> |
189 | <dt><span class="sect2"><a href="#components.patch.structure">11.3.1. Structure of a single patch file</a></span></dt> | | 188 | <dt><span class="sect2"><a href="#components.patch.structure">11.3.1. Structure of a single patch file</a></span></dt> |
190 | <dt><span class="sect2"><a href="#components.patches.caveats">11.3.2. Creating patch files</a></span></dt> | | 189 | <dt><span class="sect2"><a href="#components.patches.caveats">11.3.2. Creating patch files</a></span></dt> |
191 | <dt><span class="sect2"><a href="#components.patches.sources">11.3.3. Sources where the patch files come from</a></span></dt> | | 190 | <dt><span class="sect2"><a href="#components.patches.sources">11.3.3. Sources where the patch files come from</a></span></dt> |
192 | <dt><span class="sect2"><a href="#components.patches.guidelines">11.3.4. Patching guidelines</a></span></dt> | | 191 | <dt><span class="sect2"><a href="#components.patches.guidelines">11.3.4. Patching guidelines</a></span></dt> |
193 | <dt><span class="sect2"><a href="#components.patches.feedback">11.3.5. Feedback to the author</a></span></dt> | | 192 | <dt><span class="sect2"><a href="#components.patches.feedback">11.3.5. Feedback to the author</a></span></dt> |
194 | </dl></dd> | | 193 | </dl></dd> |
195 | <dt><span class="sect1"><a href="#other-mandatory-files">11.4. Other mandatory files</a></span></dt> | | 194 | <dt><span class="sect1"><a href="#other-mandatory-files">11.4. Other mandatory files</a></span></dt> |
196 | <dt><span class="sect1"><a href="#components.optional">11.5. Optional files</a></span></dt> | | 195 | <dt><span class="sect1"><a href="#components.optional">11.5. Optional files</a></span></dt> |
197 | <dd><dl> | | 196 | <dd><dl> |
198 | <dt><span class="sect2"><a href="#components.optional.bin">11.5.1. Files affecting the binary package</a></span></dt> | | 197 | <dt><span class="sect2"><a href="#components.optional.bin">11.5.1. Files affecting the binary package</a></span></dt> |
199 | <dt><span class="sect2"><a href="#components.optional.build">11.5.2. Files affecting the build process</a></span></dt> | | 198 | <dt><span class="sect2"><a href="#components.optional.build">11.5.2. Files affecting the build process</a></span></dt> |
200 | <dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> | | 199 | <dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> |
201 | </dl></dd> | | 200 | </dl></dd> |
202 | <dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt> | | 201 | <dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt> |
203 | <dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt> | | 202 | <dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt> |
204 | </dl></dd> | | 203 | </dl></dd> |
205 | <dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt> | | 204 | <dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt> |
206 | <dd><dl> | | 205 | <dd><dl> |
207 | <dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> | | 206 | <dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> |
208 | <dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> | | 207 | <dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> |
209 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> | | 208 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> |
210 | <dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> | | 209 | <dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> |
211 | <dd><dl> | | 210 | <dd><dl> |
212 | <dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> | | 211 | <dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> |
213 | <dt><span class="sect2"><a href="#converting-internal-to-external">12.3.2. Converting an internal list into an external list</a></span></dt> | | 212 | <dt><span class="sect2"><a href="#passing-variable-to-shell">12.3.2. Passing variables to a shell command</a></span></dt> |
214 | <dt><span class="sect2"><a href="#passing-variable-to-shell">12.3.3. Passing variables to a shell command</a></span></dt> | | 213 | <dt><span class="sect2"><a href="#quoting-guideline">12.3.3. Quoting guideline</a></span></dt> |
215 | <dt><span class="sect2"><a href="#quoting-guideline">12.3.4. Quoting guideline</a></span></dt> | | | |
216 | <dt><span class="sect2"><a href="#bsd-make-bug-workaround">12.3.5. Workaround for a bug in BSD Make</a></span></dt> | | | |
217 | </dl></dd> | | 214 | </dl></dd> |
218 | </dl></dd> | | 215 | </dl></dd> |
219 | <dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt> | | 216 | <dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt> |
220 | <dd><dl> | | 217 | <dd><dl> |
221 | <dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> | | 218 | <dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> |
222 | <dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> | | 219 | <dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> |
223 | <dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> | | 220 | <dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> |
224 | <dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> | | 221 | <dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> |
225 | <dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> | | 222 | <dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> |
226 | <dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> | | 223 | <dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> |
227 | <dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt> | | 224 | <dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt> |
228 | <dt><span class="sect1"><a href="#build-plist">13.8. Build-specific PLISTs</a></span></dt> | | 225 | <dt><span class="sect1"><a href="#build-plist">13.8. Build-specific PLISTs</a></span></dt> |
229 | <dt><span class="sect1"><a href="#faq.common-dirs">13.9. Sharing directories between packages</a></span></dt> | | 226 | <dt><span class="sect1"><a href="#faq.common-dirs">13.9. Sharing directories between packages</a></span></dt> |
| @@ -410,39 +407,35 @@ builds) | | | @@ -410,39 +407,35 @@ builds) |
410 | <dt><span class="sect1"><a href="#infr.design.intf">24.5. Designing interfaces for Makefile fragments</a></span></dt> | | 407 | <dt><span class="sect1"><a href="#infr.design.intf">24.5. Designing interfaces for Makefile fragments</a></span></dt> |
411 | <dd><dl> | | 408 | <dd><dl> |
412 | <dt><span class="sect2"><a href="#infr.design.intf.proc">24.5.1. Procedures with parameters</a></span></dt> | | 409 | <dt><span class="sect2"><a href="#infr.design.intf.proc">24.5.1. Procedures with parameters</a></span></dt> |
413 | <dt><span class="sect2"><a href="#infr.design.intf.action">24.5.2. Actions taken on behalf of parameters</a></span></dt> | | 410 | <dt><span class="sect2"><a href="#infr.design.intf.action">24.5.2. Actions taken on behalf of parameters</a></span></dt> |
414 | </dl></dd> | | 411 | </dl></dd> |
415 | <dt><span class="sect1"><a href="#infr.order">24.6. The order in which files are loaded</a></span></dt> | | 412 | <dt><span class="sect1"><a href="#infr.order">24.6. The order in which files are loaded</a></span></dt> |
416 | <dd><dl> | | 413 | <dd><dl> |
417 | <dt><span class="sect2"><a href="#infr.order.prefs">24.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt> | | 414 | <dt><span class="sect2"><a href="#infr.order.prefs">24.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt> |
418 | <dt><span class="sect2"><a href="#infr.order.pkg">24.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt> | | 415 | <dt><span class="sect2"><a href="#infr.order.pkg">24.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt> |
419 | </dl></dd> | | 416 | </dl></dd> |
420 | </dl></dd> | | 417 | </dl></dd> |
421 | <dt><span class="chapter"><a href="#regression">25. Regression tests</a></span></dt> | | 418 | <dt><span class="chapter"><a href="#regression">25. Regression tests</a></span></dt> |
422 | <dd><dl> | | 419 | <dd><dl> |
423 | <dt><span class="sect1"><a href="#regression.descr">25.1. The regression tests framework</a></span></dt> | | 420 | <dt><span class="sect1"><a href="#regression.run">25.1. Running the regression tests</a></span></dt> |
424 | <dt><span class="sect1"><a href="#regression.run">25.2. Running the regression tests</a></span></dt> | | 421 | <dt><span class="sect1"><a href="#regression.new">25.2. Adding a new regression test</a></span></dt> |
425 | <dt><span class="sect1"><a href="#regression.new">25.3. Adding a new regression test</a></span></dt> | | | |
426 | <dd><dl> | | 422 | <dd><dl> |
427 | <dt><span class="sect2"><a href="#regression.fun.override">25.3.1. Overridable functions</a></span></dt> | | 423 | <dt><span class="sect2"><a href="#regression.fun.override">25.2.1. Overridable functions</a></span></dt> |
428 | <dt><span class="sect2"><a href="#regression.fun.helper">25.3.2. Helper functions</a></span></dt> | | 424 | <dt><span class="sect2"><a href="#regression.fun.helper">25.2.2. Helper functions</a></span></dt> |
429 | </dl></dd> | | 425 | </dl></dd> |
430 | </dl></dd> | | 426 | </dl></dd> |
431 | <dt><span class="chapter"><a href="#porting">26. Porting pkgsrc</a></span></dt> | | 427 | <dt><span class="chapter"><a href="#porting">26. Porting pkgsrc</a></span></dt> |
432 | <dd><dl> | | 428 | <dd><dl><dt><span class="sect1"><a href="#porting.opsys">26.1. Porting pkgsrc to a new operating system</a></span></dt></dl></dd> |
433 | <dt><span class="sect1"><a href="#porting.opsys">26.1. Porting pkgsrc to a new operating system</a></span></dt> | | | |
434 | <dt><span class="sect1"><a href="#porting.compiler">26.2. Adding support for a new compiler</a></span></dt> | | | |
435 | </dl></dd> | | | |
436 | </dl></dd> | | 429 | </dl></dd> |
437 | <dt><span class="appendix"><a href="#examples">A. A simple example package: bison</a></span></dt> | | 430 | <dt><span class="appendix"><a href="#examples">A. A simple example package: bison</a></span></dt> |
438 | <dd><dl> | | 431 | <dd><dl> |
439 | <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt> | | 432 | <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt> |
440 | <dd><dl> | | 433 | <dd><dl> |
441 | <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt> | | 434 | <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt> |
442 | <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt> | | 435 | <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt> |
443 | <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt> | | 436 | <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt> |
444 | <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with <span class="command"><strong>pkglint</strong></span></a></span></dt> | | 437 | <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with <span class="command"><strong>pkglint</strong></span></a></span></dt> |
445 | </dl></dd> | | 438 | </dl></dd> |
446 | <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt> | | 439 | <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt> |
447 | </dl></dd> | | 440 | </dl></dd> |
448 | <dt><span class="appendix"><a href="#logs">B. Build logs</a></span></dt> | | 441 | <dt><span class="appendix"><a href="#logs">B. Build logs</a></span></dt> |
| @@ -507,27 +500,27 @@ to handle binary packages, so that not e | | | @@ -507,27 +500,27 @@ to handle binary packages, so that not e |
507 | packages for himself, which is a time-costly task.</p> | | 500 | packages for himself, which is a time-costly task.</p> |
508 | <p>pkgsrc currently contains several thousand packages, | | 501 | <p>pkgsrc currently contains several thousand packages, |
509 | including:</p> | | 502 | including:</p> |
510 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 503 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
511 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/apache24/README.html" target="_top"><code class="filename">www/apache24</code></a> - The Apache | | 504 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/apache24/README.html" target="_top"><code class="filename">www/apache24</code></a> - The Apache |
512 | web server</p></li> | | 505 | web server</p></li> |
513 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a> - The Firefox | | 506 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a> - The Firefox |
514 | web browser</p></li> | | 507 | web browser</p></li> |
515 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome/README.html" target="_top"><code class="filename">meta-pkgs/gnome</code></a> - The GNOME | | 508 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome/README.html" target="_top"><code class="filename">meta-pkgs/gnome</code></a> - The GNOME |
516 | Desktop Environment</p></li> | | 509 | Desktop Environment</p></li> |
517 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a> - The K | | 510 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a> - The K |
518 | Desktop Environment</p></li> | | 511 | Desktop Environment</p></li> |
519 | </ul></div> | | 512 | </ul></div> |
520 | <p>...just to name a few.</p> | | 513 | <p>… just to name a few.</p> |
521 | <p>pkgsrc has built-in support for handling varying dependencies, | | 514 | <p>pkgsrc has built-in support for handling varying dependencies, |
522 | such as pthreads and X11, and extended features such as IPv6 support on | | 515 | such as pthreads and X11, and extended features such as IPv6 support on |
523 | a range of platforms.</p> | | 516 | a range of platforms.</p> |
524 | <div class="sect2"> | | 517 | <div class="sect2"> |
525 | <div class="titlepage"><div><div><h3 class="title"> | | 518 | <div class="titlepage"><div><div><h3 class="title"> |
526 | <a name="why-pkgsrc"></a>1.1.1. Why pkgsrc?</h3></div></div></div> | | 519 | <a name="why-pkgsrc"></a>1.1.1. Why pkgsrc?</h3></div></div></div> |
527 | <p> | | 520 | <p> |
528 | pkgsrc provides the following key features: | | 521 | pkgsrc provides the following key features: |
529 | </p> | | 522 | </p> |
530 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 523 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
531 | <li class="listitem"><p>Easy building of software from source as well as the creation | | 524 | <li class="listitem"><p>Easy building of software from source as well as the creation |
532 | and installation of binary packages. The source and latest | | 525 | and installation of binary packages. The source and latest |
533 | patches are retrieved from a master or mirror download site, checksum | | 526 | patches are retrieved from a master or mirror download site, checksum |
| @@ -848,27 +841,26 @@ minutes! | | | @@ -848,27 +841,26 @@ minutes! |
848 | </dl></dd> | | 841 | </dl></dd> |
849 | </dl></dd> | | 842 | </dl></dd> |
850 | <dt><span class="chapter"><a href="#using">4. Using pkgsrc</a></span></dt> | | 843 | <dt><span class="chapter"><a href="#using">4. Using pkgsrc</a></span></dt> |
851 | <dd><dl> | | 844 | <dd><dl> |
852 | <dt><span class="sect1"><a href="#using-pkg">4.1. Using binary packages</a></span></dt> | | 845 | <dt><span class="sect1"><a href="#using-pkg">4.1. Using binary packages</a></span></dt> |
853 | <dd><dl> | | 846 | <dd><dl> |
854 | <dt><span class="sect2"><a href="#finding-binary-packages">4.1.1. Finding binary packages</a></span></dt> | | 847 | <dt><span class="sect2"><a href="#finding-binary-packages">4.1.1. Finding binary packages</a></span></dt> |
855 | <dt><span class="sect2"><a href="#installing-binary-packages">4.1.2. Installing binary packages</a></span></dt> | | 848 | <dt><span class="sect2"><a href="#installing-binary-packages">4.1.2. Installing binary packages</a></span></dt> |
856 | <dt><span class="sect2"><a href="#using.pkg_delete">4.1.3. Deinstalling packages</a></span></dt> | | 849 | <dt><span class="sect2"><a href="#using.pkg_delete">4.1.3. Deinstalling packages</a></span></dt> |
857 | <dt><span class="sect2"><a href="#using.pkg_info">4.1.4. Getting information about installed packages</a></span></dt> | | 850 | <dt><span class="sect2"><a href="#using.pkg_info">4.1.4. Getting information about installed packages</a></span></dt> |
858 | <dt><span class="sect2"><a href="#vulnerabilities">4.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> | | 851 | <dt><span class="sect2"><a href="#vulnerabilities">4.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> |
859 | <dt><span class="sect2"><a href="#pkg_versions">4.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> | | 852 | <dt><span class="sect2"><a href="#pkg_versions">4.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> |
860 | <dt><span class="sect2"><a href="#using.pkg_admin">4.1.7. Other administrative functions</a></span></dt> | | 853 | <dt><span class="sect2"><a href="#using.pkg_admin">4.1.7. Other administrative functions</a></span></dt> |
861 | <dt><span class="sect2"><a href="#a-word-of-warning">4.1.8. A word of warning</a></span></dt> | | | |
862 | </dl></dd> | | 854 | </dl></dd> |
863 | <dt><span class="sect1"><a href="#building-packages-from-source">4.2. Building packages from source</a></span></dt> | | 855 | <dt><span class="sect1"><a href="#building-packages-from-source">4.2. Building packages from source</a></span></dt> |
864 | <dd><dl> | | 856 | <dd><dl> |
865 | <dt><span class="sect2"><a href="#requirements">4.2.1. Requirements</a></span></dt> | | 857 | <dt><span class="sect2"><a href="#requirements">4.2.1. Requirements</a></span></dt> |
866 | <dt><span class="sect2"><a href="#fetching-distfiles">4.2.2. Fetching distfiles</a></span></dt> | | 858 | <dt><span class="sect2"><a href="#fetching-distfiles">4.2.2. Fetching distfiles</a></span></dt> |
867 | <dt><span class="sect2"><a href="#how-to-build-and-install">4.2.3. How to build and install</a></span></dt> | | 859 | <dt><span class="sect2"><a href="#how-to-build-and-install">4.2.3. How to build and install</a></span></dt> |
868 | </dl></dd> | | 860 | </dl></dd> |
869 | </dl></dd> | | 861 | </dl></dd> |
870 | <dt><span class="chapter"><a href="#configuring">5. Configuring pkgsrc</a></span></dt> | | 862 | <dt><span class="chapter"><a href="#configuring">5. Configuring pkgsrc</a></span></dt> |
871 | <dd><dl> | | 863 | <dd><dl> |
872 | <dt><span class="sect1"><a href="#general-configuration">5.1. General configuration</a></span></dt> | | 864 | <dt><span class="sect1"><a href="#general-configuration">5.1. General configuration</a></span></dt> |
873 | <dt><span class="sect1"><a href="#variables-affecting-build">5.2. Variables affecting the build process</a></span></dt> | | 865 | <dt><span class="sect1"><a href="#variables-affecting-build">5.2. Variables affecting the build process</a></span></dt> |
874 | <dt><span class="sect1"><a href="#variables-affecting-installation">5.3. Variables affecting the installation process</a></span></dt> | | 866 | <dt><span class="sect1"><a href="#variables-affecting-installation">5.3. Variables affecting the installation process</a></span></dt> |
| @@ -1178,27 +1170,26 @@ release -d | | | @@ -1178,27 +1170,26 @@ release -d |
1178 | </div> | | 1170 | </div> |
1179 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 1171 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
1180 | <h3 class="title">Note</h3> | | 1172 | <h3 class="title">Note</h3> |
1181 | <p>It is possible to bootstrap multiple instances of pkgsrc | | 1173 | <p>It is possible to bootstrap multiple instances of pkgsrc |
1182 | using non-intersecting directories. Use <span class="command"><strong>bmake</strong></span> | | 1174 | using non-intersecting directories. Use <span class="command"><strong>bmake</strong></span> |
1183 | corresponding to the installation you're working with to build | | 1175 | corresponding to the installation you're working with to build |
1184 | and install packages. | | 1176 | and install packages. |
1185 | </p> | | 1177 | </p> |
1186 | </div> | | 1178 | </div> |
1187 | </div> | | 1179 | </div> |
1188 | <div class="sect1"> | | 1180 | <div class="sect1"> |
1189 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1181 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1190 | <a name="platform-specific-notes"></a>3.3. Platform-specific notes</h2></div></div></div> | | 1182 | <a name="platform-specific-notes"></a>3.3. Platform-specific notes</h2></div></div></div> |
1191 | <p>Here are some platform-specific notes you should be aware of.</p> | | | |
1192 | <div class="sect2"> | | 1183 | <div class="sect2"> |
1193 | <div class="titlepage"><div><div><h3 class="title"> | | 1184 | <div class="titlepage"><div><div><h3 class="title"> |
1194 | <a name="cygwin"></a>3.3.1. Cygwin</h3></div></div></div> | | 1185 | <a name="cygwin"></a>3.3.1. Cygwin</h3></div></div></div> |
1195 | <p>Cygwin 1.7.x and later are supported.</p> | | 1186 | <p>Cygwin 1.7.x and later are supported.</p> |
1196 | <p>You need to install minimal base packages in `Base' category | | 1187 | <p>You need to install minimal base packages in `Base' category |
1197 | plus any of compiler, gcc, gcc4, and/or clang. | | 1188 | plus any of compiler, gcc, gcc4, and/or clang. |
1198 | For gcc and gcc4, C and C++ compiler will be installed by default, | | 1189 | For gcc and gcc4, C and C++ compiler will be installed by default, |
1199 | but you can install Fortran compiler additionally | | 1190 | but you can install Fortran compiler additionally |
1200 | because it will be required to use libtool. | | 1191 | because it will be required to use libtool. |
1201 | If it is not installed (or too old), Fortran compiler will be | | 1192 | If it is not installed (or too old), Fortran compiler will be |
1202 | installed with pkgsrc automatically.</p> | | 1193 | installed with pkgsrc automatically.</p> |
1203 | <p>As noted in | | 1194 | <p>As noted in |
1204 | <a class="ulink" href="http://cygwin.com/faq-nochunks.html#faq.using.su" target="_top">Cygwin FAQ: `Why doesn't su work?'</a>, | | 1195 | <a class="ulink" href="http://cygwin.com/faq-nochunks.html#faq.using.su" target="_top">Cygwin FAQ: `Why doesn't su work?'</a>, |
| @@ -1692,27 +1683,26 @@ WRAPPER_SHELL= ${LOCALBASE}/bin/bash | | | @@ -1692,27 +1683,26 @@ WRAPPER_SHELL= ${LOCALBASE}/bin/bash |
1692 | <a name="using"></a>Chapter 4. Using pkgsrc</h2></div></div></div> | | 1683 | <a name="using"></a>Chapter 4. Using pkgsrc</h2></div></div></div> |
1693 | <div class="toc"> | | 1684 | <div class="toc"> |
1694 | <p><b>Table of Contents</b></p> | | 1685 | <p><b>Table of Contents</b></p> |
1695 | <dl class="toc"> | | 1686 | <dl class="toc"> |
1696 | <dt><span class="sect1"><a href="#using-pkg">4.1. Using binary packages</a></span></dt> | | 1687 | <dt><span class="sect1"><a href="#using-pkg">4.1. Using binary packages</a></span></dt> |
1697 | <dd><dl> | | 1688 | <dd><dl> |
1698 | <dt><span class="sect2"><a href="#finding-binary-packages">4.1.1. Finding binary packages</a></span></dt> | | 1689 | <dt><span class="sect2"><a href="#finding-binary-packages">4.1.1. Finding binary packages</a></span></dt> |
1699 | <dt><span class="sect2"><a href="#installing-binary-packages">4.1.2. Installing binary packages</a></span></dt> | | 1690 | <dt><span class="sect2"><a href="#installing-binary-packages">4.1.2. Installing binary packages</a></span></dt> |
1700 | <dt><span class="sect2"><a href="#using.pkg_delete">4.1.3. Deinstalling packages</a></span></dt> | | 1691 | <dt><span class="sect2"><a href="#using.pkg_delete">4.1.3. Deinstalling packages</a></span></dt> |
1701 | <dt><span class="sect2"><a href="#using.pkg_info">4.1.4. Getting information about installed packages</a></span></dt> | | 1692 | <dt><span class="sect2"><a href="#using.pkg_info">4.1.4. Getting information about installed packages</a></span></dt> |
1702 | <dt><span class="sect2"><a href="#vulnerabilities">4.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> | | 1693 | <dt><span class="sect2"><a href="#vulnerabilities">4.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> |
1703 | <dt><span class="sect2"><a href="#pkg_versions">4.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> | | 1694 | <dt><span class="sect2"><a href="#pkg_versions">4.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> |
1704 | <dt><span class="sect2"><a href="#using.pkg_admin">4.1.7. Other administrative functions</a></span></dt> | | 1695 | <dt><span class="sect2"><a href="#using.pkg_admin">4.1.7. Other administrative functions</a></span></dt> |
1705 | <dt><span class="sect2"><a href="#a-word-of-warning">4.1.8. A word of warning</a></span></dt> | | | |
1706 | </dl></dd> | | 1696 | </dl></dd> |
1707 | <dt><span class="sect1"><a href="#building-packages-from-source">4.2. Building packages from source</a></span></dt> | | 1697 | <dt><span class="sect1"><a href="#building-packages-from-source">4.2. Building packages from source</a></span></dt> |
1708 | <dd><dl> | | 1698 | <dd><dl> |
1709 | <dt><span class="sect2"><a href="#requirements">4.2.1. Requirements</a></span></dt> | | 1699 | <dt><span class="sect2"><a href="#requirements">4.2.1. Requirements</a></span></dt> |
1710 | <dt><span class="sect2"><a href="#fetching-distfiles">4.2.2. Fetching distfiles</a></span></dt> | | 1700 | <dt><span class="sect2"><a href="#fetching-distfiles">4.2.2. Fetching distfiles</a></span></dt> |
1711 | <dt><span class="sect2"><a href="#how-to-build-and-install">4.2.3. How to build and install</a></span></dt> | | 1701 | <dt><span class="sect2"><a href="#how-to-build-and-install">4.2.3. How to build and install</a></span></dt> |
1712 | </dl></dd> | | 1702 | </dl></dd> |
1713 | </dl> | | 1703 | </dl> |
1714 | </div> | | 1704 | </div> |
1715 | <p>Basically, there are two ways of using pkgsrc. The first | | 1705 | <p>Basically, there are two ways of using pkgsrc. The first |
1716 | is to only install the package tools and to use binary packages | | 1706 | is to only install the package tools and to use binary packages |
1717 | that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span> | | 1707 | that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span> |
1718 | in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span> | | 1708 | in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span> |
| @@ -1889,41 +1879,26 @@ and you can still use binary packages fr | | | @@ -1889,41 +1879,26 @@ and you can still use binary packages fr |
1889 | ... | | 1879 | ... |
1890 | Version mismatch: 'tcsh' 6.09.00 vs 6.10.00 | | 1880 | Version mismatch: 'tcsh' 6.09.00 vs 6.10.00 |
1891 | </pre> | | 1881 | </pre> |
1892 | <p>You can then use <span class="command"><strong>make update</strong></span> to update the | | 1882 | <p>You can then use <span class="command"><strong>make update</strong></span> to update the |
1893 | package on your system and rebuild any dependencies. | | 1883 | package on your system and rebuild any dependencies. |
1894 | </p> | | 1884 | </p> |
1895 | </div> | | 1885 | </div> |
1896 | <div class="sect2"> | | 1886 | <div class="sect2"> |
1897 | <div class="titlepage"><div><div><h3 class="title"> | | 1887 | <div class="titlepage"><div><div><h3 class="title"> |
1898 | <a name="using.pkg_admin"></a>4.1.7. Other administrative functions</h3></div></div></div> | | 1888 | <a name="using.pkg_admin"></a>4.1.7. Other administrative functions</h3></div></div></div> |
1899 | <p>The <span class="command"><strong>pkg_admin</strong></span> executes various | | 1889 | <p>The <span class="command"><strong>pkg_admin</strong></span> executes various |
1900 | administrative functions on the package system.</p> | | 1890 | administrative functions on the package system.</p> |
1901 | </div> | | 1891 | </div> |
1902 | <div class="sect2"> | | | |
1903 | <div class="titlepage"><div><div><h3 class="title"> | | | |
1904 | <a name="a-word-of-warning"></a>4.1.8. A word of warning</h3></div></div></div> | | | |
1905 | <p>Please pay very careful attention to the warnings | | | |
1906 | expressed in the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a> manual page about the | | | |
1907 | inherent dangers of installing binary packages which you did | | | |
1908 | not create yourself, and the security holes that can be | | | |
1909 | introduced onto your system by indiscriminate adding of such | | | |
1910 | files.</p> | | | |
1911 | <p>The same warning of course applies to every package you | | | |
1912 | install from source when you haven't completely read and | | | |
1913 | understood the source code of the package, the compiler that | | | |
1914 | is used to build the package and all the other tools that are | | | |
1915 | involved.</p> | | | |
1916 | </div> | | | |
1917 | </div> | | 1892 | </div> |
1918 | <div class="sect1"> | | 1893 | <div class="sect1"> |
1919 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1894 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1920 | <a name="building-packages-from-source"></a>4.2. Building packages from source</h2></div></div></div> | | 1895 | <a name="building-packages-from-source"></a>4.2. Building packages from source</h2></div></div></div> |
1921 | <p>After obtaining pkgsrc, the <code class="filename">pkgsrc</code> | | 1896 | <p>After obtaining pkgsrc, the <code class="filename">pkgsrc</code> |
1922 | directory now contains a set of packages, organized into | | 1897 | directory now contains a set of packages, organized into |
1923 | categories. You can browse the online index of packages, or run | | 1898 | categories. You can browse the online index of packages, or run |
1924 | <span class="command"><strong>make readme</strong></span> from the <code class="filename">pkgsrc</code> | | 1899 | <span class="command"><strong>make readme</strong></span> from the <code class="filename">pkgsrc</code> |
1925 | directory to build local <code class="filename">README.html</code> files for | | 1900 | directory to build local <code class="filename">README.html</code> files for |
1926 | all packages, viewable with any web browser such as <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/lynx/README.html" target="_top"><code class="filename">www/lynx</code></a> or <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a>.</p> | | 1901 | all packages, viewable with any web browser such as <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/lynx/README.html" target="_top"><code class="filename">www/lynx</code></a> or <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a>.</p> |
1927 | <p>The default <span class="emphasis"><em>prefix</em></span> for installed packages | | 1902 | <p>The default <span class="emphasis"><em>prefix</em></span> for installed packages |
1928 | is <code class="filename">/usr/pkg</code>. If you wish to change this, you | | 1903 | is <code class="filename">/usr/pkg</code>. If you wish to change this, you |
1929 | should do so by setting <code class="varname">LOCALBASE</code> in | | 1904 | should do so by setting <code class="varname">LOCALBASE</code> in |
| @@ -2205,47 +2180,47 @@ works. | | | @@ -2205,47 +2180,47 @@ works. |
2205 | release (<span class="quote">“<span class="quote">2.0</span>”</span>, etc.) and architecture | | 2180 | release (<span class="quote">“<span class="quote">2.0</span>”</span>, etc.) and architecture |
2206 | (<span class="quote">“<span class="quote">mipsel</span>”</span>, etc.).</p></li> | | 2181 | (<span class="quote">“<span class="quote">mipsel</span>”</span>, etc.).</p></li> |
2207 | <li class="listitem"><p><code class="varname">ACCEPTABLE_LICENSES</code>: | | 2182 | <li class="listitem"><p><code class="varname">ACCEPTABLE_LICENSES</code>: |
2208 | List of acceptable licenses. License names are case-sensitive. | | 2183 | List of acceptable licenses. License names are case-sensitive. |
2209 | Whenever you try to build a package whose license is not in this | | 2184 | Whenever you try to build a package whose license is not in this |
2210 | list, you will get an error message. If the license condition is | | 2185 | list, you will get an error message. If the license condition is |
2211 | simple enough, the error message will include specific | | 2186 | simple enough, the error message will include specific |
2212 | instructions on how to change this variable.</p></li> | | 2187 | instructions on how to change this variable.</p></li> |
2213 | </ul></div> | | 2188 | </ul></div> |
2214 | </div> | | 2189 | </div> |
2215 | <div class="sect1"> | | 2190 | <div class="sect1"> |
2216 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2191 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2217 | <a name="variables-affecting-build"></a>5.2. Variables affecting the build process</h2></div></div></div> | | 2192 | <a name="variables-affecting-build"></a>5.2. Variables affecting the build process</h2></div></div></div> |
2218 | <p>XXX | | 2193 | <p> |
2219 | </p> | | 2194 | </p> |
2220 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2195 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2221 | <li class="listitem"><p><code class="varname">PACKAGES</code>: The top level | | 2196 | <li class="listitem"><p><code class="varname">PACKAGES</code>: The top level |
2222 | directory for the binary packages. The default is | | 2197 | directory for the binary packages. The default is |
2223 | <code class="filename">${PKGSRCDIR}/packages</code>.</p></li> | | 2198 | <code class="filename">${PKGSRCDIR}/packages</code>.</p></li> |
2224 | <li class="listitem"><p><code class="varname">WRKOBJDIR</code>: | | 2199 | <li class="listitem"><p><code class="varname">WRKOBJDIR</code>: |
2225 | The top level directory where, if defined, the separate | | 2200 | The top level directory where, if defined, the separate |
2226 | working directories will get created, and symbolically | | 2201 | working directories will get created, and symbolically |
2227 | linked to from <code class="filename">${WRKDIR}</code> (see below). | | 2202 | linked to from <code class="filename">${WRKDIR}</code> (see below). |
2228 | This is useful for building packages on several | | 2203 | This is useful for building packages on several |
2229 | architectures, then <code class="filename">${PKGSRCDIR}</code> | | 2204 | architectures, then <code class="filename">${PKGSRCDIR}</code> |
2230 | can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code> | | 2205 | can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code> |
2231 | is local to every architecture. (It should be noted that | | 2206 | is local to every architecture. (It should be noted that |
2232 | <code class="varname">PKGSRCDIR</code> should not be set by the user | | 2207 | <code class="varname">PKGSRCDIR</code> should not be set by the user |
2233 | — it is an internal definition which refers to the | | 2208 | — it is an internal definition which refers to the |
2234 | root of the pkgsrc tree. It is possible to have many | | 2209 | root of the pkgsrc tree. It is possible to have many |
2235 | pkgsrc tree instances.)</p></li> | | 2210 | pkgsrc tree instances.)</p></li> |
2236 | <li class="listitem"><p><code class="varname">LOCALPATCHES</code>: | | 2211 | <li class="listitem"><p><code class="varname">LOCALPATCHES</code>: |
2237 | Directory for local patches that aren't part of pkgsrc. | | 2212 | Directory for local patches that aren't part of pkgsrc. |
2238 | See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “patches/*”</a> for more | | 2213 | See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “<code class="filename">patches/*</code>”</a> for more |
2239 | information.</p></li> | | 2214 | information.</p></li> |
2240 | <li class="listitem"><p><code class="varname">PKGMAKECONF</code>: Location of | | 2215 | <li class="listitem"><p><code class="varname">PKGMAKECONF</code>: Location of |
2241 | the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's | | 2216 | the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's |
2242 | BSD-style Makefile. If this is not set, | | 2217 | BSD-style Makefile. If this is not set, |
2243 | <code class="varname">MAKECONF</code> is set to | | 2218 | <code class="varname">MAKECONF</code> is set to |
2244 | <code class="filename">/dev/null</code> to avoid picking up | | 2219 | <code class="filename">/dev/null</code> to avoid picking up |
2245 | settings used by builds in <code class="filename">/usr/src</code>.</p></li> | | 2220 | settings used by builds in <code class="filename">/usr/src</code>.</p></li> |
2246 | <li class="listitem"><p><code class="varname">DEPENDS_TARGET</code>: | | 2221 | <li class="listitem"><p><code class="varname">DEPENDS_TARGET</code>: |
2247 | By default, dependencies are only installed, and no binary | | 2222 | By default, dependencies are only installed, and no binary |
2248 | package is created for them. You can set this variable to | | 2223 | package is created for them. You can set this variable to |
2249 | <code class="literal">package-install</code> to automatically create binary | | 2224 | <code class="literal">package-install</code> to automatically create binary |
2250 | packages after installing dependencies. Please note that the | | 2225 | packages after installing dependencies. Please note that the |
2251 | <code class="varname">PKGSRC_KEEP_BIN_PKGS</code> can be set to | | 2226 | <code class="varname">PKGSRC_KEEP_BIN_PKGS</code> can be set to |
| @@ -3006,43 +2981,34 @@ etc: | | | @@ -3006,43 +2981,34 @@ etc: |
3006 | </ul></div> | | 2981 | </ul></div> |
3007 | <p>Utilities for people maintaining pkgsrc (or: more obscure pkg | | 2982 | <p>Utilities for people maintaining pkgsrc (or: more obscure pkg |
3008 | utilities)</p> | | 2983 | utilities)</p> |
3009 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2984 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
3010 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_comp/README.html" target="_top"><code class="filename">pkgtools/pkg_comp</code></a>: Build | | 2985 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_comp/README.html" target="_top"><code class="filename">pkgtools/pkg_comp</code></a>: Build |
3011 | packages in a chrooted area.</p></li> | | 2986 | packages in a chrooted area.</p></li> |
3012 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libkver/README.html" target="_top"><code class="filename">pkgtools/libkver</code></a>: Spoof | | 2987 | <li class="listitem"><p><a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libkver/README.html" target="_top"><code class="filename">pkgtools/libkver</code></a>: Spoof |
3013 | kernel version for chrooted cross builds.</p></li> | | 2988 | kernel version for chrooted cross builds.</p></li> |
3014 | </ul></div> | | 2989 | </ul></div> |
3015 | </div> | | 2990 | </div> |
3016 | <div class="sect1"> | | 2991 | <div class="sect1"> |
3017 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2992 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
3018 | <a name="non-root-pkgsrc"></a>9.3. How to use pkgsrc as non-root</h2></div></div></div> | | 2993 | <a name="non-root-pkgsrc"></a>9.3. How to use pkgsrc as non-root</h2></div></div></div> |
3019 | <p>If you want to use pkgsrc as non-root user, you can set some | | 2994 | <p>To install packages from source as a non-root user, download |
3020 | variables to make pkgsrc work under these conditions. At the very least, | | 2995 | pkgsrc as described in <a class="xref" href="#getting" title="Chapter 2. Where to get pkgsrc and how to keep it up-to-date">Chapter 2, <i>Where to get pkgsrc and how to keep it up-to-date</i></a>, cd into that |
3021 | you need to set <code class="varname">UNPRIVILEGED</code> to <span class="quote">“<span class="quote">yes</span>”</span>; this | | 2996 | directory and run the command <span class="command"><strong>./bootstrap/bootstrap |
3022 | will turn on unprivileged mode and set multiple related variables to allow | | 2997 | --unprivileged</strong></span>.</p> |
3023 | installation of packages as non-root.</p> | | 2998 | <p>This will install the binary part of pkgsrc to |
3024 | <p>In case the defaults are not enough, you may want to tune some other | | 2999 | <code class="filename">~/pkg</code> and put the pkgsrc configuration <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> |
3025 | variables used. For example, if the automatic user/group detection leads | | 3000 | into <code class="filename">~/pkg/etc</code>.</p> |
3026 | to incorrect values (or not the ones you would like to use), you can change | | 3001 | <p>For more details, see <code class="filename">mk/unprivileged.mk</code>.</p> |
3027 | them by setting <code class="varname">UNPRIVILEGED_USER</code> and | | | |
3028 | <code class="varname">UNPRIVILEGED_GROUP</code> respectively.</p> | | | |
3029 | <p>As regards bootstrapping, please note that the | | | |
3030 | <span class="command"><strong>bootstrap</strong></span> script will ease non-root configuration when | | | |
3031 | given the <span class="quote">“<span class="quote">--ignore-user-check</span>”</span> flag, as it will choose and | | | |
3032 | use multiple default directories under <code class="filename">~/pkg</code> as the | | | |
3033 | installation targets. These directories can be overridden by the | | | |
3034 | <span class="quote">“<span class="quote">--prefix</span>”</span> flag provided by the script, as well as some others | | | |
3035 | that allow finer tuning of the tree layout.</p> | | | |
3036 | </div> | | 3002 | </div> |
3037 | <div class="sect1"> | | 3003 | <div class="sect1"> |
3038 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 3004 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
3039 | <a name="resume-transfers"></a>9.4. How to resume transfers when fetching distfiles?</h2></div></div></div> | | 3005 | <a name="resume-transfers"></a>9.4. How to resume transfers when fetching distfiles?</h2></div></div></div> |
3040 | <p>By default, resuming transfers in pkgsrc is disabled, but you can | | 3006 | <p>By default, resuming transfers in pkgsrc is disabled, but you can |
3041 | enable this feature by adding the option | | 3007 | enable this feature by adding the option |
3042 | <code class="varname">PKG_RESUME_TRANSFERS=YES</code> into | | 3008 | <code class="varname">PKG_RESUME_TRANSFERS=YES</code> into |
3043 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. If, during a fetch step, an incomplete | | 3009 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. If, during a fetch step, an incomplete |
3044 | distfile is found, pkgsrc will try to resume it.</p> | | 3010 | distfile is found, pkgsrc will try to resume it.</p> |
3045 | <p>You can also | | 3011 | <p>You can also |
3046 | use a different program than the platform default program by changing the | | 3012 | use a different program than the platform default program by changing the |
3047 | <code class="varname">FETCH_USING</code> variable. You can specify the program by | | 3013 | <code class="varname">FETCH_USING</code> variable. You can specify the program by |
3048 | using of ftp, fetch, wget or curl. Alternatively, fetching can be disabled | | 3014 | using of ftp, fetch, wget or curl. Alternatively, fetching can be disabled |
| @@ -3332,56 +3298,54 @@ anymore, you can remove that file and ru | | | @@ -3332,56 +3298,54 @@ anymore, you can remove that file and ru |
3332 | <dt><span class="sect1"><a href="#creating.common">10.1. Common types of packages</a></span></dt> | | 3298 | <dt><span class="sect1"><a href="#creating.common">10.1. Common types of packages</a></span></dt> |
3333 | <dd><dl> | | 3299 | <dd><dl> |
3334 | <dt><span class="sect2"><a href="#creating.perl-module">10.1.1. Perl modules</a></span></dt> | | 3300 | <dt><span class="sect2"><a href="#creating.perl-module">10.1.1. Perl modules</a></span></dt> |
3335 | <dt><span class="sect2"><a href="#creating.kde-app">10.1.2. KDE3 applications</a></span></dt> | | 3301 | <dt><span class="sect2"><a href="#creating.kde-app">10.1.2. KDE3 applications</a></span></dt> |
3336 | <dt><span class="sect2"><a href="#creating.python-module">10.1.3. Python modules and programs</a></span></dt> | | 3302 | <dt><span class="sect2"><a href="#creating.python-module">10.1.3. Python modules and programs</a></span></dt> |
3337 | </dl></dd> | | 3303 | </dl></dd> |
3338 | <dt><span class="sect1"><a href="#creating.examples">10.2. Examples</a></span></dt> | | 3304 | <dt><span class="sect1"><a href="#creating.examples">10.2. Examples</a></span></dt> |
3339 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">10.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> | | 3305 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">10.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> |
3340 | </dl></dd> | | 3306 | </dl></dd> |
3341 | <dt><span class="chapter"><a href="#components">11. Package components - files, directories and contents</a></span></dt> | | 3307 | <dt><span class="chapter"><a href="#components">11. Package components - files, directories and contents</a></span></dt> |
3342 | <dd><dl> | | 3308 | <dd><dl> |
3343 | <dt><span class="sect1"><a href="#components.Makefile">11.1. <code class="filename">Makefile</code></a></span></dt> | | 3309 | <dt><span class="sect1"><a href="#components.Makefile">11.1. <code class="filename">Makefile</code></a></span></dt> |
3344 | <dt><span class="sect1"><a href="#components.distinfo">11.2. <code class="filename">distinfo</code></a></span></dt> | | 3310 | <dt><span class="sect1"><a href="#components.distinfo">11.2. <code class="filename">distinfo</code></a></span></dt> |
3345 | <dt><span class="sect1"><a href="#components.patches">11.3. patches/*</a></span></dt> | | 3311 | <dt><span class="sect1"><a href="#components.patches">11.3. <code class="filename">patches/*</code></a></span></dt> |
3346 | <dd><dl> | | 3312 | <dd><dl> |
3347 | <dt><span class="sect2"><a href="#components.patch.structure">11.3.1. Structure of a single patch file</a></span></dt> | | 3313 | <dt><span class="sect2"><a href="#components.patch.structure">11.3.1. Structure of a single patch file</a></span></dt> |
3348 | <dt><span class="sect2"><a href="#components.patches.caveats">11.3.2. Creating patch files</a></span></dt> | | 3314 | <dt><span class="sect2"><a href="#components.patches.caveats">11.3.2. Creating patch files</a></span></dt> |
3349 | <dt><span class="sect2"><a href="#components.patches.sources">11.3.3. Sources where the patch files come from</a></span></dt> | | 3315 | <dt><span class="sect2"><a href="#components.patches.sources">11.3.3. Sources where the patch files come from</a></span></dt> |
3350 | <dt><span class="sect2"><a href="#components.patches.guidelines">11.3.4. Patching guidelines</a></span></dt> | | 3316 | <dt><span class="sect2"><a href="#components.patches.guidelines">11.3.4. Patching guidelines</a></span></dt> |
3351 | <dt><span class="sect2"><a href="#components.patches.feedback">11.3.5. Feedback to the author</a></span></dt> | | 3317 | <dt><span class="sect2"><a href="#components.patches.feedback">11.3.5. Feedback to the author</a></span></dt> |
3352 | </dl></dd> | | 3318 | </dl></dd> |
3353 | <dt><span class="sect1"><a href="#other-mandatory-files">11.4. Other mandatory files</a></span></dt> | | 3319 | <dt><span class="sect1"><a href="#other-mandatory-files">11.4. Other mandatory files</a></span></dt> |
3354 | <dt><span class="sect1"><a href="#components.optional">11.5. Optional files</a></span></dt> | | 3320 | <dt><span class="sect1"><a href="#components.optional">11.5. Optional files</a></span></dt> |
3355 | <dd><dl> | | 3321 | <dd><dl> |
3356 | <dt><span class="sect2"><a href="#components.optional.bin">11.5.1. Files affecting the binary package</a></span></dt> | | 3322 | <dt><span class="sect2"><a href="#components.optional.bin">11.5.1. Files affecting the binary package</a></span></dt> |
3357 | <dt><span class="sect2"><a href="#components.optional.build">11.5.2. Files affecting the build process</a></span></dt> | | 3323 | <dt><span class="sect2"><a href="#components.optional.build">11.5.2. Files affecting the build process</a></span></dt> |
3358 | <dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> | | 3324 | <dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> |
3359 | </dl></dd> | | 3325 | </dl></dd> |
3360 | <dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt> | | 3326 | <dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt> |
3361 | <dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt> | | 3327 | <dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt> |
3362 | </dl></dd> | | 3328 | </dl></dd> |
3363 | <dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt> | | 3329 | <dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt> |
3364 | <dd><dl> | | 3330 | <dd><dl> |
3365 | <dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> | | 3331 | <dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> |
3366 | <dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> | | 3332 | <dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> |
3367 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> | | 3333 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> |
3368 | <dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> | | 3334 | <dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> |
3369 | <dd><dl> | | 3335 | <dd><dl> |
3370 | <dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> | | 3336 | <dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> |
3371 | <dt><span class="sect2"><a href="#converting-internal-to-external">12.3.2. Converting an internal list into an external list</a></span></dt> | | 3337 | <dt><span class="sect2"><a href="#passing-variable-to-shell">12.3.2. Passing variables to a shell command</a></span></dt> |
3372 | <dt><span class="sect2"><a href="#passing-variable-to-shell">12.3.3. Passing variables to a shell command</a></span></dt> | | 3338 | <dt><span class="sect2"><a href="#quoting-guideline">12.3.3. Quoting guideline</a></span></dt> |
3373 | <dt><span class="sect2"><a href="#quoting-guideline">12.3.4. Quoting guideline</a></span></dt> | | | |
3374 | <dt><span class="sect2"><a href="#bsd-make-bug-workaround">12.3.5. Workaround for a bug in BSD Make</a></span></dt> | | | |
3375 | </dl></dd> | | 3339 | </dl></dd> |
3376 | </dl></dd> | | 3340 | </dl></dd> |
3377 | <dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt> | | 3341 | <dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt> |
3378 | <dd><dl> | | 3342 | <dd><dl> |
3379 | <dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> | | 3343 | <dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> |
3380 | <dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> | | 3344 | <dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> |
3381 | <dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> | | 3345 | <dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> |
3382 | <dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> | | 3346 | <dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> |
3383 | <dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> | | 3347 | <dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> |
3384 | <dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> | | 3348 | <dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> |
3385 | <dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt> | | 3349 | <dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt> |
3386 | <dt><span class="sect1"><a href="#build-plist">13.8. Build-specific PLISTs</a></span></dt> | | 3350 | <dt><span class="sect1"><a href="#build-plist">13.8. Build-specific PLISTs</a></span></dt> |
3387 | <dt><span class="sect1"><a href="#faq.common-dirs">13.9. Sharing directories between packages</a></span></dt> | | 3351 | <dt><span class="sect1"><a href="#faq.common-dirs">13.9. Sharing directories between packages</a></span></dt> |
| @@ -3953,27 +3917,27 @@ everything worked. | | | @@ -3953,27 +3917,27 @@ everything worked. |
3953 | </pre> | | 3917 | </pre> |
3954 | </div> | | 3918 | </div> |
3955 | </div> | | 3919 | </div> |
3956 | </div> | | 3920 | </div> |
3957 | </div> | | 3921 | </div> |
3958 | <div class="chapter"> | | 3922 | <div class="chapter"> |
3959 | <div class="titlepage"><div><div><h2 class="title"> | | 3923 | <div class="titlepage"><div><div><h2 class="title"> |
3960 | <a name="components"></a>Chapter 11. Package components - files, directories and contents</h2></div></div></div> | | 3924 | <a name="components"></a>Chapter 11. Package components - files, directories and contents</h2></div></div></div> |
3961 | <div class="toc"> | | 3925 | <div class="toc"> |
3962 | <p><b>Table of Contents</b></p> | | 3926 | <p><b>Table of Contents</b></p> |
3963 | <dl class="toc"> | | 3927 | <dl class="toc"> |
3964 | <dt><span class="sect1"><a href="#components.Makefile">11.1. <code class="filename">Makefile</code></a></span></dt> | | 3928 | <dt><span class="sect1"><a href="#components.Makefile">11.1. <code class="filename">Makefile</code></a></span></dt> |
3965 | <dt><span class="sect1"><a href="#components.distinfo">11.2. <code class="filename">distinfo</code></a></span></dt> | | 3929 | <dt><span class="sect1"><a href="#components.distinfo">11.2. <code class="filename">distinfo</code></a></span></dt> |
3966 | <dt><span class="sect1"><a href="#components.patches">11.3. patches/*</a></span></dt> | | 3930 | <dt><span class="sect1"><a href="#components.patches">11.3. <code class="filename">patches/*</code></a></span></dt> |
3967 | <dd><dl> | | 3931 | <dd><dl> |
3968 | <dt><span class="sect2"><a href="#components.patch.structure">11.3.1. Structure of a single patch file</a></span></dt> | | 3932 | <dt><span class="sect2"><a href="#components.patch.structure">11.3.1. Structure of a single patch file</a></span></dt> |
3969 | <dt><span class="sect2"><a href="#components.patches.caveats">11.3.2. Creating patch files</a></span></dt> | | 3933 | <dt><span class="sect2"><a href="#components.patches.caveats">11.3.2. Creating patch files</a></span></dt> |
3970 | <dt><span class="sect2"><a href="#components.patches.sources">11.3.3. Sources where the patch files come from</a></span></dt> | | 3934 | <dt><span class="sect2"><a href="#components.patches.sources">11.3.3. Sources where the patch files come from</a></span></dt> |
3971 | <dt><span class="sect2"><a href="#components.patches.guidelines">11.3.4. Patching guidelines</a></span></dt> | | 3935 | <dt><span class="sect2"><a href="#components.patches.guidelines">11.3.4. Patching guidelines</a></span></dt> |
3972 | <dt><span class="sect2"><a href="#components.patches.feedback">11.3.5. Feedback to the author</a></span></dt> | | 3936 | <dt><span class="sect2"><a href="#components.patches.feedback">11.3.5. Feedback to the author</a></span></dt> |
3973 | </dl></dd> | | 3937 | </dl></dd> |
3974 | <dt><span class="sect1"><a href="#other-mandatory-files">11.4. Other mandatory files</a></span></dt> | | 3938 | <dt><span class="sect1"><a href="#other-mandatory-files">11.4. Other mandatory files</a></span></dt> |
3975 | <dt><span class="sect1"><a href="#components.optional">11.5. Optional files</a></span></dt> | | 3939 | <dt><span class="sect1"><a href="#components.optional">11.5. Optional files</a></span></dt> |
3976 | <dd><dl> | | 3940 | <dd><dl> |
3977 | <dt><span class="sect2"><a href="#components.optional.bin">11.5.1. Files affecting the binary package</a></span></dt> | | 3941 | <dt><span class="sect2"><a href="#components.optional.bin">11.5.1. Files affecting the binary package</a></span></dt> |
3978 | <dt><span class="sect2"><a href="#components.optional.build">11.5.2. Files affecting the build process</a></span></dt> | | 3942 | <dt><span class="sect2"><a href="#components.optional.build">11.5.2. Files affecting the build process</a></span></dt> |
3979 | <dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> | | 3943 | <dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> |
| @@ -4125,75 +4089,74 @@ converters games mbone | | | @@ -4125,75 +4089,74 @@ converters games mbone |
4125 | <span class="quote">“<span class="quote">${PREFIX}</span>”</span> in all files (see patches, | | 4089 | <span class="quote">“<span class="quote">${PREFIX}</span>”</span> in all files (see patches, |
4126 | below).</p></li> | | 4090 | below).</p></li> |
4127 | <li class="listitem"><p>If the package installs any info files, see <a class="xref" href="#faq.info-files" title="19.6.7. Packages installing info files">Section 19.6.7, “Packages installing info files”</a>.</p></li> | | 4091 | <li class="listitem"><p>If the package installs any info files, see <a class="xref" href="#faq.info-files" title="19.6.7. Packages installing info files">Section 19.6.7, “Packages installing info files”</a>.</p></li> |
4128 | </ul></div> | | 4092 | </ul></div> |
4129 | </div> | | 4093 | </div> |
4130 | <div class="sect1"> | | 4094 | <div class="sect1"> |
4131 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 4095 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
4132 | <a name="components.distinfo"></a>11.2. <code class="filename">distinfo</code> | | 4096 | <a name="components.distinfo"></a>11.2. <code class="filename">distinfo</code> |
4133 | </h2></div></div></div> | | 4097 | </h2></div></div></div> |
4134 | <p>The <code class="filename">distinfo</code> file contains the message | | 4098 | <p>The <code class="filename">distinfo</code> file contains the message |
4135 | digest, or checksum, of each distfile needed for the package. This | | 4099 | digest, or checksum, of each distfile needed for the package. This |
4136 | ensures that the distfiles retrieved from the Internet have not been | | 4100 | ensures that the distfiles retrieved from the Internet have not been |
4137 | corrupted during transfer or altered by a malign force to introduce | | 4101 | corrupted during transfer or altered by a malign force to introduce |
4138 | a security hole. Due to recent rumor about weaknesses of digest | | 4102 | a security hole. To provide maximum security, all distfiles are |
4139 | algorithms, all distfiles are protected using both SHA1 and RMD160 | | 4103 | protected using three different message digest algorithms (SHA1, |
4140 | message digests, as well as the file size.</p> | | 4104 | RMD160, SHA512), as well as the file size.</p> |
4141 | <p>The <code class="filename">distinfo</code> file also contains the | | 4105 | <p>The <code class="filename">distinfo</code> file also contains the |
4142 | checksums for all the patches found in the | | 4106 | checksums for all the patches found in the |
4143 | <code class="filename">patches</code> directory (see <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “patches/*”</a>).</p> | | 4107 | <code class="filename">patches</code> directory (see <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “<code class="filename">patches/*</code>”</a>).</p> |
4144 | <p>To regenerate the <code class="filename">distinfo</code> file, use the | | 4108 | <p>To regenerate the <code class="filename">distinfo</code> file, use the |
4145 | <span class="command"><strong>make makedistinfo</strong></span> or <span class="command"><strong>make mdi</strong></span> | | 4109 | <span class="command"><strong>make distinfo</strong></span> command.</p> |
4146 | command.</p> | | | |
4147 | <p>Some packages have different sets of distfiles depending on | | 4110 | <p>Some packages have different sets of distfiles depending on |
4148 | the platform, for example <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/lang/openjdk7/README.html" target="_top"><code class="filename">lang/openjdk7</code></a>. These are kept in the same | | 4111 | the platform, for example <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/lang/openjdk7/README.html" target="_top"><code class="filename">lang/openjdk7</code></a>. These are kept in the same |
4149 | <code class="filename">distinfo</code> file and care should be taken when | | 4112 | <code class="filename">distinfo</code> file and care should be taken when |
4150 | upgrading such a package to ensure distfile information is not | | 4113 | upgrading such a package to ensure distfile information is not |
4151 | lost.</p> | | 4114 | lost.</p> |
4152 | </div> | | 4115 | </div> |
4153 | <div class="sect1"> | | 4116 | <div class="sect1"> |
4154 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 4117 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
4155 | <a name="components.patches"></a>11.3. patches/*</h2></div></div></div> | | 4118 | <a name="components.patches"></a>11.3. <code class="filename">patches/*</code> |
4156 | <p>Many packages still don't work out-of-the box on the various | | 4119 | </h2></div></div></div> |
4157 | platforms that are supported by pkgsrc. Therefore, a number of custom | | 4120 | <p>Some packages don't work out-of-the box on the various |
4158 | patch files are needed to make the package work. These patch files are | | 4121 | platforms that are supported by pkgsrc. These packages need |
| | | 4122 | to be patched to make them work. The patch files can be |
4159 | found in the <code class="filename">patches/</code> directory.</p> | | 4123 | found in the <code class="filename">patches/</code> directory.</p> |
4160 | <p>In the <span class="emphasis"><em>patch</em></span> phase, these patches are | | 4124 | <p>In the <span class="emphasis"><em>patch</em></span> phase, these patches are |
4161 | applied to the files in <code class="varname">WRKSRC</code> directory after | | 4125 | applied to the files in <code class="varname">WRKSRC</code> directory after |
4162 | extracting them, in <a class="ulink" href="http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13_03" target="_top">alphabetic | | 4126 | extracting them, in alphabetic order.</p> |
4163 | order</a>.</p> | | | |
4164 | <div class="sect2"> | | 4127 | <div class="sect2"> |
4165 | <div class="titlepage"><div><div><h3 class="title"> | | 4128 | <div class="titlepage"><div><div><h3 class="title"> |
4166 | <a name="components.patch.structure"></a>11.3.1. Structure of a single patch file</h3></div></div></div> | | 4129 | <a name="components.patch.structure"></a>11.3.1. Structure of a single patch file</h3></div></div></div> |
4167 | <p>The <code class="filename">patch-*</code> files should be in | | 4130 | <p>The <code class="filename">patch-*</code> files should be in |
4168 | <span class="command"><strong>diff -bu</strong></span> format, and apply without a fuzz to avoid | | 4131 | <span class="command"><strong>diff -bu</strong></span> format, and apply without a fuzz to avoid |
4169 | problems. (To force patches to apply with fuzz you can set | | 4132 | problems. (To force patches to apply with fuzz you can set |
4170 | <code class="varname">PATCH_FUZZ_FACTOR=-F2</code>). Furthermore, each patch | | 4133 | <code class="varname">PATCH_FUZZ_FACTOR=-F2</code>). Furthermore, each patch |
4171 | should contain only changes for a single file, and no file should be | | 4134 | should contain only changes for a single file, and no file should be |
4172 | patched by more than one patch file. This helps to keep future | | 4135 | patched by more than one patch file. This helps to keep future |
4173 | modifications simple.</p> | | 4136 | modifications simple.</p> |
4174 | <p>Each patch file is structured as follows: In the first line, | | 4137 | <p>Each patch file is structured as follows: In the first line, |
4175 | there is the RCS Id of the patch itself. The second line should be | | 4138 | there is the RCS Id of the patch itself. The second line should be |
4176 | empty for aesthetic reasons. After that, there should be a comment for | | 4139 | empty for aesthetic reasons. After that, there should be a comment for |
4177 | each change that the patch does. There are a number of standard | | 4140 | each change that the patch does. There are a number of standard |
4178 | cases:</p> | | 4141 | cases:</p> |
4179 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 4142 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
4180 | <li class="listitem"><p>Patches for commonly known vulnerabilities should | | 4143 | <li class="listitem"><p>Patches for commonly known vulnerabilities should |
4181 | mention the vulnerability ID (CAN, CVE).</p></li> | | 4144 | mention the vulnerability ID (CAN, CVE).</p></li> |
4182 | <li class="listitem"><p>Patches that change source code should mention the | | 4145 | <li class="listitem"><p>Patches that change source code should mention the |
4183 | platform and other environment (for example, the compiler) that the | | 4146 | platform and other environment (for example, the compiler) that the |
4184 | patch is needed for.</p></li> | | 4147 | patch is needed for.</p></li> |
4185 | </ul></div> | | 4148 | </ul></div> |
4186 | <p>In all, the patch should be commented so that any | | 4149 | <p>The patch should be commented so that any |
4187 | developer who knows the code of the application can make some use of | | 4150 | developer who knows the code of the application can make some use of |
4188 | the patch. Special care should be taken for the upstream developers, | | 4151 | the patch. Special care should be taken for the upstream developers, |
4189 | since we generally want that they accept our patches, so we have less | | 4152 | since we generally want that they accept our patches, so we have less |
4190 | work in the future.</p> | | 4153 | work in the future.</p> |
4191 | </div> | | 4154 | </div> |
4192 | <div class="sect2"> | | 4155 | <div class="sect2"> |
4193 | <div class="titlepage"><div><div><h3 class="title"> | | 4156 | <div class="titlepage"><div><div><h3 class="title"> |
4194 | <a name="components.patches.caveats"></a>11.3.2. Creating patch files</h3></div></div></div> | | 4157 | <a name="components.patches.caveats"></a>11.3.2. Creating patch files</h3></div></div></div> |
4195 | <p>One important thing to mention is to pay attention that no RCS | | 4158 | <p>One important thing to mention is to pay attention that no RCS |
4196 | IDs get stored in the patch files, as these will cause problems when | | 4159 | IDs get stored in the patch files, as these will cause problems when |
4197 | later checked into the NetBSD CVS tree. Use the | | 4160 | later checked into the NetBSD CVS tree. Use the |
4198 | <span class="command"><strong>pkgdiff</strong></span> command from the <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a> package to avoid these | | 4161 | <span class="command"><strong>pkgdiff</strong></span> command from the <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a> package to avoid these |
4199 | problems.</p> | | 4162 | problems.</p> |
| @@ -4564,30 +4527,28 @@ FILESDIR=${.CURDIR}/../xemacs/files | | | @@ -4564,30 +4527,28 @@ FILESDIR=${.CURDIR}/../xemacs/files |
4564 | </div> | | 4527 | </div> |
4565 | <div class="chapter"> | | 4528 | <div class="chapter"> |
4566 | <div class="titlepage"><div><div><h2 class="title"> | | 4529 | <div class="titlepage"><div><div><h2 class="title"> |
4567 | <a name="makefile"></a>Chapter 12. Programming in <code class="filename">Makefile</code>s</h2></div></div></div> | | 4530 | <a name="makefile"></a>Chapter 12. Programming in <code class="filename">Makefile</code>s</h2></div></div></div> |
4568 | <div class="toc"> | | 4531 | <div class="toc"> |
4569 | <p><b>Table of Contents</b></p> | | 4532 | <p><b>Table of Contents</b></p> |
4570 | <dl class="toc"> | | 4533 | <dl class="toc"> |
4571 | <dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> | | 4534 | <dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> |
4572 | <dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> | | 4535 | <dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> |
4573 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> | | 4536 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> |
4574 | <dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> | | 4537 | <dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> |
4575 | <dd><dl> | | 4538 | <dd><dl> |
4576 | <dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> | | 4539 | <dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> |
4577 | <dt><span class="sect2"><a href="#converting-internal-to-external">12.3.2. Converting an internal list into an external list</a></span></dt> | | 4540 | <dt><span class="sect2"><a href="#passing-variable-to-shell">12.3.2. Passing variables to a shell command</a></span></dt> |
4578 | <dt><span class="sect2"><a href="#passing-variable-to-shell">12.3.3. Passing variables to a shell command</a></span></dt> | | 4541 | <dt><span class="sect2"><a href="#quoting-guideline">12.3.3. Quoting guideline</a></span></dt> |
4579 | <dt><span class="sect2"><a href="#quoting-guideline">12.3.4. Quoting guideline</a></span></dt> | | | |
4580 | <dt><span class="sect2"><a href="#bsd-make-bug-workaround">12.3.5. Workaround for a bug in BSD Make</a></span></dt> | | | |
4581 | </dl></dd> | | 4542 | </dl></dd> |
4582 | </dl> | | 4543 | </dl> |
4583 | </div> | | 4544 | </div> |
4584 | <p>Pkgsrc consists of many <code class="filename">Makefile</code> fragments, | | 4545 | <p>Pkgsrc consists of many <code class="filename">Makefile</code> fragments, |
4585 | each of which forms a well-defined part of the pkgsrc system. Using | | 4546 | each of which forms a well-defined part of the pkgsrc system. Using |
4586 | the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> system as a programming language for a big system | | 4547 | the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> system as a programming language for a big system |
4587 | like pkgsrc requires some discipline to keep the code correct and | | 4548 | like pkgsrc requires some discipline to keep the code correct and |
4588 | understandable.</p> | | 4549 | understandable.</p> |
4589 | <p>The basic ingredients for <code class="filename">Makefile</code> | | 4550 | <p>The basic ingredients for <code class="filename">Makefile</code> |
4590 | programming are variables (which are actually macros) and shell | | 4551 | programming are variables (which are actually macros) and shell |
4591 | commands. Among these shell commands may even be more complex ones | | 4552 | commands. Among these shell commands may even be more complex ones |
4592 | like <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?awk+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">awk</span>(1)</span></a> programs. To make sure that every shell command runs | | 4553 | like <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?awk+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">awk</span>(1)</span></a> programs. To make sure that every shell command runs |
4593 | as intended it is necessary to quote all variables correctly when they | | 4554 | as intended it is necessary to quote all variables correctly when they |
| @@ -4636,44 +4597,34 @@ correct: | | | @@ -4636,44 +4597,34 @@ correct: |
4636 | ``:='', and ``!='', which are described in the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man | | 4597 | ``:='', and ``!='', which are described in the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man |
4637 | page.</p> | | 4598 | page.</p> |
4638 | <p>When a variable's value is parsed from a | | 4599 | <p>When a variable's value is parsed from a |
4639 | <code class="filename">Makefile</code>, the hash character ``#'' and the | | 4600 | <code class="filename">Makefile</code>, the hash character ``#'' and the |
4640 | backslash character ``\'' are handled specially. If a backslash is | | 4601 | backslash character ``\'' are handled specially. If a backslash is |
4641 | followed by a newline, any whitespace immediately in front of the | | 4602 | followed by a newline, any whitespace immediately in front of the |
4642 | backslash, the backslash, the newline, and any whitespace | | 4603 | backslash, the backslash, the newline, and any whitespace |
4643 | immediately behind the newline are replaced with a single space. A | | 4604 | immediately behind the newline are replaced with a single space. A |
4644 | backslash character and an immediately following hash character are | | 4605 | backslash character and an immediately following hash character are |
4645 | replaced with a single hash character. Otherwise, the backslash is | | 4606 | replaced with a single hash character. Otherwise, the backslash is |
4646 | passed as is. In a variable assignment, any hash character that is | | 4607 | passed as is. In a variable assignment, any hash character that is |
4647 | not preceded by a backslash starts a comment that continues upto the | | 4608 | not preceded by a backslash starts a comment that continues upto the |
4648 | end of the logical line.</p> | | 4609 | end of the logical line.</p> |
4649 | <p><span class="emphasis"><em>Note:</em></span> Because of this parsing algorithm | | 4610 | <p>The evaluation of variables either happens immediately or lazy. |
4650 | the only way to create a variable consisting of a single backslash | | 4611 | It happens immediately when the variable occurs |
4651 | is using the ``!='' operator, for example: <code class="varname">BACKSLASH!=echo "\\"</code>.</p> | | 4612 | on the right-hand side of the ``:='' or the ``!='' operator, in a |
4652 | <p>So far for defining variables. The other thing you can do with | | 4613 | <code class="varname">.if</code> condition or a <code class="varname">.for</code> loop. |
4653 | variables is evaluating them. A variable is evaluated when it is | | 4614 | In the other cases, it is evaluated lazily.</p> |
4654 | part of the right side of the ``:='' or the ``!='' operator, or | | | |
4655 | directly before executing a shell command which the variable is part | | | |
4656 | of. In all other cases, <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> performs lazy evaluation, that | | | |
4657 | is, variables are not evaluated until there's no other way. The | | | |
4658 | ``modifiers'' mentioned in the man page also evaluate the | | | |
4659 | variable.</p> | | | |
4660 | <p>Some of the modifiers split the string into words and then | | 4615 | <p>Some of the modifiers split the string into words and then |
4661 | operate on the words, others operate on the string as a whole. When | | 4616 | operate on the words, others operate on the string as a whole. When |
4662 | a string is split into words, it is split as you would expect | | 4617 | a string is split into words, it is split like in <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">sh</span>(1)</span></a>.</p> |
4663 | it from <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">sh</span>(1)</span></a>.</p> | | | |
4664 | <p>No rule without exception—the <span class="command"><strong>.for</strong></span> | | | |
4665 | loop does not follow the shell quoting rules but splits at sequences | | | |
4666 | of whitespace.</p> | | | |
4667 | <p>There are several types of variables that should be handled | | 4618 | <p>There are several types of variables that should be handled |
4668 | differently. Strings and two types of lists.</p> | | 4619 | differently. Strings and two types of lists.</p> |
4669 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 4620 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
4670 | <li class="listitem"><p><span class="emphasis"><em>Strings</em></span> can contain arbitrary | | 4621 | <li class="listitem"><p><span class="emphasis"><em>Strings</em></span> can contain arbitrary |
4671 | characters. Nevertheless, you should restrict yourself to only | | 4622 | characters. Nevertheless, you should restrict yourself to only |
4672 | using printable characters. Examples are | | 4623 | using printable characters. Examples are |
4673 | <code class="varname">PREFIX</code> and | | 4624 | <code class="varname">PREFIX</code> and |
4674 | <code class="varname">COMMENT</code>.</p></li> | | 4625 | <code class="varname">COMMENT</code>.</p></li> |
4675 | <li class="listitem"><p><span class="emphasis"><em>Internal lists</em></span> are lists that | | 4626 | <li class="listitem"><p><span class="emphasis"><em>Internal lists</em></span> are lists that |
4676 | are never exported to any shell command. Their elements are | | 4627 | are never exported to any shell command. Their elements are |
4677 | separated by whitespace. Therefore, the elements themselves cannot | | 4628 | separated by whitespace. Therefore, the elements themselves cannot |
4678 | have embedded whitespace. Any other characters are allowed. | | 4629 | have embedded whitespace. Any other characters are allowed. |
4679 | Internal lists can be used in <span class="command"><strong>.for</strong></span> loops. | | 4630 | Internal lists can be used in <span class="command"><strong>.for</strong></span> loops. |
| @@ -4722,86 +4673,52 @@ ANOTHER_EXT_LIST= a=b c=d | | | @@ -4722,86 +4673,52 @@ ANOTHER_EXT_LIST= a=b c=d |
4722 | INT_LIST+= ${STRING} # 1 | | 4673 | INT_LIST+= ${STRING} # 1 |
4723 | INT_LIST+= ${ANOTHER_INT_LIST} # 2 | | 4674 | INT_LIST+= ${ANOTHER_INT_LIST} # 2 |
4724 | EXT_LIST+= ${STRING:Q} # 3 | | 4675 | EXT_LIST+= ${STRING:Q} # 3 |
4725 | EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 | | 4676 | EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 |
4726 | </pre> | | 4677 | </pre> |
4727 | <p>When you add a string to an external list (example 3), it | | 4678 | <p>When you add a string to an external list (example 3), it |
4728 | must be quoted. In all other cases, you must not add a quoting | | 4679 | must be quoted. In all other cases, you must not add a quoting |
4729 | level. You must not merge internal and external lists, unless you | | 4680 | level. You must not merge internal and external lists, unless you |
4730 | are sure that all entries are correctly interpreted in both | | 4681 | are sure that all entries are correctly interpreted in both |
4731 | lists.</p> | | 4682 | lists.</p> |
4732 | </div> | | 4683 | </div> |
4733 | <div class="sect2"> | | 4684 | <div class="sect2"> |
4734 | <div class="titlepage"><div><div><h3 class="title"> | | 4685 | <div class="titlepage"><div><div><h3 class="title"> |
4735 | <a name="converting-internal-to-external"></a>12.3.2. Converting an internal list into an external list</h3></div></div></div> | | 4686 | <a name="passing-variable-to-shell"></a>12.3.2. Passing variables to a shell command</h3></div></div></div> |
4736 | <pre class="programlisting"> | | | |
4737 | EXT_LIST= # empty | | | |
4738 | .for i in ${INT_LIST} | | | |
4739 | EXT_LIST+= ${i:Q}"" | | | |
4740 | .endfor | | | |
4741 | </pre> | | | |
4742 | <p>This code converts the internal list | | | |
4743 | <code class="varname">INT_LIST</code> into the external list | | | |
4744 | <code class="varname">EXT_LIST</code>. As the elements of an internal list | | | |
4745 | are unquoted they must be quoted here. The reason for appending | | | |
4746 | <code class="varname">""</code> is explained below.</p> | | | |
4747 | </div> | | | |
4748 | <div class="sect2"> | | | |
4749 | <div class="titlepage"><div><div><h3 class="title"> | | | |
4750 | <a name="passing-variable-to-shell"></a>12.3.3. Passing variables to a shell command</h3></div></div></div> | | | |
4751 | <p>Sometimes you may want to print an arbitrary string. There | | 4687 | <p>Sometimes you may want to print an arbitrary string. There |
4752 | are many ways to get it wrong and only few that can handle every | | 4688 | are many ways to get it wrong and only few that can handle every |
4753 | nastiness.</p> | | 4689 | nastiness.</p> |
4754 | <pre class="programlisting"> | | 4690 | <pre class="programlisting"> |
4755 | STRING= foo bar < > * `date` $$HOME ' " | | 4691 | STRING= foo bar < > * `date` $$HOME ' " |
4756 | EXT_LIST= string=${STRING:Q} x=second\ item | | 4692 | EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words |
4757 | | | 4693 | |
4758 | all: | | 4694 | all: |
4759 | echo ${STRING} # 1 | | 4695 | echo ${STRING} # 1 |
4760 | echo "${STRING}" # 2 | | 4696 | echo ${STRING:Q} # 2 |
4761 | echo "${STRING:Q}" # 3 | | 4697 | printf '%s\n' ${STRING:Q}'' # 3 |
4762 | echo ${STRING:Q} # 4 | | 4698 | env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4 |
4763 | echo x${STRING:Q} | sed 1s,.,, # 5 | | | |
4764 | printf "%s\\n" ${STRING:Q}"" # 6 | | | |
4765 | env ${EXT_LIST} /bin/sh -c 'echo "$$string"; echo "$$x"' | | | |
4766 | </pre> | | 4699 | </pre> |
4767 | <p>Example 1 leads to a syntax error in the shell, as the | | 4700 | <p>Example 1 leads to a syntax error in the shell, as the |
4768 | characters are just copied.</p> | | 4701 | characters are just copied.</p> |
4769 | <p>Example 2 leads to a syntax error too, and if you leave out | | 4702 | <p>Example 2 can handle all strings, except those starting |
4770 | the last " character from <code class="varname">${STRING}</code>, | | 4703 | with a dash or those containing backslashes.</p> |
4771 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?date+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">date</span>(1)</span></a> will be executed. The <code class="varname">$HOME</code> shell | | 4704 | <p>Example 3 can handle arbitrary strings.</p> |
4772 | variable would be evaluated, too.</p> | | 4705 | <p>In example 4, the <code class="varname">EXT_LIST</code> does not |
4773 | <p>Example 3 outputs each space character preceded by a | | 4706 | need to be quoted because the quoting has already been done |
4774 | backslash (or not), depending on the implementation of the | | 4707 | when adding elements to the list.</p> |
4775 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">echo</span>(1)</span></a> command.</p> | | | |
4776 | <p>Example 4 handles correctly every string that does not start | | | |
4777 | with a dash. In that case, the result depends on the | | | |
4778 | implementation of the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">echo</span>(1)</span></a> command. As long as you can | | | |
4779 | guarantee that your input does not start with a dash, this form is | | | |
4780 | appropriate.</p> | | | |
4781 | <p>Example 5 handles even the case of a leading dash | | | |
4782 | correctly.</p> | | | |
4783 | <p>Example 6 also works with every string and is the | | | |
4784 | light-weight solution, since it does not involve a pipe, which has | | | |
4785 | its own problems.</p> | | | |
4786 | <p>The <code class="varname">EXT_LIST</code> does not need to be quoted | | | |
4787 | because the quoting has already been done when adding elements to | | | |
4788 | the list.</p> | | | |
4789 | <p>As internal lists shall not be passed to the shell, there is | | | |
4790 | no example for it.</p> | | | |
4791 | </div> | | 4708 | </div> |
4792 | <div class="sect2"> | | 4709 | <div class="sect2"> |
4793 | <div class="titlepage"><div><div><h3 class="title"> | | 4710 | <div class="titlepage"><div><div><h3 class="title"> |
4794 | <a name="quoting-guideline"></a>12.3.4. Quoting guideline</h3></div></div></div> | | 4711 | <a name="quoting-guideline"></a>12.3.3. Quoting guideline</h3></div></div></div> |
4795 | <p>There are many possible sources of wrongly quoted variables. | | 4712 | <p>There are many possible sources of wrongly quoted variables. |
4796 | This section lists some of the commonly known ones.</p> | | 4713 | This section lists some of the commonly known ones.</p> |
4797 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 4714 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
4798 | <li class="listitem"> | | 4715 | <li class="listitem"> |
4799 | <p>Whenever you use the value of a list, think | | 4716 | <p>Whenever you use the value of a list, think |
4800 | about what happens to leading or trailing whitespace. If the | | 4717 | about what happens to leading or trailing whitespace. If the |
4801 | list is a well-formed shell expression, you can apply the | | 4718 | list is a well-formed shell expression, you can apply the |
4802 | <code class="varname">:M*</code> modifier to strip leading and trailing | | 4719 | <code class="varname">:M*</code> modifier to strip leading and trailing |
4803 | whitespace from each word. The <code class="varname">:M</code> operator | | 4720 | whitespace from each word. The <code class="varname">:M</code> operator |
4804 | first splits its argument according to the rules of the shell, | | 4721 | first splits its argument according to the rules of the shell, |
4805 | and then creates a new list consisting of all words that match | | 4722 | and then creates a new list consisting of all words that match |
4806 | the shell glob expression <code class="varname">*</code>, that is: all. | | 4723 | the shell glob expression <code class="varname">*</code>, that is: all. |
4807 | One class of situations where this is needed is when adding a | | 4724 | One class of situations where this is needed is when adding a |
| @@ -4862,40 +4779,26 @@ for_test: | | | @@ -4862,40 +4779,26 @@ for_test: |
4862 | <code class="varname">${EMPTY:Q}""</code>. This pattern can be often found | | 4779 | <code class="varname">${EMPTY:Q}""</code>. This pattern can be often found |
4863 | as <code class="varname">${TEST} -z ${VAR:Q}</code> or as <code class="varname">${TEST} | | 4780 | as <code class="varname">${TEST} -z ${VAR:Q}</code> or as <code class="varname">${TEST} |
4864 | -f ${FNAME:Q}</code> (both of these are wrong).</p> | | 4781 | -f ${FNAME:Q}</code> (both of these are wrong).</p> |
4865 | <p>The second example will only print three lines instead of | | 4782 | <p>The second example will only print three lines instead of |
4866 | four. The first line looks like <code class="varname">a:\ echo foo</code>. | | 4783 | four. The first line looks like <code class="varname">a:\ echo foo</code>. |
4867 | This is because the backslash of the value | | 4784 | This is because the backslash of the value |
4868 | <code class="varname">a:\</code> is interpreted as a line-continuation by | | 4785 | <code class="varname">a:\</code> is interpreted as a line-continuation by |
4869 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>, which makes the second line the arguments of the | | 4786 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>, which makes the second line the arguments of the |
4870 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">echo</span>(1)</span></a> command from the first line. To avoid this, write | | 4787 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">echo</span>(1)</span></a> command from the first line. To avoid this, write |
4871 | <code class="varname">${i:Q}""</code>.</p> | | 4788 | <code class="varname">${i:Q}""</code>.</p> |
4872 | </li> | | 4789 | </li> |
4873 | </ul></div> | | 4790 | </ul></div> |
4874 | </div> | | 4791 | </div> |
4875 | <div class="sect2"> | | | |
4876 | <div class="titlepage"><div><div><h3 class="title"> | | | |
4877 | <a name="bsd-make-bug-workaround"></a>12.3.5. Workaround for a bug in BSD Make</h3></div></div></div> | | | |
4878 | <p>The pkgsrc bmake program does not handle the following | | | |
4879 | assignment correctly. In case <code class="varname">_othervar_</code> | | | |
4880 | contains a ``-'' character, one of the closing braces is included | | | |
4881 | in <code class="varname">${VAR}</code> after this code executes.</p> | | | |
4882 | <pre class="programlisting"> | | | |
4883 | VAR:= ${VAR:N${_othervar_:C/-//}} | | | |
4884 | </pre> | | | |
4885 | <p>For a more complex code snippet and a workaround, see the | | | |
4886 | package <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/regress/make-quoting/README.html" target="_top"><code class="filename">regress/make-quoting</code></a>, testcase | | | |
4887 | <code class="varname">bug1</code>.</p> | | | |
4888 | </div> | | | |
4889 | </div> | | 4792 | </div> |
4890 | </div> | | 4793 | </div> |
4891 | <div class="chapter"> | | 4794 | <div class="chapter"> |
4892 | <div class="titlepage"><div><div><h2 class="title"> | | 4795 | <div class="titlepage"><div><div><h2 class="title"> |
4893 | <a name="plist"></a>Chapter 13. PLIST issues</h2></div></div></div> | | 4796 | <a name="plist"></a>Chapter 13. PLIST issues</h2></div></div></div> |
4894 | <div class="toc"> | | 4797 | <div class="toc"> |
4895 | <p><b>Table of Contents</b></p> | | 4798 | <p><b>Table of Contents</b></p> |
4896 | <dl class="toc"> | | 4799 | <dl class="toc"> |
4897 | <dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> | | 4800 | <dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> |
4898 | <dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> | | 4801 | <dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> |
4899 | <dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> | | 4802 | <dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> |
4900 | <dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> | | 4803 | <dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> |
4901 | <dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> | | 4804 | <dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> |
| @@ -6306,27 +6209,27 @@ details. | | | @@ -6306,27 +6209,27 @@ details. |
6306 | <div class="sect1"> | | 6209 | <div class="sect1"> |
6307 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 6210 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
6308 | <a name="build.prefix"></a>17.2. Program location</h2></div></div></div> | | 6211 | <a name="build.prefix"></a>17.2. Program location</h2></div></div></div> |
6309 | <p>Before outlining the process performed by the NetBSD package system in | | 6212 | <p>Before outlining the process performed by the NetBSD package system in |
6310 | the next section, here's a brief discussion on where programs are | | 6213 | the next section, here's a brief discussion on where programs are |
6311 | installed, and which variables influence this.</p> | | 6214 | installed, and which variables influence this.</p> |
6312 | <p>The automatic variable <code class="varname">PREFIX</code> indicates | | 6215 | <p>The automatic variable <code class="varname">PREFIX</code> indicates |
6313 | where all files of the final program shall be installed. It is | | 6216 | where all files of the final program shall be installed. It is |
6314 | usually set to <code class="varname">LOCALBASE</code> | | 6217 | usually set to <code class="varname">LOCALBASE</code> |
6315 | (<code class="filename">/usr/pkg</code>), or <code class="varname">CROSSBASE</code> | | 6218 | (<code class="filename">/usr/pkg</code>), or <code class="varname">CROSSBASE</code> |
6316 | for pkgs in the <code class="filename">cross</code> category. The value of | | 6219 | for pkgs in the <code class="filename">cross</code> category. The value of |
6317 | <code class="varname">PREFIX</code> needs to be put | | 6220 | <code class="varname">PREFIX</code> needs to be put |
6318 | into the various places in the program's source where paths to | | 6221 | into the various places in the program's source where paths to |
6319 | these files are encoded. See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “patches/*”</a> and <a class="xref" href="#fixes.libtool" title="19.3.1. Shared libraries - libtool">Section 19.3.1, “Shared libraries - libtool”</a> for more details.</p> | | 6222 | these files are encoded. See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “<code class="filename">patches/*</code>”</a> and <a class="xref" href="#fixes.libtool" title="19.3.1. Shared libraries - libtool">Section 19.3.1, “Shared libraries - libtool”</a> for more details.</p> |
6320 | <p>When choosing which of these variables to use, | | 6223 | <p>When choosing which of these variables to use, |
6321 | follow the following rules:</p> | | 6224 | follow the following rules:</p> |
6322 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 6225 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
6323 | <li class="listitem"><p><code class="varname">PREFIX</code> always points to the location | | 6226 | <li class="listitem"><p><code class="varname">PREFIX</code> always points to the location |
6324 | where the current pkg will be installed. When referring to a | | 6227 | where the current pkg will be installed. When referring to a |
6325 | pkg's own installation path, use | | 6228 | pkg's own installation path, use |
6326 | <span class="quote">“<span class="quote">${PREFIX}</span>”</span>.</p></li> | | 6229 | <span class="quote">“<span class="quote">${PREFIX}</span>”</span>.</p></li> |
6327 | <li class="listitem"><p><code class="varname">LOCALBASE</code> is where all non-X11 pkgs | | 6230 | <li class="listitem"><p><code class="varname">LOCALBASE</code> is where all non-X11 pkgs |
6328 | are installed. If you need to construct a -I or -L argument | | 6231 | are installed. If you need to construct a -I or -L argument |
6329 | to the compiler to find includes and libraries installed by | | 6232 | to the compiler to find includes and libraries installed by |
6330 | another non-X11 pkg, use <span class="quote">“<span class="quote">${LOCALBASE}</span>”</span>. The name | | 6233 | another non-X11 pkg, use <span class="quote">“<span class="quote">${LOCALBASE}</span>”</span>. The name |
6331 | <code class="varname">LOCALBASE</code> stems from FreeBSD, which | | 6234 | <code class="varname">LOCALBASE</code> stems from FreeBSD, which |
6332 | installed all packages in <code class="filename">/usr/local</code>. As | | 6235 | installed all packages in <code class="filename">/usr/local</code>. As |
| @@ -6640,27 +6543,27 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site | | | @@ -6640,27 +6543,27 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site |
6640 | <div class="sect1"> | | 6543 | <div class="sect1"> |
6641 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 6544 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
6642 | <a name="build.patch"></a>17.8. The <span class="emphasis"><em>patch</em></span> phase</h2></div></div></div> | | 6545 | <a name="build.patch"></a>17.8. The <span class="emphasis"><em>patch</em></span> phase</h2></div></div></div> |
6643 | <p>After extraction, all the patches named by the | | 6546 | <p>After extraction, all the patches named by the |
6644 | <code class="varname">PATCHFILES</code>, those present in the patches | | 6547 | <code class="varname">PATCHFILES</code>, those present in the patches |
6645 | subdirectory of the package as well as in | | 6548 | subdirectory of the package as well as in |
6646 | $LOCALPATCHES/$PKGPATH (e.g. | | 6549 | $LOCALPATCHES/$PKGPATH (e.g. |
6647 | <code class="filename">/usr/local/patches/graphics/png</code>) are | | 6550 | <code class="filename">/usr/local/patches/graphics/png</code>) are |
6648 | applied. Patchfiles ending in <code class="filename">.Z</code> or | | 6551 | applied. Patchfiles ending in <code class="filename">.Z</code> or |
6649 | <code class="filename">.gz</code> are uncompressed before they are | | 6552 | <code class="filename">.gz</code> are uncompressed before they are |
6650 | applied, files ending in <code class="filename">.orig</code> or | | 6553 | applied, files ending in <code class="filename">.orig</code> or |
6651 | <code class="filename">.rej</code> are ignored. Any special options to | | 6554 | <code class="filename">.rej</code> are ignored. Any special options to |
6652 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">patch</span>(1)</span></a> can be handed in | | 6555 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">patch</span>(1)</span></a> can be handed in |
6653 | <code class="varname">PATCH_DIST_ARGS</code>. See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “patches/*”</a> for more details.</p> | | 6556 | <code class="varname">PATCH_DIST_ARGS</code>. See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “<code class="filename">patches/*</code>”</a> for more details.</p> |
6654 | <p>By default <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">patch</span>(1)</span></a> is given special args to make | | 6557 | <p>By default <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">patch</span>(1)</span></a> is given special args to make |
6655 | it fail if the patches apply with some lines of fuzz. Please | | 6558 | it fail if the patches apply with some lines of fuzz. Please |
6656 | fix (regen) the patches so that they apply cleanly. The | | 6559 | fix (regen) the patches so that they apply cleanly. The |
6657 | rationale behind this is that patches that don't apply cleanly | | 6560 | rationale behind this is that patches that don't apply cleanly |
6658 | may end up being applied in the wrong place, and cause severe | | 6561 | may end up being applied in the wrong place, and cause severe |
6659 | harm there.</p> | | 6562 | harm there.</p> |
6660 | </div> | | 6563 | </div> |
6661 | <div class="sect1"> | | 6564 | <div class="sect1"> |
6662 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 6565 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
6663 | <a name="build.tools"></a>17.9. The <span class="emphasis"><em>tools</em></span> phase</h2></div></div></div> | | 6566 | <a name="build.tools"></a>17.9. The <span class="emphasis"><em>tools</em></span> phase</h2></div></div></div> |
6664 | <p>This is covered in <a class="xref" href="#tools" title="Chapter 18. Tools needed for building or running">Chapter 18, <i>Tools needed for building or running</i></a>. | | 6567 | <p>This is covered in <a class="xref" href="#tools" title="Chapter 18. Tools needed for building or running">Chapter 18, <i>Tools needed for building or running</i></a>. |
6665 | </p> | | 6568 | </p> |
6666 | </div> | | 6569 | </div> |
| @@ -7357,67 +7260,67 @@ the name of the common tools. For exampl | | | @@ -7357,67 +7260,67 @@ the name of the common tools. For exampl |
7357 | .if exists(/usr/bin/bzcat) | | 7260 | .if exists(/usr/bin/bzcat) |
7358 | TOOLS_PLATFORM.bzcat?= /usr/bin/bzcat | | 7261 | TOOLS_PLATFORM.bzcat?= /usr/bin/bzcat |
7359 | .elif exists(/usr/bin/bzip2) | | 7262 | .elif exists(/usr/bin/bzip2) |
7360 | TOOLS_PLATFORM.bzcat?= /usr/bin/bzip2 -cd | | 7263 | TOOLS_PLATFORM.bzcat?= /usr/bin/bzip2 -cd |
7361 | .endif | | 7264 | .endif |
7362 | | | 7265 | |
7363 | TOOLS_PLATFORM.true?= true # shell builtin | | 7266 | TOOLS_PLATFORM.true?= true # shell builtin |
7364 | </pre> | | 7267 | </pre> |
7365 | </div> | | 7268 | </div> |
7366 | <div class="sect1"> | | 7269 | <div class="sect1"> |
7367 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 7270 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
7368 | <a name="tools.questions"></a>18.4. Questions regarding the tools</h2></div></div></div> | | 7271 | <a name="tools.questions"></a>18.4. Questions regarding the tools</h2></div></div></div> |
7369 | <div class="qandaset"> | | 7272 | <div class="qandaset"> |
7370 | <a name="idm83805728"></a><dl> | | 7273 | <a name="idm83808672"></a><dl> |
7371 | <dt>18.4.1. <a href="#tools.new">How do I add a new tool?</a> | | 7274 | <dt>18.4.1. <a href="#tools.new">How do I add a new tool?</a> |
7372 | </dt> | | 7275 | </dt> |
7373 | <dt>18.4.2. <a href="#tools.listall">How do I get a list of all available | | 7276 | <dt>18.4.2. <a href="#tools.listall">How do I get a list of all available |
7374 | tools?</a> | | 7277 | tools?</a> |
7375 | </dt> | | 7278 | </dt> |
7376 | <dt>18.4.3. <a href="#tools.used">How can I get a list of all the tools that a | | 7279 | <dt>18.4.3. <a href="#tools.used">How can I get a list of all the tools that a |
7377 | package is using while being built? I want to know whether it | | 7280 | package is using while being built? I want to know whether it |
7378 | uses sed or not.</a> | | 7281 | uses sed or not.</a> |
7379 | </dt> | | 7282 | </dt> |
7380 | </dl> | | 7283 | </dl> |
7381 | <table border="0" style="width: 100%;"> | | 7284 | <table border="0" style="width: 100%;"> |
7382 | <colgroup> | | 7285 | <colgroup> |
7383 | <col align="left" width="1%"> | | 7286 | <col align="left" width="1%"> |
7384 | <col> | | 7287 | <col> |
7385 | </colgroup> | | 7288 | </colgroup> |
7386 | <tbody> | | 7289 | <tbody> |
7387 | <tr class="question"> | | 7290 | <tr class="question"> |
7388 | <td align="left" valign="top"> | | 7291 | <td align="left" valign="top"> |
7389 | <a name="tools.new"></a><a name="idm83805344"></a><p><b>18.4.1.</b></p> | | 7292 | <a name="tools.new"></a><a name="idm83808288"></a><p><b>18.4.1.</b></p> |
7390 | </td> | | 7293 | </td> |
7391 | <td align="left" valign="top"><p>How do I add a new tool?</p></td> | | 7294 | <td align="left" valign="top"><p>How do I add a new tool?</p></td> |
7392 | </tr> | | 7295 | </tr> |
7393 | <tr class="answer"> | | 7296 | <tr class="answer"> |
7394 | <td align="left" valign="top"></td> | | 7297 | <td align="left" valign="top"></td> |
7395 | <td align="left" valign="top"><p>TODO</p></td> | | 7298 | <td align="left" valign="top"><p>TODO</p></td> |
7396 | </tr> | | 7299 | </tr> |
7397 | <tr class="question"> | | 7300 | <tr class="question"> |
7398 | <td align="left" valign="top"> | | 7301 | <td align="left" valign="top"> |
7399 | <a name="tools.listall"></a><a name="idm83804320"></a><p><b>18.4.2.</b></p> | | 7302 | <a name="tools.listall"></a><a name="idm83807264"></a><p><b>18.4.2.</b></p> |
7400 | </td> | | 7303 | </td> |
7401 | <td align="left" valign="top"><p>How do I get a list of all available | | 7304 | <td align="left" valign="top"><p>How do I get a list of all available |
7402 | tools?</p></td> | | 7305 | tools?</p></td> |
7403 | </tr> | | 7306 | </tr> |
7404 | <tr class="answer"> | | 7307 | <tr class="answer"> |
7405 | <td align="left" valign="top"></td> | | 7308 | <td align="left" valign="top"></td> |
7406 | <td align="left" valign="top"><p>TODO</p></td> | | 7309 | <td align="left" valign="top"><p>TODO</p></td> |
7407 | </tr> | | 7310 | </tr> |
7408 | <tr class="question"> | | 7311 | <tr class="question"> |
7409 | <td align="left" valign="top"> | | 7312 | <td align="left" valign="top"> |
7410 | <a name="tools.used"></a><a name="idm83803296"></a><p><b>18.4.3.</b></p> | | 7313 | <a name="tools.used"></a><a name="idm83806240"></a><p><b>18.4.3.</b></p> |
7411 | </td> | | 7314 | </td> |
7412 | <td align="left" valign="top"><p>How can I get a list of all the tools that a | | 7315 | <td align="left" valign="top"><p>How can I get a list of all the tools that a |
7413 | package is using while being built? I want to know whether it | | 7316 | package is using while being built? I want to know whether it |
7414 | uses sed or not.</p></td> | | 7317 | uses sed or not.</p></td> |
7415 | </tr> | | 7318 | </tr> |
7416 | <tr class="answer"> | | 7319 | <tr class="answer"> |
7417 | <td align="left" valign="top"></td> | | 7320 | <td align="left" valign="top"></td> |
7418 | <td align="left" valign="top"><p>Currently, you can't. (TODO: But I want to be able | | 7321 | <td align="left" valign="top"><p>Currently, you can't. (TODO: But I want to be able |
7419 | to do it.)</p></td> | | 7322 | to do it.)</p></td> |
7420 | </tr> | | 7323 | </tr> |
7421 | </tbody> | | 7324 | </tbody> |
7422 | </table> | | 7325 | </table> |
7423 | </div> | | 7326 | </div> |
| @@ -7508,34 +7411,35 @@ TOOLS_PLATFORM.true?= true | | | @@ -7508,34 +7411,35 @@ TOOLS_PLATFORM.true?= true |
7508 | <div class="sect2"> | | 7411 | <div class="sect2"> |
7509 | <div class="titlepage"><div><div><h3 class="title"> | | 7412 | <div class="titlepage"><div><div><h3 class="title"> |
7510 | <a name="pulling-vars-from-etc-mk.conf"></a>19.1.1. How to pull in user-settable variables from <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> | | 7413 | <a name="pulling-vars-from-etc-mk.conf"></a>19.1.1. How to pull in user-settable variables from <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> |
7511 | </h3></div></div></div> | | 7414 | </h3></div></div></div> |
7512 | <p>The pkgsrc user can configure pkgsrc by overriding several | | 7415 | <p>The pkgsrc user can configure pkgsrc by overriding several |
7513 | variables in the file pointed to by <code class="varname">MAKECONF</code>, | | 7416 | variables in the file pointed to by <code class="varname">MAKECONF</code>, |
7514 | which is <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> by default. When you | | 7417 | which is <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> by default. When you |
7515 | want to use those variables in the preprocessor directives of | | 7418 | want to use those variables in the preprocessor directives of |
7516 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> (for example <code class="literal">.if</code> or | | 7419 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> (for example <code class="literal">.if</code> or |
7517 | <code class="literal">.for</code>), you need to include the file | | 7420 | <code class="literal">.for</code>), you need to include the file |
7518 | <code class="filename">../../mk/bsd.prefs.mk</code> before, which in turn | | 7421 | <code class="filename">../../mk/bsd.prefs.mk</code> before, which in turn |
7519 | loads the user preferences.</p> | | 7422 | loads the user preferences.</p> |
7520 | <p>But note that some variables may not be completely defined | | 7423 | <p>But note that some variables may not be completely defined |
7521 | after <code class="filename">../../mk/bsd.prefs.mk</code> has been included, | | 7424 | after <code class="filename">../../mk/bsd.prefs.mk</code> has been |
7522 | as they may contain references to variables that are not yet | | 7425 | included, as they may contain references to variables that are |
7523 | defined. In shell commands (the lines in | | 7426 | not yet defined. In shell commands (the lines in |
7524 | <code class="filename">Makefile</code> that are indented with a tab) this is | | 7427 | <code class="filename">Makefile</code> that are indented with a tab) this |
7525 | no problem, since variables are only expanded when they are used. | | 7428 | is no problem, since variables are only expanded when they are |
7526 | But in the preprocessor directives mentioned above and in dependency | | 7429 | used. But in the preprocessor directives mentioned above and in |
7527 | lines (of the form <code class="literal">target: dependencies</code>) the | | 7430 | dependency lines (of the form <code class="literal">target: |
7528 | variables are expanded at load time.</p> | | 7431 | dependencies</code>) the variables are expanded at load |
| | | 7432 | time.</p> |
7529 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 7433 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
7530 | <h3 class="title">Note</h3> | | 7434 | <h3 class="title">Note</h3> |
7531 | <p>To check whether a variable can be used at load time, | | 7435 | <p>To check whether a variable can be used at load time, |
7532 | run <span class="command"><strong>pkglint -Wall</strong></span> on your package.</p> | | 7436 | run <span class="command"><strong>pkglint -Wall</strong></span> on your package.</p> |
7533 | </div> | | 7437 | </div> |
7534 | </div> | | 7438 | </div> |
7535 | <div class="sect2"> | | 7439 | <div class="sect2"> |
7536 | <div class="titlepage"><div><div><h3 class="title"> | | 7440 | <div class="titlepage"><div><div><h3 class="title"> |
7537 | <a name="user-interaction"></a>19.1.2. User interaction</h3></div></div></div> | | 7441 | <a name="user-interaction"></a>19.1.2. User interaction</h3></div></div></div> |
7538 | <p>Occasionally, packages require interaction from the user, | | 7442 | <p>Occasionally, packages require interaction from the user, |
7539 | and this can be in a number of ways:</p> | | 7443 | and this can be in a number of ways:</p> |
7540 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 7444 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
7541 | <li class="listitem"><p>When fetching the distfiles, some packages require user | | 7445 | <li class="listitem"><p>When fetching the distfiles, some packages require user |
| @@ -7557,28 +7461,32 @@ INTERACTIVE_STAGE= configure instal | | | @@ -7557,28 +7461,32 @@ INTERACTIVE_STAGE= configure instal |
7557 | <code class="varname">BATCH</code> variable. Packages that require interaction | | 7461 | <code class="varname">BATCH</code> variable. Packages that require interaction |
7558 | are also excluded from bulk builds.</p> | | 7462 | are also excluded from bulk builds.</p> |
7559 | </div> | | 7463 | </div> |
7560 | <div class="sect2"> | | 7464 | <div class="sect2"> |
7561 | <div class="titlepage"><div><div><h3 class="title"> | | 7465 | <div class="titlepage"><div><div><h3 class="title"> |
7562 | <a name="handling-licenses"></a>19.1.3. Handling licenses</h3></div></div></div> | | 7466 | <a name="handling-licenses"></a>19.1.3. Handling licenses</h3></div></div></div> |
7563 | <p>Authors of software can choose the licence under which | | 7467 | <p>Authors of software can choose the licence under which |
7564 | software can be copied. This is due to copyright law, and reasons | | 7468 | software can be copied. This is due to copyright law, and reasons |
7565 | for license choices are outside the scope of pkgsrc. The pkgsrc | | 7469 | for license choices are outside the scope of pkgsrc. The pkgsrc |
7566 | system recognizes that there are a number of licenses which some | | 7470 | system recognizes that there are a number of licenses which some |
7567 | users may find objectionable or difficult or impossible to comply | | 7471 | users may find objectionable or difficult or impossible to comply |
7568 | with. The Free Software Foundation has declared some licenses | | 7472 | with. The Free Software Foundation has declared some licenses |
7569 | "Free", and the Open Source Initiative has a definition of "Open | | 7473 | "Free", and the Open Source Initiative has a definition of "Open |
7570 | Source". Note that a package whose license forbids to copy does | | 7474 | Source". The pkgsrc system, as a policy choice, does not label |
7571 | not meet either the Free or Open Source test.</p> | | 7475 | packages which have licenses that are Free or Open Source. |
| | | 7476 | However, packages without a license meeting either of those tests |
| | | 7477 | are labeled with a license tag denoting the license. Note that a |
| | | 7478 | package with no license to copy trivially does not meet either the |
| | | 7479 | Free or Open Source test.</p> |
7572 | <p>For packages which are not Free or Open Source, pkgsrc will | | 7480 | <p>For packages which are not Free or Open Source, pkgsrc will |
7573 | not build the package unless the user has indicated to pkgsrc that | | 7481 | not build the package unless the user has indicated to pkgsrc that |
7574 | packages with that particular license may be built. Note that | | 7482 | packages with that particular license may be built. Note that |
7575 | this documentation avoids the term "accepted the license". The | | 7483 | this documentation avoids the term "accepted the license". The |
7576 | pkgsrc system is merely providing a mechanism to avoid | | 7484 | pkgsrc system is merely providing a mechanism to avoid |
7577 | accidentally building a package with a non-free license; | | 7485 | accidentally building a package with a non-free license; |
7578 | judgement and responsibility remain with the user. (Installation | | 7486 | judgement and responsibility remain with the user. (Installation |
7579 | of binary packages are not currently subject to this mechanism; | | 7487 | of binary packages are not currently subject to this mechanism; |
7580 | this is a bug.)</p> | | 7488 | this is a bug.)</p> |
7581 | <p>One might want to only install packages with a BSD license, | | 7489 | <p>One might want to only install packages with a BSD license, |
7582 | or the GPL, and not the other. The free licenses are added to the | | 7490 | or the GPL, and not the other. The free licenses are added to the |
7583 | default <code class="varname">ACCEPTABLE_LICENSES</code> variable. The | | 7491 | default <code class="varname">ACCEPTABLE_LICENSES</code> variable. The |
7584 | user can override the default by setting the | | 7492 | user can override the default by setting the |
| @@ -9544,27 +9452,27 @@ place. | | | @@ -9544,27 +9452,27 @@ place. |
9544 | </li> | | 9452 | </li> |
9545 | </ol></div> | | 9453 | </ol></div> |
9546 | </div> | | 9454 | </div> |
9547 | </div> | | 9455 | </div> |
9548 | <div class="chapter"> | | 9456 | <div class="chapter"> |
9549 | <div class="titlepage"><div><div><h2 class="title"> | | 9457 | <div class="titlepage"><div><div><h2 class="title"> |
9550 | <a name="devfaq"></a>Chapter 22. Frequently Asked Questions</h2></div></div></div> | | 9458 | <a name="devfaq"></a>Chapter 22. Frequently Asked Questions</h2></div></div></div> |
9551 | <p>This section contains the answers to questions that may | | 9459 | <p>This section contains the answers to questions that may |
9552 | arise when you are writing a package. If you don't find your | | 9460 | arise when you are writing a package. If you don't find your |
9553 | question answered here, first have a look in the other chapters, | | 9461 | question answered here, first have a look in the other chapters, |
9554 | and if you still don't have the answer, ask on the | | 9462 | and if you still don't have the answer, ask on the |
9555 | <code class="literal">pkgsrc-users</code> mailing list.</p> | | 9463 | <code class="literal">pkgsrc-users</code> mailing list.</p> |
9556 | <div class="qandaset"> | | 9464 | <div class="qandaset"> |
9557 | <a name="idm83229600"></a><dl> | | 9465 | <a name="idm83207968"></a><dl> |
9558 | <dt>22.1. <a href="#devfaq.makeflags">What is the difference between | | 9466 | <dt>22.1. <a href="#devfaq.makeflags">What is the difference between |
9559 | MAKEFLAGS, .MAKEFLAGS and | | 9467 | MAKEFLAGS, .MAKEFLAGS and |
9560 | MAKE_FLAGS?</a> | | 9468 | MAKE_FLAGS?</a> |
9561 | </dt> | | 9469 | </dt> |
9562 | <dt>22.2. <a href="#devfaq.make">What is the difference between | | 9470 | <dt>22.2. <a href="#devfaq.make">What is the difference between |
9563 | MAKE, GMAKE and | | 9471 | MAKE, GMAKE and |
9564 | MAKE_PROGRAM?</a> | | 9472 | MAKE_PROGRAM?</a> |
9565 | </dt> | | 9473 | </dt> |
9566 | <dt>22.3. <a href="#devfaq.cc">What is the difference between | | 9474 | <dt>22.3. <a href="#devfaq.cc">What is the difference between |
9567 | CC, PKG_CC and | | 9475 | CC, PKG_CC and |
9568 | PKGSRC_COMPILER?</a> | | 9476 | PKGSRC_COMPILER?</a> |
9569 | </dt> | | 9477 | </dt> |
9570 | <dt>22.4. <a href="#devfaq.bl3flags">What is the difference between | | 9478 | <dt>22.4. <a href="#devfaq.bl3flags">What is the difference between |
| @@ -9589,157 +9497,157 @@ place. | | | @@ -9589,157 +9497,157 @@ place. |
9589 | </dt> | | 9497 | </dt> |
9590 | <dt>22.9. <a href="#devfaq.too-much-time">I have a little time to kill. What shall I | | 9498 | <dt>22.9. <a href="#devfaq.too-much-time">I have a little time to kill. What shall I |
9591 | do?</a> | | 9499 | do?</a> |
9592 | </dt> | | 9500 | </dt> |
9593 | </dl> | | 9501 | </dl> |
9594 | <table border="0" style="width: 100%;"> | | 9502 | <table border="0" style="width: 100%;"> |
9595 | <colgroup> | | 9503 | <colgroup> |
9596 | <col align="left" width="1%"> | | 9504 | <col align="left" width="1%"> |
9597 | <col> | | 9505 | <col> |
9598 | </colgroup> | | 9506 | </colgroup> |
9599 | <tbody> | | 9507 | <tbody> |
9600 | <tr class="question"> | | 9508 | <tr class="question"> |
9601 | <td align="left" valign="top"> | | 9509 | <td align="left" valign="top"> |
9602 | <a name="devfaq.makeflags"></a><a name="idm83229216"></a><p><b>22.1.</b></p> | | 9510 | <a name="devfaq.makeflags"></a><a name="idm83207584"></a><p><b>22.1.</b></p> |
9603 | </td> | | 9511 | </td> |
9604 | <td align="left" valign="top"><p>What is the difference between | | 9512 | <td align="left" valign="top"><p>What is the difference between |
9605 | <code class="varname">MAKEFLAGS</code>, <code class="varname">.MAKEFLAGS</code> and | | 9513 | <code class="varname">MAKEFLAGS</code>, <code class="varname">.MAKEFLAGS</code> and |
9606 | <code class="varname">MAKE_FLAGS</code>?</p></td> | | 9514 | <code class="varname">MAKE_FLAGS</code>?</p></td> |
9607 | </tr> | | 9515 | </tr> |
9608 | <tr class="answer"> | | 9516 | <tr class="answer"> |
9609 | <td align="left" valign="top"></td> | | 9517 | <td align="left" valign="top"></td> |
9610 | <td align="left" valign="top"><p><code class="varname">MAKEFLAGS</code> are the flags passed | | 9518 | <td align="left" valign="top"><p><code class="varname">MAKEFLAGS</code> are the flags passed |
9611 | to the pkgsrc-internal invocations of <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>, while | | 9519 | to the pkgsrc-internal invocations of <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>, while |
9612 | <code class="varname">MAKE_FLAGS</code> are the flags that are passed to | | 9520 | <code class="varname">MAKE_FLAGS</code> are the flags that are passed to |
9613 | the <code class="varname">MAKE_PROGRAM</code> when building the | | 9521 | the <code class="varname">MAKE_PROGRAM</code> when building the |
9614 | package. [FIXME: What is .MAKEFLAGS for?]</p></td> | | 9522 | package. [FIXME: What is .MAKEFLAGS for?]</p></td> |
9615 | </tr> | | 9523 | </tr> |
9616 | <tr class="question"> | | 9524 | <tr class="question"> |
9617 | <td align="left" valign="top"> | | 9525 | <td align="left" valign="top"> |
9618 | <a name="devfaq.make"></a><a name="idm83225248"></a><p><b>22.2.</b></p> | | 9526 | <a name="devfaq.make"></a><a name="idm83203488"></a><p><b>22.2.</b></p> |
9619 | </td> | | 9527 | </td> |
9620 | <td align="left" valign="top"><p>What is the difference between | | 9528 | <td align="left" valign="top"><p>What is the difference between |
9621 | <code class="varname">MAKE</code>, <code class="varname">GMAKE</code> and | | 9529 | <code class="varname">MAKE</code>, <code class="varname">GMAKE</code> and |
9622 | <code class="varname">MAKE_PROGRAM</code>?</p></td> | | 9530 | <code class="varname">MAKE_PROGRAM</code>?</p></td> |
9623 | </tr> | | 9531 | </tr> |
9624 | <tr class="answer"> | | 9532 | <tr class="answer"> |
9625 | <td align="left" valign="top"></td> | | 9533 | <td align="left" valign="top"></td> |
9626 | <td align="left" valign="top"><p><code class="varname">MAKE</code> is the path to the | | 9534 | <td align="left" valign="top"><p><code class="varname">MAKE</code> is the path to the |
9627 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> program that is used in the pkgsrc | | 9535 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> program that is used in the pkgsrc |
9628 | infrastructure. <code class="varname">GMAKE</code> is the path to GNU | | 9536 | infrastructure. <code class="varname">GMAKE</code> is the path to GNU |
9629 | Make, but you need to say <code class="varname">USE_TOOLS+=gmake</code> to | | 9537 | Make, but you need to say <code class="varname">USE_TOOLS+=gmake</code> to |
9630 | use that. <code class="varname">MAKE_PROGRAM</code> is the path to the | | 9538 | use that. <code class="varname">MAKE_PROGRAM</code> is the path to the |
9631 | Make program that is used for building the | | 9539 | Make program that is used for building the |
9632 | package.</p></td> | | 9540 | package.</p></td> |
9633 | </tr> | | 9541 | </tr> |
9634 | <tr class="question"> | | 9542 | <tr class="question"> |
9635 | <td align="left" valign="top"> | | 9543 | <td align="left" valign="top"> |
9636 | <a name="devfaq.cc"></a><a name="idm83220768"></a><p><b>22.3.</b></p> | | 9544 | <a name="devfaq.cc"></a><a name="idm83199136"></a><p><b>22.3.</b></p> |
9637 | </td> | | 9545 | </td> |
9638 | <td align="left" valign="top"><p>What is the difference between | | 9546 | <td align="left" valign="top"><p>What is the difference between |
9639 | <code class="varname">CC</code>, <code class="varname">PKG_CC</code> and | | 9547 | <code class="varname">CC</code>, <code class="varname">PKG_CC</code> and |
9640 | <code class="varname">PKGSRC_COMPILER</code>?</p></td> | | 9548 | <code class="varname">PKGSRC_COMPILER</code>?</p></td> |
9641 | </tr> | | 9549 | </tr> |
9642 | <tr class="answer"> | | 9550 | <tr class="answer"> |
9643 | <td align="left" valign="top"></td> | | 9551 | <td align="left" valign="top"></td> |
9644 | <td align="left" valign="top"><p><code class="varname">CC</code> is the path to the real C | | 9552 | <td align="left" valign="top"><p><code class="varname">CC</code> is the path to the real C |
9645 | compiler, which can be configured by the pkgsrc user. | | 9553 | compiler, which can be configured by the pkgsrc user. |
9646 | <code class="varname">PKG_CC</code> is the path to the compiler wrapper. | | 9554 | <code class="varname">PKG_CC</code> is the path to the compiler wrapper. |
9647 | <code class="varname">PKGSRC_COMPILER</code> is <span class="emphasis"><em>not</em></span> a | | 9555 | <code class="varname">PKGSRC_COMPILER</code> is <span class="emphasis"><em>not</em></span> a |
9648 | path to a compiler, but the type of compiler that should be | | 9556 | path to a compiler, but the type of compiler that should be |
9649 | used. See <code class="filename">mk/compiler.mk</code> for more | | 9557 | used. See <code class="filename">mk/compiler.mk</code> for more |
9650 | information about the latter variable.</p></td> | | 9558 | information about the latter variable.</p></td> |
9651 | </tr> | | 9559 | </tr> |
9652 | <tr class="question"> | | 9560 | <tr class="question"> |
9653 | <td align="left" valign="top"> | | 9561 | <td align="left" valign="top"> |
9654 | <a name="devfaq.bl3flags"></a><a name="idm83216672"></a><p><b>22.4.</b></p> | | 9562 | <a name="devfaq.bl3flags"></a><a name="idm83194912"></a><p><b>22.4.</b></p> |
9655 | </td> | | 9563 | </td> |
9656 | <td align="left" valign="top"><p>What is the difference between | | 9564 | <td align="left" valign="top"><p>What is the difference between |
9657 | <code class="varname">BUILDLINK_LDFLAGS</code>, | | 9565 | <code class="varname">BUILDLINK_LDFLAGS</code>, |
9658 | <code class="varname">BUILDLINK_LDADD</code> and | | 9566 | <code class="varname">BUILDLINK_LDADD</code> and |
9659 | <code class="varname">BUILDLINK_LIBS</code>?</p></td> | | 9567 | <code class="varname">BUILDLINK_LIBS</code>?</p></td> |
9660 | </tr> | | 9568 | </tr> |
9661 | <tr class="answer"> | | 9569 | <tr class="answer"> |
9662 | <td align="left" valign="top"></td> | | 9570 | <td align="left" valign="top"></td> |
9663 | <td align="left" valign="top"><p>[FIXME]</p></td> | | 9571 | <td align="left" valign="top"><p>[FIXME]</p></td> |
9664 | </tr> | | 9572 | </tr> |
9665 | <tr class="question"> | | 9573 | <tr class="question"> |
9666 | <td align="left" valign="top"> | | 9574 | <td align="left" valign="top"> |
9667 | <a name="devfaq.bl3prefix"></a><a name="idm83214368"></a><p><b>22.5.</b></p> | | 9575 | <a name="devfaq.bl3prefix"></a><a name="idm83192736"></a><p><b>22.5.</b></p> |
9668 | </td> | | 9576 | </td> |
9669 | <td align="left" valign="top"><p>Why does <span class="command"><strong>make show-var | | 9577 | <td align="left" valign="top"><p>Why does <span class="command"><strong>make show-var |
9670 | VARNAME=BUILDLINK_PREFIX.<em class="replaceable"><code>foo</code></em></strong></span> | | 9578 | VARNAME=BUILDLINK_PREFIX.<em class="replaceable"><code>foo</code></em></strong></span> |
9671 | say it's empty?</p></td> | | 9579 | say it's empty?</p></td> |
9672 | </tr> | | 9580 | </tr> |
9673 | <tr class="answer"> | | 9581 | <tr class="answer"> |
9674 | <td align="left" valign="top"></td> | | 9582 | <td align="left" valign="top"></td> |
9675 | <td align="left" valign="top"><p>For optimization reasons, some variables are only | | 9583 | <td align="left" valign="top"><p>For optimization reasons, some variables are only |
9676 | available in the <span class="quote">“<span class="quote">wrapper</span>”</span> phase and later. To | | 9584 | available in the <span class="quote">“<span class="quote">wrapper</span>”</span> phase and later. To |
9677 | <span class="quote">“<span class="quote">simulate</span>”</span> the wrapper phase, append | | 9585 | <span class="quote">“<span class="quote">simulate</span>”</span> the wrapper phase, append |
9678 | <span class="command"><strong>PKG_PHASE=wrapper</strong></span> to the above | | 9586 | <span class="command"><strong>PKG_PHASE=wrapper</strong></span> to the above |
9679 | command.</p></td> | | 9587 | command.</p></td> |
9680 | </tr> | | 9588 | </tr> |
9681 | <tr class="question"> | | 9589 | <tr class="question"> |
9682 | <td align="left" valign="top"> | | 9590 | <td align="left" valign="top"> |
9683 | <a name="devfaq.master_sites"></a><a name="idm83211296"></a><p><b>22.6.</b></p> | | 9591 | <a name="devfaq.master_sites"></a><a name="idm83189664"></a><p><b>22.6.</b></p> |
9684 | </td> | | 9592 | </td> |
9685 | <td align="left" valign="top"><p>What does | | 9593 | <td align="left" valign="top"><p>What does |
9686 | <code class="literal">${MASTER_SITE_SOURCEFORGE:=package/}</code> mean? I | | 9594 | <code class="literal">${MASTER_SITE_SOURCEFORGE:=package/}</code> mean? I |
9687 | don't understand the <code class="literal">:=</code> inside | | 9595 | don't understand the <code class="literal">:=</code> inside |
9688 | it.</p></td> | | 9596 | it.</p></td> |
9689 | </tr> | | 9597 | </tr> |
9690 | <tr class="answer"> | | 9598 | <tr class="answer"> |
9691 | <td align="left" valign="top"></td> | | 9599 | <td align="left" valign="top"></td> |
9692 | <td align="left" valign="top"><p>The <code class="literal">:=</code> is not really an | | 9600 | <td align="left" valign="top"><p>The <code class="literal">:=</code> is not really an |
9693 | assignment operator, like you might expect at first sight. | | 9601 | assignment operator, like you might expect at first sight. |
9694 | Instead, it is a degenerate form of | | 9602 | Instead, it is a degenerate form of |
9695 | <code class="literal">${LIST:<em class="replaceable"><code>old_string</code></em>=<em class="replaceable"><code>new_string</code></em>}</code>, | | 9603 | <code class="literal">${LIST:<em class="replaceable"><code>old_string</code></em>=<em class="replaceable"><code>new_string</code></em>}</code>, |
9696 | which is documented in the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man page and which you | | 9604 | which is documented in the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man page and which you |
9697 | may have seen as in <code class="literal">${SRCS:.c=.o}</code>. In the | | 9605 | may have seen as in <code class="literal">${SRCS:.c=.o}</code>. In the |
9698 | case of <code class="varname">MASTER_SITE_*</code>, | | 9606 | case of <code class="varname">MASTER_SITE_*</code>, |
9699 | <em class="replaceable"><code>old_string</code></em> is the empty string and | | 9607 | <em class="replaceable"><code>old_string</code></em> is the empty string and |
9700 | <em class="replaceable"><code>new_string</code></em> is | | 9608 | <em class="replaceable"><code>new_string</code></em> is |
9701 | <code class="literal">package/</code>. That's where the | | 9609 | <code class="literal">package/</code>. That's where the |
9702 | <code class="literal">:</code> and the <code class="literal">=</code> fall | | 9610 | <code class="literal">:</code> and the <code class="literal">=</code> fall |
9703 | together.</p></td> | | 9611 | together.</p></td> |
9704 | </tr> | | 9612 | </tr> |
9705 | <tr class="question"> | | 9613 | <tr class="question"> |
9706 | <td align="left" valign="top"> | | 9614 | <td align="left" valign="top"> |
9707 | <a name="devfaq.mailinglists"></a><a name="idm83203232"></a><p><b>22.7.</b></p> | | 9615 | <a name="devfaq.mailinglists"></a><a name="idm83173408"></a><p><b>22.7.</b></p> |
9708 | </td> | | 9616 | </td> |
9709 | <td align="left" valign="top"><p>Which mailing lists are there for package | | 9617 | <td align="left" valign="top"><p>Which mailing lists are there for package |
9710 | developers?</p></td> | | 9618 | developers?</p></td> |
9711 | </tr> | | 9619 | </tr> |
9712 | <tr class="answer"> | | 9620 | <tr class="answer"> |
9713 | <td align="left" valign="top"></td> | | 9621 | <td align="left" valign="top"></td> |
9714 | <td align="left" valign="top"><div class="variablelist"><dl class="variablelist"> | | 9622 | <td align="left" valign="top"><div class="variablelist"><dl class="variablelist"> |
9715 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#tech-pkg" target="_top">tech-pkg</a></span></dt> | | 9623 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#tech-pkg" target="_top">tech-pkg</a></span></dt> |
9716 | <dd><p>This is a list for technical discussions related | | 9624 | <dd><p>This is a list for technical discussions related |
9717 | to pkgsrc development, e.g. soliciting feedback for changes to | | 9625 | to pkgsrc development, e.g. soliciting feedback for changes to |
9718 | pkgsrc infrastructure, proposed new features, questions related | | 9626 | pkgsrc infrastructure, proposed new features, questions related |
9719 | to porting pkgsrc to a new platform, advice for maintaining a | | 9627 | to porting pkgsrc to a new platform, advice for maintaining a |
9720 | package, patches that affect many packages, help requests moved | | 9628 | package, patches that affect many packages, help requests moved |
9721 | from pkgsrc-users when an infrastructure bug is found, | | 9629 | from pkgsrc-users when an infrastructure bug is found, |
9722 | etc.</p></dd> | | 9630 | etc.</p></dd> |
9723 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#pkgsrc-bugs" target="_top">pkgsrc-bugs</a></span></dt> | | 9631 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#pkgsrc-bugs" target="_top">pkgsrc-bugs</a></span></dt> |
9724 | <dd><p>All bug reports in category "pkg" sent with | | 9632 | <dd><p>All bug reports in category "pkg" sent with |
9725 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">send-pr</span>(1)</span></a> appear here. Please do not report your bugs here | | 9633 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">send-pr</span>(1)</span></a> appear here. Please do not report your bugs here |
9726 | directly; use one of the other mailing | | 9634 | directly; use one of the other mailing |
9727 | lists.</p></dd> | | 9635 | lists.</p></dd> |
9728 | </dl></div></td> | | 9636 | </dl></div></td> |
9729 | </tr> | | 9637 | </tr> |
9730 | <tr class="question"> | | 9638 | <tr class="question"> |
9731 | <td align="left" valign="top"> | | 9639 | <td align="left" valign="top"> |
9732 | <a name="devfaq.documentation"></a><a name="idm83199392"></a><p><b>22.8.</b></p> | | 9640 | <a name="devfaq.documentation"></a><a name="idm83169568"></a><p><b>22.8.</b></p> |
9733 | </td> | | 9641 | </td> |
9734 | <td align="left" valign="top"><p>Where is the pkgsrc | | 9642 | <td align="left" valign="top"><p>Where is the pkgsrc |
9735 | documentation?</p></td> | | 9643 | documentation?</p></td> |
9736 | </tr> | | 9644 | </tr> |
9737 | <tr class="answer"> | | 9645 | <tr class="answer"> |
9738 | <td align="left" valign="top"></td> | | 9646 | <td align="left" valign="top"></td> |
9739 | <td align="left" valign="top"> | | 9647 | <td align="left" valign="top"> |
9740 | <p>There are many places where you can find | | 9648 | <p>There are many places where you can find |
9741 | documentation about pkgsrc:</p> | | 9649 | documentation about pkgsrc:</p> |
9742 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 9650 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
9743 | <li class="listitem"><p>The pkgsrc guide (this document) is a collection | | 9651 | <li class="listitem"><p>The pkgsrc guide (this document) is a collection |
9744 | of chapters that explain large parts of pkgsrc, but some | | 9652 | of chapters that explain large parts of pkgsrc, but some |
9745 | chapters tend to be outdated. Which ones they are is hard to | | 9653 | chapters tend to be outdated. Which ones they are is hard to |
| @@ -9767,27 +9675,27 @@ do? | | | @@ -9767,27 +9675,27 @@ do? |
9767 | documented</span>”</span>, that is the documentation exists only in the | | 9675 | documented</span>”</span>, that is the documentation exists only in the |
9768 | mind of the developer who wrote the code. To get this | | 9676 | mind of the developer who wrote the code. To get this |
9769 | information, use the <span class="command"><strong>cvs annotate</strong></span> command | | 9677 | information, use the <span class="command"><strong>cvs annotate</strong></span> command |
9770 | to see who has written it and ask on the | | 9678 | to see who has written it and ask on the |
9771 | <code class="literal">tech-pkg</code> mailing list, so that others can | | 9679 | <code class="literal">tech-pkg</code> mailing list, so that others can |
9772 | find your questions later (see above). To be sure that the | | 9680 | find your questions later (see above). To be sure that the |
9773 | developer in charge reads the mail, you may CC him or | | 9681 | developer in charge reads the mail, you may CC him or |
9774 | her.</p></li> | | 9682 | her.</p></li> |
9775 | </ul></div> | | 9683 | </ul></div> |
9776 | </td> | | 9684 | </td> |
9777 | </tr> | | 9685 | </tr> |
9778 | <tr class="question"> | | 9686 | <tr class="question"> |
9779 | <td align="left" valign="top"> | | 9687 | <td align="left" valign="top"> |
9780 | <a name="devfaq.too-much-time"></a><a name="idm83192992"></a><p><b>22.9.</b></p> | | 9688 | <a name="devfaq.too-much-time"></a><a name="idm83163168"></a><p><b>22.9.</b></p> |
9781 | </td> | | 9689 | </td> |
9782 | <td align="left" valign="top"><p>I have a little time to kill. What shall I | | 9690 | <td align="left" valign="top"><p>I have a little time to kill. What shall I |
9783 | do?</p></td> | | 9691 | do?</p></td> |
9784 | </tr> | | 9692 | </tr> |
9785 | <tr class="answer"> | | 9693 | <tr class="answer"> |
9786 | <td align="left" valign="top"></td> | | 9694 | <td align="left" valign="top"></td> |
9787 | <td align="left" valign="top"> | | 9695 | <td align="left" valign="top"> |
9788 | <p>This is not really an FAQ yet, but here's the answer | | 9696 | <p>This is not really an FAQ yet, but here's the answer |
9789 | anyway.</p> | | 9697 | anyway.</p> |
9790 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 9698 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
9791 | <li class="listitem"><p>Run <span class="command"><strong>pkg_chk -N</strong></span> (from the | | 9699 | <li class="listitem"><p>Run <span class="command"><strong>pkg_chk -N</strong></span> (from the |
9792 | <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_chk/README.html" target="_top"><code class="filename">pkgtools/pkg_chk</code></a> package). It | | 9700 | <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_chk/README.html" target="_top"><code class="filename">pkgtools/pkg_chk</code></a> package). It |
9793 | will tell you about newer versions of installed packages that are | | 9701 | will tell you about newer versions of installed packages that are |
| @@ -10126,39 +10034,35 @@ details. | | | @@ -10126,39 +10034,35 @@ details. |
10126 | <dt><span class="sect1"><a href="#infr.design.intf">24.5. Designing interfaces for Makefile fragments</a></span></dt> | | 10034 | <dt><span class="sect1"><a href="#infr.design.intf">24.5. Designing interfaces for Makefile fragments</a></span></dt> |
10127 | <dd><dl> | | 10035 | <dd><dl> |
10128 | <dt><span class="sect2"><a href="#infr.design.intf.proc">24.5.1. Procedures with parameters</a></span></dt> | | 10036 | <dt><span class="sect2"><a href="#infr.design.intf.proc">24.5.1. Procedures with parameters</a></span></dt> |
10129 | <dt><span class="sect2"><a href="#infr.design.intf.action">24.5.2. Actions taken on behalf of parameters</a></span></dt> | | 10037 | <dt><span class="sect2"><a href="#infr.design.intf.action">24.5.2. Actions taken on behalf of parameters</a></span></dt> |
10130 | </dl></dd> | | 10038 | </dl></dd> |
10131 | <dt><span class="sect1"><a href="#infr.order">24.6. The order in which files are loaded</a></span></dt> | | 10039 | <dt><span class="sect1"><a href="#infr.order">24.6. The order in which files are loaded</a></span></dt> |
10132 | <dd><dl> | | 10040 | <dd><dl> |
10133 | <dt><span class="sect2"><a href="#infr.order.prefs">24.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt> | | 10041 | <dt><span class="sect2"><a href="#infr.order.prefs">24.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt> |
10134 | <dt><span class="sect2"><a href="#infr.order.pkg">24.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt> | | 10042 | <dt><span class="sect2"><a href="#infr.order.pkg">24.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt> |
10135 | </dl></dd> | | 10043 | </dl></dd> |
10136 | </dl></dd> | | 10044 | </dl></dd> |
10137 | <dt><span class="chapter"><a href="#regression">25. Regression tests</a></span></dt> | | 10045 | <dt><span class="chapter"><a href="#regression">25. Regression tests</a></span></dt> |
10138 | <dd><dl> | | 10046 | <dd><dl> |
10139 | <dt><span class="sect1"><a href="#regression.descr">25.1. The regression tests framework</a></span></dt> | | 10047 | <dt><span class="sect1"><a href="#regression.run">25.1. Running the regression tests</a></span></dt> |
10140 | <dt><span class="sect1"><a href="#regression.run">25.2. Running the regression tests</a></span></dt> | | 10048 | <dt><span class="sect1"><a href="#regression.new">25.2. Adding a new regression test</a></span></dt> |
10141 | <dt><span class="sect1"><a href="#regression.new">25.3. Adding a new regression test</a></span></dt> | | | |
10142 | <dd><dl> | | 10049 | <dd><dl> |
10143 | <dt><span class="sect2"><a href="#regression.fun.override">25.3.1. Overridable functions</a></span></dt> | | 10050 | <dt><span class="sect2"><a href="#regression.fun.override">25.2.1. Overridable functions</a></span></dt> |
10144 | <dt><span class="sect2"><a href="#regression.fun.helper">25.3.2. Helper functions</a></span></dt> | | 10051 | <dt><span class="sect2"><a href="#regression.fun.helper">25.2.2. Helper functions</a></span></dt> |
10145 | </dl></dd> | | 10052 | </dl></dd> |
10146 | </dl></dd> | | 10053 | </dl></dd> |
10147 | <dt><span class="chapter"><a href="#porting">26. Porting pkgsrc</a></span></dt> | | 10054 | <dt><span class="chapter"><a href="#porting">26. Porting pkgsrc</a></span></dt> |
10148 | <dd><dl> | | 10055 | <dd><dl><dt><span class="sect1"><a href="#porting.opsys">26.1. Porting pkgsrc to a new operating system</a></span></dt></dl></dd> |
10149 | <dt><span class="sect1"><a href="#porting.opsys">26.1. Porting pkgsrc to a new operating system</a></span></dt> | | | |
10150 | <dt><span class="sect1"><a href="#porting.compiler">26.2. Adding support for a new compiler</a></span></dt> | | | |
10151 | </dl></dd> | | | |
10152 | </dl> | | 10056 | </dl> |
10153 | </div> | | 10057 | </div> |
10154 | </div> | | 10058 | </div> |
10155 | <div class="chapter"> | | 10059 | <div class="chapter"> |
10156 | <div class="titlepage"><div><div><h2 class="title"> | | 10060 | <div class="titlepage"><div><div><h2 class="title"> |
10157 | <a name="infr.design"></a>Chapter 24. Design of the pkgsrc infrastructure</h2></div></div></div> | | 10061 | <a name="infr.design"></a>Chapter 24. Design of the pkgsrc infrastructure</h2></div></div></div> |
10158 | <div class="toc"> | | 10062 | <div class="toc"> |
10159 | <p><b>Table of Contents</b></p> | | 10063 | <p><b>Table of Contents</b></p> |
10160 | <dl class="toc"> | | 10064 | <dl class="toc"> |
10161 | <dt><span class="sect1"><a href="#infr.vardef">24.1. The meaning of variable definitions</a></span></dt> | | 10065 | <dt><span class="sect1"><a href="#infr.vardef">24.1. The meaning of variable definitions</a></span></dt> |
10162 | <dt><span class="sect1"><a href="#infr.vardef.problems">24.2. Avoiding problems before they arise</a></span></dt> | | 10066 | <dt><span class="sect1"><a href="#infr.vardef.problems">24.2. Avoiding problems before they arise</a></span></dt> |
10163 | <dt><span class="sect1"><a href="#infr.var">24.3. Variable evaluation</a></span></dt> | | 10067 | <dt><span class="sect1"><a href="#infr.var">24.3. Variable evaluation</a></span></dt> |
10164 | <dd><dl> | | 10068 | <dd><dl> |
| @@ -10421,68 +10325,62 @@ CFLAGS+= -Wall | | | @@ -10421,68 +10325,62 @@ CFLAGS+= -Wall |
10421 | matter.</p> | | 10325 | matter.</p> |
10422 | <p>At last, some more files are included that don't set any | | 10326 | <p>At last, some more files are included that don't set any |
10423 | interesting variables but rather just define make targets to be | | 10327 | interesting variables but rather just define make targets to be |
10424 | executed.</p> | | 10328 | executed.</p> |
10425 | </div> | | 10329 | </div> |
10426 | </div> | | 10330 | </div> |
10427 | </div> | | 10331 | </div> |
10428 | <div class="chapter"> | | 10332 | <div class="chapter"> |
10429 | <div class="titlepage"><div><div><h2 class="title"> | | 10333 | <div class="titlepage"><div><div><h2 class="title"> |
10430 | <a name="regression"></a>Chapter 25. Regression tests</h2></div></div></div> | | 10334 | <a name="regression"></a>Chapter 25. Regression tests</h2></div></div></div> |
10431 | <div class="toc"> | | 10335 | <div class="toc"> |
10432 | <p><b>Table of Contents</b></p> | | 10336 | <p><b>Table of Contents</b></p> |
10433 | <dl class="toc"> | | 10337 | <dl class="toc"> |
10434 | <dt><span class="sect1"><a href="#regression.descr">25.1. The regression tests framework</a></span></dt> | | 10338 | <dt><span class="sect1"><a href="#regression.run">25.1. Running the regression tests</a></span></dt> |
10435 | <dt><span class="sect1"><a href="#regression.run">25.2. Running the regression tests</a></span></dt> | | 10339 | <dt><span class="sect1"><a href="#regression.new">25.2. Adding a new regression test</a></span></dt> |
10436 | <dt><span class="sect1"><a href="#regression.new">25.3. Adding a new regression test</a></span></dt> | | | |
10437 | <dd><dl> | | 10340 | <dd><dl> |
10438 | <dt><span class="sect2"><a href="#regression.fun.override">25.3.1. Overridable functions</a></span></dt> | | 10341 | <dt><span class="sect2"><a href="#regression.fun.override">25.2.1. Overridable functions</a></span></dt> |
10439 | <dt><span class="sect2"><a href="#regression.fun.helper">25.3.2. Helper functions</a></span></dt> | | 10342 | <dt><span class="sect2"><a href="#regression.fun.helper">25.2.2. Helper functions</a></span></dt> |
10440 | </dl></dd> | | 10343 | </dl></dd> |
10441 | </dl> | | 10344 | </dl> |
10442 | </div> | | 10345 | </div> |
10443 | <p>The pkgsrc infrastructure consists of a large codebase, | | 10346 | <p>The pkgsrc infrastructure consists of a large codebase, |
10444 | and there are many corners where every little bit of a file is | | 10347 | and there are many corners where every little bit of a file is |
10445 | well thought out, making pkgsrc likely to fail as soon as | | 10348 | well thought out, making pkgsrc likely to fail as soon as |
10446 | anything is changed near those parts. To prevent most changes | | 10349 | anything is changed near those parts. To prevent most changes |
10447 | from breaking anything, a suite of regression tests should go | | 10350 | from breaking anything, a suite of regression tests should go |
10448 | along with every important part of the pkgsrc infrastructure. | | 10351 | along with every important part of the pkgsrc infrastructure. |
10449 | This chapter describes how regression tests work in pkgsrc and | | 10352 | This chapter describes how regression tests work in pkgsrc and |
10450 | how you can add new tests.</p> | | 10353 | how you can add new tests.</p> |
10451 | <div class="sect1"> | | 10354 | <div class="sect1"> |
10452 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 10355 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
10453 | <a name="regression.descr"></a>25.1. The regression tests framework</h2></div></div></div> | | 10356 | <a name="regression.run"></a>25.1. Running the regression tests</h2></div></div></div> |
10454 | <p></p> | | | |
10455 | </div> | | | |
10456 | <div class="sect1"> | | | |
10457 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | | |
10458 | <a name="regression.run"></a>25.2. Running the regression tests</h2></div></div></div> | | | |
10459 | <p>You first need to install the <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_regress/README.html" target="_top"><code class="filename">pkgtools/pkg_regress</code></a> package, which | | 10357 | <p>You first need to install the <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_regress/README.html" target="_top"><code class="filename">pkgtools/pkg_regress</code></a> package, which |
10460 | provides the <span class="command"><strong>pkg_regress</strong></span> command. Then you | | 10358 | provides the <span class="command"><strong>pkg_regress</strong></span> command. Then you |
10461 | can simply run that command, which will run all tests in the | | 10359 | can simply run that command, which will run all tests in the |
10462 | <code class="filename">regress</code> category.</p> | | 10360 | <code class="filename">regress</code> category.</p> |
10463 | </div> | | 10361 | </div> |
10464 | <div class="sect1"> | | 10362 | <div class="sect1"> |
10465 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 10363 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
10466 | <a name="regression.new"></a>25.3. Adding a new regression test</h2></div></div></div> | | 10364 | <a name="regression.new"></a>25.2. Adding a new regression test</h2></div></div></div> |
10467 | <p>Every directory in the <code class="filename">regress</code> | | 10365 | <p>Every directory in the <code class="filename">regress</code> |
10468 | category that contains a file called <code class="filename">spec</code> | | 10366 | category that contains a file called <code class="filename">spec</code> |
10469 | is considered a regression test. This file is a shell program | | 10367 | is considered a regression test. This file is a shell program |
10470 | that is included by the <span class="command"><strong>pkg_regress</strong></span> command. | | 10368 | that is included by the <span class="command"><strong>pkg_regress</strong></span> command. |
10471 | The following functions can be overridden to suit your | | 10369 | The following functions can be overridden to suit your |
10472 | needs.</p> | | 10370 | needs.</p> |
10473 | <div class="sect2"> | | 10371 | <div class="sect2"> |
10474 | <div class="titlepage"><div><div><h3 class="title"> | | 10372 | <div class="titlepage"><div><div><h3 class="title"> |
10475 | <a name="regression.fun.override"></a>25.3.1. Overridable functions</h3></div></div></div> | | 10373 | <a name="regression.fun.override"></a>25.2.1. Overridable functions</h3></div></div></div> |
10476 | <p>These functions do not take any parameters. Although they | | 10374 | <p>These functions do not take any parameters. Although they |
10477 | are called in <span class="quote">“<span class="quote">set -e</span>”</span> mode, they don't stop at the | | 10375 | are called in <span class="quote">“<span class="quote">set -e</span>”</span> mode, they don't stop at the |
10478 | first failing command. See <a class="ulink" href="http://stackoverflow.com/q/4072984" target="_top">this StackOverflow | | 10376 | first failing command. See <a class="ulink" href="http://stackoverflow.com/q/4072984" target="_top">this StackOverflow |
10479 | question</a> for details.</p> | | 10377 | question</a> for details.</p> |
10480 | <div class="variablelist"><dl class="variablelist"> | | 10378 | <div class="variablelist"><dl class="variablelist"> |
10481 | <dt><span class="term"><code class="varname">do_setup</code></span></dt> | | 10379 | <dt><span class="term"><code class="varname">do_setup</code></span></dt> |
10482 | <dd><p>This function prepares the environment for the | | 10380 | <dd><p>This function prepares the environment for the |
10483 | test. By default it does nothing.</p></dd> | | 10381 | test. By default it does nothing.</p></dd> |
10484 | <dt><span class="term"><code class="varname">do_test</code></span></dt> | | 10382 | <dt><span class="term"><code class="varname">do_test</code></span></dt> |
10485 | <dd> | | 10383 | <dd> |
10486 | <p>This function runs the actual test. By default, | | 10384 | <p>This function runs the actual test. By default, |
10487 | it calls <code class="varname">TEST_MAKE</code> with the arguments | | 10385 | it calls <code class="varname">TEST_MAKE</code> with the arguments |
10488 | <code class="varname">MAKEARGS_TEST</code> and writes its output including | | 10386 | <code class="varname">MAKEARGS_TEST</code> and writes its output including |
| @@ -10509,61 +10407,59 @@ check_result() { | | | @@ -10509,61 +10407,59 @@ check_result() { |
10509 | output_require "Example" | | 10407 | output_require "Example" |
10510 | output_require "^[[:alpha:]+[[:space:]][[:alpha:]]{6}$" | | 10408 | output_require "^[[:alpha:]+[[:space:]][[:alpha:]]{6}$" |
10511 | output_prohibit "no such file or directory" | | 10409 | output_prohibit "no such file or directory" |
10512 | } | | 10410 | } |
10513 | </pre> | | 10411 | </pre> |
10514 | </dd> | | 10412 | </dd> |
10515 | <dt><span class="term"><code class="varname">do_cleanup</code></span></dt> | | 10413 | <dt><span class="term"><code class="varname">do_cleanup</code></span></dt> |
10516 | <dd><p>This function cleans everything up after the | | 10414 | <dd><p>This function cleans everything up after the |
10517 | test has been run. By default it does nothing.</p></dd> | | 10415 | test has been run. By default it does nothing.</p></dd> |
10518 | </dl></div> | | 10416 | </dl></div> |
10519 | </div> | | 10417 | </div> |
10520 | <div class="sect2"> | | 10418 | <div class="sect2"> |
10521 | <div class="titlepage"><div><div><h3 class="title"> | | 10419 | <div class="titlepage"><div><div><h3 class="title"> |
10522 | <a name="regression.fun.helper"></a>25.3.2. Helper functions</h3></div></div></div> | | 10420 | <a name="regression.fun.helper"></a>25.2.2. Helper functions</h3></div></div></div> |
10523 | <div class="variablelist"><dl class="variablelist"> | | 10421 | <div class="variablelist"><dl class="variablelist"> |
10524 | <dt><span class="term"><code class="varname">exit_status expected</code></span></dt> | | 10422 | <dt><span class="term"><code class="varname">exit_status expected</code></span></dt> |
10525 | <dd><p>This function compares the exitcode of the | | 10423 | <dd><p>This function compares the exitcode of the |
10526 | <span class="command"><strong>do_test</strong></span> function with its first parameter. | | 10424 | <span class="command"><strong>do_test</strong></span> function with its first parameter. |
10527 | If they differ, the test will fail.</p></dd> | | 10425 | If they differ, the test will fail.</p></dd> |
10528 | <dt><span class="term"><code class="varname">output_require regex...</code></span></dt> | | 10426 | <dt><span class="term"><code class="varname">output_require regex...</code></span></dt> |
10529 | <dd> | | 10427 | <dd> |
10530 | <p>This function checks for each of its parameters | | 10428 | <p>This function checks for each of its parameters |
10531 | if the output from <span class="command"><strong>do_test</strong></span> matches the | | 10429 | if the output from <span class="command"><strong>do_test</strong></span> matches the |
10532 | extended regular expression. If it does not, the test will | | 10430 | extended regular expression. If it does not, the test will |
10533 | fail. Example:</p> | | 10431 | fail. Example:</p> |
10534 | <pre class="programlisting"> | | 10432 | <pre class="programlisting"> |
10535 | output_require | | 10433 | output_require "looks fine" |
| | | 10434 | output_require "^[[:alpha:]+[[:space:]][[:alpha:]]{6}$" |
10536 | </pre> | | 10435 | </pre> |
10537 | </dd> | | 10436 | </dd> |
10538 | <dt><span class="term"><code class="varname">output_prohibit(regex...)</code></span></dt> | | 10437 | <dt><span class="term"><code class="varname">output_prohibit(regex...)</code></span></dt> |
10539 | <dd><p>This function checks for each of its parameters | | 10438 | <dd><p>This function checks for each of its parameters |
10540 | if the output from <span class="command"><strong>do_test()</strong></span> does | | 10439 | if the output from <span class="command"><strong>do_test()</strong></span> does |
10541 | <span class="emphasis"><em>not</em></span> match the extended regular expression. | | 10440 | <span class="emphasis"><em>not</em></span> match the extended regular expression. |
10542 | If any of the regular expressions matches, the test will | | 10441 | If any of the regular expressions matches, the test will |
10543 | fail.</p></dd> | | 10442 | fail.</p></dd> |
10544 | </dl></div> | | 10443 | </dl></div> |
10545 | </div> | | 10444 | </div> |
10546 | </div> | | 10445 | </div> |
10547 | </div> | | 10446 | </div> |
10548 | <div class="chapter"> | | 10447 | <div class="chapter"> |
10549 | <div class="titlepage"><div><div><h2 class="title"> | | 10448 | <div class="titlepage"><div><div><h2 class="title"> |
10550 | <a name="porting"></a>Chapter 26. Porting pkgsrc</h2></div></div></div> | | 10449 | <a name="porting"></a>Chapter 26. Porting pkgsrc</h2></div></div></div> |
10551 | <div class="toc"> | | 10450 | <div class="toc"> |
10552 | <p><b>Table of Contents</b></p> | | 10451 | <p><b>Table of Contents</b></p> |
10553 | <dl class="toc"> | | 10452 | <dl class="toc"><dt><span class="sect1"><a href="#porting.opsys">26.1. Porting pkgsrc to a new operating system</a></span></dt></dl> |
10554 | <dt><span class="sect1"><a href="#porting.opsys">26.1. Porting pkgsrc to a new operating system</a></span></dt> | | | |
10555 | <dt><span class="sect1"><a href="#porting.compiler">26.2. Adding support for a new compiler</a></span></dt> | | | |
10556 | </dl> | | | |
10557 | </div> | | 10453 | </div> |
10558 | <p>The pkgsrc system has already been ported to many | | 10454 | <p>The pkgsrc system has already been ported to many |
10559 | operating systems, hardware architectures and compilers. This | | 10455 | operating systems, hardware architectures and compilers. This |
10560 | chapter explains the necessary steps to make pkgsrc even more | | 10456 | chapter explains the necessary steps to make pkgsrc even more |
10561 | portable.</p> | | 10457 | portable.</p> |
10562 | <div class="sect1"> | | 10458 | <div class="sect1"> |
10563 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 10459 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
10564 | <a name="porting.opsys"></a>26.1. Porting pkgsrc to a new operating system</h2></div></div></div> | | 10460 | <a name="porting.opsys"></a>26.1. Porting pkgsrc to a new operating system</h2></div></div></div> |
10565 | <p>To port pkgsrc to a new operating system (called | | 10461 | <p>To port pkgsrc to a new operating system (called |
10566 | <code class="literal">MyOS</code> in this example), you need to touch the | | 10462 | <code class="literal">MyOS</code> in this example), you need to touch the |
10567 | following files:</p> | | 10463 | following files:</p> |
10568 | <div class="variablelist"><dl class="variablelist"> | | 10464 | <div class="variablelist"><dl class="variablelist"> |
10569 | <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> | | 10465 | <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> |
| @@ -10582,31 +10478,26 @@ output_require | | | @@ -10582,31 +10478,26 @@ output_require |
10582 | <dd><p>This file contains the platform-specific | | 10478 | <dd><p>This file contains the platform-specific |
10583 | definitions that are used by pkgsrc. Start by copying one of the | | 10479 | definitions that are used by pkgsrc. Start by copying one of the |
10584 | other files and edit it to your | | 10480 | other files and edit it to your |
10585 | needs.</p></dd> | | 10481 | needs.</p></dd> |
10586 | <dt><span class="term"><code class="filename">mk/tools/tools.<em class="replaceable"><code>MyOS</code></em>.mk</code></span></dt> | | 10482 | <dt><span class="term"><code class="filename">mk/tools/tools.<em class="replaceable"><code>MyOS</code></em>.mk</code></span></dt> |
10587 | <dd><p>This file defines the paths to all the tools | | 10483 | <dd><p>This file defines the paths to all the tools |
10588 | that are needed by one or the other package in pkgsrc, as well | | 10484 | that are needed by one or the other package in pkgsrc, as well |
10589 | as by pkgsrc itself. Find out where these tools are on your | | 10485 | as by pkgsrc itself. Find out where these tools are on your |
10590 | platform and add them.</p></dd> | | 10486 | platform and add them.</p></dd> |
10591 | </dl></div> | | 10487 | </dl></div> |
10592 | <p>Now, you should be able to build some basic packages, like | | 10488 | <p>Now, you should be able to build some basic packages, like |
10593 | <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/lang/perl5/README.html" target="_top"><code class="filename">lang/perl5</code></a>, <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/bash/README.html" target="_top"><code class="filename">shells/bash</code></a>.</p> | | 10489 | <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/lang/perl5/README.html" target="_top"><code class="filename">lang/perl5</code></a>, <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/bash/README.html" target="_top"><code class="filename">shells/bash</code></a>.</p> |
10594 | </div> | | 10490 | </div> |
10595 | <div class="sect1"> | | | |
10596 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | | |
10597 | <a name="porting.compiler"></a>26.2. Adding support for a new compiler</h2></div></div></div> | | | |
10598 | <p>TODO</p> | | | |
10599 | </div> | | | |
10600 | </div> | | 10491 | </div> |
10601 | </div> | | 10492 | </div> |
10602 | <div class="appendix"> | | 10493 | <div class="appendix"> |
10603 | <div class="titlepage"><div><div><h1 class="title"> | | 10494 | <div class="titlepage"><div><div><h1 class="title"> |
10604 | <a name="examples"></a>Appendix A. A simple example package: bison</h1></div></div></div> | | 10495 | <a name="examples"></a>Appendix A. A simple example package: bison</h1></div></div></div> |
10605 | <div class="toc"> | | 10496 | <div class="toc"> |
10606 | <p><b>Table of Contents</b></p> | | 10497 | <p><b>Table of Contents</b></p> |
10607 | <dl class="toc"> | | 10498 | <dl class="toc"> |
10608 | <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt> | | 10499 | <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt> |
10609 | <dd><dl> | | 10500 | <dd><dl> |
10610 | <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt> | | 10501 | <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt> |
10611 | <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt> | | 10502 | <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt> |
10612 | <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt> | | 10503 | <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt> |