| @@ -557,34 +557,34 @@ pkgsrc provides the following key featur | | | @@ -557,34 +557,34 @@ pkgsrc provides the following key featur |
557 | <li><p>The installation prefix, acceptable software licenses, | | 557 | <li><p>The installation prefix, acceptable software licenses, |
558 | international encryption requirements and build-time options for a | | 558 | international encryption requirements and build-time options for a |
559 | large number of packages are all set in a simple, central | | 559 | large number of packages are all set in a simple, central |
560 | configuration file.</p></li> | | 560 | configuration file.</p></li> |
561 | <li><p>The entire source (not including the distribution files) is | | 561 | <li><p>The entire source (not including the distribution files) is |
562 | freely available under a BSD license, so you may extend and adapt | | 562 | freely available under a BSD license, so you may extend and adapt |
563 | pkgsrc to your needs. Support for local packages and patches is | | 563 | pkgsrc to your needs. Support for local packages and patches is |
564 | available right out of the box, so you can configure it specifically | | 564 | available right out of the box, so you can configure it specifically |
565 | for your environment.</p></li> | | 565 | for your environment.</p></li> |
566 | </ul></div> | | 566 | </ul></div> |
567 | <p>The following principles are basic to pkgsrc:</p> | | 567 | <p>The following principles are basic to pkgsrc:</p> |
568 | <div class="itemizedlist"><ul type="disc"> | | 568 | <div class="itemizedlist"><ul type="disc"> |
569 | <li><p>“<span class="quote">It should only work if it's right.</span>” | | 569 | <li><p>“<span class="quote">It should only work if it's right.</span>” |
570 | — That means, if a package contains bugs, it's better to find | | 570 | — That means, if a package contains bugs, it's better to find |
571 | them and to complain about them rather than to just install the package | | 571 | them and to complain about them rather than to just install the package |
572 | and hope that it works. There are numerous checks in pkgsrc that try to | | 572 | and hope that it works. There are numerous checks in pkgsrc that try to |
573 | find such bugs: Static analysis tools (<a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>), build-time checks (portability | | 573 | find such bugs: Static analysis tools (<a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>), build-time checks (portability |
574 | of shell scripts), and post-installation checks (installed files, | | 574 | of shell scripts), and post-installation checks (installed files, |
575 | references to shared libraries, script interpreters).</p></li> | | 575 | references to shared libraries, script interpreters).</p></li> |
576 | <li><p>“<span class="quote">If it works, it should work everywhere</span>” | | 576 | <li><p>“<span class="quote">If it works, it should work everywhere</span>” |
577 | — Like NetBSD has been ported to many hardware architectures, | | 577 | — Like NetBSD has been ported to many hardware architectures, |
578 | pkgsrc has been ported to many operating systems. Care is taken that | | 578 | pkgsrc has been ported to many operating systems. Care is taken that |
579 | packages behave the same on all platforms.</p></li> | | 579 | packages behave the same on all platforms.</p></li> |
580 | </ul></div> | | 580 | </ul></div> |
581 | </div> | | 581 | </div> |
582 | <div class="sect2" lang="en"> | | 582 | <div class="sect2" lang="en"> |
583 | <div class="titlepage"><div><div><h3 class="title"> | | 583 | <div class="titlepage"><div><div><h3 class="title"> |
584 | <a name="intro.platforms"></a>1.1.2. Supported platforms</h3></div></div></div> | | 584 | <a name="intro.platforms"></a>1.1.2. Supported platforms</h3></div></div></div> |
585 | <p>pkgsrc consists of both a source distribution and a binary | | 585 | <p>pkgsrc consists of both a source distribution and a binary |
586 | distribution for these operating systems. After retrieving the required | | 586 | distribution for these operating systems. After retrieving the required |
587 | source or binaries, you can be up and running with pkgsrc in just | | 587 | source or binaries, you can be up and running with pkgsrc in just |
588 | minutes!</p> | | 588 | minutes!</p> |
589 | <p>pkgsrc was derived from FreeBSD's ports system, and | | 589 | <p>pkgsrc was derived from FreeBSD's ports system, and |
590 | initially developed for NetBSD only. Since then, pkgsrc has | | 590 | initially developed for NetBSD only. Since then, pkgsrc has |
| @@ -1749,27 +1749,27 @@ and you can still use binary packages fr | | | @@ -1749,27 +1749,27 @@ and you can still use binary packages fr |
1749 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add openoffice2</code></strong> | | 1749 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add openoffice2</code></strong> |
1750 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add kde-3.5.7</code></strong> | | 1750 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add kde-3.5.7</code></strong> |
1751 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap2-php5-*</code></strong> | | 1751 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap2-php5-*</code></strong> |
1752 | </pre> | | 1752 | </pre> |
1753 | <p>Note that any prerequisite packages needed to run the | | 1753 | <p>Note that any prerequisite packages needed to run the |
1754 | package in question will be installed, too, assuming they are | | 1754 | package in question will be installed, too, assuming they are |
1755 | present where you install from.</p> | | 1755 | present where you install from.</p> |
1756 | <p>As mentioned above, packages for which vulnerabilities get | | 1756 | <p>As mentioned above, packages for which vulnerabilities get |
1757 | known are not stored in the <code class="filename">All</code> subdirectory. | | 1757 | known are not stored in the <code class="filename">All</code> subdirectory. |
1758 | They don't get deleted since that could be very frustrating if many | | 1758 | They don't get deleted since that could be very frustrating if many |
1759 | other packages depend on it. Instead, they are moved to the | | 1759 | other packages depend on it. Instead, they are moved to the |
1760 | <code class="filename">vulnerable</code> subdirectory. So you may need to add | | 1760 | <code class="filename">vulnerable</code> subdirectory. So you may need to add |
1761 | this directory to the <code class="varname">PKG_PATH</code> variable. | | 1761 | this directory to the <code class="varname">PKG_PATH</code> variable. |
1762 | However, you should run <span class="command"><strong>audit-packages</strong></span> | | 1762 | However, you should run <span class="command"><strong>pkg_admin audit</strong></span> |
1763 | regularly, especially after installing new packages, and verify | | 1763 | regularly, especially after installing new packages, and verify |
1764 | that the vulnerabilities are acceptable for your configuration.</p> | | 1764 | that the vulnerabilities are acceptable for your configuration.</p> |
1765 | <p>After you've installed packages, be sure to have | | 1765 | <p>After you've installed packages, be sure to have |
1766 | <code class="filename">/usr/pkg/bin</code> and <code class="filename">/usr/pkg/sbin</code> in your | | 1766 | <code class="filename">/usr/pkg/bin</code> and <code class="filename">/usr/pkg/sbin</code> in your |
1767 | <code class="varname">PATH</code> so you can actually start the just | | 1767 | <code class="varname">PATH</code> so you can actually start the just |
1768 | installed program.</p> | | 1768 | installed program.</p> |
1769 | </div> | | 1769 | </div> |
1770 | <div class="sect2" lang="en"> | | 1770 | <div class="sect2" lang="en"> |
1771 | <div class="titlepage"><div><div><h3 class="title"> | | 1771 | <div class="titlepage"><div><div><h3 class="title"> |
1772 | <a name="using.pkg_delete"></a>4.1.3. Deinstalling packages</h3></div></div></div> | | 1772 | <a name="using.pkg_delete"></a>4.1.3. Deinstalling packages</h3></div></div></div> |
1773 | <p>To deinstall a package, it does not matter whether it was | | 1773 | <p>To deinstall a package, it does not matter whether it was |
1774 | installed from source code or from a binary package. The | | 1774 | installed from source code or from a binary package. The |
1775 | <span class="command"><strong>pkg_delete</strong></span> command does not know it anyway. | | 1775 | <span class="command"><strong>pkg_delete</strong></span> command does not know it anyway. |
| @@ -1799,48 +1799,65 @@ and you can still use binary packages fr | | | @@ -1799,48 +1799,65 @@ and you can still use binary packages fr |
1799 | <p>The <span class="command"><strong>pkg_info</strong></span> shows information about | | 1799 | <p>The <span class="command"><strong>pkg_info</strong></span> shows information about |
1800 | installed packages or binary package files.</p> | | 1800 | installed packages or binary package files.</p> |
1801 | </div> | | 1801 | </div> |
1802 | <div class="sect2" lang="en"> | | 1802 | <div class="sect2" lang="en"> |
1803 | <div class="titlepage"><div><div><h3 class="title"> | | 1803 | <div class="titlepage"><div><div><h3 class="title"> |
1804 | <a name="vulnerabilities"></a>4.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div> | | 1804 | <a name="vulnerabilities"></a>4.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div> |
1805 | <p> | | 1805 | <p> |
1806 | The NetBSD Security-Officer and Packages Groups maintain a list of | | 1806 | The NetBSD Security-Officer and Packages Groups maintain a list of |
1807 | known security vulnerabilities to packages which are (or have been) | | 1807 | known security vulnerabilities to packages which are (or have been) |
1808 | included in pkgsrc. The list is available from the NetBSD | | 1808 | included in pkgsrc. The list is available from the NetBSD |
1809 | FTP site at <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities</a>. | | 1809 | FTP site at <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities</a>. |
1810 | </p> | | 1810 | </p> |
1811 | <p> | | 1811 | <p> |
1812 | Through <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/audit-packages/README.html" target="_top"><code class="filename">security/audit-packages</code></a>, | | 1812 | Through <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, |
1813 | this list can be downloaded | | 1813 | this list can be downloaded |
1814 | automatically, and a security audit of all packages installed on a system | | 1814 | automatically, and a security audit of all packages installed on a system |
1815 | can take place. | | 1815 | can take place. |
1816 | </p> | | 1816 | </p> |
1817 | <p> | | 1817 | <p> |
1818 | There are two components to | | 1818 | There are two components to auditing. The first |
1819 | <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/audit-packages/README.html" target="_top"><code class="filename">security/audit-packages</code></a>. The first | | 1819 | step, <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, |
1820 | component, “<span class="quote">download-vulnerability-list</span>”, is for downloading | | 1820 | is for downloading |
1821 | the list of vulnerabilities from the NetBSD FTP site. The second | | 1821 | the list of vulnerabilities from the NetBSD FTP site. The second |
1822 | component, “<span class="quote">audit-packages</span>”, checks to see if any of your | | 1822 | step, <span class="command"><strong>pkg_admin audit</strong></span>, checks to see if any of your |
1823 | installed packages are vulnerable. If a package is vulnerable, you | | 1823 | installed packages are vulnerable. If a package is vulnerable, you |
1824 | will see output similar to the following: | | 1824 | will see output similar to the following: |
1825 | </p> | | 1825 | </p> |
1826 | <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see | | 1826 | <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see |
1827 | http://www.samba.org/samba/whatsnew/macroexploit.html</pre> | | 1827 | http://www.samba.org/samba/whatsnew/macroexploit.html</pre> |
1828 | <p> | | 1828 | <p> |
1829 | One can set up <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/audit-packages/README.html" target="_top"><code class="filename">security/audit-packages</code></a> to download the | | 1829 | You may wish to have the |
1830 | <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">vulnerabilities</a> | | 1830 | <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">vulnerabilities</a> |
1831 | file daily, and include a package audit in the daily security script. | | 1831 | file downloaded daily so that |
1832 | Details on this are located in the <a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/pkgsrc/security/audit-packages/MESSAGE?rev=HEAD&content-type=text/x-cvsweb-markup" target="_top">MESSAGE</a> | | 1832 | it remains current. This may be done by adding an appropriate entry |
1833 | file for <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/audit-packages/README.html" target="_top"><code class="filename">security/audit-packages</code></a>. | | 1833 | to the root users <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?crontab+5+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">crontab</span>(5)</span></a> entry. For example the entry |
| | | 1834 | </p> |
| | | 1835 | <pre class="screen"> |
| | | 1836 | # download vulnerabilities file |
| | | 1837 | 0 3 * * * /usr/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1 |
| | | 1838 | </pre> |
| | | 1839 | <p> |
| | | 1840 | will update the vulnerability list every day at 3AM. You may wish to do |
| | | 1841 | this more often than once a day. |
| | | 1842 | |
| | | 1843 | In addition, you may wish to run the package audit from the daily |
| | | 1844 | security script. This may be accomplished by adding the following |
| | | 1845 | line to <code class="filename">/etc/security.local</code>: |
| | | 1846 | </p> |
| | | 1847 | <pre class="screen"> |
| | | 1848 | /usr/sbin/pkg_admin audit |
| | | 1849 | </pre> |
| | | 1850 | <p> |
1834 | </p> | | 1851 | </p> |
1835 | </div> | | 1852 | </div> |
1836 | <div class="sect2" lang="en"> | | 1853 | <div class="sect2" lang="en"> |
1837 | <div class="titlepage"><div><div><h3 class="title"> | | 1854 | <div class="titlepage"><div><div><h3 class="title"> |
1838 | <a name="pkg_versions"></a>4.1.6. Finding if newer versions of your installed packages are in pkgsrc</h3></div></div></div> | | 1855 | <a name="pkg_versions"></a>4.1.6. Finding if newer versions of your installed packages are in pkgsrc</h3></div></div></div> |
1839 | <p> | | 1856 | <p> |
1840 | Install <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a> and run | | 1857 | Install <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a> and run |
1841 | <span class="command"><strong>lintpkgsrc</strong></span> with the “<span class="quote">-i</span>” | | 1858 | <span class="command"><strong>lintpkgsrc</strong></span> with the “<span class="quote">-i</span>” |
1842 | argument to check if your packages are up-to-date, e.g. | | 1859 | argument to check if your packages are up-to-date, e.g. |
1843 | </p> | | 1860 | </p> |
1844 | <pre class="screen"> | | 1861 | <pre class="screen"> |
1845 | <code class="prompt">%</code> <strong class="userinput"><code>lintpkgsrc -i</code></strong> | | 1862 | <code class="prompt">%</code> <strong class="userinput"><code>lintpkgsrc -i</code></strong> |
1846 | ... | | 1863 | ... |
| @@ -2152,50 +2169,52 @@ works. | | | @@ -2152,50 +2169,52 @@ works. |
2152 | if not found locally or in | | 2169 | if not found locally or in |
2153 | <code class="filename">${MASTER_SITES}</code> or | | 2170 | <code class="filename">${MASTER_SITES}</code> or |
2154 | <code class="filename">${PATCH_SITES}</code> respectively. | | 2171 | <code class="filename">${PATCH_SITES}</code> respectively. |
2155 | The defaults are | | 2172 | The defaults are |
2156 | <code class="filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/</code> | | 2173 | <code class="filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/</code> |
2157 | and | | 2174 | and |
2158 | <code class="filename">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/</code>.</p></li> | | 2175 | <code class="filename">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/</code>.</p></li> |
2159 | <li><p><code class="varname">BINPKG_SITES</code>: | | 2176 | <li><p><code class="varname">BINPKG_SITES</code>: |
2160 | List of sites carrying binary pkgs. <em class="replaceable"><code>rel</code></em> and | | 2177 | List of sites carrying binary pkgs. <em class="replaceable"><code>rel</code></em> and |
2161 | <em class="replaceable"><code>arch</code></em> are replaced with OS | | 2178 | <em class="replaceable"><code>arch</code></em> are replaced with OS |
2162 | release (“<span class="quote">2.0</span>”, etc.) and architecture | | 2179 | release (“<span class="quote">2.0</span>”, etc.) and architecture |
2163 | (“<span class="quote">mipsel</span>”, etc.).</p></li> | | 2180 | (“<span class="quote">mipsel</span>”, etc.).</p></li> |
2164 | <li><p><code class="varname">ACCEPTABLE_LICENSES</code>: | | 2181 | <li><p><code class="varname">ACCEPTABLE_LICENSES</code>: |
2165 | List of acceptable licenses. Whenever you try to build a package | | 2182 | List of acceptable licenses. License names are case-sensitive. |
2166 | whose license is not in this list, you will get an error message | | 2183 | Whenever you try to build a package whose license is not in this |
2167 | that includes instructions on how to change this variable.</p></li> | | 2184 | list, you will get an error message. If the license condition is |
| | | 2185 | simple enough, the error message will include specific |
| | | 2186 | instructions on how to change this variable.</p></li> |
2168 | </ul></div> | | 2187 | </ul></div> |
2169 | </div> | | 2188 | </div> |
2170 | <div class="sect1" lang="en"> | | 2189 | <div class="sect1" lang="en"> |
2171 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2190 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2172 | <a name="variables-affecting-build"></a>5.2. Variables affecting the build process</h2></div></div></div> | | 2191 | <a name="variables-affecting-build"></a>5.2. Variables affecting the build process</h2></div></div></div> |
2173 | <p>XXX | | 2192 | <p>XXX |
2174 | </p> | | 2193 | </p> |
2175 | <div class="itemizedlist"><ul type="disc"> | | 2194 | <div class="itemizedlist"><ul type="disc"> |
2176 | <li><p><code class="varname">PACKAGES</code>: The top level | | 2195 | <li><p><code class="varname">PACKAGES</code>: The top level |
2177 | directory for the binary packages. The default is | | 2196 | directory for the binary packages. The default is |
2178 | <code class="filename">${PKGSRCDIR}/packages</code>.</p></li> | | 2197 | <code class="filename">${PKGSRCDIR}/packages</code>.</p></li> |
2179 | <li><p><code class="varname">WRKOBJDIR</code>: | | 2198 | <li><p><code class="varname">WRKOBJDIR</code>: |
2180 | The top level directory where, if defined, the separate | | 2199 | The top level directory where, if defined, the separate |
2181 | working directories will get created, and symbolically | | 2200 | working directories will get created, and symbolically |
2182 | linked to from <code class="filename">${WRKDIR}</code> (see below). | | 2201 | linked to from <code class="filename">${WRKDIR}</code> (see below). |
2183 | This is useful for building packages on several | | 2202 | This is useful for building packages on several |
2184 | architectures, then <code class="filename">${PKGSRCDIR}</code> | | 2203 | architectures, then <code class="filename">${PKGSRCDIR}</code> |
2185 | can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code> | | 2204 | can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code> |
2186 | is local to every architecture. (It should be noted that | | 2205 | is local to every architecture. (It should be noted that |
2187 | <code class="varname">PKGSRCDIR</code> should not be set by the user | | 2206 | <code class="varname">PKGSRCDIR</code> should not be set by the user |
2188 | — it is an internal definition which refers to the | | 2207 | — it is an internal definition which refers to the |
2189 | root of the pkgsrc tree. It is possible to have many | | 2208 | root of the pkgsrc tree. It is possible to have many |
2190 | pkgsrc tree instances.)</p></li> | | 2209 | pkgsrc tree instances.)</p></li> |
2191 | <li><p><code class="varname">LOCALPATCHES</code>: | | 2210 | <li><p><code class="varname">LOCALPATCHES</code>: |
2192 | Directory for local patches that aren't part of pkgsrc. | | 2211 | Directory for local patches that aren't part of pkgsrc. |
2193 | See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “patches/*”</a> for more | | 2212 | See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, “patches/*”</a> for more |
2194 | information.</p></li> | | 2213 | information.</p></li> |
2195 | <li><p><code class="varname">PKGMAKECONF</code>: Location of | | 2214 | <li><p><code class="varname">PKGMAKECONF</code>: Location of |
2196 | the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's | | 2215 | the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's |
2197 | BSD-style Makefile. If this is not set, | | 2216 | BSD-style Makefile. If this is not set, |
2198 | <code class="varname">MAKECONF</code> is set to | | 2217 | <code class="varname">MAKECONF</code> is set to |
2199 | <code class="filename">/dev/null</code> to avoid picking up | | 2218 | <code class="filename">/dev/null</code> to avoid picking up |
2200 | settings used by builds in <code class="filename">/usr/src</code>.</p></li> | | 2219 | settings used by builds in <code class="filename">/usr/src</code>.</p></li> |
2201 | <li><p><code class="varname">DEPENDS_TARGET</code>: | | 2220 | <li><p><code class="varname">DEPENDS_TARGET</code>: |
| @@ -2618,37 +2637,37 @@ way. | | | @@ -2618,37 +2637,37 @@ way. |
2618 | <code class="filename">pkgsrc/mk/bulk/build.conf-example</code>. To use | | 2637 | <code class="filename">pkgsrc/mk/bulk/build.conf-example</code>. To use |
2619 | it, copy <code class="filename">build.conf-example</code> to | | 2638 | it, copy <code class="filename">build.conf-example</code> to |
2620 | <code class="filename">build.conf</code> and edit it, following the | | 2639 | <code class="filename">build.conf</code> and edit it, following the |
2621 | comments in that file.</p> | | 2640 | comments in that file.</p> |
2622 | </div> | | 2641 | </div> |
2623 | <div class="sect3" lang="en"> | | 2642 | <div class="sect3" lang="en"> |
2624 | <div class="titlepage"><div><div><h4 class="title"> | | 2643 | <div class="titlepage"><div><div><h4 class="title"> |
2625 | <a name="binary.mk.conf"></a>7.3.1.2. <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> | | 2644 | <a name="binary.mk.conf"></a>7.3.1.2. <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> |
2626 | </h4></div></div></div> | | 2645 | </h4></div></div></div> |
2627 | <p>You may want to set variables in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. | | 2646 | <p>You may want to set variables in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. |
2628 | Look at <code class="filename">pkgsrc/mk/defaults/mk.conf</code> for | | 2647 | Look at <code class="filename">pkgsrc/mk/defaults/mk.conf</code> for |
2629 | details of the default settings. You will want to ensure that | | 2648 | details of the default settings. You will want to ensure that |
2630 | <code class="varname">ACCEPTABLE_LICENSES</code> meet your local policy. | | 2649 | <code class="varname">ACCEPTABLE_LICENSES</code> meet your local policy. |
2631 | As used in this example, <code class="varname">_ACCEPTABLE=yes</code> | | 2650 | As used in this example, <code class="varname">SKIP_LICENSE_CHECK=yes</code> |
2632 | completely bypasses the license check.</p> | | 2651 | completely bypasses the license check.</p> |
2633 | <pre class="programlisting"> | | 2652 | <pre class="programlisting"> |
2634 | PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH} | | 2653 | PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH} |
2635 | WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc | | 2654 | WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc |
2636 | BSDSRCDIR= /usr/src | | 2655 | BSDSRCDIR= /usr/src |
2637 | BSDXSRCDIR= /usr/xsrc # for x11/xservers | | 2656 | BSDXSRCDIR= /usr/xsrc # for x11/xservers |
2638 | OBJHOSTNAME?= yes # use work.`hostname` | | 2657 | OBJHOSTNAME?= yes # use work.`hostname` |
2639 | FAILOVER_FETCH= yes # insist on the correct checksum | | 2658 | FAILOVER_FETCH= yes # insist on the correct checksum |
2640 | PKG_DEVELOPER?= yes | | 2659 | PKG_DEVELOPER?= yes |
2641 | _ACCEPTABLE= yes | | 2660 | SKIP_LICENSE_CHECK= yes |
2642 | </pre> | | 2661 | </pre> |
2643 | <p>Some options that are especially useful for bulk builds | | 2662 | <p>Some options that are especially useful for bulk builds |
2644 | can be found at the top lines of the file | | 2663 | can be found at the top lines of the file |
2645 | <code class="filename">mk/bulk/bsd.bulk-pkg.mk</code>. The most useful | | 2664 | <code class="filename">mk/bulk/bsd.bulk-pkg.mk</code>. The most useful |
2646 | options of these are briefly described here.</p> | | 2665 | options of these are briefly described here.</p> |
2647 | <div class="itemizedlist"><ul type="disc"> | | 2666 | <div class="itemizedlist"><ul type="disc"> |
2648 | <li><p>If you are on a slow machine, you may want to | | 2667 | <li><p>If you are on a slow machine, you may want to |
2649 | set <code class="varname">USE_BULK_BROKEN_CHECK</code> to | | 2668 | set <code class="varname">USE_BULK_BROKEN_CHECK</code> to |
2650 | “<span class="quote">no</span>”.</p></li> | | 2669 | “<span class="quote">no</span>”.</p></li> |
2651 | <li><p>If you are doing bulk builds from a read-only | | 2670 | <li><p>If you are doing bulk builds from a read-only |
2652 | copy of pkgsrc, you have to set <code class="varname">BULKFILESDIR</code> | | 2671 | copy of pkgsrc, you have to set <code class="varname">BULKFILESDIR</code> |
2653 | to the directory where all log files are created. Otherwise the | | 2672 | to the directory where all log files are created. Otherwise the |
2654 | log files are created in the pkgsrc directory.</p></li> | | 2673 | log files are created in the pkgsrc directory.</p></li> |
| @@ -2846,27 +2865,27 @@ fi | | | @@ -2846,27 +2865,27 @@ fi |
2846 | <p><code class="filename">/etc/resolv.conf</code> (for <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/smtpd/README.html" target="_top"><code class="filename">security/smtpd</code></a> and mail):</p> | | 2865 | <p><code class="filename">/etc/resolv.conf</code> (for <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/smtpd/README.html" target="_top"><code class="filename">security/smtpd</code></a> and mail):</p> |
2847 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cp /etc/resolv.conf /usr/sandbox/etc</code></strong></pre> | | 2866 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cp /etc/resolv.conf /usr/sandbox/etc</code></strong></pre> |
2848 | </li> | | 2867 | </li> |
2849 | <li> | | 2868 | <li> |
2850 | <p>Working(!) mail config (hostname, sendmail.cf):</p> | | 2869 | <p>Working(!) mail config (hostname, sendmail.cf):</p> |
2851 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cp /etc/mail/sendmail.cf /usr/sandbox/etc/mail</code></strong></pre> | | 2870 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cp /etc/mail/sendmail.cf /usr/sandbox/etc/mail</code></strong></pre> |
2852 | </li> | | 2871 | </li> |
2853 | <li> | | 2872 | <li> |
2854 | <p><code class="filename">/etc/localtime</code> (for <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/smtpd/README.html" target="_top"><code class="filename">security/smtpd</code></a>):</p> | | 2873 | <p><code class="filename">/etc/localtime</code> (for <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/smtpd/README.html" target="_top"><code class="filename">security/smtpd</code></a>):</p> |
2855 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime</code></strong></pre> | | 2874 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime</code></strong></pre> |
2856 | </li> | | 2875 | </li> |
2857 | <li> | | 2876 | <li> |
2858 | <p><code class="filename">/usr/src</code> (system sources, | | 2877 | <p><code class="filename">/usr/src</code> (system sources, |
2859 | e. g. for <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/aperture/README.html" target="_top"><code class="filename">sysutils/aperture</code></a>):</p> | | 2878 | e. g. for <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/aperture/README.html" target="_top"><code class="filename">sysutils/aperture</code></a>):</p> |
2860 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>ln -s ../disk1/cvs .</code></strong> | | 2879 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>ln -s ../disk1/cvs .</code></strong> |
2861 | <code class="prompt">#</code> <strong class="userinput"><code>ln -s cvs/src-2.0 src</code></strong></pre> | | 2880 | <code class="prompt">#</code> <strong class="userinput"><code>ln -s cvs/src-2.0 src</code></strong></pre> |
2862 | </li> | | 2881 | </li> |
2863 | <li> | | 2882 | <li> |
2864 | <p>Create <code class="filename">/var/db/pkg</code> (not part of default install):</p> | | 2883 | <p>Create <code class="filename">/var/db/pkg</code> (not part of default install):</p> |
2865 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>mkdir /usr/sandbox/var/db/pkg</code></strong></pre> | | 2884 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>mkdir /usr/sandbox/var/db/pkg</code></strong></pre> |
2866 | </li> | | 2885 | </li> |
2867 | <li> | | 2886 | <li> |
2868 | <p>Create <code class="filename">/usr/pkg</code> (not part of default install):</p> | | 2887 | <p>Create <code class="filename">/usr/pkg</code> (not part of default install):</p> |
2869 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>mkdir /usr/sandbox/usr/pkg</code></strong></pre> | | 2888 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>mkdir /usr/sandbox/usr/pkg</code></strong></pre> |
2870 | </li> | | 2889 | </li> |
2871 | <li> | | 2890 | <li> |
2872 | <p>Checkout pkgsrc via cvs into | | 2891 | <p>Checkout pkgsrc via cvs into |
| @@ -3009,27 +3028,27 @@ nbftp% c | | | @@ -3009,27 +3028,27 @@ nbftp% c |
3009 | <a name="bulk.pbulk.prepare"></a>7.4.1. Preparation</h3></div></div></div> | | 3028 | <a name="bulk.pbulk.prepare"></a>7.4.1. Preparation</h3></div></div></div> |
3010 | <p>First, you need to create a pkgsrc installation for the pbulk infrastructure. No matter on which platform you are (even on NetBSD), you should bootstrap into its own directory. Let's take the directory <code class="filename">/usr/pbulk</code> or <code class="filename">$HOME/pbulk</code> for it. This installation will be bootstrapped and all the tools that are required for the bulk build will be installed there.</p> | | 3029 | <p>First, you need to create a pkgsrc installation for the pbulk infrastructure. No matter on which platform you are (even on NetBSD), you should bootstrap into its own directory. Let's take the directory <code class="filename">/usr/pbulk</code> or <code class="filename">$HOME/pbulk</code> for it. This installation will be bootstrapped and all the tools that are required for the bulk build will be installed there.</p> |
3011 | <pre class="screen"> | | 3030 | <pre class="screen"> |
3012 | $ <strong class="userinput"><code>cd /usr/pkgsrc</code></strong> | | 3031 | $ <strong class="userinput"><code>cd /usr/pkgsrc</code></strong> |
3013 | $ <strong class="userinput"><code>./bootstrap/bootstrap --prefix=/usr/pbulk --varbase=/usr/pbulk/var --workdir=/tmp/pbulk-bootstrap</code></strong> | | 3032 | $ <strong class="userinput"><code>./bootstrap/bootstrap --prefix=/usr/pbulk --varbase=/usr/pbulk/var --workdir=/tmp/pbulk-bootstrap</code></strong> |
3014 | $ <strong class="userinput"><code>rm -rf /tmp/pbulk-bootstrap</code></strong> | | 3033 | $ <strong class="userinput"><code>rm -rf /tmp/pbulk-bootstrap</code></strong> |
3015 | </pre> | | 3034 | </pre> |
3016 | <p>Now the basic environment for the pbulk infrastructure is installed. The specific tools are still missing. This is a good time to edit the pkgsrc configuration file <code class="filename">/usr/pbulk/etc/mk.conf</code> to fit your needs. Typical things you might set now are:</p> | | 3035 | <p>Now the basic environment for the pbulk infrastructure is installed. The specific tools are still missing. This is a good time to edit the pkgsrc configuration file <code class="filename">/usr/pbulk/etc/mk.conf</code> to fit your needs. Typical things you might set now are:</p> |
3017 | <div class="itemizedlist"><ul type="disc"> | | 3036 | <div class="itemizedlist"><ul type="disc"> |
3018 | <li><p><code class="literal"><code class="varname">PKG_DEVELOPER</code>=yes</code>, to enable many consistency checks,</p></li> | | 3037 | <li><p><code class="literal"><code class="varname">PKG_DEVELOPER</code>=yes</code>, to enable many consistency checks,</p></li> |
3019 | <li><p><code class="literal"><code class="varname">WRKOBJDIR</code>=/tmp/pbulk-outer</code>, to keep <code class="filename">/usr/pkgsrc</code> free from any modifications,</p></li> | | 3038 | <li><p><code class="literal"><code class="varname">WRKOBJDIR</code>=/tmp/pbulk-outer</code>, to keep <code class="filename">/usr/pkgsrc</code> free from any modifications,</p></li> |
3020 | <li><p><code class="literal"><code class="varname">DISTDIR</code>=/distfiles</code>, to have only one directory in which all distfiles (for the infrastructure and for the actual packages) are downloaded,</p></li> | | 3039 | <li><p><code class="literal"><code class="varname">DISTDIR</code>=/distfiles</code>, to have only one directory in which all distfiles (for the infrastructure and for the actual packages) are downloaded,</p></li> |
3021 | <li><p><code class="literal"><code class="varname">ACCEPTABLE_LICENSES</code>+=...</code>, to select some licenses additional to the usual Free/Open Source licenses that are acceptable to you,</p></li> | | 3040 | <li><p><code class="literal"><code class="varname">ACCEPTABLE_LICENSES</code>+=...</code>, to select some licenses additional to the usual Free/Open Source licenses that are acceptable to you,</p></li> |
3022 | <li><p><code class="literal"><code class="varname">_ACCEPTABLE</code>=yes</code>, to accept all licenses, no matter how restrictive they are.</p></li> | | 3041 | <li><p><code class="literal"><code class="varname">SKIP_LICENSE_CHECK</code>=yes</code>, to bypass the license checks.</p></li> |
3023 | </ul></div> | | 3042 | </ul></div> |
3024 | <p>Now you are ready to build the rest of the pbulk infrastructure.</p> | | 3043 | <p>Now you are ready to build the rest of the pbulk infrastructure.</p> |
3025 | <pre class="screen"> | | 3044 | <pre class="screen"> |
3026 | $ <strong class="userinput"><code>cd pkgtools/pbulk</code></strong> | | 3045 | $ <strong class="userinput"><code>cd pkgtools/pbulk</code></strong> |
3027 | $ <strong class="userinput"><code>/usr/pbulk/bin/bmake install</code></strong> | | 3046 | $ <strong class="userinput"><code>/usr/pbulk/bin/bmake install</code></strong> |
3028 | $ <strong class="userinput"><code>rm -rf /tmp/pbulk-outer</code></strong> | | 3047 | $ <strong class="userinput"><code>rm -rf /tmp/pbulk-outer</code></strong> |
3029 | </pre> | | 3048 | </pre> |
3030 | <p>Now the pbulk infrastructure is built and installed. It still needs to be configured, and after some more preparation, we will be able to start the real bulk build.</p> | | 3049 | <p>Now the pbulk infrastructure is built and installed. It still needs to be configured, and after some more preparation, we will be able to start the real bulk build.</p> |
3031 | </div> | | 3050 | </div> |
3032 | <div class="sect2" lang="en"> | | 3051 | <div class="sect2" lang="en"> |
3033 | <div class="titlepage"><div><div><h3 class="title"> | | 3052 | <div class="titlepage"><div><div><h3 class="title"> |
3034 | <a name="bulk.pbulk.conf"></a>7.4.2. Configuration</h3></div></div></div> | | 3053 | <a name="bulk.pbulk.conf"></a>7.4.2. Configuration</h3></div></div></div> |
3035 | <p>TODO; see pkgsrc/doc/HOWTO-pbulk for more information.</p> | | 3054 | <p>TODO; see pkgsrc/doc/HOWTO-pbulk for more information.</p> |
| @@ -4574,27 +4593,27 @@ PATCHDIR= ${.CURDIR}/../xemacs/patches | | | @@ -4574,27 +4593,27 @@ PATCHDIR= ${.CURDIR}/../xemacs/patches |
4574 | </div> | | 4593 | </div> |
4575 | <div class="sect2" lang="en"> | | 4594 | <div class="sect2" lang="en"> |
4576 | <div class="titlepage"><div><div><h3 class="title"> | | 4595 | <div class="titlepage"><div><div><h3 class="title"> |
4577 | <a name="components.patches.guidelines"></a>11.3.4. Patching guidelines</h3></div></div></div> | | 4596 | <a name="components.patches.guidelines"></a>11.3.4. Patching guidelines</h3></div></div></div> |
4578 | <p>When fixing a portability issue in the code do not use | | 4597 | <p>When fixing a portability issue in the code do not use |
4579 | preprocessor magic to check for the current operating system nor | | 4598 | preprocessor magic to check for the current operating system nor |
4580 | platform. Doing so hurts portability to other platforms because | | 4599 | platform. Doing so hurts portability to other platforms because |
4581 | the OS-specific details are not abstracted appropriately.</p> | | 4600 | the OS-specific details are not abstracted appropriately.</p> |
4582 | <p>The general rule to follow is: instead of checking for the | | 4601 | <p>The general rule to follow is: instead of checking for the |
4583 | operating system the application is being built on, check for the | | 4602 | operating system the application is being built on, check for the |
4584 | specific <span class="emphasis"><em>features</em></span> you need. For example, | | 4603 | specific <span class="emphasis"><em>features</em></span> you need. For example, |
4585 | instead of assuming that kqueue is available under NetBSD and | | 4604 | instead of assuming that kqueue is available under NetBSD and |
4586 | using the <code class="varname">__NetBSD__</code> macro to conditionalize | | 4605 | using the <code class="varname">__NetBSD__</code> macro to conditionalize |
4587 | kqueue support, add a check that detects kqueue itself — | | 4606 | kqueue support, add a check that detects kqueue itself — |
4588 | yes, this generally involves patching the | | 4607 | yes, this generally involves patching the |
4589 | <span class="command"><strong>configure</strong></span> script. There is absolutely nothing | | 4608 | <span class="command"><strong>configure</strong></span> script. There is absolutely nothing |
4590 | that prevents some OSes from adopting interfaces from other OSes | | 4609 | that prevents some OSes from adopting interfaces from other OSes |
4591 | (e.g. Linux implementing kqueue), something that the above checks | | 4610 | (e.g. Linux implementing kqueue), something that the above checks |
4592 | cannot take into account.</p> | | 4611 | cannot take into account.</p> |
4593 | <p>Of course, checking for features generally involves more | | 4612 | <p>Of course, checking for features generally involves more |
4594 | work on the developer's side, but the resulting changes are | | 4613 | work on the developer's side, but the resulting changes are |
4595 | cleaner and there are chances they will work on many other | | 4614 | cleaner and there are chances they will work on many other |
4596 | platforms. Not to mention that there are higher chances of being | | 4615 | platforms. Not to mention that there are higher chances of being |
4597 | later integrated into the mainstream sources. Remember: | | 4616 | later integrated into the mainstream sources. Remember: |
4598 | <span class="emphasis"><em>It doesn't work unless it is right!</em></span></p> | | 4617 | <span class="emphasis"><em>It doesn't work unless it is right!</em></span></p> |
4599 | <p>Some typical examples:</p> | | 4618 | <p>Some typical examples:</p> |
4600 | <div class="table"> | | 4619 | <div class="table"> |
| @@ -4945,27 +4964,27 @@ correct: | | | @@ -4945,27 +4964,27 @@ correct: |
4945 | is using the ``!='' operator, for example: <code class="varname">BACKSLASH!=echo "\\"</code>.</p> | | 4964 | is using the ``!='' operator, for example: <code class="varname">BACKSLASH!=echo "\\"</code>.</p> |
4946 | <p>So far for defining variables. The other thing you can do with | | 4965 | <p>So far for defining variables. The other thing you can do with |
4947 | variables is evaluating them. A variable is evaluated when it is | | 4966 | variables is evaluating them. A variable is evaluated when it is |
4948 | part of the right side of the ``:='' or the ``!='' operator, or | | 4967 | part of the right side of the ``:='' or the ``!='' operator, or |
4949 | directly before executing a shell command which the variable is part | | 4968 | directly before executing a shell command which the variable is part |
4950 | of. In all other cases, <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> performs lazy evaluation, that | | 4969 | of. In all other cases, <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> performs lazy evaluation, that |
4951 | is, variables are not evaluated until there's no other way. The | | 4970 | is, variables are not evaluated until there's no other way. The |
4952 | ``modifiers'' mentioned in the man page also evaluate the | | 4971 | ``modifiers'' mentioned in the man page also evaluate the |
4953 | variable.</p> | | 4972 | variable.</p> |
4954 | <p>Some of the modifiers split the string into words and then | | 4973 | <p>Some of the modifiers split the string into words and then |
4955 | operate on the words, others operate on the string as a whole. When | | 4974 | operate on the words, others operate on the string as a whole. When |
4956 | a string is split into words, it is split as you would expect | | 4975 | a string is split into words, it is split as you would expect |
4957 | it from <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">sh</span>(1)</span></a>.</p> | | 4976 | it from <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">sh</span>(1)</span></a>.</p> |
4958 | <p>No rule without exception—the <span class="command"><strong>.for</strong></span> | | 4977 | <p>No rule without exception—the <span class="command"><strong>.for</strong></span> |
4959 | loop does not follow the shell quoting rules but splits at sequences | | 4978 | loop does not follow the shell quoting rules but splits at sequences |
4960 | of whitespace.</p> | | 4979 | of whitespace.</p> |
4961 | <p>There are several types of variables that should be handled | | 4980 | <p>There are several types of variables that should be handled |
4962 | differently. Strings and two types of lists.</p> | | 4981 | differently. Strings and two types of lists.</p> |
4963 | <div class="itemizedlist"><ul type="disc"> | | 4982 | <div class="itemizedlist"><ul type="disc"> |
4964 | <li><p><span class="emphasis"><em>Strings</em></span> can contain arbitrary | | 4983 | <li><p><span class="emphasis"><em>Strings</em></span> can contain arbitrary |
4965 | characters. Nevertheless, you should restrict yourself to only | | 4984 | characters. Nevertheless, you should restrict yourself to only |
4966 | using printable characters. Examples are | | 4985 | using printable characters. Examples are |
4967 | <code class="varname">PREFIX</code> and | | 4986 | <code class="varname">PREFIX</code> and |
4968 | <code class="varname">COMMENT</code>.</p></li> | | 4987 | <code class="varname">COMMENT</code>.</p></li> |
4969 | <li><p><span class="emphasis"><em>Internal lists</em></span> are lists that | | 4988 | <li><p><span class="emphasis"><em>Internal lists</em></span> are lists that |
4970 | are never exported to any shell command. Their elements are | | 4989 | are never exported to any shell command. Their elements are |
4971 | separated by whitespace. Therefore, the elements themselves cannot | | 4990 | separated by whitespace. Therefore, the elements themselves cannot |
| @@ -5367,74 +5386,42 @@ ${PLIST.foo}@dirrm share/bar | | | @@ -5367,74 +5386,42 @@ ${PLIST.foo}@dirrm share/bar |
5367 | <div class="itemizedlist"><ul type="disc"> | | 5386 | <div class="itemizedlist"><ul type="disc"> |
5368 | <li><p><code class="filename">PLIST.common</code></p></li> | | 5387 | <li><p><code class="filename">PLIST.common</code></p></li> |
5369 | <li><p><code class="filename">PLIST.${OPSYS}</code></p></li> | | 5388 | <li><p><code class="filename">PLIST.${OPSYS}</code></p></li> |
5370 | <li><p><code class="filename">PLIST.${MACHINE_ARCH}</code></p></li> | | 5389 | <li><p><code class="filename">PLIST.${MACHINE_ARCH}</code></p></li> |
5371 | <li><p><code class="filename">PLIST.${OPSYS}-${MACHINE_ARCH}</code></p></li> | | 5390 | <li><p><code class="filename">PLIST.${OPSYS}-${MACHINE_ARCH}</code></p></li> |
5372 | <li><p><code class="filename">PLIST.common_end</code></p></li> | | 5391 | <li><p><code class="filename">PLIST.common_end</code></p></li> |
5373 | </ul></div> | | 5392 | </ul></div> |
5374 | </div> | | 5393 | </div> |
5375 | <div class="sect1" lang="en"> | | 5394 | <div class="sect1" lang="en"> |
5376 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 5395 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
5377 | <a name="faq.common-dirs"></a>13.8. Sharing directories between packages</h2></div></div></div> | | 5396 | <a name="faq.common-dirs"></a>13.8. Sharing directories between packages</h2></div></div></div> |
5378 | <p>A “<span class="quote">shared directory</span>” is a directory where | | 5397 | <p>A “<span class="quote">shared directory</span>” is a directory where |
5379 | multiple (and unrelated) packages install files. These | | 5398 | multiple (and unrelated) packages install files. These |
5380 | directories are problematic because you have to add special tricks | | 5399 | directories were problematic because you had to add special |
5381 | in the PLIST to conditionally remove them, or have some | | 5400 | tricks in the PLIST to conditionally remove them, or have some |
5382 | centralized package handle them.</p> | | 5401 | centralized package handle them.</p> |
5383 | <p>Within pkgsrc, you'll find both approaches. If a directory | | 5402 | <p>In pkgsrc, it is now easy: Each package should create |
5384 | is shared by a few unrelated packages, it's often not worth to add | | 5403 | directories and install files as needed; <span class="command"><strong>pkg_delete</strong></span> |
5385 | an extra package to remove it. Therefore, one simply does:</p> | | 5404 | will remove any directories left empty after uninstalling a |
5386 | <pre class="programlisting"> | | 5405 | package.</p> |
5387 | @unexec ${RMDIR} %D/path/to/shared/directory 2>/dev/null || ${TRUE} | | 5406 | <p>If a package needs an empty directory to work, create |
5388 | </pre> | | 5407 | the directory during installation as usual, and also add an |
5389 | <p>in the PLISTs of all affected packages, instead of the | | 5408 | entry to the PLIST: |
5390 | regular "@dirrm" line.</p> | | 5409 | </p> |
5391 | <p>However, if the directory is shared across many packages, two | | | |
5392 | different solutions are available:</p> | | | |
5393 | <div class="orderedlist"><ol type="1"> | | | |
5394 | <li><p>If the packages have a common dependency, the directory | | | |
5395 | can be removed in that. For example, see | | | |
5396 | <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/textproc/scrollkeeper/README.html" target="_top"><code class="filename">textproc/scrollkeeper</code></a>, which | | | |
5397 | removes the shared directory | | | |
5398 | <code class="filename">share/omf</code>.</p></li> | | | |
5399 | <li><p>If the packages using the directory are not related at | | | |
5400 | all (they have no common dependencies), a *-dirs package is | | | |
5401 | used.</p></li> | | | |
5402 | </ol></div> | | | |
5403 | <p>From now on, we'll discuss the second solution. To get an | | | |
5404 | idea of the *-dirs packages available, issue:</p> | | | |
5405 | <pre class="programlisting"> | | | |
5406 | <code class="prompt">%</code> cd .../pkgsrc | | | |
5407 | <code class="prompt">%</code> ls -d */*-dirs | | | |
5408 | </pre> | | | |
5409 | <p>Their use from other packages is very simple. The | | | |
5410 | <code class="varname">USE_DIRS</code> variable takes a list of package names | | | |
5411 | (without the “<span class="quote">-dirs</span>” part) together with the required | | | |
5412 | version number (always pick the latest one when writing new | | | |
5413 | packages).</p> | | | |
5414 | <p>For example, if a package installs files under | | | |
5415 | <code class="filename">share/applications</code>, it should have the | | | |
5416 | following line in it:</p> | | | |
5417 | <pre class="programlisting"> | | 5410 | <pre class="programlisting"> |
5418 | USE_DIRS+= xdg-1.1 | | 5411 | @pkgdir path/to/empty/directory |
5419 | </pre> | | 5412 | </pre> |
5420 | <p>After regenerating the PLIST using <span class="command"><strong>make | | 5413 | <p> |
5421 | print-PLIST</strong></span>, you should get the right (commented out) | | 5414 | </p> |
5422 | lines.</p> | | | |
5423 | <p>Note that even if your package is using | | | |
5424 | <code class="filename">$X11BASE</code>, it must not depend on the | | | |
5425 | *-x11-dirs packages. Just specify the name without that part and | | | |
5426 | pkgsrc (in particular, <code class="filename">mk/dirs.mk</code>) will take | | | |
5427 | care of it.</p> | | | |
5428 | </div> | | 5415 | </div> |
5429 | </div> | | 5416 | </div> |
5430 | <div class="chapter" lang="en"> | | 5417 | <div class="chapter" lang="en"> |
5431 | <div class="titlepage"><div><div><h2 class="title"> | | 5418 | <div class="titlepage"><div><div><h2 class="title"> |
5432 | <a name="buildlink"></a>Chapter 14. Buildlink methodology</h2></div></div></div> | | 5419 | <a name="buildlink"></a>Chapter 14. Buildlink methodology</h2></div></div></div> |
5433 | <div class="toc"> | | 5420 | <div class="toc"> |
5434 | <p><b>Table of Contents</b></p> | | 5421 | <p><b>Table of Contents</b></p> |
5435 | <dl> | | 5422 | <dl> |
5436 | <dt><span class="sect1"><a href="#converting-to-buildlink3">14.1. Converting packages to use buildlink3</a></span></dt> | | 5423 | <dt><span class="sect1"><a href="#converting-to-buildlink3">14.1. Converting packages to use buildlink3</a></span></dt> |
5437 | <dt><span class="sect1"><a href="#creating-buildlink3.mk">14.2. Writing buildlink3.mk files</a></span></dt> | | 5424 | <dt><span class="sect1"><a href="#creating-buildlink3.mk">14.2. Writing buildlink3.mk files</a></span></dt> |
5438 | <dd><dl> | | 5425 | <dd><dl> |
5439 | <dt><span class="sect2"><a href="#anatomy-of-bl3">14.2.1. Anatomy of a buildlink3.mk file</a></span></dt> | | 5426 | <dt><span class="sect2"><a href="#anatomy-of-bl3">14.2.1. Anatomy of a buildlink3.mk file</a></span></dt> |
5440 | <dt><span class="sect2"><a href="#updating-buildlink-depends">14.2.2. Updating BUILDLINK_API_DEPENDS.pkg in buildlink3.mk files</a></span></dt> | | 5427 | <dt><span class="sect2"><a href="#updating-buildlink-depends">14.2.2. Updating BUILDLINK_API_DEPENDS.pkg in buildlink3.mk files</a></span></dt> |
| @@ -6773,26 +6760,29 @@ http://www.somewhereelse.com/mirror/some | | | @@ -6773,26 +6760,29 @@ http://www.somewhereelse.com/mirror/some |
6773 | </pre> | | 6760 | </pre> |
6774 | <p>When actually fetching the distfiles, each item from | | 6761 | <p>When actually fetching the distfiles, each item from |
6775 | <code class="varname">MASTER_SITES</code> or | | 6762 | <code class="varname">MASTER_SITES</code> or |
6776 | <code class="varname">SITES.*</code> gets the name of each distfile | | 6763 | <code class="varname">SITES.*</code> gets the name of each distfile |
6777 | appended to it, without an intermediate slash. Therefore, | | 6764 | appended to it, without an intermediate slash. Therefore, |
6778 | all site values have to end with a slash or other separator | | 6765 | all site values have to end with a slash or other separator |
6779 | character. This allows for example to set | | 6766 | character. This allows for example to set |
6780 | <code class="varname">MASTER_SITES</code> to a URL of a CGI script | | 6767 | <code class="varname">MASTER_SITES</code> to a URL of a CGI script |
6781 | that gets the name of the distfile as a parameter. In this | | 6768 | that gets the name of the distfile as a parameter. In this |
6782 | case, the definition would look like:</p> | | 6769 | case, the definition would look like:</p> |
6783 | <pre class="programlisting"> | | 6770 | <pre class="programlisting"> |
6784 | MASTER_SITES= http://www.example.com/download.cgi?file= | | 6771 | MASTER_SITES= http://www.example.com/download.cgi?file= |
6785 | </pre> | | 6772 | </pre> |
| | | 6773 | <p> The exception to this rule are URLs starting with a dash. |
| | | 6774 | In that case the URL is taken as is, fetched and the result stored |
| | | 6775 | under the name of the distfile.</p> |
6786 | <p>There are some predefined values for | | 6776 | <p>There are some predefined values for |
6787 | <code class="varname">MASTER_SITES</code>, which can be used in | | 6777 | <code class="varname">MASTER_SITES</code>, which can be used in |
6788 | packages. The names of the variables should speak for | | 6778 | packages. The names of the variables should speak for |
6789 | themselves.</p> | | 6779 | themselves.</p> |
6790 | <pre class="programlisting"> | | 6780 | <pre class="programlisting"> |
6791 | ${MASTER_SITE_APACHE} | | 6781 | ${MASTER_SITE_APACHE} |
6792 | ${MASTER_SITE_BACKUP} | | 6782 | ${MASTER_SITE_BACKUP} |
6793 | ${MASTER_SITE_CYGWIN} | | 6783 | ${MASTER_SITE_CYGWIN} |
6794 | ${MASTER_SITE_DEBIAN} | | 6784 | ${MASTER_SITE_DEBIAN} |
6795 | ${MASTER_SITE_FREEBSD} | | 6785 | ${MASTER_SITE_FREEBSD} |
6796 | ${MASTER_SITE_FREEBSD_LOCAL} | | 6786 | ${MASTER_SITE_FREEBSD_LOCAL} |
6797 | ${MASTER_SITE_GENTOO} | | 6787 | ${MASTER_SITE_GENTOO} |
6798 | ${MASTER_SITE_GNOME} | | 6788 | ${MASTER_SITE_GNOME} |
| @@ -7627,48 +7617,48 @@ TOOLS_PLATFORM.true?= true | | | @@ -7627,48 +7617,48 @@ TOOLS_PLATFORM.true?= true |
7627 | <dt>18.4.2. <a href="#tools.listall">How do I get a list of all available | | 7617 | <dt>18.4.2. <a href="#tools.listall">How do I get a list of all available |
7628 | tools?</a> | | 7618 | tools?</a> |
7629 | </dt> | | 7619 | </dt> |
7630 | <dt>18.4.3. <a href="#tools.used">How can I get a list of all the tools that a | | 7620 | <dt>18.4.3. <a href="#tools.used">How can I get a list of all the tools that a |
7631 | package is using while being built? I want to know whether it | | 7621 | package is using while being built? I want to know whether it |
7632 | uses sed or not.</a> | | 7622 | uses sed or not.</a> |
7633 | </dt> | | 7623 | </dt> |
7634 | </dl> | | 7624 | </dl> |
7635 | <table border="0" summary="Q and A Set"> | | 7625 | <table border="0" summary="Q and A Set"> |
7636 | <col align="left" width="1%"> | | 7626 | <col align="left" width="1%"> |
7637 | <tbody> | | 7627 | <tbody> |
7638 | <tr class="question"> | | 7628 | <tr class="question"> |
7639 | <td align="left" valign="top"> | | 7629 | <td align="left" valign="top"> |
7640 | <a name="tools.new"></a><a name="id1168230299569"></a><p><b>18.4.1.</b></p> | | 7630 | <a name="tools.new"></a><a name="id1168230298940"></a><p><b>18.4.1.</b></p> |
7641 | </td> | | 7631 | </td> |
7642 | <td align="left" valign="top"><p>How do I add a new tool?</p></td> | | 7632 | <td align="left" valign="top"><p>How do I add a new tool?</p></td> |
7643 | </tr> | | 7633 | </tr> |
7644 | <tr class="answer"> | | 7634 | <tr class="answer"> |
7645 | <td align="left" valign="top"></td> | | 7635 | <td align="left" valign="top"></td> |
7646 | <td align="left" valign="top"><p>TODO</p></td> | | 7636 | <td align="left" valign="top"><p>TODO</p></td> |
7647 | </tr> | | 7637 | </tr> |
7648 | <tr class="question"> | | 7638 | <tr class="question"> |
7649 | <td align="left" valign="top"> | | 7639 | <td align="left" valign="top"> |
7650 | <a name="tools.listall"></a><a name="id1168230299577"></a><p><b>18.4.2.</b></p> | | 7640 | <a name="tools.listall"></a><a name="id1168230298949"></a><p><b>18.4.2.</b></p> |
7651 | </td> | | 7641 | </td> |
7652 | <td align="left" valign="top"><p>How do I get a list of all available | | 7642 | <td align="left" valign="top"><p>How do I get a list of all available |
7653 | tools?</p></td> | | 7643 | tools?</p></td> |
7654 | </tr> | | 7644 | </tr> |
7655 | <tr class="answer"> | | 7645 | <tr class="answer"> |
7656 | <td align="left" valign="top"></td> | | 7646 | <td align="left" valign="top"></td> |
7657 | <td align="left" valign="top"><p>TODO</p></td> | | 7647 | <td align="left" valign="top"><p>TODO</p></td> |
7658 | </tr> | | 7648 | </tr> |
7659 | <tr class="question"> | | 7649 | <tr class="question"> |
7660 | <td align="left" valign="top"> | | 7650 | <td align="left" valign="top"> |
7661 | <a name="tools.used"></a><a name="id1168230299587"></a><p><b>18.4.3.</b></p> | | 7651 | <a name="tools.used"></a><a name="id1168230298957"></a><p><b>18.4.3.</b></p> |
7662 | </td> | | 7652 | </td> |
7663 | <td align="left" valign="top"><p>How can I get a list of all the tools that a | | 7653 | <td align="left" valign="top"><p>How can I get a list of all the tools that a |
7664 | package is using while being built? I want to know whether it | | 7654 | package is using while being built? I want to know whether it |
7665 | uses sed or not.</p></td> | | 7655 | uses sed or not.</p></td> |
7666 | </tr> | | 7656 | </tr> |
7667 | <tr class="answer"> | | 7657 | <tr class="answer"> |
7668 | <td align="left" valign="top"></td> | | 7658 | <td align="left" valign="top"></td> |
7669 | <td align="left" valign="top"><p>Currently, you can't. (TODO: But I want to be able | | 7659 | <td align="left" valign="top"><p>Currently, you can't. (TODO: But I want to be able |
7670 | to do it.)</p></td> | | 7660 | to do it.)</p></td> |
7671 | </tr> | | 7661 | </tr> |
7672 | </tbody> | | 7662 | </tbody> |
7673 | </table> | | 7663 | </table> |
7674 | </div> | | 7664 | </div> |
| @@ -9248,46 +9238,47 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/P | | | @@ -9248,46 +9238,47 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/P |
9248 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. This option will copy the scripts | | 9238 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. This option will copy the scripts |
9249 | into <code class="filename">/etc/rc.d</code> when a package is installed, and | | 9239 | into <code class="filename">/etc/rc.d</code> when a package is installed, and |
9250 | it will automatically remove the scripts when the package is | | 9240 | it will automatically remove the scripts when the package is |
9251 | deinstalled.</p> | | 9241 | deinstalled.</p> |
9252 | </div> | | 9242 | </div> |
9253 | <div class="sect2" lang="en"> | | 9243 | <div class="sect2" lang="en"> |
9254 | <div class="titlepage"><div><div><h3 class="title"> | | 9244 | <div class="titlepage"><div><div><h3 class="title"> |
9255 | <a name="tex-packages"></a>19.6.17. Packages installing TeX modules</h3></div></div></div> | | 9245 | <a name="tex-packages"></a>19.6.17. Packages installing TeX modules</h3></div></div></div> |
9256 | <p>If a package installs TeX packages into the texmf tree, | | 9246 | <p>If a package installs TeX packages into the texmf tree, |
9257 | the <code class="filename">ls-R</code> database of the tree needs to be | | 9247 | the <code class="filename">ls-R</code> database of the tree needs to be |
9258 | updated.</p> | | 9248 | updated.</p> |
9259 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 9249 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
9260 | <h3 class="title">Note</h3> | | 9250 | <h3 class="title">Note</h3> |
9261 | <p>Except the main TeX packages such as teTeX-texmf, | | 9251 | <p>Except the main TeX packages such as kpathsea, |
9262 | packages should install files | | 9252 | packages should install files |
9263 | into <code class="varname">PKG_LOCALTEXMFPREFIX</code>, | | 9253 | into <code class="filename">${PREFIX}/share/texmf-dist</code>, |
9264 | not <code class="varname">PKG_TEXMFPREFIX</code>.</p> | | 9254 | not <code class="filename">${PREFIX}/share/texmf</code>.</p> |
9265 | </div> | | 9255 | </div> |
9266 | <div class="orderedlist"><ol type="1"> | | 9256 | <div class="orderedlist"><ol type="1"> |
9267 | <li><p>Include | | 9257 | <li><p>Include |
9268 | <code class="filename">../../print/teTeX/module.mk</code> instead | | 9258 | <code class="filename">../../print/kpathsea/texmf.mk</code>. This |
9269 | of <code class="filename">../../mk/tex.buildlink3.mk</code>. This | | | |
9270 | takes care of rebuilding the <code class="filename">ls-R</code> | | 9259 | takes care of rebuilding the <code class="filename">ls-R</code> |
9271 | database at installation and deinstallation time.</p></li> | | 9260 | database at installation and deinstallation time.</p></li> |
9272 | <li> | | 9261 | <li> |
9273 | <p>If your package installs files into a texmf | | 9262 | <p>If your package installs files into a texmf |
9274 | tree other than the one | | 9263 | tree other than the one |
9275 | at <code class="varname">PKG_LOCALTEXMFPREFIX</code>, | | 9264 | at <code class="filename">${PREFIX}/share/texmf-dist</code>, |
9276 | set <code class="varname">TEXMFDIRS</code> to the list of all texmf | | 9265 | set <code class="varname">TEX_TEXMF_DIRS</code> to the list of all texmf |
9277 | trees that need database update.</p> | | 9266 | trees that need database update.</p> |
9278 | <p>If your package also installs font map files that need | | 9267 | <p>If your package also installs font map files that need |
9279 | to be registered using <span class="command"><strong>updmap</strong></span>, | | 9268 | to be registered using <span class="command"><strong>updmap</strong></span>, |
9280 | set <code class="varname">TEX_FONTMAPS</code> to the list of all | | 9269 | include <code class="filename">../../print/texlive-tetex/map.mk</code> and |
| | | 9270 | set <code class="varname">TEX_MAP_FILES</code> and/or |
| | | 9271 | <code class="varname">TEX_MIXEDMAP_FILES</code> to the list of all |
9281 | such font map files. Then <span class="command"><strong>updmap</strong></span> will | | 9272 | such font map files. Then <span class="command"><strong>updmap</strong></span> will |
9282 | be run automatically at installation/deinstallation to | | 9273 | be run automatically at installation/deinstallation to |
9283 | enable/disable font map files for TeX output | | 9274 | enable/disable font map files for TeX output |
9284 | drivers.</p> | | 9275 | drivers.</p> |
9285 | </li> | | 9276 | </li> |
9286 | <li><p>Make sure that none of <code class="filename">ls-R</code> | | 9277 | <li><p>Make sure that none of <code class="filename">ls-R</code> |
9287 | databases are included in <code class="filename">PLIST</code>, as | | 9278 | databases are included in <code class="filename">PLIST</code>, as |
9288 | they will be removed only by the teTeX-bin package.</p></li> | | 9279 | they will be removed only by the teTeX-bin package.</p></li> |
9289 | </ol></div> | | 9280 | </ol></div> |
9290 | </div> | | 9281 | </div> |
9291 | <div class="sect2" lang="en"> | | 9282 | <div class="sect2" lang="en"> |
9292 | <div class="titlepage"><div><div><h3 class="title"> | | 9283 | <div class="titlepage"><div><div><h3 class="title"> |
9293 | <a name="emulation-packages"></a>19.6.18. Packages supporting running binaries in | | 9284 | <a name="emulation-packages"></a>19.6.18. Packages supporting running binaries in |
| @@ -9340,46 +9331,33 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/P | | | @@ -9340,46 +9331,33 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/P |
9340 | <li><p>Check the PLIST and remove the entry that refers to the | | 9331 | <li><p>Check the PLIST and remove the entry that refers to the |
9341 | <code class="filename">share/applications/mimeinfo.cache</code> file. | | 9332 | <code class="filename">share/applications/mimeinfo.cache</code> file. |
9342 | It will be handled automatically.</p></li> | | 9333 | It will be handled automatically.</p></li> |
9343 | </ol></div> | | 9334 | </ol></div> |
9344 | <p>The best way to verify that the PLIST is correct with | | 9335 | <p>The best way to verify that the PLIST is correct with |
9345 | respect to the last point is to regenerate it using <span class="command"><strong>make | | 9336 | respect to the last point is to regenerate it using <span class="command"><strong>make |
9346 | print-PLIST</strong></span>.</p> | | 9337 | print-PLIST</strong></span>.</p> |
9347 | </div> | | 9338 | </div> |
9348 | </div> | | 9339 | </div> |
9349 | <div class="sect1" lang="en"> | | 9340 | <div class="sect1" lang="en"> |
9350 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 9341 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
9351 | <a name="punting"></a>19.7. Marking packages as having problems</h2></div></div></div> | | 9342 | <a name="punting"></a>19.7. Marking packages as having problems</h2></div></div></div> |
9352 | <p>In some cases one does not have the time to solve a problem | | 9343 | <p>In some cases one does not have the time to solve a problem |
9353 | immediately. There are currently two ways to declare that one knows | | 9344 | immediately. In this case, one can plainly mark a package as broken. For |
9354 | that a package has problems.</p> | | 9345 | this, one just sets the variable <code class="varname">BROKEN</code> to the |
9355 | <div class="itemizedlist"><ul type="disc"> | | 9346 | reason why the package is broken (similar to the |
9356 | <li><p>The first way is to plainly mark it as broken. For | | 9347 | <code class="varname">RESTRICTED</code> variable). A user trying to build |
9357 | this, one just sets the variable <code class="varname">BROKEN</code> to the | | 9348 | the package will immediately be shown this message, and the build |
9358 | reason why the package is broken (similar to the | | 9349 | will not be even tried.</p> |
9359 | <code class="varname">RESTRICTED</code> variable). A user trying to build | | 9350 | <p><code class="varname">BROKEN</code> packages are removed from pkgsrc in irregular |
9360 | the package will immediately be shown this message, and the build | | | |
9361 | will not be even tried.</p></li> | | | |
9362 | <li><p>After each pkgsrc freeze period (a time when the | | | |
9363 | tree is stabilized and a new pkgsrc branch is cut), the packages | | | |
9364 | that were not building in the official branch build on the latest | | | |
9365 | NetBSD release will be marked as broken on that branch. This is | | | |
9366 | done by setting the <code class="varname">BROKEN_IN</code> variable to the | | | |
9367 | branch name (or appending the branch name to it). If a user tries | | | |
9368 | to build such a package and the build fails, the user gets a | | | |
9369 | message that says that the package was broken on the respective | | | |
9370 | branch(es).</p></li> | | | |
9371 | </ul></div> | | | |
9372 | <p>Both types of packages are removed from pkgsrc in irregular | | | |
9373 | intervals.</p> | | 9351 | intervals.</p> |
9374 | </div> | | 9352 | </div> |
9375 | </div> | | 9353 | </div> |
9376 | <div class="chapter" lang="en"> | | 9354 | <div class="chapter" lang="en"> |
9377 | <div class="titlepage"><div><div><h2 class="title"> | | 9355 | <div class="titlepage"><div><div><h2 class="title"> |
9378 | <a name="debug"></a>Chapter 20. Debugging</h2></div></div></div> | | 9356 | <a name="debug"></a>Chapter 20. Debugging</h2></div></div></div> |
9379 | <p>To check out all the gotchas when building a package, here are | | 9357 | <p>To check out all the gotchas when building a package, here are |
9380 | the steps that I do in order to get a package working. Please note | | 9358 | the steps that I do in order to get a package working. Please note |
9381 | this is basically the same as what was explained in the previous | | 9359 | this is basically the same as what was explained in the previous |
9382 | sections, only with some debugging aids.</p> | | 9360 | sections, only with some debugging aids.</p> |
9383 | <div class="itemizedlist"><ul type="disc"> | | 9361 | <div class="itemizedlist"><ul type="disc"> |
9384 | <li><p>Be sure to set <code class="varname">PKG_DEVELOPER=yes</code> in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p></li> | | 9362 | <li><p>Be sure to set <code class="varname">PKG_DEVELOPER=yes</code> in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p></li> |
9385 | <li> | | 9363 | <li> |
| @@ -9531,28 +9509,34 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/P | | | @@ -9531,28 +9509,34 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/P |
9531 | cases it's the developer's decision.</p> | | 9509 | cases it's the developer's decision.</p> |
9532 | <p>There is a make target that helps in creating proper | | 9510 | <p>There is a make target that helps in creating proper |
9533 | <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code> entries: <span class="command"><strong>make | | 9511 | <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code> entries: <span class="command"><strong>make |
9534 | changes-entry</strong></span>. It uses the optional <code class="varname">CTYPE</code> | | 9512 | changes-entry</strong></span>. It uses the optional <code class="varname">CTYPE</code> |
9535 | and <code class="varname">NETBSD_LOGIN_NAME</code> variables. The general | | 9513 | and <code class="varname">NETBSD_LOGIN_NAME</code> variables. The general |
9536 | usage is to first make sure that your <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code> | | 9514 | usage is to first make sure that your <code class="filename">CHANGES-<em class="replaceable"><code>YYYY</code></em></code> |
9537 | file is up-to-date (to avoid having to resolve conflicts later-on) | | 9515 | file is up-to-date (to avoid having to resolve conflicts later-on) |
9538 | and then to <span class="command"><strong>cd</strong></span> to the package directory. For | | 9516 | and then to <span class="command"><strong>cd</strong></span> to the package directory. For |
9539 | package updates, <span class="command"><strong>make changes-entry</strong></span> is enough. | | 9517 | package updates, <span class="command"><strong>make changes-entry</strong></span> is enough. |
9540 | For new packages, or package moves or removals, set the | | 9518 | For new packages, or package moves or removals, set the |
9541 | <code class="varname">CTYPE</code> variable on the command line to "Added", | | 9519 | <code class="varname">CTYPE</code> variable on the command line to "Added", |
9542 | "Moved", or "Removed". You can set <code class="varname">NETBSD_LOGIN_NAME</code> | | 9520 | "Moved", or "Removed". You can set <code class="varname">NETBSD_LOGIN_NAME</code> |
9543 | in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> if your local login name is | | 9521 | in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> if your local login name is |
9544 | not the same as your NetBSD login name. Don't forget to commit | | 9522 | not the same as your NetBSD login name. The target also automatically |
9545 | the changes to <code class="filename">pkgsrc/doc/CHANGES-<em class="replaceable"><code>YYYY</code></em></code>!</p> | | 9523 | removes possibly existing entries for the package in the |
| | | 9524 | <code class="filename">TODO</code> file. Don't forget to commit |
| | | 9525 | the changes, e.g. by using <span class="command"><strong>make changes-entry-commit</strong></span>! |
| | | 9526 | If you are not using a checkout directly from cvs.netbsd.org, but e.g. |
| | | 9527 | a local copy of the repository, you can set USE_NETBSD_REPO=yes. This |
| | | 9528 | makes the cvs commands use the main repository. |
| | | 9529 | </p> |
9546 | </div> | | 9530 | </div> |
9547 | <div class="sect1" lang="en"> | | 9531 | <div class="sect1" lang="en"> |
9548 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 9532 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
9549 | <a name="committing-importing"></a>21.4. Committing: Importing a package into CVS</h2></div></div></div> | | 9533 | <a name="committing-importing"></a>21.4. Committing: Importing a package into CVS</h2></div></div></div> |
9550 | <p>This section is only of interest for pkgsrc developers with write | | 9534 | <p>This section is only of interest for pkgsrc developers with write |
9551 | access to the pkgsrc repository. Please remember that cvs | | 9535 | access to the pkgsrc repository. Please remember that cvs |
9552 | imports files relative to the current working directory, and that | | 9536 | imports files relative to the current working directory, and that |
9553 | the pathname that you | | 9537 | the pathname that you |
9554 | give the <span class="command"><strong>cvs import</strong></span> command is so that it knows where | | 9538 | give the <span class="command"><strong>cvs import</strong></span> command is so that it knows where |
9555 | to place the files in the repository. Newly created packages should be | | 9539 | to place the files in the repository. Newly created packages should be |
9556 | imported with a vendor tag of “<span class="quote">TNF</span>” and a release tag of | | 9540 | imported with a vendor tag of “<span class="quote">TNF</span>” and a release tag of |
9557 | “<span class="quote">pkgsrc-base</span>”, e.g:</p> | | 9541 | “<span class="quote">pkgsrc-base</span>”, e.g:</p> |
9558 | <pre class="programlisting"> | | 9542 | <pre class="programlisting"> |
| @@ -9701,157 +9685,157 @@ place. | | | @@ -9701,157 +9685,157 @@ place. |
9701 | </dt> | | 9685 | </dt> |
9702 | <dt>22.8. <a href="#devfaq.documentation">Where is the pkgsrc | | 9686 | <dt>22.8. <a href="#devfaq.documentation">Where is the pkgsrc |
9703 | documentation?</a> | | 9687 | documentation?</a> |
9704 | </dt> | | 9688 | </dt> |
9705 | <dt>22.9. <a href="#devfaq.too-much-time">I have a little time to kill. What shall I | | 9689 | <dt>22.9. <a href="#devfaq.too-much-time">I have a little time to kill. What shall I |
9706 | do?</a> | | 9690 | do?</a> |
9707 | </dt> | | 9691 | </dt> |
9708 | </dl> | | 9692 | </dl> |
9709 | <table border="0" summary="Q and A Set"> | | 9693 | <table border="0" summary="Q and A Set"> |
9710 | <col align="left" width="1%"> | | 9694 | <col align="left" width="1%"> |
9711 | <tbody> | | 9695 | <tbody> |
9712 | <tr class="question"> | | 9696 | <tr class="question"> |
9713 | <td align="left" valign="top"> | | 9697 | <td align="left" valign="top"> |
9714 | <a name="devfaq.makeflags"></a><a name="id1168230286914"></a><p><b>22.1.</b></p> | | 9698 | <a name="devfaq.makeflags"></a><a name="id1168230286524"></a><p><b>22.1.</b></p> |
9715 | </td> | | 9699 | </td> |
9716 | <td align="left" valign="top"><p>What is the difference between | | 9700 | <td align="left" valign="top"><p>What is the difference between |
9717 | <code class="varname">MAKEFLAGS</code>, <code class="varname">.MAKEFLAGS</code> and | | 9701 | <code class="varname">MAKEFLAGS</code>, <code class="varname">.MAKEFLAGS</code> and |
9718 | <code class="varname">MAKE_FLAGS</code>?</p></td> | | 9702 | <code class="varname">MAKE_FLAGS</code>?</p></td> |
9719 | </tr> | | 9703 | </tr> |
9720 | <tr class="answer"> | | 9704 | <tr class="answer"> |
9721 | <td align="left" valign="top"></td> | | 9705 | <td align="left" valign="top"></td> |
9722 | <td align="left" valign="top"><p><code class="varname">MAKEFLAGS</code> are the flags passed | | 9706 | <td align="left" valign="top"><p><code class="varname">MAKEFLAGS</code> are the flags passed |
9723 | to the pkgsrc-internal invocations of <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>, while | | 9707 | to the pkgsrc-internal invocations of <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>, while |
9724 | <code class="varname">MAKE_FLAGS</code> are the flags that are passed to | | 9708 | <code class="varname">MAKE_FLAGS</code> are the flags that are passed to |
9725 | the <code class="varname">MAKE_PROGRAM</code> when building the | | 9709 | the <code class="varname">MAKE_PROGRAM</code> when building the |
9726 | package. [FIXME: What is .MAKEFLAGS for?]</p></td> | | 9710 | package. [FIXME: What is .MAKEFLAGS for?]</p></td> |
9727 | </tr> | | 9711 | </tr> |
9728 | <tr class="question"> | | 9712 | <tr class="question"> |
9729 | <td align="left" valign="top"> | | 9713 | <td align="left" valign="top"> |
9730 | <a name="devfaq.make"></a><a name="id1168230286947"></a><p><b>22.2.</b></p> | | 9714 | <a name="devfaq.make"></a><a name="id1168230286557"></a><p><b>22.2.</b></p> |
9731 | </td> | | 9715 | </td> |
9732 | <td align="left" valign="top"><p>What is the difference between | | 9716 | <td align="left" valign="top"><p>What is the difference between |
9733 | <code class="varname">MAKE</code>, <code class="varname">GMAKE</code> and | | 9717 | <code class="varname">MAKE</code>, <code class="varname">GMAKE</code> and |
9734 | <code class="varname">MAKE_PROGRAM</code>?</p></td> | | 9718 | <code class="varname">MAKE_PROGRAM</code>?</p></td> |
9735 | </tr> | | 9719 | </tr> |
9736 | <tr class="answer"> | | 9720 | <tr class="answer"> |
9737 | <td align="left" valign="top"></td> | | 9721 | <td align="left" valign="top"></td> |
9738 | <td align="left" valign="top"><p><code class="varname">MAKE</code> is the path to the | | 9722 | <td align="left" valign="top"><p><code class="varname">MAKE</code> is the path to the |
9739 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> program that is used in the pkgsrc | | 9723 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> program that is used in the pkgsrc |
9740 | infrastructure. <code class="varname">GMAKE</code> is the path to GNU | | 9724 | infrastructure. <code class="varname">GMAKE</code> is the path to GNU |
9741 | Make, but you need to say <code class="varname">USE_TOOLS+=gmake</code> to | | 9725 | Make, but you need to say <code class="varname">USE_TOOLS+=gmake</code> to |
9742 | use that. <code class="varname">MAKE_PROGRAM</code> is the path to the | | 9726 | use that. <code class="varname">MAKE_PROGRAM</code> is the path to the |
9743 | Make program that is used for building the | | 9727 | Make program that is used for building the |
9744 | package.</p></td> | | 9728 | package.</p></td> |
9745 | </tr> | | 9729 | </tr> |
9746 | <tr class="question"> | | 9730 | <tr class="question"> |
9747 | <td align="left" valign="top"> | | 9731 | <td align="left" valign="top"> |
9748 | <a name="devfaq.cc"></a><a name="id1168230286984"></a><p><b>22.3.</b></p> | | 9732 | <a name="devfaq.cc"></a><a name="id1168230286595"></a><p><b>22.3.</b></p> |
9749 | </td> | | 9733 | </td> |
9750 | <td align="left" valign="top"><p>What is the difference between | | 9734 | <td align="left" valign="top"><p>What is the difference between |
9751 | <code class="varname">CC</code>, <code class="varname">PKG_CC</code> and | | 9735 | <code class="varname">CC</code>, <code class="varname">PKG_CC</code> and |
9752 | <code class="varname">PKGSRC_COMPILER</code>?</p></td> | | 9736 | <code class="varname">PKGSRC_COMPILER</code>?</p></td> |
9753 | </tr> | | 9737 | </tr> |
9754 | <tr class="answer"> | | 9738 | <tr class="answer"> |
9755 | <td align="left" valign="top"></td> | | 9739 | <td align="left" valign="top"></td> |
9756 | <td align="left" valign="top"><p><code class="varname">CC</code> is the path to the real C | | 9740 | <td align="left" valign="top"><p><code class="varname">CC</code> is the path to the real C |
9757 | compiler, which can be configured by the pkgsrc user. | | 9741 | compiler, which can be configured by the pkgsrc user. |
9758 | <code class="varname">PKG_CC</code> is the path to the compiler wrapper. | | 9742 | <code class="varname">PKG_CC</code> is the path to the compiler wrapper. |
9759 | <code class="varname">PKGSRC_COMPILER</code> is <span class="emphasis"><em>not</em></span> a | | 9743 | <code class="varname">PKGSRC_COMPILER</code> is <span class="emphasis"><em>not</em></span> a |
9760 | path to a compiler, but the type of compiler that should be | | 9744 | path to a compiler, but the type of compiler that should be |
9761 | used. See <code class="filename">mk/compiler.mk</code> for more | | 9745 | used. See <code class="filename">mk/compiler.mk</code> for more |
9762 | information about the latter variable.</p></td> | | 9746 | information about the latter variable.</p></td> |
9763 | </tr> | | 9747 | </tr> |
9764 | <tr class="question"> | | 9748 | <tr class="question"> |
9765 | <td align="left" valign="top"> | | 9749 | <td align="left" valign="top"> |
9766 | <a name="devfaq.bl3flags"></a><a name="id1168230287019"></a><p><b>22.4.</b></p> | | 9750 | <a name="devfaq.bl3flags"></a><a name="id1168230286629"></a><p><b>22.4.</b></p> |
9767 | </td> | | 9751 | </td> |
9768 | <td align="left" valign="top"><p>What is the difference between | | 9752 | <td align="left" valign="top"><p>What is the difference between |
9769 | <code class="varname">BUILDLINK_LDFLAGS</code>, | | 9753 | <code class="varname">BUILDLINK_LDFLAGS</code>, |
9770 | <code class="varname">BUILDLINK_LDADD</code> and | | 9754 | <code class="varname">BUILDLINK_LDADD</code> and |
9771 | <code class="varname">BUILDLINK_LIBS</code>?</p></td> | | 9755 | <code class="varname">BUILDLINK_LIBS</code>?</p></td> |
9772 | </tr> | | 9756 | </tr> |
9773 | <tr class="answer"> | | 9757 | <tr class="answer"> |
9774 | <td align="left" valign="top"></td> | | 9758 | <td align="left" valign="top"></td> |
9775 | <td align="left" valign="top"><p>[FIXME]</p></td> | | 9759 | <td align="left" valign="top"><p>[FIXME]</p></td> |
9776 | </tr> | | 9760 | </tr> |
9777 | <tr class="question"> | | 9761 | <tr class="question"> |
9778 | <td align="left" valign="top"> | | 9762 | <td align="left" valign="top"> |
9779 | <a name="devfaq.bl3prefix"></a><a name="id1168230287037"></a><p><b>22.5.</b></p> | | 9763 | <a name="devfaq.bl3prefix"></a><a name="id1168230286648"></a><p><b>22.5.</b></p> |
9780 | </td> | | 9764 | </td> |
9781 | <td align="left" valign="top"><p>Why does <span class="command"><strong>make show-var | | 9765 | <td align="left" valign="top"><p>Why does <span class="command"><strong>make show-var |
9782 | VARNAME=BUILDLINK_PREFIX.<em class="replaceable"><code>foo</code></em></strong></span> | | 9766 | VARNAME=BUILDLINK_PREFIX.<em class="replaceable"><code>foo</code></em></strong></span> |
9783 | say it's empty?</p></td> | | 9767 | say it's empty?</p></td> |
9784 | </tr> | | 9768 | </tr> |
9785 | <tr class="answer"> | | 9769 | <tr class="answer"> |
9786 | <td align="left" valign="top"></td> | | 9770 | <td align="left" valign="top"></td> |
9787 | <td align="left" valign="top"><p>For optimization reasons, some variables are only | | 9771 | <td align="left" valign="top"><p>For optimization reasons, some variables are only |
9788 | available in the “<span class="quote">wrapper</span>” phase and later. To | | 9772 | available in the “<span class="quote">wrapper</span>” phase and later. To |
9789 | “<span class="quote">simulate</span>” the wrapper phase, append | | 9773 | “<span class="quote">simulate</span>” the wrapper phase, append |
9790 | <span class="command"><strong>PKG_PHASE=wrapper</strong></span> to the above | | 9774 | <span class="command"><strong>PKG_PHASE=wrapper</strong></span> to the above |
9791 | command.</p></td> | | 9775 | command.</p></td> |
9792 | </tr> | | 9776 | </tr> |
9793 | <tr class="question"> | | 9777 | <tr class="question"> |
9794 | <td align="left" valign="top"> | | 9778 | <td align="left" valign="top"> |
9795 | <a name="devfaq.master_sites"></a><a name="id1168230287063"></a><p><b>22.6.</b></p> | | 9779 | <a name="devfaq.master_sites"></a><a name="id1168230286674"></a><p><b>22.6.</b></p> |
9796 | </td> | | 9780 | </td> |
9797 | <td align="left" valign="top"><p>What does | | 9781 | <td align="left" valign="top"><p>What does |
9798 | <code class="literal">${MASTER_SITE_SOURCEFORGE:=package/}</code> mean? I | | 9782 | <code class="literal">${MASTER_SITE_SOURCEFORGE:=package/}</code> mean? I |
9799 | don't understand the <code class="literal">:=</code> inside | | 9783 | don't understand the <code class="literal">:=</code> inside |
9800 | it.</p></td> | | 9784 | it.</p></td> |
9801 | </tr> | | 9785 | </tr> |
9802 | <tr class="answer"> | | 9786 | <tr class="answer"> |
9803 | <td align="left" valign="top"></td> | | 9787 | <td align="left" valign="top"></td> |
9804 | <td align="left" valign="top"><p>The <code class="literal">:=</code> is not really an | | 9788 | <td align="left" valign="top"><p>The <code class="literal">:=</code> is not really an |
9805 | assignment operator, like you might expect at first sight. | | 9789 | assignment operator, like you might expect at first sight. |
9806 | Instead, it is a degenerate form of | | 9790 | Instead, it is a degenerate form of |
9807 | <code class="literal">${LIST:<em class="replaceable"><code>old_string</code></em>=<em class="replaceable"><code>new_string</code></em>}</code>, | | 9791 | <code class="literal">${LIST:<em class="replaceable"><code>old_string</code></em>=<em class="replaceable"><code>new_string</code></em>}</code>, |
9808 | which is documented in the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man page and which you | | 9792 | which is documented in the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> man page and which you |
9809 | may have seen as in <code class="literal">${SRCS:.c=.o}</code>. In the | | 9793 | may have seen as in <code class="literal">${SRCS:.c=.o}</code>. In the |
9810 | case of <code class="varname">MASTER_SITE_*</code>, | | 9794 | case of <code class="varname">MASTER_SITE_*</code>, |
9811 | <em class="replaceable"><code>old_string</code></em> is the empty string and | | 9795 | <em class="replaceable"><code>old_string</code></em> is the empty string and |
9812 | <em class="replaceable"><code>new_string</code></em> is | | 9796 | <em class="replaceable"><code>new_string</code></em> is |
9813 | <code class="literal">package/</code>. That's where the | | 9797 | <code class="literal">package/</code>. That's where the |
9814 | <code class="literal">:</code> and the <code class="literal">=</code> fall | | 9798 | <code class="literal">:</code> and the <code class="literal">=</code> fall |
9815 | together.</p></td> | | 9799 | together.</p></td> |
9816 | </tr> | | 9800 | </tr> |
9817 | <tr class="question"> | | 9801 | <tr class="question"> |
9818 | <td align="left" valign="top"> | | 9802 | <td align="left" valign="top"> |
9819 | <a name="devfaq.mailinglists"></a><a name="id1168230287198"></a><p><b>22.7.</b></p> | | 9803 | <a name="devfaq.mailinglists"></a><a name="id1168230286741"></a><p><b>22.7.</b></p> |
9820 | </td> | | 9804 | </td> |
9821 | <td align="left" valign="top"><p>Which mailing lists are there for package | | 9805 | <td align="left" valign="top"><p>Which mailing lists are there for package |
9822 | developers?</p></td> | | 9806 | developers?</p></td> |
9823 | </tr> | | 9807 | </tr> |
9824 | <tr class="answer"> | | 9808 | <tr class="answer"> |
9825 | <td align="left" valign="top"></td> | | 9809 | <td align="left" valign="top"></td> |
9826 | <td align="left" valign="top"><div class="variablelist"><dl> | | 9810 | <td align="left" valign="top"><div class="variablelist"><dl> |
9827 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#tech-pkg" target="_top">tech-pkg</a></span></dt> | | 9811 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#tech-pkg" target="_top">tech-pkg</a></span></dt> |
9828 | <dd><p>This is a list for technical discussions related | | 9812 | <dd><p>This is a list for technical discussions related |
9829 | to pkgsrc development, e.g. soliciting feedback for changes to | | 9813 | to pkgsrc development, e.g. soliciting feedback for changes to |
9830 | pkgsrc infrastructure, proposed new features, questions related | | 9814 | pkgsrc infrastructure, proposed new features, questions related |
9831 | to porting pkgsrc to a new platform, advice for maintaining a | | 9815 | to porting pkgsrc to a new platform, advice for maintaining a |
9832 | package, patches that affect many packages, help requests moved | | 9816 | package, patches that affect many packages, help requests moved |
9833 | from pkgsrc-users when an infrastructure bug is found, | | 9817 | from pkgsrc-users when an infrastructure bug is found, |
9834 | etc.</p></dd> | | 9818 | etc.</p></dd> |
9835 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#pkgsrc-bugs" target="_top">pkgsrc-bugs</a></span></dt> | | 9819 | <dt><span class="term"><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#pkgsrc-bugs" target="_top">pkgsrc-bugs</a></span></dt> |
9836 | <dd><p>All bug reports in category "pkg" sent with | | 9820 | <dd><p>All bug reports in category "pkg" sent with |
9837 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">send-pr</span>(1)</span></a> appear here. Please do not report your bugs here | | 9821 | <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">send-pr</span>(1)</span></a> appear here. Please do not report your bugs here |
9838 | directly; use one of the other mailing | | 9822 | directly; use one of the other mailing |
9839 | lists.</p></dd> | | 9823 | lists.</p></dd> |
9840 | </dl></div></td> | | 9824 | </dl></div></td> |
9841 | </tr> | | 9825 | </tr> |
9842 | <tr class="question"> | | 9826 | <tr class="question"> |
9843 | <td align="left" valign="top"> | | 9827 | <td align="left" valign="top"> |
9844 | <a name="devfaq.documentation"></a><a name="id1168230287230"></a><p><b>22.8.</b></p> | | 9828 | <a name="devfaq.documentation"></a><a name="id1168230286772"></a><p><b>22.8.</b></p> |
9845 | </td> | | 9829 | </td> |
9846 | <td align="left" valign="top"><p>Where is the pkgsrc | | 9830 | <td align="left" valign="top"><p>Where is the pkgsrc |
9847 | documentation?</p></td> | | 9831 | documentation?</p></td> |
9848 | </tr> | | 9832 | </tr> |
9849 | <tr class="answer"> | | 9833 | <tr class="answer"> |
9850 | <td align="left" valign="top"></td> | | 9834 | <td align="left" valign="top"></td> |
9851 | <td align="left" valign="top"> | | 9835 | <td align="left" valign="top"> |
9852 | <p>There are many places where you can find | | 9836 | <p>There are many places where you can find |
9853 | documentation about pkgsrc:</p> | | 9837 | documentation about pkgsrc:</p> |
9854 | <div class="itemizedlist"><ul type="disc"> | | 9838 | <div class="itemizedlist"><ul type="disc"> |
9855 | <li><p>The pkgsrc guide (this document) is a collection | | 9839 | <li><p>The pkgsrc guide (this document) is a collection |
9856 | of chapters that explain large parts of pkgsrc, but some | | 9840 | of chapters that explain large parts of pkgsrc, but some |
9857 | chapters tend to be outdated. Which ones they are is hard to | | 9841 | chapters tend to be outdated. Which ones they are is hard to |
| @@ -9879,43 +9863,43 @@ do? | | | @@ -9879,43 +9863,43 @@ do? |
9879 | documented</span>”, that is the documentation exists only in the | | 9863 | documented</span>”, that is the documentation exists only in the |
9880 | mind of the developer who wrote the code. To get this | | 9864 | mind of the developer who wrote the code. To get this |
9881 | information, use the <span class="command"><strong>cvs annotate</strong></span> command | | 9865 | information, use the <span class="command"><strong>cvs annotate</strong></span> command |
9882 | to see who has written it and ask on the | | 9866 | to see who has written it and ask on the |
9883 | <code class="literal">tech-pkg</code> mailing list, so that others can | | 9867 | <code class="literal">tech-pkg</code> mailing list, so that others can |
9884 | find your questions later (see above). To be sure that the | | 9868 | find your questions later (see above). To be sure that the |
9885 | developer in charge reads the mail, you may CC him or | | 9869 | developer in charge reads the mail, you may CC him or |
9886 | her.</p></li> | | 9870 | her.</p></li> |
9887 | </ul></div> | | 9871 | </ul></div> |
9888 | </td> | | 9872 | </td> |
9889 | </tr> | | 9873 | </tr> |
9890 | <tr class="question"> | | 9874 | <tr class="question"> |
9891 | <td align="left" valign="top"> | | 9875 | <td align="left" valign="top"> |
9892 | <a name="devfaq.too-much-time"></a><a name="id1168230287284"></a><p><b>22.9.</b></p> | | 9876 | <a name="devfaq.too-much-time"></a><a name="id1168230286826"></a><p><b>22.9.</b></p> |
9893 | </td> | | 9877 | </td> |
9894 | <td align="left" valign="top"><p>I have a little time to kill. What shall I | | 9878 | <td align="left" valign="top"><p>I have a little time to kill. What shall I |
9895 | do?</p></td> | | 9879 | do?</p></td> |
9896 | </tr> | | 9880 | </tr> |
9897 | <tr class="answer"> | | 9881 | <tr class="answer"> |
9898 | <td align="left" valign="top"></td> | | 9882 | <td align="left" valign="top"></td> |
9899 | <td align="left" valign="top"> | | 9883 | <td align="left" valign="top"> |
9900 | <p>This is not really an FAQ yet, but here's the answer | | 9884 | <p>This is not really an FAQ yet, but here's the answer |
9901 | anyway.</p> | | 9885 | anyway.</p> |
9902 | <div class="itemizedlist"><ul type="disc"> | | 9886 | <div class="itemizedlist"><ul type="disc"> |
9903 | <li><p>Run <span class="command"><strong>pkg_chk -N</strong></span> (from the | | 9887 | <li><p>Run <span class="command"><strong>pkg_chk -N</strong></span> (from the |
9904 | <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 | | 9888 | <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 |
9905 | will tell you about newer versions of installed packages that are | | 9889 | will tell you about newer versions of installed packages that are |
9906 | available, but not yet updated in pkgsrc.</p></li> | | 9890 | available, but not yet updated in pkgsrc.</p></li> |
9907 | <li><p>Browse <code class="filename">pkgsrc/doc/TODO</code> | | 9891 | <li><p>Browse <code class="filename">pkgsrc/doc/TODO</code> |
9908 | — it contains a list of suggested new packages and a list of | | 9892 | — it contains a list of suggested new packages and a list of |
9909 | cleanups and enhancements for pkgsrc that would be nice to | | 9893 | cleanups and enhancements for pkgsrc that would be nice to |
9910 | have.</p></li> | | 9894 | have.</p></li> |
9911 | <li><p>Review packages for which review was requested on | | 9895 | <li><p>Review packages for which review was requested on |
9912 | the <a class="ulink" href="http://pkgsrc-wip.sourceforge.net/" target="_top">pkgsrc-wip</a> review | | 9896 | the <a class="ulink" href="http://pkgsrc-wip.sourceforge.net/" target="_top">pkgsrc-wip</a> review |
9913 | mailing list.</p></li> | | 9897 | mailing list.</p></li> |
9914 | </ul></div> | | 9898 | </ul></div> |
9915 | </td> | | 9899 | </td> |
9916 | </tr> | | 9900 | </tr> |
9917 | </tbody> | | 9901 | </tbody> |
9918 | </table> | | 9902 | </table> |
9919 | </div> | | 9903 | </div> |
9920 | </div> | | 9904 | </div> |
9921 | <div class="chapter" lang="en"> | | 9905 | <div class="chapter" lang="en"> |
| @@ -10413,28 +10397,28 @@ CFLAGS+= -Wall | | | @@ -10413,28 +10397,28 @@ CFLAGS+= -Wall |
10413 | </div> | | 10397 | </div> |
10414 | <div class="sect1" lang="en"> | | 10398 | <div class="sect1" lang="en"> |
10415 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 10399 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
10416 | <a name="infr.design.intf"></a>24.5. Designing interfaces for Makefile fragments</h2></div></div></div> | | 10400 | <a name="infr.design.intf"></a>24.5. Designing interfaces for Makefile fragments</h2></div></div></div> |
10417 | <p>Most of the <code class="filename">.mk</code> files fall into one | | 10401 | <p>Most of the <code class="filename">.mk</code> files fall into one |
10418 | of the following classes. Cases where a file falls into more | | 10402 | of the following classes. Cases where a file falls into more |
10419 | than one class should be avoided as it often leads to subtle | | 10403 | than one class should be avoided as it often leads to subtle |
10420 | bugs.</p> | | 10404 | bugs.</p> |
10421 | <div class="sect2" lang="en"> | | 10405 | <div class="sect2" lang="en"> |
10422 | <div class="titlepage"><div><div><h3 class="title"> | | 10406 | <div class="titlepage"><div><div><h3 class="title"> |
10423 | <a name="infr.design.intf.proc"></a>24.5.1. Procedures with parameters</h3></div></div></div> | | 10407 | <a name="infr.design.intf.proc"></a>24.5.1. Procedures with parameters</h3></div></div></div> |
10424 | <p>In a traditional imperative programming language some of | | 10408 | <p>In a traditional imperative programming language some of |
10425 | the <code class="filename">.mk</code> files could be described as | | 10409 | the <code class="filename">.mk</code> files could be described as |
10426 | procedures. They take some input parameters and—after | | 10410 | procedures. They take some input parameters and—after |
10427 | inclusion—provide a result in output parameters. Since all | | 10411 | inclusion—provide a result in output parameters. Since all |
10428 | variables in <code class="filename">Makefile</code>s have global scope | | 10412 | variables in <code class="filename">Makefile</code>s have global scope |
10429 | care must be taken not to use parameter names that have already | | 10413 | care must be taken not to use parameter names that have already |
10430 | another meaning. For example, <code class="varname">PKGNAME</code> is a | | 10414 | another meaning. For example, <code class="varname">PKGNAME</code> is a |
10431 | bad choice for a parameter name.</p> | | 10415 | bad choice for a parameter name.</p> |
10432 | <p>Procedures are completely evaluated at preprocessing time. | | 10416 | <p>Procedures are completely evaluated at preprocessing time. |
10433 | That is, when calling a procedure all input parameters must be | | 10417 | That is, when calling a procedure all input parameters must be |
10434 | completely resolvable. For example, | | 10418 | completely resolvable. For example, |
10435 | <code class="varname">CONFIGURE_ARGS</code> should never be an input | | 10419 | <code class="varname">CONFIGURE_ARGS</code> should never be an input |
10436 | parameter since it is very likely that further text will be | | 10420 | parameter since it is very likely that further text will be |
10437 | added after calling the procedure, which would effectively apply | | 10421 | added after calling the procedure, which would effectively apply |
10438 | the procedure to only a part of the variable. Also, references | | 10422 | the procedure to only a part of the variable. Also, references |
10439 | to other variables wit will be modified after calling the | | 10423 | to other variables wit will be modified after calling the |
10440 | procedure.</p> | | 10424 | procedure.</p> |