Tue Aug 25 13:20:58 2009 UTC ()
regen.


(wiz)
diff -r1.124 -r1.125 pkgsrc/doc/pkgsrc.html
diff -r1.125 -r1.126 pkgsrc/doc/pkgsrc.txt

cvs diff -r1.124 -r1.125 pkgsrc/doc/pkgsrc.html (expand / switch to unified diff)

--- pkgsrc/doc/pkgsrc.html 2009/05/17 23:36:01 1.124
+++ pkgsrc/doc/pkgsrc.html 2009/08/25 13:20:58 1.125
@@ -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>&#8220;<span class="quote">It should only work if it's right.</span>&#8221; 569<li><p>&#8220;<span class="quote">It should only work if it's right.</span>&#8221;
570&mdash; That means, if a package contains bugs, it's better to find 570&#8212; That means, if a package contains bugs, it's better to find
571them and to complain about them rather than to just install the package 571them and to complain about them rather than to just install the package
572and hope that it works. There are numerous checks in pkgsrc that try to 572and hope that it works. There are numerous checks in pkgsrc that try to
573find 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 573find 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
574of shell scripts), and post-installation checks (installed files, 574of shell scripts), and post-installation checks (installed files,
575references to shared libraries, script interpreters).</p></li> 575references to shared libraries, script interpreters).</p></li>
576<li><p>&#8220;<span class="quote">If it works, it should work everywhere</span>&#8221; 576<li><p>&#8220;<span class="quote">If it works, it should work everywhere</span>&#8221;
577&mdash; Like NetBSD has been ported to many hardware architectures, 577&#8212; Like NetBSD has been ported to many hardware architectures,
578pkgsrc has been ported to many operating systems. Care is taken that 578pkgsrc has been ported to many operating systems. Care is taken that
579packages behave the same on all platforms.</p></li> 579packages 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
586distribution for these operating systems. After retrieving the required 586distribution for these operating systems. After retrieving the required
587source or binaries, you can be up and running with pkgsrc in just 587source or binaries, you can be up and running with pkgsrc in just
588minutes!</p> 588minutes!</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, &#8220;<span class="quote">download-vulnerability-list</span>&#8221;, 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, &#8220;<span class="quote">audit-packages</span>&#8221;, 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&amp;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
 18370 3 * * * /usr/sbin/pkg_admin fetch-pkg-vulnerabilities &gt;/dev/null 2&gt;&amp;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 &#8220;<span class="quote">-i</span>&#8221; 1858 <span class="command"><strong>lintpkgsrc</strong></span> with the &#8220;<span class="quote">-i</span>&#8221;
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 (&#8220;<span class="quote">2.0</span>&#8221;, etc.) and architecture 2179 release (&#8220;<span class="quote">2.0</span>&#8221;, etc.) and architecture
2163 (&#8220;<span class="quote">mipsel</span>&#8221;, etc.).</p></li> 2180 (&#8220;<span class="quote">mipsel</span>&#8221;, 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 &mdash; it is an internal definition which refers to the 2207 &#8212; 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, &#8220;patches/*&#8221;</a> for more 2212 See <a class="xref" href="#components.patches" title="11.3. patches/*">Section 11.3, &#8220;patches/*&#8221;</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">
2634PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH} 2653PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH}
2635WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc 2654WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc
2636BSDSRCDIR= /usr/src 2655BSDSRCDIR= /usr/src
2637BSDXSRCDIR= /usr/xsrc # for x11/xservers 2656BSDXSRCDIR= /usr/xsrc # for x11/xservers
2638OBJHOSTNAME?= yes # use work.`hostname` 2657OBJHOSTNAME?= yes # use work.`hostname`
2639FAILOVER_FETCH= yes # insist on the correct checksum 2658FAILOVER_FETCH= yes # insist on the correct checksum
2640PKG_DEVELOPER?= yes 2659PKG_DEVELOPER?= yes
2641_ACCEPTABLE= yes 2660SKIP_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 &#8220;<span class="quote">no</span>&#8221;.</p></li> 2669 &#8220;<span class="quote">no</span>&#8221;.</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.&nbsp;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 &mdash; 4606 kqueue support, add a check that detects kqueue itself &#8212;
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&mdash;the <span class="command"><strong>.for</strong></span> 4977<p>No rule without exception&#8212;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 &#8220;<span class="quote">shared directory</span>&#8221; is a directory where 5397<p>A &#8220;<span class="quote">shared directory</span>&#8221; 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&gt;/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 &#8220;<span class="quote">-dirs</span>&#8221; 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">
5418USE_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">
6784MASTER_SITES= http://www.example.com/download.cgi?file= 6771MASTER_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 &#8220;<span class="quote">TNF</span>&#8221; and a release tag of 9540 imported with a vendor tag of &#8220;<span class="quote">TNF</span>&#8221; and a release tag of
9557 &#8220;<span class="quote">pkgsrc-base</span>&#8221;, e.g:</p> 9541 &#8220;<span class="quote">pkgsrc-base</span>&#8221;, 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
9706do?</a> 9690do?</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 &#8220;<span class="quote">wrapper</span>&#8221; phase and later. To 9772 available in the &#8220;<span class="quote">wrapper</span>&#8221; phase and later. To
9789 &#8220;<span class="quote">simulate</span>&#8221; the wrapper phase, append 9773 &#8220;<span class="quote">simulate</span>&#8221; 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>&#8221;, that is the documentation exists only in the 9863 documented</span>&#8221;, 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
9895do?</p></td> 9879do?</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
9901anyway.</p> 9885anyway.</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 &mdash; it contains a list of suggested new packages and a list of 9892 &#8212; 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&mdash;after 10410 procedures. They take some input parameters and&#8212;after
10427 inclusion&mdash;provide a result in output parameters. Since all 10411 inclusion&#8212;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>

