| @@ -116,38 +116,35 @@ | | | @@ -116,38 +116,35 @@ |
116 | <dd><dl> | | 116 | <dd><dl> |
117 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> | | 117 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> |
118 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> | | 118 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> |
119 | </dl></dd> | | 119 | </dl></dd> |
120 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk | | 120 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk |
121 | builds)</a></span></dt> | | 121 | builds)</a></span></dt> |
122 | <dd><dl> | | 122 | <dd><dl> |
123 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> | | 123 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> |
124 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> | | 124 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> |
125 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> | | 125 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> |
126 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> | | 126 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> |
127 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> | | 127 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> |
128 | <dd><dl> | | 128 | <dd><dl> |
129 | <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt> | | 129 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt> |
130 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt> | | 130 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt> |
131 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt> | | 131 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.3. Use custom directories</a></span></dt> |
132 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt> | | 132 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.4. Turn warnings into errors</a></span></dt> |
133 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt> | | 133 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.5. Reject packages for which pkglint reports errors</a></span></dt> |
134 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt> | | 134 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.6. Reject packages that contain forbidden strings</a></span></dt> |
135 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt> | | 135 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.7. Reject packages whose self-test fails</a></span></dt> |
136 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt> | | 136 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.8. Reject packages that use undefined shell variables</a></span></dt> |
137 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt> | | 137 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.9. Turn off verbose logging</a></span></dt> |
138 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt> | | | |
139 | <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt> | | | |
140 | <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt> | | | |
141 | </dl></dd> | | 138 | </dl></dd> |
142 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> | | 139 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> |
143 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> | | 140 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> |
144 | </dl></dd> | | 141 | </dl></dd> |
145 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> | | 142 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> |
146 | <dd><dl> | | 143 | <dd><dl> |
147 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> | | 144 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> |
148 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> | | 145 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> |
149 | </dl></dd> | | 146 | </dl></dd> |
150 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> | | 147 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> |
151 | <dd><dl> | | 148 | <dd><dl> |
152 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> | | 149 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> |
153 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> | | 150 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> |
| @@ -876,38 +873,35 @@ minutes! | | | @@ -876,38 +873,35 @@ minutes! |
876 | <dd><dl> | | 873 | <dd><dl> |
877 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> | | 874 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> |
878 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> | | 875 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> |
879 | </dl></dd> | | 876 | </dl></dd> |
880 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk | | 877 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk |
881 | builds)</a></span></dt> | | 878 | builds)</a></span></dt> |
882 | <dd><dl> | | 879 | <dd><dl> |
883 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> | | 880 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> |
884 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> | | 881 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> |
885 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> | | 882 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> |
886 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> | | 883 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> |
887 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> | | 884 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> |
888 | <dd><dl> | | 885 | <dd><dl> |
889 | <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt> | | 886 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt> |
890 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt> | | 887 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt> |
891 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt> | | 888 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.3. Use custom directories</a></span></dt> |
892 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt> | | 889 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.4. Turn warnings into errors</a></span></dt> |
893 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt> | | 890 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.5. Reject packages for which pkglint reports errors</a></span></dt> |
894 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt> | | 891 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.6. Reject packages that contain forbidden strings</a></span></dt> |
895 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt> | | 892 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.7. Reject packages whose self-test fails</a></span></dt> |
896 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt> | | 893 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.8. Reject packages that use undefined shell variables</a></span></dt> |
897 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt> | | 894 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.9. Turn off verbose logging</a></span></dt> |
898 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt> | | | |
899 | <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt> | | | |
900 | <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt> | | | |
901 | </dl></dd> | | 895 | </dl></dd> |
902 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> | | 896 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> |
903 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> | | 897 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> |
904 | </dl></dd> | | 898 | </dl></dd> |
905 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> | | 899 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> |
906 | <dd><dl> | | 900 | <dd><dl> |
907 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> | | 901 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> |
908 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> | | 902 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> |
909 | </dl></dd> | | 903 | </dl></dd> |
910 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> | | 904 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> |
911 | <dd><dl> | | 905 | <dd><dl> |
912 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> | | 906 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> |
913 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> | | 907 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> |
| @@ -1240,71 +1234,73 @@ release -d | | | @@ -1240,71 +1234,73 @@ release -d |
1240 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> | | 1234 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> |
1241 | </dl></dd> | | 1235 | </dl></dd> |
1242 | </dl> | | 1236 | </dl> |
1243 | </div> | | 1237 | </div> |
1244 | <p>Basically, there are two ways of using pkgsrc. The first | | 1238 | <p>Basically, there are two ways of using pkgsrc. The first |
1245 | is to only install the package tools and to use binary packages | | 1239 | is to only install the package tools and to use binary packages |
1246 | that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span> | | 1240 | that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span> |
1247 | in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span> | | 1241 | in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span> |
1248 | of pkgsrc, too. Then you are able to build your own packages, | | 1242 | of pkgsrc, too. Then you are able to build your own packages, |
1249 | and you can still use binary packages from someone else.</p> | | 1243 | and you can still use binary packages from someone else.</p> |
1250 | <div class="sect1"> | | 1244 | <div class="sect1"> |
1251 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1245 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1252 | <a name="using-pkg"></a>5.1. Using binary packages</h2></div></div></div> | | 1246 | <a name="using-pkg"></a>5.1. Using binary packages</h2></div></div></div> |
1253 | <p>On the <a class="ulink" href="https://cdn.NetBSD.org/" target="_top">cdn.NetBSD.org</a> | | 1247 | <p>On the <a class="ulink" href="http://cdn.NetBSD.org/" target="_top">cdn.NetBSD.org</a> |
1254 | site and mirrors, there are collections of binary packages, | | 1248 | site and mirrors, there are collections of binary packages, |
1255 | ready to be installed. These binary packages have been built using the | | 1249 | ready to be installed. These binary packages have been built using the |
1256 | default settings for the directories, that is:</p> | | 1250 | default settings for the directories, that is:</p> |
1257 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 1251 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
1258 | <li class="listitem"><p><code class="filename">/usr/pkg</code> for <code class="varname">LOCALBASE</code>, where most of the files are installed,</p></li> | | 1252 | <li class="listitem"><p><code class="filename">/usr/pkg</code> for <code class="varname">LOCALBASE</code>, where most of the files are installed,</p></li> |
1259 | <li class="listitem"><p><code class="filename">/usr/pkg/etc</code> for configuration files,</p></li> | | 1253 | <li class="listitem"><p><code class="filename">/usr/pkg/etc</code> for configuration files,</p></li> |
1260 | <li class="listitem"><p><code class="filename">/var</code> for <code class="varname">VARBASE</code>, where those files are installed that may change after installation.</p></li> | | 1254 | <li class="listitem"><p><code class="filename">/var</code> for <code class="varname">VARBASE</code>, where those files are installed that may change after installation.</p></li> |
1261 | </ul></div> | | 1255 | </ul></div> |
1262 | <p>If you cannot use these directories for whatever reasons (maybe | | 1256 | <p>If you cannot use these directories for whatever reasons (maybe |
1263 | because you're not root), you cannot use these binary packages, but | | 1257 | because you're not root), you cannot use these binary packages, but |
1264 | have to build the packages yourself, which is explained in <a class="xref" href="#bootstrapping-pkgsrc" title="4.2. Bootstrapping pkgsrc">Section 4.2, “Bootstrapping pkgsrc”</a>.</p> | | 1258 | have to build the packages yourself, which is explained in <a class="xref" href="#bootstrapping-pkgsrc" title="4.2. Bootstrapping pkgsrc">Section 4.2, “Bootstrapping pkgsrc”</a>.</p> |
1265 | <div class="sect2"> | | 1259 | <div class="sect2"> |
1266 | <div class="titlepage"><div><div><h3 class="title"> | | 1260 | <div class="titlepage"><div><div><h3 class="title"> |
1267 | <a name="finding-binary-packages"></a>5.1.1. Finding binary packages</h3></div></div></div> | | 1261 | <a name="finding-binary-packages"></a>5.1.1. Finding binary packages</h3></div></div></div> |
1268 | <p>To install binary packages, you first need to know from where | | 1262 | <p>To install binary packages, you first need to know from where |
1269 | to get them. The first place where you should look is on the main | | 1263 | to get them. The first place where you should look is on the main |
1270 | pkgsrc FTP server in the directory <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/packages/" target="_top"><code class="filename">/pub/pkgsrc/packages</code></a>.</p> | | 1264 | |
| | | 1265 | pkgsrc FTP server in the directory <a class="ulink" href="http://cdn.NetBSD.org/pub/pkgsrc/packages/" target="_top"><code class="filename">/pub/pkgsrc/packages</code></a>.</p> |
1271 | <p>This directory contains binary packages for multiple | | 1266 | <p>This directory contains binary packages for multiple |
1272 | platforms. First, select your operating system. (Ignore the | | 1267 | platforms. First, select your operating system. (Ignore the |
1273 | directories with version numbers attached to it, they just exist for | | 1268 | directories with version numbers attached to it, they just exist for |
1274 | legacy reasons.) Then, select your hardware architecture, and in the | | 1269 | legacy reasons.) Then, select your hardware architecture, and in the |
1275 | third step, the OS version and the <span class="quote">“<span class="quote">version</span>”</span> of pkgsrc.</p> | | 1270 | third step, the OS version and the <span class="quote">“<span class="quote">version</span>”</span> of pkgsrc.</p> |
1276 | <p>In this directory, you often find a file called | | 1271 | <p>In this directory, you often find a file called |
1277 | <code class="filename">bootstrap.tar.gz</code> which contains the package | | 1272 | <code class="filename">bootstrap.tar.gz</code> which contains the package |
1278 | management tools. If the file is missing, it is likely that your | | 1273 | management tools. If the file is missing, it is likely that your |
1279 | operating system already provides those tools. Download the file and | | 1274 | operating system already provides those tools. Download the file and |
1280 | extract it in the <code class="filename">/</code> directory. It will create | | 1275 | extract it in the <code class="filename">/</code> directory. It will create |
1281 | the directories <code class="filename">/usr/pkg</code> (containing the tools | | 1276 | the directories <code class="filename">/usr/pkg</code> (containing the tools |
1282 | for managing binary packages and the database of installed packages).</p> | | 1277 | for managing binary packages and the database of installed packages).</p> |
1283 | </div> | | 1278 | </div> |
1284 | <div class="sect2"> | | 1279 | <div class="sect2"> |
1285 | <div class="titlepage"><div><div><h3 class="title"> | | 1280 | <div class="titlepage"><div><div><h3 class="title"> |
1286 | <a name="installing-binary-packages"></a>5.1.2. Installing binary packages</h3></div></div></div> | | 1281 | <a name="installing-binary-packages"></a>5.1.2. Installing binary packages</h3></div></div></div> |
1287 | <p>In the directory from the last section, there is a | | 1282 | <p>In the directory from the last section, there is a |
1288 | subdirectory called <code class="filename">All/</code>, which contains all the | | 1283 | subdirectory called <code class="filename">All/</code>, which contains all the |
1289 | binary packages that are available for the platform, excluding those | | 1284 | binary packages that are available for the platform, excluding those |
1290 | that may not be distributed via FTP or CDROM (depending on which | | 1285 | that may not be distributed via FTP or CDROM (depending on which |
1291 | medium you are using).</p> | | 1286 | medium you are using).</p> |
1292 | <p>To install packages directly from an FTP or HTTP server, run | | 1287 | <p>To install packages directly from an FTP or HTTP server, run |
1293 | the following commands in a Bourne-compatible shell (be sure to | | 1288 | the following commands in a Bourne-compatible shell (be sure to |
1294 | <span class="command"><strong>su</strong></span> to root first):</p> | | 1289 | <span class="command"><strong>su</strong></span> to root first):</p> |
1295 | <pre class="screen"> | | 1290 | <pre class="screen"> |
1296 | <code class="prompt">#</code> <strong class="userinput"><code>PATH="/usr/pkg/sbin:$PATH"</code></strong> | | 1291 | <code class="prompt">#</code> <strong class="userinput"><code>PATH="/usr/pkg/sbin:$PATH"</code></strong> |
1297 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages"</code></strong> | | 1292 | |
| | | 1293 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages"</code></strong> |
1298 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="$PKG_PATH/<em class="replaceable"><code>OPSYS</code></em>/<em class="replaceable"><code>ARCH</code></em>/<em class="replaceable"><code>VERSIONS</code></em>/All/"</code></strong> | | 1294 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="$PKG_PATH/<em class="replaceable"><code>OPSYS</code></em>/<em class="replaceable"><code>ARCH</code></em>/<em class="replaceable"><code>VERSIONS</code></em>/All/"</code></strong> |
1299 | <code class="prompt">#</code> <strong class="userinput"><code>export PATH PKG_PATH</code></strong> | | 1295 | <code class="prompt">#</code> <strong class="userinput"><code>export PATH PKG_PATH</code></strong> |
1300 | </pre> | | 1296 | </pre> |
1301 | <p>Instead of URLs, you can also use local paths, for example if | | 1297 | <p>Instead of URLs, you can also use local paths, for example if |
1302 | you are installing from a set of CDROMs, DVDs or an NFS-mounted | | 1298 | you are installing from a set of CDROMs, DVDs or an NFS-mounted |
1303 | repository. If you want to install packages from multiple sources, | | 1299 | repository. If you want to install packages from multiple sources, |
1304 | you can separate them by a semicolon in | | 1300 | you can separate them by a semicolon in |
1305 | <code class="varname">PKG_PATH</code>.</p> | | 1301 | <code class="varname">PKG_PATH</code>.</p> |
1306 | <p>After these preparations, installing a package is very | | 1302 | <p>After these preparations, installing a package is very |
1307 | easy:</p> | | 1303 | easy:</p> |
1308 | <pre class="screen"> | | 1304 | <pre class="screen"> |
1309 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add libreoffice</code></strong> | | 1305 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add libreoffice</code></strong> |
1310 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap24-php71-*</code></strong> | | 1306 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap24-php71-*</code></strong> |
| @@ -1350,48 +1346,50 @@ and you can still use binary packages fr | | | @@ -1350,48 +1346,50 @@ and you can still use binary packages fr |
1350 | <div class="sect2"> | | 1346 | <div class="sect2"> |
1351 | <div class="titlepage"><div><div><h3 class="title"> | | 1347 | <div class="titlepage"><div><div><h3 class="title"> |
1352 | <a name="using.pkg_info"></a>5.1.4. Getting information about installed packages</h3></div></div></div> | | 1348 | <a name="using.pkg_info"></a>5.1.4. Getting information about installed packages</h3></div></div></div> |
1353 | <p>The <span class="command"><strong>pkg_info</strong></span> shows information about | | 1349 | <p>The <span class="command"><strong>pkg_info</strong></span> shows information about |
1354 | installed packages or binary package files.</p> | | 1350 | installed packages or binary package files.</p> |
1355 | </div> | | 1351 | </div> |
1356 | <div class="sect2"> | | 1352 | <div class="sect2"> |
1357 | <div class="titlepage"><div><div><h3 class="title"> | | 1353 | <div class="titlepage"><div><div><h3 class="title"> |
1358 | <a name="vulnerabilities"></a>5.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div> | | 1354 | <a name="vulnerabilities"></a>5.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div> |
1359 | <p> | | 1355 | <p> |
1360 | The pkgsrc Security Team and Packages Groups maintain a list of | | 1356 | The pkgsrc Security Team and Packages Groups maintain a list of |
1361 | known security vulnerabilities to packages which are (or have been) | | 1357 | known security vulnerabilities to packages which are (or have been) |
1362 | included in pkgsrc. The list is available from the NetBSD | | 1358 | included in pkgsrc. The list is available from the NetBSD |
1363 | FTP site at <a class="ulink" href="https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a>. | | 1359 | |
| | | 1360 | FTP site at <a class="ulink" href="http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a>. |
1364 | </p> | | 1361 | </p> |
1365 | <p> | | 1362 | <p> |
1366 | Through <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, | | 1363 | Through <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, |
1367 | this list can be downloaded | | 1364 | this list can be downloaded |
1368 | automatically, and a security audit of all packages installed on a system | | 1365 | automatically, and a security audit of all packages installed on a system |
1369 | can take place. | | 1366 | can take place. |
1370 | </p> | | 1367 | </p> |
1371 | <p> | | 1368 | <p> |
1372 | There are two components to auditing. The first | | 1369 | There are two components to auditing. The first |
1373 | step, <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, | | 1370 | step, <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, |
1374 | is for downloading | | 1371 | is for downloading |
1375 | the list of vulnerabilities from the NetBSD FTP site. The second | | 1372 | the list of vulnerabilities from the NetBSD FTP site. The second |
1376 | step, <span class="command"><strong>pkg_admin audit</strong></span>, checks to see if any of your | | 1373 | step, <span class="command"><strong>pkg_admin audit</strong></span>, checks to see if any of your |
1377 | installed packages are vulnerable. If a package is vulnerable, you | | 1374 | installed packages are vulnerable. If a package is vulnerable, you |
1378 | will see output similar to the following: | | 1375 | will see output similar to the following: |
1379 | </p> | | 1376 | </p> |
1380 | <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see | | 1377 | <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see |
1381 | https://www.samba.org/samba/whatsnew/macroexploit.html</pre> | | 1378 | https://www.samba.org/samba/whatsnew/macroexploit.html</pre> |
1382 | <p> | | 1379 | <p> |
1383 | You may wish to have the | | 1380 | You may wish to have the |
1384 | <a class="ulink" href="https://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">vulnerabilities</a> | | 1381 | |
| | | 1382 | <a class="ulink" href="http://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">vulnerabilities</a> |
1385 | file downloaded daily so that | | 1383 | file downloaded daily so that |
1386 | it remains current. This may be done by adding an appropriate entry | | 1384 | it remains current. This may be done by adding an appropriate entry |
1387 | to the root users <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?crontab+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">crontab</span>(5)</span></a> entry. For example the entry | | 1385 | to the root users <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?crontab+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">crontab</span>(5)</span></a> entry. For example the entry |
1388 | </p> | | 1386 | </p> |
1389 | <pre class="screen"> | | 1387 | <pre class="screen"> |
1390 | # Download vulnerabilities file | | 1388 | # Download vulnerabilities file |
1391 | 0 3 * * * /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1 | | 1389 | 0 3 * * * /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1 |
1392 | # Audit the installed packages and email results to root | | 1390 | # Audit the installed packages and email results to root |
1393 | 9 3 * * * /usr/pkg/sbin/pkg_admin audit |mail -s "Installed package audit result" \ | | 1391 | 9 3 * * * /usr/pkg/sbin/pkg_admin audit |mail -s "Installed package audit result" \ |
1394 | root >/dev/null 2>&1 | | 1392 | root >/dev/null 2>&1 |
1395 | </pre> | | 1393 | </pre> |
1396 | <p> | | 1394 | <p> |
1397 | will update the vulnerability list every day at 3AM, followed by an audit | | 1395 | will update the vulnerability list every day at 3AM, followed by an audit |
| @@ -2083,38 +2081,35 @@ PKG_OPTIONS.apache= suexec | | | @@ -2083,38 +2081,35 @@ PKG_OPTIONS.apache= suexec |
2083 | <div class="chapter"> | | 2081 | <div class="chapter"> |
2084 | <div class="titlepage"><div><div><h2 class="title"> | | 2082 | <div class="titlepage"><div><div><h2 class="title"> |
2085 | <a name="bulk"></a>Chapter 8. Creating binary packages for everything in pkgsrc (bulk | | 2083 | <a name="bulk"></a>Chapter 8. Creating binary packages for everything in pkgsrc (bulk |
2086 | builds)</h2></div></div></div> | | 2084 | builds)</h2></div></div></div> |
2087 | <div class="toc"> | | 2085 | <div class="toc"> |
2088 | <p><b>Table of Contents</b></p> | | 2086 | <p><b>Table of Contents</b></p> |
2089 | <dl class="toc"> | | 2087 | <dl class="toc"> |
2090 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> | | 2088 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> |
2091 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> | | 2089 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> |
2092 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> | | 2090 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> |
2093 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> | | 2091 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> |
2094 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> | | 2092 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> |
2095 | <dd><dl> | | 2093 | <dd><dl> |
2096 | <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt> | | 2094 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt> |
2097 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt> | | 2095 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt> |
2098 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt> | | 2096 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.3. Use custom directories</a></span></dt> |
2099 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt> | | 2097 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.4. Turn warnings into errors</a></span></dt> |
2100 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt> | | 2098 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.5. Reject packages for which pkglint reports errors</a></span></dt> |
2101 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt> | | 2099 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.6. Reject packages that contain forbidden strings</a></span></dt> |
2102 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt> | | 2100 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.7. Reject packages whose self-test fails</a></span></dt> |
2103 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt> | | 2101 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.8. Reject packages that use undefined shell variables</a></span></dt> |
2104 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt> | | 2102 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.9. Turn off verbose logging</a></span></dt> |
2105 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt> | | | |
2106 | <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt> | | | |
2107 | <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt> | | | |
2108 | </dl></dd> | | 2103 | </dl></dd> |
2109 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> | | 2104 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> |
2110 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> | | 2105 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> |
2111 | </dl> | | 2106 | </dl> |
2112 | </div> | | 2107 | </div> |
2113 | <p>For a number of reasons, you may want to build binary packages | | 2108 | <p>For a number of reasons, you may want to build binary packages |
2114 | for a large selected set of packages in pkgsrc, or even for all pkgsrc packages. | | 2109 | for a large selected set of packages in pkgsrc, or even for all pkgsrc packages. |
2115 | For instance, when you have multiple machines that should run the same software, | | 2110 | For instance, when you have multiple machines that should run the same software, |
2116 | it is wasted time if they all build their packages themselves from source. | | 2111 | it is wasted time if they all build their packages themselves from source. |
2117 | Or you may want to build a list of packages you want and check them before | | 2112 | Or you may want to build a list of packages you want and check them before |
2118 | deploying onto production systems. | | 2113 | deploying onto production systems. |
2119 | There is a way of getting a set of binary packages: | | 2114 | There is a way of getting a set of binary packages: |
2120 | the bulk build system, or pbulk ("p" stands for "parallel"). | | 2115 | the bulk build system, or pbulk ("p" stands for "parallel"). |
| @@ -2228,236 +2223,180 @@ temporary filesystems, others must survi | | | @@ -2228,236 +2223,180 @@ temporary filesystems, others must survi |
2228 | <li class="listitem"><p>10 GB for the log files (read-write, remote, permanent)</p></li> | | 2223 | <li class="listitem"><p>10 GB for the log files (read-write, remote, permanent)</p></li> |
2229 | <li class="listitem"><p>5 GB for temporary files (read-write, local, temporary)</p></li> | | 2224 | <li class="listitem"><p>5 GB for temporary files (read-write, local, temporary)</p></li> |
2230 | </ul></div> | | 2225 | </ul></div> |
2231 | </div> | | 2226 | </div> |
2232 | <div class="sect1"> | | 2227 | <div class="sect1"> |
2233 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2228 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2234 | <a name="bulk.var"></a>8.4. Bulk build variants</h2></div></div></div> | | 2229 | <a name="bulk.var"></a>8.4. Bulk build variants</h2></div></div></div> |
2235 | <p>To ensure that pkgsrc packages work in different configurations, it | | 2230 | <p>To ensure that pkgsrc packages work in different configurations, it |
2236 | makes sense to run non-default bulk builds from time to time. This | | 2231 | makes sense to run non-default bulk builds from time to time. This |
2237 | section lists some ideas for bulk builds that intentionally let packages | | 2232 | section lists some ideas for bulk builds that intentionally let packages |
2238 | fail if they don't follow the pkgsrc style.</p> | | 2233 | fail if they don't follow the pkgsrc style.</p> |
2239 | <div class="sect2"> | | 2234 | <div class="sect2"> |
2240 | <div class="titlepage"><div><div><h3 class="title"> | | 2235 | <div class="titlepage"><div><div><h3 class="title"> |
2241 | <a name="bulk.var.subst_noop"></a>8.4.1. Strict SUBST blocks</h3></div></div></div> | | 2236 | <a name="bulk.var.confopt"></a>8.4.1. Detect unknown configure options</h3></div></div></div> |
2242 | <p>Up to May 2020, the SUBST blocks ignored files that didn't exist, | | | |
2243 | as well as substitutions that didn't have any effect. There were quite a | | | |
2244 | few SUBST blocks that were redundant, and these have been removed | | | |
2245 | already.</p> | | | |
2246 | <p>The next step would be to not only check that each filename pattern | | | |
2247 | has an effect but also that each substitution in SUBST_SED or SUBST_VARS | | | |
2248 | applies to at least one file.</p> | | | |
2249 | <p>To do this, <code class="filename">mk/subst.mk</code> would have to be | | | |
2250 | adjusted, in a similar way as the check for no-op SUBST_FILES. There are | | | |
2251 | several regression tests in <code class="filename">regress/infra-unittests</code> | | | |
2252 | that help to get all edge cases correct.</p> | | | |
2253 | <p>When a package fails this additional check, there are various | | | |
2254 | possible causes why the <code class="varname">SUBST_SED</code> became a | | | |
2255 | no-op.</p> | | | |
2256 | <div class="orderedlist"><ol class="orderedlist" type="1"> | | | |
2257 | <li class="listitem"><p>The pattern used to be found in a former version of the | | | |
2258 | package, but is not needed anymore. In that case, just remove | | | |
2259 | it.</p></li> | | | |
2260 | <li class="listitem"><p>The pattern contains a typo. In that case, fix the typo | | | |
2261 | and bump <code class="varname">PKGREVISION</code>, since the fixed typo will | | | |
2262 | probably modify the resulting binary package.</p></li> | | | |
2263 | <li class="listitem"><p>There is a patch that is applied before the SUBST block, | | | |
2264 | and the patch accidentally contains the change that was intended for the | | | |
2265 | SUBST block. In that case, remove the respective hunk from the | | | |
2266 | patch.</p></li> | | | |
2267 | </ol></div> | | | |
2268 | </div> | | | |
2269 | <div class="sect2"> | | | |
2270 | <div class="titlepage"><div><div><h3 class="title"> | | | |
2271 | <a name="bulk.var.confopt"></a>8.4.2. Detect unknown configure options</h3></div></div></div> | | | |
2272 | <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2237 | <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2273 | <pre class="programlisting"> | | 2238 | <pre class="programlisting"> |
2274 | GNU_CONFIGURE_STRICT= yes | | 2239 | GNU_CONFIGURE_STRICT= yes |
2275 | </pre> | | 2240 | </pre> |
2276 | <p>When a package fails this additional check, the most common cause | | 2241 | <p>When a package fails this additional check, the most common cause |
2277 | is that the configure option was valid for an older version of the | | 2242 | is that the configure option was valid for an older version of the |
2278 | package but does not apply anymore. In that case, just remove it.</p> | | 2243 | package but does not apply anymore. In that case, just remove it.</p> |
2279 | </div> | | 2244 | </div> |
2280 | <div class="sect2"> | | 2245 | <div class="sect2"> |
2281 | <div class="titlepage"><div><div><h3 class="title"> | | 2246 | <div class="titlepage"><div><div><h3 class="title"> |
2282 | <a name="bulk.var.comperr"></a>8.4.3. Detect classes of bugs by forcing compiler warnings</h3></div></div></div> | | 2247 | <a name="bulk.var.comperr"></a>8.4.2. Detect classes of bugs by forcing compiler warnings</h3></div></div></div> |
2283 | <p>The job of a compiler is not restricted to producing executable | | 2248 | <p>The job of a compiler is not restricted to producing executable |
2284 | code, most compilers also detects typical mistakes.</p> | | 2249 | code, most compilers also detect typical programming mistakes. The pkgsrc |
2285 | <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2250 | compiler wrappers make it easy to force compiler options when the package |
| | | 2251 | is built. This can be used to find typical bugs across all packages that |
| | | 2252 | are in pkgsrc. By reporting these bugs upstream, the packages will be |
| | | 2253 | more reliable with the next updates.</p> |
| | | 2254 | <p>Add some of the following lines to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p> |
2286 | <pre class="programlisting"> | | 2255 | <pre class="programlisting"> |
2287 | CFLAGS+= -Werror=char-subscripts | | 2256 | CFLAGS+= -Werror=char-subscripts |
| | | 2257 | CFLAGS+= -Werror=implicit-function-declaration |
2288 | </pre> | | 2258 | </pre> |
2289 | <p>When a package fails this additional check, first document the | | 2259 | <p>When a package fails to build using these stricter compiler |
2290 | circumstances in which the compiler produced the error message. This | | 2260 | options, document the circumstances in which the compiler produced the |
2291 | includes:</p> | | 2261 | error message. This includes:</p> |
2292 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2262 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2293 | <li class="listitem"><p>The platform | | 2263 | <li class="listitem"><p>The platform |
2294 | (<code class="varname">MACHINE_PLATFORM</code>)</p></li> | | 2264 | (<code class="varname">MACHINE_PLATFORM</code>)</p></li> |
2295 | <li class="listitem"><p>The source file</p></li> | | 2265 | <li class="listitem"><p>The source file</p></li> |
2296 | <li class="listitem"><p>An excerpt of the code. GCC and Clang already do this as | | 2266 | <li class="listitem"><p>An excerpt of the code. GCC and Clang already do this as |
2297 | part of the diagnostic.</p></li> | | 2267 | part of the diagnostic.</p></li> |
2298 | <li class="listitem"><p>The error message from the compiler.</p></li> | | 2268 | <li class="listitem"><p>The exact error message from the compiler.</p></li> |
2299 | </ul></div> | | 2269 | </ul></div> |
2300 | <p>If a package produces these error messages, but the package is | | 2270 | <p>If a package produces these error messages, but the package is |
2301 | fine, document this in the package Makefile, like this:</p> | | 2271 | fine, record this in your local <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, like this, to skip this check |
| | | 2272 | in the next builds:</p> |
2302 | <pre class="programlisting"> | | 2273 | <pre class="programlisting"> |
| | | 2274 | .if ${PKGPATH} == category/package |
2303 | # Version ${VERSION} failed on ${MACHINE_PLATFORM}: | | 2275 | # Version ${VERSION} failed on ${MACHINE_PLATFORM}: |
2304 | # error message | | 2276 | # error message |
2305 | # code | | 2277 | # code |
2306 | # reason why the code does not need to be fixed | | 2278 | # Reason why the code does not need to be fixed. |
2307 | BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts | | 2279 | BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts |
| | | 2280 | .endif |
2308 | </pre> | | 2281 | </pre> |
2309 | <p>If the error messages from the compiler are valid and the code | | 2282 | <p>If the error messages from the compiler are valid and the code |
2310 | needs to be fixed, prepare a patch for a single source file, or if it's a | | 2283 | needs to be fixed, prepare a local patch (see |
2311 | one-liner fix, add a SUBST block to the package Makefile. In any case, | | 2284 | <code class="varname">LOCALPATCHES</code>) and report the bug to the upstream |
2312 | report it to the upstream authors of the package.</p> | | 2285 | authors of the package, providing them with the information you collected |
| | | 2286 | above.</p> |
| | | 2287 | <p>Patches that are not essential for the package to work should only |
| | | 2288 | be reported upstream but not committed to pkgsrc, to make future updates |
| | | 2289 | easier.</p> |
2313 | </div> | | 2290 | </div> |
2314 | <div class="sect2"> | | 2291 | <div class="sect2"> |
2315 | <div class="titlepage"><div><div><h3 class="title"> | | 2292 | <div class="titlepage"><div><div><h3 class="title"> |
2316 | <a name="bulk.var.dirs"></a>8.4.4. Use custom directories</h3></div></div></div> | | 2293 | <a name="bulk.var.dirs"></a>8.4.3. Use custom directories</h3></div></div></div> |
2317 | <p>Some directories like <code class="varname">PREFIX</code>, | | 2294 | <p>Some directories like <code class="varname">PREFIX</code>, |
2318 | <code class="varname">VARBASE</code>, <code class="varname">PKG_SYSCONFDIR</code>, | | 2295 | <code class="varname">VARBASE</code>, <code class="varname">PKG_SYSCONFDIR</code>, |
2319 | <code class="varname">PKGMANDIR</code>, <code class="varname">PKG_INFODIR</code> can be | | 2296 | <code class="varname">PKGMANDIR</code>, <code class="varname">PKG_INFODIR</code> can be |
2320 | configured in pkgsrc. Set these to arbitrary paths during bootstrap or | | 2297 | configured in pkgsrc. Set these to arbitrary paths during bootstrap or |
2321 | afterwards in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2298 | afterwards in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2322 | <pre class="programlisting"> | | 2299 | <pre class="programlisting"> |
2323 | PREFIX= /a-random-uuid | | 2300 | PREFIX= /a-random-uuid |
2324 | PKG_SYSCONFDIR= /a-random-uuid | | 2301 | PKG_SYSCONFDIR= /a-random-uuid |
2325 | VARBASE= /a-random-uuid | | 2302 | VARBASE= /a-random-uuid |
2326 | PKGMANDIR= a-random-uuid | | 2303 | PKGMANDIR= a-random-uuid |
2327 | PKG_INFODIR= a-random-uuid | | 2304 | PKG_INFODIR= a-random-uuid |
2328 | </pre> | | 2305 | </pre> |
2329 | </div> | | 2306 | </div> |
2330 | <div class="sect2"> | | 2307 | <div class="sect2"> |
2331 | <div class="titlepage"><div><div><h3 class="title"> | | 2308 | <div class="titlepage"><div><div><h3 class="title"> |
2332 | <a name="bulk.var.warn"></a>8.4.5. Turn warnings into errors</h3></div></div></div> | | 2309 | <a name="bulk.var.warn"></a>8.4.4. Turn warnings into errors</h3></div></div></div> |
2333 | <p>When building a package, warnings are typically ignored since they | | 2310 | <p>When building a package, warnings are typically ignored since they |
2334 | just flow by and do not cause the build to fail immediately. To find | | 2311 | just flow by and do not cause the build to fail immediately. To find |
2335 | these warnings, redefine them to errors in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2312 | these warnings, redefine them to errors in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2336 | <pre class="programlisting"> | | 2313 | <pre class="programlisting"> |
2337 | DELAYED_WARNING_MSG= ${DELAYED_ERROR_MSG} "(was warning)" | | 2314 | DELAYED_WARNING_MSG= ${DELAYED_ERROR_MSG} "(was warning)" |
2338 | WARNING_MSG= ${FAIL_MSG} "(was warning)" | | 2315 | WARNING_MSG= ${FAIL_MSG} "(was warning)" |
2339 | </pre> | | 2316 | </pre> |
2340 | <p>(There are many more classes of warnings in pkgsrc, and most of | | 2317 | <p>(There are many more classes of warnings in pkgsrc, and most of |
2341 | them can be redefined with a simple definition like above.</p> | | 2318 | them can be redefined with a simple definition like above.</p> |
2342 | <p>If a package suggest to add <code class="varname">USE_TOOLS+=perl</code> to | | 2319 | <p>If a package suggests to add <code class="varname">USE_TOOLS+=perl</code> to |
2343 | the package Makefile, research whether the package actually needs Perl. | | 2320 | the package Makefile, research whether the package actually needs Perl. |
2344 | If it does, add <code class="varname">USE_TOOLS+=perl</code> to the package | | 2321 | If it does, add <code class="varname">USE_TOOLS+=perl</code> to the package |
2345 | Makefile, and if it doesn't, add | | 2322 | Makefile, and if it doesn't, add |
2346 | <code class="varname">TOOLS_BROKEN+=perl</code>.</p> | | 2323 | <code class="varname">TOOLS_BROKEN+=perl</code>.</p> |
2347 | </div> | | 2324 | </div> |
2348 | <div class="sect2"> | | 2325 | <div class="sect2"> |
2349 | <div class="titlepage"><div><div><h3 class="title"> | | 2326 | <div class="titlepage"><div><div><h3 class="title"> |
2350 | <a name="bulk.var.pkglint"></a>8.4.6. Reject packages for which pkglint reports errors</h3></div></div></div> | | 2327 | <a name="bulk.var.pkglint"></a>8.4.5. Reject packages for which pkglint reports errors</h3></div></div></div> |
2351 | <p>Using pkglint as part of the regular build process is mostly a | | 2328 | <p>Using pkglint as part of the regular build process is mostly a |
2352 | waste of time. If you want to fix some of the warnings, just run pkglint | | 2329 | waste of time. If you want to fix some of the warnings, just run pkglint |
2353 | recursively on the whole pkgsrc tree. This will take a few minutes (up to | | 2330 | recursively on the whole pkgsrc tree. This will take a few minutes (up to |
2354 | 10), which is much faster than a complete bulk build.</p> | | 2331 | 10), which is much faster than a complete bulk build.</p> |
2355 | </div> | | 2332 | </div> |
2356 | <div class="sect2"> | | 2333 | <div class="sect2"> |
2357 | <div class="titlepage"><div><div><h3 class="title"> | | 2334 | <div class="titlepage"><div><div><h3 class="title"> |
2358 | <a name="bulk.var.strings"></a>8.4.7. Reject packages that contain forbidden strings</h3></div></div></div> | | 2335 | <a name="bulk.var.strings"></a>8.4.6. Reject packages that contain forbidden strings</h3></div></div></div> |
2359 | <p>To ensure that the binary packages don't contain references to the | | 2336 | <p>To ensure that the binary packages don't contain references to the |
2360 | build directory, there is already <code class="varname">CHECK_WRKREF</code>. If | | 2337 | build directory, there is already <code class="varname">CHECK_WRKREF</code>. If |
2361 | that variable includes the item <code class="literal">extra</code>, it is | | 2338 | that variable includes the item <code class="literal">extra</code>, it is |
2362 | possible to define additional patterns that must not appear in any | | 2339 | possible to define additional patterns that must not appear in any |
2363 | installed file. This is specified in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2340 | installed file. This is specified in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2364 | <pre class="programlisting"> | | 2341 | <pre class="programlisting"> |
2365 | CHECK_WRKREF= extra | | 2342 | CHECK_WRKREF= extra |
2366 | CHECK_WRKREF_EXTRA_DIRS+= /usr/local | | 2343 | CHECK_WRKREF_EXTRA_DIRS+= /usr/local |
2367 | CHECK_WRKREF_EXTRA_DIRS+= /usr/pkg | | 2344 | CHECK_WRKREF_EXTRA_DIRS+= /usr/pkg |
2368 | CHECK_WRKREF_EXTRA_DIRS+= @[A-Z][A-Z]*@ | | 2345 | CHECK_WRKREF_EXTRA_DIRS+= @[A-Z][A-Z]*@ |
2369 | </pre> | | 2346 | </pre> |
2370 | <p>The above patterns will probably generate many false positives, | | 2347 | <p>The above patterns will probably generate many false positives, |
2371 | therefore the results need to be taken with a grain of salt.</p> | | 2348 | therefore the results need to be taken with a grain of salt.</p> |
2372 | </div> | | 2349 | </div> |
2373 | <div class="sect2"> | | 2350 | <div class="sect2"> |
2374 | <div class="titlepage"><div><div><h3 class="title"> | | 2351 | <div class="titlepage"><div><div><h3 class="title"> |
2375 | <a name="bulk.var.test"></a>8.4.8. Reject packages whose self-test fails</h3></div></div></div> | | 2352 | <a name="bulk.var.test"></a>8.4.7. Reject packages whose self-test fails</h3></div></div></div> |
2376 | <p>To run the test suites that come with each package, add this line | | 2353 | <p>To run the test suites that come with each package, add this line |
2377 | to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2354 | to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2378 | <pre class="programlisting"> | | 2355 | <pre class="programlisting"> |
2379 | PKGSRC_RUN_TEST= yes | | 2356 | PKGSRC_RUN_TEST= yes |
2380 | </pre> | | 2357 | </pre> |
2381 | <p>Be prepared that even the most basic packages fail this test. When | | 2358 | <p>Be prepared that even the most basic packages fail this test. When |
2382 | doing a bulk build with this, it will often abort in the early phase | | 2359 | doing a bulk build with this, it will often abort in the early phase |
2383 | where the packages are scanned for their dependencies since there are | | 2360 | where the packages are scanned for their dependencies since there are |
2384 | cyclic dependencies. There is still a lot to do in this area.</p> | | 2361 | cyclic dependencies. There is still a lot to do in this area.</p> |
2385 | </div> | | 2362 | </div> |
2386 | <div class="sect2"> | | 2363 | <div class="sect2"> |
2387 | <div class="titlepage"><div><div><h3 class="title"> | | 2364 | <div class="titlepage"><div><div><h3 class="title"> |
2388 | <a name="bulk.var.shvar"></a>8.4.9. Reject packages that use undefined shell variables</h3></div></div></div> | | 2365 | <a name="bulk.var.shvar"></a>8.4.8. Reject packages that use undefined shell variables</h3></div></div></div> |
2389 | <p>To catch typos in the shell snippets from the Makefile fragments, | | 2366 | <p>To catch typos in the shell snippets from the Makefile fragments, |
2390 | add the <code class="literal">-u</code> flag to most of the commands by adding this | | 2367 | add the <code class="literal">-u</code> flag to most of the commands by adding this |
2391 | line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2368 | line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2392 | <pre class="programlisting"> | | 2369 | <pre class="programlisting"> |
2393 | RUN= @set -eu; | | 2370 | RUN= @set -eu; |
2394 | </pre> | | 2371 | </pre> |
2395 | <p>See <code class="filename">mk/misc/common.mk</code> for the existing | | 2372 | <p>See <code class="filename">mk/misc/common.mk</code> for the existing |
2396 | definition.</p> | | 2373 | definition.</p> |
2397 | </div> | | 2374 | </div> |
2398 | <div class="sect2"> | | 2375 | <div class="sect2"> |
2399 | <div class="titlepage"><div><div><h3 class="title"> | | 2376 | <div class="titlepage"><div><div><h3 class="title"> |
2400 | <a name="bulk.var.quiet"></a>8.4.10. Turn off verbose logging</h3></div></div></div> | | 2377 | <a name="bulk.var.quiet"></a>8.4.9. Turn off verbose logging</h3></div></div></div> |
2401 | <p>The build logs of a package are often quite long. This allows error | | 2378 | <p>The build logs of a package are often quite long. This allows error |
2402 | messages or other interesting details to hide between the noise. To make | | 2379 | messages or other interesting details to hide between the noise. To make |
2403 | the actual error message stand out more, add these lines to | | 2380 | the actual error message stand out more, add these lines to |
2404 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2381 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2405 | <pre class="programlisting"> | | 2382 | <pre class="programlisting"> |
2406 | GNU_CONFIGURE_QUIET= yes | | 2383 | GNU_CONFIGURE_QUIET= yes |
2407 | MAKE_FLAGS+= -s | | 2384 | MAKE_FLAGS+= -s |
2408 | </pre> | | 2385 | </pre> |
2409 | <p>The <code class="literal">-s</code> option works for both GNU Make and BSD | | 2386 | <p>The <code class="literal">-s</code> option works for both GNU Make and BSD |
2410 | Make. On exotic platforms with their own make, it may be a little | | 2387 | Make. On exotic platforms with their own make, it may be a little |
2411 | different.</p> | | 2388 | different.</p> |
2412 | </div> | | 2389 | </div> |
2413 | <div class="sect2"> | | | |
2414 | <div class="titlepage"><div><div><h3 class="title"> | | | |
2415 | <a name="bulk.var.options"></a>8.4.11. Select random sets of options</h3></div></div></div> | | | |
2416 | <p>Most bulk builds run with the default package options. This means | | | |
2417 | that other combinations of options are not regularly tested. To do this, | | | |
2418 | run a bulk build with these configurations.</p> | | | |
2419 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | | |
2420 | <li class="listitem"><p>no options enabled</p></li> | | | |
2421 | <li class="listitem"><p>all options enabled</p></li> | | | |
2422 | <li class="listitem"><p>2n + 0</p></li> | | | |
2423 | <li class="listitem"><p>2n + 1</p></li> | | | |
2424 | <li class="listitem"><p>4n + 0..1</p></li> | | | |
2425 | <li class="listitem"><p>4n + 2..3</p></li> | | | |
2426 | <li class="listitem"><p>8n + 0..3</p></li> | | | |
2427 | <li class="listitem"><p>8n + 4..7</p></li> | | | |
2428 | <li class="listitem"><p>2048n + 0..1023</p></li> | | | |
2429 | <li class="listitem"><p>2048n + 1024..2047</p></li> | | | |
2430 | </ul></div> | | | |
2431 | <p>Open questions are:</p> | | | |
2432 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | | |
2433 | <li class="listitem"><p>how to collect all options from the entire | | | |
2434 | pkgsrc</p></li> | | | |
2435 | <li class="listitem"><p>how to handle mutually exclusive | | | |
2436 | options</p></li> | | | |
2437 | <li class="listitem"><p>the sets of mutually exclusive options are defined | | | |
2438 | per-package</p></li> | | | |
2439 | <li class="listitem"><p>the sets of nonempty sets are defined | | | |
2440 | per-package</p></li> | | | |
2441 | </ul></div> | | | |
2442 | </div> | | | |
2443 | <div class="sect2"> | | | |
2444 | <div class="titlepage"><div><div><h3 class="title"> | | | |
2445 | <a name="bulk.var.build_defs"></a>8.4.12. Select random configurations of BUILD_DEFS</h3></div></div></div> | | | |
2446 | <p>Just like the <code class="varname">PKG_OPTIONS</code>, the | | | |
2447 | <code class="varname">BUILD_DEFS</code> also allow different variants of pkgsrc to | | | |
2448 | be created. The same ideas as in <a class="xref" href="#bulk.var.options" title="8.4.11. Select random sets of options">Section 8.4.11, “Select random sets of options”</a> | | | |
2449 | apply.</p> | | | |
2450 | </div> | | | |
2451 | </div> | | 2390 | </div> |
2452 | <div class="sect1"> | | 2391 | <div class="sect1"> |
2453 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2392 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2454 | <a name="creating-cdroms"></a>8.5. Creating a multiple CD-ROM packages collection</h2></div></div></div> | | 2393 | <a name="creating-cdroms"></a>8.5. Creating a multiple CD-ROM packages collection</h2></div></div></div> |
2455 | <p>After your pkgsrc bulk-build has completed, you may wish to | | 2394 | <p>After your pkgsrc bulk-build has completed, you may wish to |
2456 | create a CD-ROM set of the resulting binary packages to assist | | 2395 | create a CD-ROM set of the resulting binary packages to assist |
2457 | in installing packages on other machines. The | | 2396 | in installing packages on other machines. The |
2458 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/cdpack/README.html" target="_top"><code class="filename">pkgtools/cdpack</code></a> package provides | | 2397 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/cdpack/README.html" target="_top"><code class="filename">pkgtools/cdpack</code></a> package provides |
2459 | a simple tool for creating the ISO 9660 images. | | 2398 | a simple tool for creating the ISO 9660 images. |
2460 | <span class="command"><strong>cdpack</strong></span> arranges the packages on the CD-ROMs in a | | 2399 | <span class="command"><strong>cdpack</strong></span> arranges the packages on the CD-ROMs in a |
2461 | way that keeps all the dependencies for a given package on the same | | 2400 | way that keeps all the dependencies for a given package on the same |
2462 | CD as that package.</p> | | 2401 | CD as that package.</p> |
2463 | <div class="sect2"> | | 2402 | <div class="sect2"> |