cvs diff -r1.125 -r1.126 pkgsrc/doc/pkgsrc.txt (expand / switch to unified diff)

--- pkgsrc/doc/pkgsrc.txt 2009/05/17 23:36:01 1.125
+++ pkgsrc/doc/pkgsrc.txt 2009/08/25 13:20:58 1.126
@@ -1587,27 +1587,27 @@ in PKG_PATH. @@ -1587,27 +1587,27 @@ in PKG_PATH.
1587After these preparations, installing a package is very easy: 1587After these preparations, installing a package is very easy:
1588 1588
1589# pkg_add openoffice2 1589# pkg_add openoffice2
1590# pkg_add kde-3.5.7 1590# pkg_add kde-3.5.7
1591# pkg_add ap2-php5-* 1591# pkg_add ap2-php5-*
1592 1592
1593Note that any prerequisite packages needed to run the package in question will 1593Note that any prerequisite packages needed to run the package in question will
1594be installed, too, assuming they are present where you install from. 1594be installed, too, assuming they are present where you install from.
1595 1595
1596As mentioned above, packages for which vulnerabilities get known are not stored 1596As mentioned above, packages for which vulnerabilities get known are not stored
1597in the All subdirectory. They don't get deleted since that could be very 1597in the All subdirectory. They don't get deleted since that could be very
1598frustrating if many other packages depend on it. Instead, they are moved to the 1598frustrating if many other packages depend on it. Instead, they are moved to the
1599vulnerable subdirectory. So you may need to add this directory to the PKG_PATH 1599vulnerable subdirectory. So you may need to add this directory to the PKG_PATH
1600variable. However, you should run audit-packages regularly, especially after 1600variable. However, you should run pkg_admin audit regularly, especially after
1601installing new packages, and verify that the vulnerabilities are acceptable for 1601installing new packages, and verify that the vulnerabilities are acceptable for
1602your configuration. 1602your configuration.
1603 1603
1604After you've installed packages, be sure to have /usr/pkg/bin and /usr/pkg/sbin 1604After you've installed packages, be sure to have /usr/pkg/bin and /usr/pkg/sbin
1605in your PATH so you can actually start the just installed program. 1605in your PATH so you can actually start the just installed program.
1606 1606
16074.1.3. Deinstalling packages 16074.1.3. Deinstalling packages
1608 1608
1609To deinstall a package, it does not matter whether it was installed from source 1609To deinstall a package, it does not matter whether it was installed from source
1610code or from a binary package. The pkg_delete command does not know it anyway. 1610code or from a binary package. The pkg_delete command does not know it anyway.
1611To delete a package, you can just run pkg_delete package-name. The package name 1611To delete a package, you can just run pkg_delete package-name. The package name
1612can be given with or without version number. Wildcards can also be used to 1612can be given with or without version number. Wildcards can also be used to
1613deinstall a set of packages, for example *emacs*. Be sure to include them in 1613deinstall a set of packages, for example *emacs*. Be sure to include them in
@@ -1624,41 +1624,54 @@ jpeg package. @@ -1624,41 +1624,54 @@ jpeg package.
1624 1624
16254.1.4. Getting information about installed packages 16254.1.4. Getting information about installed packages
1626 1626
1627The pkg_info shows information about installed packages or binary package 1627The pkg_info shows information about installed packages or binary package
1628files. 1628files.
1629 1629
16304.1.5. Checking for security vulnerabilities in installed packages 16304.1.5. Checking for security vulnerabilities in installed packages
1631 1631
1632The NetBSD Security-Officer and Packages Groups maintain a list of known 1632The NetBSD Security-Officer and Packages Groups maintain a list of known
1633security vulnerabilities to packages which are (or have been) included in 1633security vulnerabilities to packages which are (or have been) included in
1634pkgsrc. The list is available from the NetBSD FTP site at ftp://ftp.NetBSD.org/ 1634pkgsrc. The list is available from the NetBSD FTP site at ftp://ftp.NetBSD.org/
1635pub/pkgsrc/distfiles/vulnerabilities. 1635pub/pkgsrc/distfiles/vulnerabilities.
1636 1636
1637Through security/audit-packages, this list can be downloaded automatically, and 1637Through pkg_admin fetch-pkg-vulnerabilities, this list can be downloaded
1638a security audit of all packages installed on a system can take place. 1638automatically, and a security audit of all packages installed on a system can
1639 1639take place.
1640There are two components to security/audit-packages. The first component, 1640
1641"download-vulnerability-list", is for downloading the list of vulnerabilities 1641There are two components to auditing. The first step, pkg_admin
1642from the NetBSD FTP site. The second component, "audit-packages", checks to see 1642fetch-pkg-vulnerabilities, is for downloading the list of vulnerabilities from
1643if any of your installed packages are vulnerable. If a package is vulnerable, 1643the NetBSD FTP site. The second step, pkg_admin audit, checks to see if any of
1644you will see output similar to the following: 1644your installed packages are vulnerable. If a package is vulnerable, you will
 1645see output similar to the following:
1645 1646
1646Package samba-2.0.9 has a local-root-shell vulnerability, see 1647Package samba-2.0.9 has a local-root-shell vulnerability, see
1647 http://www.samba.org/samba/whatsnew/macroexploit.html 1648 http://www.samba.org/samba/whatsnew/macroexploit.html
1648 1649
1649One can set up security/audit-packages to download the vulnerabilities file 1650You may wish to have the vulnerabilities file downloaded daily so that it
1650daily, and include a package audit in the daily security script. Details on 1651remains current. This may be done by adding an appropriate entry to the root
1651this are located in the MESSAGE file for security/audit-packages. 1652users crontab(5) entry. For example the entry
 1653
 1654# download vulnerabilities file
 16550 3 * * * /usr/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1
 1656
 1657
 1658will update the vulnerability list every day at 3AM. You may wish to do this
 1659more often than once a day. In addition, you may wish to run the package audit
 1660from the daily security script. This may be accomplished by adding the
 1661following line to /etc/security.local:
 1662
 1663/usr/sbin/pkg_admin audit
 1664
1652 1665
16534.1.6. Finding if newer versions of your installed packages are in pkgsrc 16664.1.6. Finding if newer versions of your installed packages are in pkgsrc
1654 1667
1655Install pkgtools/lintpkgsrc and run lintpkgsrc with the "-i" argument to check 1668Install pkgtools/lintpkgsrc and run lintpkgsrc with the "-i" argument to check
1656if your packages are up-to-date, e.g. 1669if your packages are up-to-date, e.g.
1657 1670
1658% lintpkgsrc -i 1671% lintpkgsrc -i
1659... 1672...
1660Version mismatch: 'tcsh' 6.09.00 vs 6.10.00 1673Version mismatch: 'tcsh' 6.09.00 vs 6.10.00
1661 1674
1662 1675
1663You can then use make update to update the package on your system and rebuild 1676You can then use make update to update the package on your system and rebuild
1664any dependencies. 1677any dependencies.
@@ -1903,29 +1916,31 @@ each variable's intent. @@ -1903,29 +1916,31 @@ each variable's intent.
1903 1916
1904 * MASTER_SITE_OVERRIDE: If set, override the packages' MASTER_SITES with this 1917 * MASTER_SITE_OVERRIDE: If set, override the packages' MASTER_SITES with this
1905 value. 1918 value.
1906 1919
1907 * MASTER_SITE_BACKUP: Backup location(s) for distribution files and patch 1920 * MASTER_SITE_BACKUP: Backup location(s) for distribution files and patch
1908 files if not found locally or in ${MASTER_SITES} or ${PATCH_SITES} 1921 files if not found locally or in ${MASTER_SITES} or ${PATCH_SITES}
1909 respectively. The defaults are ftp://ftp.NetBSD.org/pub/NetBSD/packages/ 1922 respectively. The defaults are ftp://ftp.NetBSD.org/pub/NetBSD/packages/
1910 distfiles/${DIST_SUBDIR}/ and ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/$ 1923 distfiles/${DIST_SUBDIR}/ and ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/$
1911 {DIST_SUBDIR}/. 1924 {DIST_SUBDIR}/.
1912 1925
1913 * BINPKG_SITES: List of sites carrying binary pkgs. rel and arch are replaced 1926 * BINPKG_SITES: List of sites carrying binary pkgs. rel and arch are replaced
1914 with OS release ("2.0", etc.) and architecture ("mipsel", etc.). 1927 with OS release ("2.0", etc.) and architecture ("mipsel", etc.).
1915 1928
1916 * ACCEPTABLE_LICENSES: List of acceptable licenses. Whenever you try to build 1929 * ACCEPTABLE_LICENSES: List of acceptable licenses. License names are
1917 a package whose license is not in this list, you will get an error message 1930 case-sensitive. Whenever you try to build a package whose license is not in
1918 that includes instructions on how to change this variable. 1931 this list, you will get an error message. If the license condition is
 1932 simple enough, the error message will include specific instructions on how
 1933 to change this variable.
1919 1934
19205.2. Variables affecting the build process 19355.2. Variables affecting the build process
1921 1936
1922XXX 1937XXX
1923 1938
1924 * PACKAGES: The top level directory for the binary packages. The default is $ 1939 * PACKAGES: The top level directory for the binary packages. The default is $
1925 {PKGSRCDIR}/packages. 1940 {PKGSRCDIR}/packages.
1926 1941
1927 * WRKOBJDIR: The top level directory where, if defined, the separate working 1942 * WRKOBJDIR: The top level directory where, if defined, the separate working
1928 directories will get created, and symbolically linked to from ${WRKDIR} 1943 directories will get created, and symbolically linked to from ${WRKDIR}
1929 (see below). This is useful for building packages on several architectures, 1944 (see below). This is useful for building packages on several architectures,
1930 then ${PKGSRCDIR} can be NFS-mounted while ${WRKOBJDIR} is local to every 1945 then ${PKGSRCDIR} can be NFS-mounted while ${WRKOBJDIR} is local to every
1931 architecture. (It should be noted that PKGSRCDIR should not be set by the 1946 architecture. (It should be noted that PKGSRCDIR should not be set by the
@@ -2260,36 +2275,36 @@ There are two ways of doing a bulk build @@ -2260,36 +2275,36 @@ There are two ways of doing a bulk build
2260 2275
2261The build.conf file is the main configuration file for bulk builds. You can 2276The build.conf file is the main configuration file for bulk builds. You can
2262configure how your copy of pkgsrc is kept up to date, how the distfiles are 2277configure how your copy of pkgsrc is kept up to date, how the distfiles are
2263downloaded, how the packages are built and how the report is generated. You can 2278downloaded, how the packages are built and how the report is generated. You can
2264find an annotated example file in pkgsrc/mk/bulk/build.conf-example. To use it, 2279find an annotated example file in pkgsrc/mk/bulk/build.conf-example. To use it,
2265copy build.conf-example to build.conf and edit it, following the comments in 2280copy build.conf-example to build.conf and edit it, following the comments in
2266that file. 2281that file.
2267 2282
22687.3.1.2. mk.conf 22837.3.1.2. mk.conf
2269 2284
2270You may want to set variables in mk.conf. Look at pkgsrc/mk/defaults/mk.conf 2285You may want to set variables in mk.conf. Look at pkgsrc/mk/defaults/mk.conf
2271for details of the default settings. You will want to ensure that 2286for details of the default settings. You will want to ensure that
2272ACCEPTABLE_LICENSES meet your local policy. As used in this example, 2287ACCEPTABLE_LICENSES meet your local policy. As used in this example,
2273_ACCEPTABLE=yes completely bypasses the license check. 2288SKIP_LICENSE_CHECK=yes completely bypasses the license check.
2274 2289
2275PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH} 2290PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH}
2276WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc 2291WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc
2277BSDSRCDIR= /usr/src 2292BSDSRCDIR= /usr/src
2278BSDXSRCDIR= /usr/xsrc # for x11/xservers 2293BSDXSRCDIR= /usr/xsrc # for x11/xservers
2279OBJHOSTNAME?= yes # use work.`hostname` 2294OBJHOSTNAME?= yes # use work.`hostname`
2280FAILOVER_FETCH= yes # insist on the correct checksum 2295FAILOVER_FETCH= yes # insist on the correct checksum
2281PKG_DEVELOPER?= yes 2296PKG_DEVELOPER?= yes
2282_ACCEPTABLE= yes 2297SKIP_LICENSE_CHECK= yes
2283 2298
2284Some options that are especially useful for bulk builds can be found at the top 2299Some options that are especially useful for bulk builds can be found at the top
2285lines of the file mk/bulk/bsd.bulk-pkg.mk. The most useful options of these are 2300lines of the file mk/bulk/bsd.bulk-pkg.mk. The most useful options of these are
2286briefly described here. 2301briefly described here.
2287 2302
2288 * If you are on a slow machine, you may want to set USE_BULK_BROKEN_CHECK to 2303 * If you are on a slow machine, you may want to set USE_BULK_BROKEN_CHECK to
2289 "no". 2304 "no".
2290 2305
2291 * If you are doing bulk builds from a read-only copy of pkgsrc, you have to 2306 * If you are doing bulk builds from a read-only copy of pkgsrc, you have to
2292 set BULKFILESDIR to the directory where all log files are created. 2307 set BULKFILESDIR to the directory where all log files are created.
2293 Otherwise the log files are created in the pkgsrc directory. 2308 Otherwise the log files are created in the pkgsrc directory.
2294 2309
2295 * Another important variable is BULK_PREREQ, which is a list of packages that 2310 * Another important variable is BULK_PREREQ, which is a list of packages that
@@ -2627,28 +2642,27 @@ configuration file /usr/pbulk/etc/mk.con @@ -2627,28 +2642,27 @@ configuration file /usr/pbulk/etc/mk.con
2627might set now are: 2642might set now are:
2628 2643
2629 * PKG_DEVELOPER=yes, to enable many consistency checks, 2644 * PKG_DEVELOPER=yes, to enable many consistency checks,
2630 2645
2631 * WRKOBJDIR=/tmp/pbulk-outer, to keep /usr/pkgsrc free from any 2646 * WRKOBJDIR=/tmp/pbulk-outer, to keep /usr/pkgsrc free from any
2632 modifications, 2647 modifications,
2633 2648
2634 * DISTDIR=/distfiles, to have only one directory in which all distfiles (for 2649 * DISTDIR=/distfiles, to have only one directory in which all distfiles (for
2635 the infrastructure and for the actual packages) are downloaded, 2650 the infrastructure and for the actual packages) are downloaded,
2636 2651
2637 * ACCEPTABLE_LICENSES+=..., to select some licenses additional to the usual 2652 * ACCEPTABLE_LICENSES+=..., to select some licenses additional to the usual
2638 Free/Open Source licenses that are acceptable to you, 2653 Free/Open Source licenses that are acceptable to you,
2639 2654
2640 * _ACCEPTABLE=yes, to accept all licenses, no matter how restrictive they 2655 * SKIP_LICENSE_CHECK=yes, to bypass the license checks.
2641 are. 
2642 2656
2643Now you are ready to build the rest of the pbulk infrastructure. 2657Now you are ready to build the rest of the pbulk infrastructure.
2644 2658
2645$ cd pkgtools/pbulk 2659$ cd pkgtools/pbulk
2646$ /usr/pbulk/bin/bmake install 2660$ /usr/pbulk/bin/bmake install
2647$ rm -rf /tmp/pbulk-outer 2661$ rm -rf /tmp/pbulk-outer
2648 2662
2649Now the pbulk infrastructure is built and installed. It still needs to be 2663Now the pbulk infrastructure is built and installed. It still needs to be
2650configured, and after some more preparation, we will be able to start the real 2664configured, and after some more preparation, we will be able to start the real
2651bulk build. 2665bulk build.
2652 2666
26537.4.2. Configuration 26677.4.2. Configuration
2654 2668
@@ -4619,72 +4633,39 @@ following files: @@ -4619,72 +4633,39 @@ following files:
4619 * PLIST.common 4633 * PLIST.common
4620 4634
4621 * PLIST.${OPSYS} 4635 * PLIST.${OPSYS}
4622 4636
4623 * PLIST.${MACHINE_ARCH} 4637 * PLIST.${MACHINE_ARCH}
4624 4638
4625 * PLIST.${OPSYS}-${MACHINE_ARCH} 4639 * PLIST.${OPSYS}-${MACHINE_ARCH}
4626 4640
4627 * PLIST.common_end 4641 * PLIST.common_end
4628 4642
462913.8. Sharing directories between packages 464313.8. Sharing directories between packages
4630 4644
4631A "shared directory" is a directory where multiple (and unrelated) packages 4645A "shared directory" is a directory where multiple (and unrelated) packages
4632install files. These directories are problematic because you have to add 4646install files. These directories were problematic because you had to add
4633special tricks in the PLIST to conditionally remove them, or have some 4647special tricks in the PLIST to conditionally remove them, or have some
4634centralized package handle them. 4648centralized package handle them.
4635 4649
4636Within pkgsrc, you'll find both approaches. If a directory is shared by a few 4650In pkgsrc, it is now easy: Each package should create directories and install
4637unrelated packages, it's often not worth to add an extra package to remove it. 4651files as needed; pkg_delete will remove any directories left empty after
4638Therefore, one simply does: 4652uninstalling a package.
4639 
4640@unexec ${RMDIR} %D/path/to/shared/directory 2>/dev/null || ${TRUE} 
4641 
4642 
4643in the PLISTs of all affected packages, instead of the regular "@dirrm" line. 
4644 
4645However, if the directory is shared across many packages, two different 
4646solutions are available: 
4647 
4648 1. If the packages have a common dependency, the directory can be removed in 
4649 that. For example, see textproc/scrollkeeper, which removes the shared 
4650 directory share/omf. 
4651 4653
4652 2. If the packages using the directory are not related at all (they have no 4654If a package needs an empty directory to work, create the directory during
4653 common dependencies), a *-dirs package is used. 4655installation as usual, and also add an entry to the PLIST:
4654 4656
4655From now on, we'll discuss the second solution. To get an idea of the *-dirs 4657@pkgdir path/to/empty/directory
4656packages available, issue: 
4657 4658
4658% cd .../pkgsrc 
4659% ls -d */*-dirs 
4660 
4661 
4662Their use from other packages is very simple. The USE_DIRS variable takes a 
4663list of package names (without the "-dirs" part) together with the required 
4664version number (always pick the latest one when writing new packages). 
4665 
4666For example, if a package installs files under share/applications, it should 
4667have the following line in it: 
4668 
4669USE_DIRS+= xdg-1.1 
4670 
4671 
4672After regenerating the PLIST using make print-PLIST, you should get the right 
4673(commented out) lines. 
4674 
4675Note that even if your package is using $X11BASE, it must not depend on the 
4676*-x11-dirs packages. Just specify the name without that part and pkgsrc (in 
4677particular, mk/dirs.mk) will take care of it. 
4678 4659
4679Chapter 14. Buildlink methodology 4660Chapter 14. Buildlink methodology
4680 4661
4681Table of Contents 4662Table of Contents
4682 4663
468314.1. Converting packages to use buildlink3 466414.1. Converting packages to use buildlink3
468414.2. Writing buildlink3.mk files 466514.2. Writing buildlink3.mk files
4685 4666
4686 14.2.1. Anatomy of a buildlink3.mk file 4667 14.2.1. Anatomy of a buildlink3.mk file
4687 14.2.2. Updating BUILDLINK_API_DEPENDS.pkg in buildlink3.mk files 4668 14.2.2. Updating BUILDLINK_API_DEPENDS.pkg in buildlink3.mk files
4688 4669
468914.3. Writing builtin.mk files 467014.3. Writing builtin.mk files
4690 4671
@@ -5770,26 +5751,29 @@ DISTFILES+= foo-file.tar.gz @@ -5770,26 +5751,29 @@ DISTFILES+= foo-file.tar.gz
5770SITES.foo-file.tar.gz= \ 5751SITES.foo-file.tar.gz= \
5771http://www.somewhere.com/somehow/ \ 5752http://www.somewhere.com/somehow/ \
5772http://www.somewhereelse.com/mirror/somehow/ 5753http://www.somewhereelse.com/mirror/somehow/
5773 5754
5774When actually fetching the distfiles, each item from MASTER_SITES or SITES.* 5755When actually fetching the distfiles, each item from MASTER_SITES or SITES.*
5775gets the name of each distfile appended to it, without an intermediate slash. 5756gets the name of each distfile appended to it, without an intermediate slash.
5776Therefore, all site values have to end with a slash or other separator 5757Therefore, all site values have to end with a slash or other separator
5777character. This allows for example to set MASTER_SITES to a URL of a CGI script 5758character. This allows for example to set MASTER_SITES to a URL of a CGI script
5778that gets the name of the distfile as a parameter. In this case, the definition 5759that gets the name of the distfile as a parameter. In this case, the definition
5779would look like: 5760would look like:
5780 5761
5781MASTER_SITES= http://www.example.com/download.cgi?file= 5762MASTER_SITES= http://www.example.com/download.cgi?file=
5782 5763
 5764The exception to this rule are URLs starting with a dash. In that case the URL
 5765is taken as is, fetched and the result stored under the name of the distfile.
 5766
5783There are some predefined values for MASTER_SITES, which can be used in 5767There are some predefined values for MASTER_SITES, which can be used in
5784packages. The names of the variables should speak for themselves. 5768packages. The names of the variables should speak for themselves.
5785 5769
5786${MASTER_SITE_APACHE} 5770${MASTER_SITE_APACHE}
5787${MASTER_SITE_BACKUP} 5771${MASTER_SITE_BACKUP}
5788${MASTER_SITE_CYGWIN} 5772${MASTER_SITE_CYGWIN}
5789${MASTER_SITE_DEBIAN} 5773${MASTER_SITE_DEBIAN}
5790${MASTER_SITE_FREEBSD} 5774${MASTER_SITE_FREEBSD}
5791${MASTER_SITE_FREEBSD_LOCAL} 5775${MASTER_SITE_FREEBSD_LOCAL}
5792${MASTER_SITE_GENTOO} 5776${MASTER_SITE_GENTOO}
5793${MASTER_SITE_GNOME} 5777${MASTER_SITE_GNOME}
5794${MASTER_SITE_GNU} 5778${MASTER_SITE_GNU}
5795${MASTER_SITE_GNUSTEP} 5779${MASTER_SITE_GNUSTEP}
@@ -7746,41 +7730,41 @@ since it was released. @@ -7746,41 +7730,41 @@ since it was released.
7746If a package contains a rc.d script, it won't be copied into the startup 7730If a package contains a rc.d script, it won't be copied into the startup
7747directory by default, but you can enable it, by adding the option 7731directory by default, but you can enable it, by adding the option
7748PKG_RCD_SCRIPTS=YES in mk.conf. This option will copy the scripts into /etc/ 7732PKG_RCD_SCRIPTS=YES in mk.conf. This option will copy the scripts into /etc/
7749rc.d when a package is installed, and it will automatically remove the scripts 7733rc.d when a package is installed, and it will automatically remove the scripts
7750when the package is deinstalled. 7734when the package is deinstalled.
7751 7735
775219.6.17. Packages installing TeX modules 773619.6.17. Packages installing TeX modules
7753 7737
7754If a package installs TeX packages into the texmf tree, the ls-R database of 7738If a package installs TeX packages into the texmf tree, the ls-R database of
7755the tree needs to be updated. 7739the tree needs to be updated.
7756 7740
7757Note 7741Note
7758 7742
7759Except the main TeX packages such as teTeX-texmf, packages should install files 7743Except the main TeX packages such as kpathsea, packages should install files
7760into PKG_LOCALTEXMFPREFIX, not PKG_TEXMFPREFIX. 7744into ${PREFIX}/share/texmf-dist, not ${PREFIX}/share/texmf.
7761 7745
7762 1. Include ../../print/teTeX/module.mk instead of ../../mk/tex.buildlink3.mk. 7746 1. Include ../../print/kpathsea/texmf.mk. This takes care of rebuilding the
7763 This takes care of rebuilding the ls-R database at installation and 7747 ls-R database at installation and deinstallation time.
7764 deinstallation time. 
7765 7748
7766 2. If your package installs files into a texmf tree other than the one at 7749 2. If your package installs files into a texmf tree other than the one at $
7767 PKG_LOCALTEXMFPREFIX, set TEXMFDIRS to the list of all texmf trees that 7750 {PREFIX}/share/texmf-dist, set TEX_TEXMF_DIRS to the list of all texmf
7768 need database update. 7751 trees that need database update.
7769 7752
7770 If your package also installs font map files that need to be registered 7753 If your package also installs font map files that need to be registered
7771 using updmap, set TEX_FONTMAPS to the list of all such font map files. Then 7754 using updmap, include ../../print/texlive-tetex/map.mk and set
7772 updmap will be run automatically at installation/deinstallation to enable/ 7755 TEX_MAP_FILES and/or TEX_MIXEDMAP_FILES to the list of all such font map
7773 disable font map files for TeX output drivers. 7756 files. Then updmap will be run automatically at installation/deinstallation
 7757 to enable/disable font map files for TeX output drivers.
7774 7758
7775 3. Make sure that none of ls-R databases are included in PLIST, as they will 7759 3. Make sure that none of ls-R databases are included in PLIST, as they will
7776 be removed only by the teTeX-bin package. 7760 be removed only by the teTeX-bin package.
7777 7761
777819.6.18. Packages supporting running binaries in emulation 776219.6.18. Packages supporting running binaries in emulation
7779 7763
7780There are some packages that provide libraries and executables for running 7764There are some packages that provide libraries and executables for running
7781binaries from a one operating system on a different one (if the latter supports 7765binaries from a one operating system on a different one (if the latter supports
7782it). One example is running Linux binaries on NetBSD. 7766it). One example is running Linux binaries on NetBSD.
7783 7767
7784The pkgtools/rpm2pkg helps in extracting and packaging Linux rpm packages. 7768The pkgtools/rpm2pkg helps in extracting and packaging Linux rpm packages.
7785 7769
7786The CHECK_SHLIBS can be set to no to avoid the check-shlibs target, which tests 7770The CHECK_SHLIBS can be set to no to avoid the check-shlibs target, which tests
@@ -7812,43 +7796,33 @@ If a package installs .desktop files und @@ -7812,43 +7796,33 @@ If a package installs .desktop files und
7812MIME information, you need to take extra steps to ensure that they are 7796MIME information, you need to take extra steps to ensure that they are
7813registered into the MIME database: 7797registered into the MIME database:
7814 7798
7815 1. Include ../../sysutils/desktop-file-utils/desktopdb.mk. 7799 1. Include ../../sysutils/desktop-file-utils/desktopdb.mk.
7816 7800
7817 2. Check the PLIST and remove the entry that refers to the share/applications/ 7801 2. Check the PLIST and remove the entry that refers to the share/applications/
7818 mimeinfo.cache file. It will be handled automatically. 7802 mimeinfo.cache file. It will be handled automatically.
7819 7803
7820The best way to verify that the PLIST is correct with respect to the last point 7804The best way to verify that the PLIST is correct with respect to the last point
7821is to regenerate it using make print-PLIST. 7805is to regenerate it using make print-PLIST.
7822 7806
782319.7. Marking packages as having problems 780719.7. Marking packages as having problems
7824 7808
7825In some cases one does not have the time to solve a problem immediately. There 7809In some cases one does not have the time to solve a problem immediately. In
7826are currently two ways to declare that one knows that a package has problems. 7810this case, one can plainly mark a package as broken. For this, one just sets
7827 7811the variable BROKEN to the reason why the package is broken (similar to the
7828 * The first way is to plainly mark it as broken. For this, one just sets the 7812RESTRICTED variable). A user trying to build the package will immediately be
7829 variable BROKEN to the reason why the package is broken (similar to the 7813shown this message, and the build will not be even tried.
7830 RESTRICTED variable). A user trying to build the package will immediately 
7831 be shown this message, and the build will not be even tried. 
7832 
7833 * After each pkgsrc freeze period (a time when the tree is stabilized and a 
7834 new pkgsrc branch is cut), the packages that were not building in the 
7835 official branch build on the latest NetBSD release will be marked as broken 
7836 on that branch. This is done by setting the BROKEN_IN variable to the 
7837 branch name (or appending the branch name to it). If a user tries to build 
7838 such a package and the build fails, the user gets a message that says that 
7839 the package was broken on the respective branch(es). 
7840 7814
7841Both types of packages are removed from pkgsrc in irregular intervals. 7815BROKEN packages are removed from pkgsrc in irregular intervals.
7842 7816
7843Chapter 20. Debugging 7817Chapter 20. Debugging
7844 7818
7845To check out all the gotchas when building a package, here are the steps that I 7819To check out all the gotchas when building a package, here are the steps that I
7846do in order to get a package working. Please note this is basically the same as 7820do in order to get a package working. Please note this is basically the same as
7847what was explained in the previous sections, only with some debugging aids. 7821what was explained in the previous sections, only with some debugging aids.
7848 7822
7849 * Be sure to set PKG_DEVELOPER=yes in mk.conf. 7823 * Be sure to set PKG_DEVELOPER=yes in mk.conf.
7850 7824
7851 * Install pkgtools/url2pkg, create a directory for a new package, change into 7825 * Install pkgtools/url2pkg, create a directory for a new package, change into
7852 it, then run url2pkg: 7826 it, then run url2pkg:
7853 7827
7854 % mkdir /usr/pkgsrc/category/examplepkg 7828 % mkdir /usr/pkgsrc/category/examplepkg
@@ -7978,28 +7952,32 @@ case it was mentioned there. @@ -7978,28 +7952,32 @@ case it was mentioned there.
7978 7952
7979When the PKGREVISION of a package is bumped, the change should appear in pkgsrc 7953When the PKGREVISION of a package is bumped, the change should appear in pkgsrc
7980/doc/CHANGES-YYYY if it is security related or otherwise relevant. Mass bumps 7954/doc/CHANGES-YYYY if it is security related or otherwise relevant. Mass bumps
7981that result from a dependency being updated should not be mentioned. In all 7955that result from a dependency being updated should not be mentioned. In all
7982other cases it's the developer's decision. 7956other cases it's the developer's decision.
7983 7957
7984There is a make target that helps in creating proper CHANGES-YYYY entries: make 7958There is a make target that helps in creating proper CHANGES-YYYY entries: make
7985changes-entry. It uses the optional CTYPE and NETBSD_LOGIN_NAME variables. The 7959changes-entry. It uses the optional CTYPE and NETBSD_LOGIN_NAME variables. The
7986general usage is to first make sure that your CHANGES-YYYY file is up-to-date 7960general usage is to first make sure that your CHANGES-YYYY file is up-to-date
7987(to avoid having to resolve conflicts later-on) and then to cd to the package 7961(to avoid having to resolve conflicts later-on) and then to cd to the package
7988directory. For package updates, make changes-entry is enough. For new packages, 7962directory. For package updates, make changes-entry is enough. For new packages,
7989or package moves or removals, set the CTYPE variable on the command line to 7963or package moves or removals, set the CTYPE variable on the command line to
7990"Added", "Moved", or "Removed". You can set NETBSD_LOGIN_NAME in mk.conf if 7964"Added", "Moved", or "Removed". You can set NETBSD_LOGIN_NAME in mk.conf if
7991your local login name is not the same as your NetBSD login name. Don't forget 7965your local login name is not the same as your NetBSD login name. The target
7992to commit the changes to pkgsrc/doc/CHANGES-YYYY! 7966also automatically removes possibly existing entries for the package in the
 7967TODO file. Don't forget to commit the changes, e.g. by using make
 7968changes-entry-commit! If you are not using a checkout directly from
 7969cvs.netbsd.org, but e.g. a local copy of the repository, you can set
 7970USE_NETBSD_REPO=yes. This makes the cvs commands use the main repository.
7993 7971
799421.4. Committing: Importing a package into CVS 797221.4. Committing: Importing a package into CVS
7995 7973
7996This section is only of interest for pkgsrc developers with write access to the 7974This section is only of interest for pkgsrc developers with write access to the
7997pkgsrc repository. Please remember that cvs imports files relative to the 7975pkgsrc repository. Please remember that cvs imports files relative to the
7998current working directory, and that the pathname that you give the cvs import 7976current working directory, and that the pathname that you give the cvs import
7999command is so that it knows where to place the files in the repository. Newly 7977command is so that it knows where to place the files in the repository. Newly
8000created packages should be imported with a vendor tag of "TNF" and a release 7978created packages should be imported with a vendor tag of "TNF" and a release
8001tag of "pkgsrc-base", e.g: 7979tag of "pkgsrc-base", e.g:
8002 7980
8003$ cd .../pkgsrc/category/pkgname 7981$ cd .../pkgsrc/category/pkgname
8004$ cvs import pkgsrc/category/pkgname TNF pkgsrc-base 7982$ cvs import pkgsrc/category/pkgname TNF pkgsrc-base
8005 7983